diff --git a/.gitattributes b/.gitattributes index 422cd747..22b59158 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,3 +14,6 @@ # Shell scripts *.sh eol=lf + +# Python +*.py eol=lf diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 00000000..279ae64e --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,35 @@ +name: Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install azure-devops/ + - name: Python compile + run: | + python -m compileall . + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + - name: Test with pytest + run: | + pip install pytest + pytest diff --git a/.gitignore b/.gitignore index 1b5d5e6d..7c81c73b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ env/** dist/ lib/ +.eggs/ # Build results [Dd]ebug/ @@ -293,3 +294,11 @@ __pycache__/ *.btm.cs *.odx.cs *.xsd.cs +.vscode/ +vsts/build/bdist.win32/ + +# don't ignore release management client +!azure-devops/azure/devops/*/release + +# ignore private folder for testing reported issues +issues/ \ No newline at end of file diff --git a/README.md b/README.md index 72f1506a..30a41992 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,61 @@ +[![Python package](https://github.com/microsoft/azure-devops-python-api/workflows/Python%20package/badge.svg)](https://github.com/microsoft/azure-devops-python-api/actions) +[![Python](https://img.shields.io/pypi/pyversions/azure-devops.svg)](https://pypi.python.org/pypi/azure-devops) -# Contributing +# Azure DevOps Python API + +This repository contains Python APIs for interacting with and managing Azure DevOps. These APIs power the Azure DevOps Extension for Azure CLI. To learn more about the Azure DevOps Extension for Azure CLI, visit the [Microsoft/azure-devops-cli-extension](https://github.com/Microsoft/azure-devops-cli-extension) repo. + +## Install + +``` +pip install azure-devops +``` + +## Get started + + +To use the API, establish a connection using a [personal access token](https://docs.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=vsts) and the URL to your Azure DevOps organization. Then get a client from the connection and make API calls. + +```python +from azure.devops.connection import Connection +from msrest.authentication import BasicAuthentication +import pprint + +# Fill in with your personal access token and org URL +personal_access_token = 'YOURPAT' +organization_url = 'https://dev.azure.com/YOURORG' + +# Create a connection to the org +credentials = BasicAuthentication('', personal_access_token) +connection = Connection(base_url=organization_url, creds=credentials) + +# Get a client (the "core" client provides access to projects, teams, etc) +core_client = connection.clients.get_core_client() + +# Get the first page of projects +get_projects_response = core_client.get_projects() +index = 0 +while get_projects_response is not None: + for project in get_projects_response.value: + pprint.pprint("[" + str(index) + "] " + project.name) + index += 1 + if get_projects_response.continuation_token is not None and get_projects_response.continuation_token != "": + # Get the next page of projects + get_projects_response = core_client.get_projects(continuation_token=get_projects_response.continuation_token) + else: + # All projects have been retrieved + get_projects_response = None +``` + +## API documentation + +This Python library provides a thin wrapper around the Azure DevOps REST APIs. See the [Azure DevOps REST API reference](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1) for details on calling different APIs. + +## Samples + +Learn how to call different APIs by viewing the samples in the [Microsoft/azure-devops-python-samples](https://github.com/Microsoft/azure-devops-python-samples) repo. + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..869fdfe2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/vsts/LICENSE.txt b/azure-devops/LICENSE.txt similarity index 100% rename from vsts/LICENSE.txt rename to azure-devops/LICENSE.txt diff --git a/azure-devops/MANIFEST.in b/azure-devops/MANIFEST.in new file mode 100644 index 00000000..42eb4101 --- /dev/null +++ b/azure-devops/MANIFEST.in @@ -0,0 +1 @@ +include LICENSE.txt diff --git a/azure-devops/azure/devops/__init__.py b/azure-devops/azure/devops/__init__.py new file mode 100644 index 00000000..34913fb3 --- /dev/null +++ b/azure-devops/azure/devops/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/_file_cache.py b/azure-devops/azure/devops/_file_cache.py similarity index 79% rename from vsts/vsts/_file_cache.py rename to azure-devops/azure/devops/_file_cache.py index 4c208f4a..2415ebab 100644 --- a/vsts/vsts/_file_cache.py +++ b/azure-devops/azure/devops/_file_cache.py @@ -14,6 +14,9 @@ import collections +logger = logging.getLogger(__name__) + + class FileCache(collections.MutableMapping): """A simple dict-like class that is backed by a JSON file. @@ -32,21 +35,21 @@ 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.clock(): - logging.info('Cache file expired: {file}'.format(file=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: - logging.info('Loading cache file: {file}'.format(file=self.file_name)) + logger.debug('Loading cache file: %s', self.file_name) self.data = get_file_json(self.file_name, throw_on_empty=False) or {} else: - logging.info('Cache file does not exist: {file}'.format(file=self.file_name)) - except Exception as e: - logging.exception(e) + 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 e2: - logging.exception(e2) + except Exception as ex2: + logger.debug(ex2, exc_info=True) self.initial_load_occurred = True def save(self): @@ -71,10 +74,10 @@ def save_with_retry(self, retries=5): def clear(self): if os.path.isfile(self.file_name): - logging.info("Deleting file: " + self.file_name) + logger.info("Deleting file: " + self.file_name) os.remove(self.file_name) else: - logging.info("File does not exist: " + self.file_name) + logger.info("File does not exist: " + self.file_name) def get(self, key, default=None): self._check_for_initial_load() @@ -108,11 +111,17 @@ def _check_for_initial_load(self): def get_cache_dir(): - vsts_cache_dir = os.getenv('VSTS_CACHE_DIR', None) or os.path.expanduser(os.path.join('~', '.vsts', 'python-sdk', - 'cache')) - if not os.path.exists(vsts_cache_dir): - os.makedirs(vsts_cache_dir) - return vsts_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): + try: + os.makedirs(azure_devops_cache_dir) + except OSError: + # https://github.com/microsoft/azure-devops-python-api/issues/354 + # FileExistsError is not available in python 2.7 + if not os.path.exists(azure_devops_cache_dir): + raise + return azure_devops_cache_dir DEFAULT_MAX_AGE = 3600 * 12 # 12 hours @@ -144,12 +153,12 @@ def read_file_content(file_path, allow_binary=False): for encoding in ['utf-8-sig', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be']: try: with codecs_open(file_path, encoding=encoding) as f: - logging.debug("attempting to read file %s as %s", file_path, encoding) + 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: - logging.debug("attempting to read file %s as binary", file_path) + logger.debug("attempting to read file %s as binary", file_path) return base64.b64encode(input_file.read()).decode("utf-8") else: raise diff --git a/azure-devops/azure/devops/_models.py b/azure-devops/azure/devops/_models.py new file mode 100644 index 00000000..58f904ae --- /dev/null +++ b/azure-devops/azure/devops/_models.py @@ -0,0 +1,215 @@ +# 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' +] diff --git a/azure-devops/azure/devops/client.py b/azure-devops/azure/devops/client.py new file mode 100644 index 00000000..ad71109b --- /dev/null +++ b/azure-devops/azure/devops/client.py @@ -0,0 +1,314 @@ +# -------------------------------------------------------------------------------------------- +# 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 = {} + self._locations = {} + 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(self.normalized_url, 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_organization_resource_location(location_id) + deployment_level = False + deployment_url = None + if location is None: + logger.debug('API resource location ' + location_id + ' is not registered on ' + self.config.base_url + '.') + deployment_url = self._get_deployment_url() + if deployment_url is not None: + logger.debug('Checking for location at deployment level: ' + deployment_url) + location = self._get_resource_location(deployment_url, location_id) + deployment_level = True + 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) + if not deployment_level: + url = self._client.format_url(route_template, **route_values) + else: + url = self._client.format_url(deployment_url + route_template, **route_values) + request = ClientRequest(method=http_method, 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_organization_resource_location(self, location_id): + return self._get_resource_location(self.normalized_url, location_id) + + def _get_deployment_url(self): + pos = self.normalized_url.rfind('/') + if pos > 0: + deployment_url = self.normalized_url[:pos] + if deployment_url.find('://') > 0: + return deployment_url + return None + + def _get_resource_location(self, url, location_id): + if url not in Client._locations_cache: + Client._locations_cache[url] = self._get_resource_locations(url, all_host_types=False) + for location in Client._locations_cache[url]: + if location.id == location_id: + return location + + def _get_resource_locations(self, url, all_host_types): + # Check local client's cached Options first + if all_host_types: + if url in self._all_host_types_locations: + return self._all_host_types_locations[url] + elif url in self._locations: + return self._locations[url] + + # Next check for options cached on disk + if not all_host_types and OPTIONS_FILE_CACHE[url]: + try: + logger.debug('File cache hit for options on: %s', url) + self._locations[url] = self._base_deserialize.deserialize_data(OPTIONS_FILE_CACHE[url], + '[ApiResourceLocation]') + return self._locations[url] + except DeserializationError as ex: + logger.debug(ex, exc_info=True) + else: + logger.debug('File cache miss for options on: %s', url) + + # Last resort, make the call to the server + options_uri = self._combine_url(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[url] = returned_locations + else: + self._locations[url] = returned_locations + try: + OPTIONS_FILE_CACHE[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' diff --git a/azure-devops/azure/devops/client_configuration.py b/azure-devops/azure/devops/client_configuration.py new file mode 100644 index 00000000..83fed802 --- /dev/null +++ b/azure-devops/azure/devops/client_configuration.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 = {} diff --git a/azure-devops/azure/devops/connection.py b/azure-devops/azure/devops/connection.py new file mode 100644 index 00000000..9c76e52a --- /dev/null +++ b/azure-devops/azure/devops/connection.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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 .v7_1.location.location_client import LocationClient +from .v7_1.client_factory import ClientFactoryV7_1 +from .v7_0.client_factory import ClientFactoryV7_0 + +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_v7_1 = ClientFactoryV7_1(self) + self.clients_v7_0 = ClientFactoryV7_0(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' diff --git a/vsts/vsts/credentials.py b/azure-devops/azure/devops/credentials.py similarity index 100% rename from vsts/vsts/credentials.py rename to azure-devops/azure/devops/credentials.py diff --git a/azure-devops/azure/devops/exceptions.py b/azure-devops/azure/devops/exceptions.py new file mode 100644 index 00000000..18a5f9ce --- /dev/null +++ b/azure-devops/azure/devops/exceptions.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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 diff --git a/azure-devops/azure/devops/issue_tests/__init__.py b/azure-devops/azure/devops/issue_tests/__init__.py new file mode 100644 index 00000000..f885a96e --- /dev/null +++ b/azure-devops/azure/devops/issue_tests/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------------------------- diff --git a/azure-devops/azure/devops/issue_tests/test_issue_268.py b/azure-devops/azure/devops/issue_tests/test_issue_268.py new file mode 100644 index 00000000..820c414d --- /dev/null +++ b/azure-devops/azure/devops/issue_tests/test_issue_268.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import pprint +import unittest + +from msrest import Deserializer +from msrest.universal_http import HTTPClientResponse + + +class _TestResponse(HTTPClientResponse): + def __init__(self, text): + super(_TestResponse, self).__init__(request=None, internal_response=None) + self._text = text + + def text(self, encoding=None): + return self._text + + +class TestDeserialization(unittest.TestCase): + + # https://github.com/microsoft/azure-devops-python-api/issues/268 + def test_deserialization_issue_268_71(self): + from azure.devops.v7_1.task_agent import models + self._test_deserialization(models.__dict__.items(), _268_type, _268_json) + + # https://github.com/microsoft/azure-devops-python-api/issues/268 + def test_deserialization_issue_268_70(self): + from azure.devops.v7_0.task_agent import models + self._test_deserialization(models.__dict__.items(), _268_type, _268_json) + + @staticmethod + def _test_deserialization(models, data_type, json): + client_models = {k: v for k, v in models if isinstance(v, type)} + deserializer = Deserializer(client_models) + response = _TestResponse(json) + task_agent_response = deserializer(data_type, response) + pprint.pprint(task_agent_response.__dict__) + + +if __name__ == '__main__': + unittest.main() + +_268_type = 'TaskAgentReference' +_268_json = '{"id":0,"name":null,"version":null,"osDescription":"Foo","provisioningState":null}' diff --git a/azure-devops/azure/devops/released/__init__.py b/azure-devops/azure/devops/released/__init__.py new file mode 100644 index 00000000..f885a96e --- /dev/null +++ b/azure-devops/azure/devops/released/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------------------------- diff --git a/azure-devops/azure/devops/released/accounts/__init__.py b/azure-devops/azure/devops/released/accounts/__init__.py new file mode 100644 index 00000000..8f80a8a6 --- /dev/null +++ b/azure-devops/azure/devops/released/accounts/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.accounts.models import * +from .accounts_client import AccountsClient + +__all__ = [ + 'Account', + 'AccountCreateInfoInternal', + 'AccountPreferencesInternal', + 'AccountsClient' +] diff --git a/azure-devops/azure/devops/released/accounts/accounts_client.py b/azure-devops/azure/devops/released/accounts/accounts_client.py new file mode 100644 index 00000000..8bc8fbaf --- /dev/null +++ b/azure-devops/azure/devops/released/accounts/accounts_client.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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. One of the following parameters is required: ownerId, memberId. + :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='7.0', + query_parameters=query_parameters) + return self._deserialize('[Account]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/build/__init__.py b/azure-devops/azure/devops/released/build/__init__.py new file mode 100644 index 00000000..cc816e75 --- /dev/null +++ b/azure-devops/azure/devops/released/build/__init__.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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', + 'BuildRetentionHistory', + 'BuildRetentionSample', + 'BuildSettings', + 'DataSourceBindingBase', + 'DefinitionReference', + 'DefinitionResourceReference', + 'Deployment', + 'Folder', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'Issue', + 'JobReference', + 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', + 'ProcessParameters', + 'ProjectRetentionSetting', + 'PullRequest', + 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', + 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', + 'RetentionPolicy', + 'RetentionSetting', + 'SourceProviderAttributes', + 'SourceRepositories', + 'SourceRepository', + 'SourceRepositoryItem', + 'StageReference', + 'SupportedTrigger', + 'TaskAgentPoolReference', + 'TaskDefinitionReference', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationPlanReference', + 'TaskReference', + 'TaskSourceDefinitionBase', + 'TeamProjectReference', + 'TestResultsContext', + 'Timeline', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', + 'VariableGroup', + 'VariableGroupReference', + 'WebApiConnectedServiceRef', + 'XamlBuildControllerReference', + 'YamlBuild', + 'BuildClient' +] diff --git a/azure-devops/azure/devops/released/build/build_client.py b/azure-devops/azure/devops/released/build/build_client.py new file mode 100644 index 00000000..ac932efb --- /dev/null +++ b/azure-devops/azure/devops/released/build/build_client.py @@ -0,0 +1,1978 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + 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 list_branches(self, project, provider_name, service_endpoint_id=None, repository=None, branch_name=None): + """ListBranches. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_retention_leases_for_build(self, project, build_id): + """GetRetentionLeasesForBuild. + Gets all retention leases that apply to a specific build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [RetentionLease] + """ + 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='3da19a6a-f088-45c4-83ce-2ad3a87be6c4', + version='7.0', + route_values=route_values) + return self._deserialize('[RetentionLease]', self._unwrap_collection(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='7.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='7.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: :class:`<[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='7.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, definition_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: + :param int definition_id: Optional definition id to queue a build without a body. Ignored if there's a valid body + :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') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + content = self._serialize.body(build, 'Build') + response = self._send(http_method='POST', + location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', + version='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[Build]', 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='7.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='7.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='7.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='7.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='7.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. To use this filter includeAllProperties should be set to true + :rtype: :class:`<[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='7.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='7.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 build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT. + :param :class:` ` definition: The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted. + :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='7.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. + 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='7.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_general_settings(self, project): + """GetBuildGeneralSettings. + Gets pipeline general 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='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values) + return self._deserialize('PipelineGeneralSettings', response) + + def update_build_general_settings(self, new_settings, project): + """UpdateBuildGeneralSettings. + Updates pipeline general settings. + :param :class:` ` 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(new_settings, 'PipelineGeneralSettings') + response = self._send(http_method='PATCH', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('PipelineGeneralSettings', response) + + def get_retention_history(self, days_to_lookback=None): + """GetRetentionHistory. + Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline. + :param int days_to_lookback: + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_lookback is not None: + query_parameters['daysToLookback'] = self._serialize.query('days_to_lookback', days_to_lookback, 'int') + response = self._send(http_method='GET', + location_id='1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('BuildRetentionHistory', 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:`<[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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(response)) + + def add_retention_leases(self, new_leases, project): + """AddRetentionLeases. + Adds new leases for pipeline runs. + :param [NewRetentionLease] new_leases: + :param str project: Project ID or project name + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_leases, '[NewRetentionLease]') + response = self._send(http_method='POST', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_retention_leases_by_id(self, project, ids): + """DeleteRetentionLeasesById. + Removes specific retention leases. + :param str project: Project ID or project name + :param [int] ids: + """ + 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') + self._send(http_method='DELETE', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_retention_lease(self, project, lease_id): + """GetRetentionLease. + Returns the details of the retention lease given a lease id. + :param str project: Project ID or project name + :param int lease_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values) + return self._deserialize('RetentionLease', response) + + def get_retention_leases_by_minimal_retention_leases(self, project, leases_to_fetch): + """GetRetentionLeasesByMinimalRetentionLeases. + Returns any leases matching the specified MinimalRetentionLeases + :param str project: Project ID or project name + :param [MinimalRetentionLease] leases_to_fetch: List of JSON-serialized MinimalRetentionLeases separated by '|' + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if leases_to_fetch is not None: + leases_to_fetch = "|".join(map(str, leases_to_fetch)) + query_parameters['leasesToFetch'] = self._serialize.query('leases_to_fetch', leases_to_fetch, 'str') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_owner_id(self, project, owner_id=None, definition_id=None, run_id=None): + """GetRetentionLeasesByOwnerId. + Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str owner_id: + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner_id is not None: + query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_user_id(self, project, user_owner_id, definition_id=None, run_id=None): + """GetRetentionLeasesByUserId. + Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str user_owner_id: The user id to search for. + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if user_owner_id is not None: + query_parameters['userOwnerId'] = self._serialize.query('user_owner_id', user_owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def update_retention_lease(self, lease_update, project, lease_id): + """UpdateRetentionLease. + Updates the duration or pipeline protection status of a retention lease. + :param :class:` ` lease_update: The new data for the retention lease. + :param str project: Project ID or project name + :param int lease_id: The ID of the lease to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + content = self._serialize.body(lease_update, 'RetentionLeaseUpdate') + response = self._send(http_method='PATCH', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('RetentionLease', 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='7.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='7.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='7.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='7.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='7.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_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='7.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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_build_properties(self, document, project, build_id): + """UpdateBuildProperties. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_definition_properties(self, document, project, definition_id): + """UpdateDefinitionProperties. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PullRequest', response) + + def get_build_report(self, project, build_id, type=None): + """GetBuildReport. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('SourceRepositories', response) + + def get_retention_settings(self, project): + """GetRetentionSettings. + Gets the project's 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='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values) + return self._deserialize('ProjectRetentionSetting', response) + + def update_retention_settings(self, update_model, project): + """UpdateRetentionSettings. + Updates the project's retention settings. + :param :class:` ` update_model: + :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(update_model, 'UpdateProjectRetentionSettingModel') + response = self._send(http_method='PATCH', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProjectRetentionSetting', 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BuildSettings', response) + + def list_source_providers(self, project): + """ListSourceProviders. + 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='7.0', + route_values=route_values) + return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) + + def update_stage(self, update_parameters, build_id, stage_ref_name, project=None): + """UpdateStage. + Update a build stage + :param :class:` ` update_parameters: + :param int build_id: + :param str stage_ref_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 build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if stage_ref_name is not None: + route_values['stageRefName'] = self._serialize.url('stage_ref_name', stage_ref_name, 'str') + content = self._serialize.body(update_parameters, 'UpdateStageParameters') + self._send(http_method='PATCH', + location_id='b8aac6c9-744b-46e1-88fc-3550969f9313', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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='7.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. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_build_tags(self, update_parameters, project, build_id): + """UpdateBuildTags. + Adds/Removes tags from a build. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tag(self, project, definition_id, tag): + """AddDefinitionTag. + 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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tags(self, tags, project, definition_id): + """AddDefinitionTags. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_definition_tag(self, project, definition_id, tag): + """DeleteDefinitionTag. + Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_definition_tags(self, project, definition_id, revision=None): + """GetDefinitionTags. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_definition_tags(self, update_parameters, project, definition_id): + """UpdateDefinitionTags. + Adds/Removes tags from a definition. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_tag(self, project, tag): + """DeleteTag. + Removes a tag from builds, definitions, and from the tag store + :param str project: Project ID or project name + :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 tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.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 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + + def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): + """ListWebhooks. + 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='7.0', + 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. Only work items in the same project are returned. + :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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + + def get_definition_yaml(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): + """GetDefinitionYaml. + Converts a definition to YAML, 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='7c3df3a1-7e51-4150-8cf7-540347f8697f', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('YamlBuild', response) + diff --git a/azure-devops/azure/devops/released/cix/__init__.py b/azure-devops/azure/devops/released/cix/__init__.py new file mode 100644 index 00000000..9895aa39 --- /dev/null +++ b/azure-devops/azure/devops/released/cix/__init__.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.cix.models import * +from .cix_client import CixClient + +__all__ = [ + 'ConfigurationFile', + 'CreatedResources', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'Operation', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', + 'ReferenceLinks', + 'ResourceCreationParameter', + 'TeamProject', + 'TeamProjectReference', + 'WebApiTeamRef', + 'CixClient' +] diff --git a/azure-devops/azure/devops/released/cix/cix_client.py b/azure-devops/azure/devops/released/cix/cix_client.py new file mode 100644 index 00000000..1144bfc0 --- /dev/null +++ b/azure-devops/azure/devops/released/cix/cix_client.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.cix 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) + + def create_resources(self, creation_parameters, project): + """CreateResources. + :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='7.0', + route_values=route_values, + content=content) + return self._deserialize('CreatedResources', response) + diff --git a/azure-devops/azure/devops/released/client_factory.py b/azure-devops/azure/devops/released/client_factory.py new file mode 100644 index 00000000..5632b0e1 --- /dev/null +++ b/azure-devops/azure/devops/released/client_factory.py @@ -0,0 +1,416 @@ +# -------------------------------------------------------------------------------------------- +# 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 7.0 released clients. + """ + + def __init__(self, connection): + self._connection = connection + + def get_accounts_client(self): + """get_accounts_client. + Gets the 7.0 version of the AccountsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.accounts.accounts_client.AccountsClient') + + def get_audit_client(self): + """get_audit_client. + Gets the 7.0 version of the AuditClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.audit.audit_client.AuditClient') + + def get_build_client(self): + """get_build_client. + Gets the 7.0 version of the BuildClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.build.build_client.BuildClient') + + def get_cix_client(self): + """get_cix_client. + Gets the 7.0 version of the CixClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.cix.cix_client.CixClient') + + def get_client_trace_client(self): + """get_client_trace_client. + Gets the 7.0 version of the ClientTraceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.client_trace.client_trace_client.ClientTraceClient') + + def get_contributions_client(self): + """get_contributions_client. + Gets the 7.0 version of the ContributionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.contributions.contributions_client.ContributionsClient') + + def get_core_client(self): + """get_core_client. + Gets the 7.0 version of the CoreClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.core.core_client.CoreClient') + + def get_customer_intelligence_client(self): + """get_customer_intelligence_client. + Gets the 7.0 version of the CustomerIntelligenceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') + + def get_dashboard_client(self): + """get_dashboard_client. + Gets the 7.0 version of the DashboardClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.dashboard.dashboard_client.DashboardClient') + + def get_elastic_client(self): + """get_elastic_client. + Gets the 7.0 version of the ElasticClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.elastic.elastic_client.ElasticClient') + + def get_extension_management_client(self): + """get_extension_management_client. + Gets the 7.0 version of the ExtensionManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.extension_management.extension_management_client.ExtensionManagementClient') + + def get_feature_availability_client(self): + """get_feature_availability_client. + Gets the 7.0 version of the FeatureAvailabilityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') + + def get_feature_management_client(self): + """get_feature_management_client. + Gets the 7.0 version of the FeatureManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feature_management.feature_management_client.FeatureManagementClient') + + def get_feed_client(self): + """get_feed_client. + Gets the 7.0 version of the FeedClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feed.feed_client.FeedClient') + + def get_file_container_client(self): + """get_file_container_client. + Gets the 7.0 version of the FileContainerClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.file_container.file_container_client.FileContainerClient') + + def get_gallery_client(self): + """get_gallery_client. + Gets the 7.0 version of the GalleryClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.gallery.gallery_client.GalleryClient') + + def get_git_client(self): + """get_git_client. + Gets the 7.0 version of the GitClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.git.git_client.GitClient') + + def get_graph_client(self): + """get_graph_client. + Gets the 7.0 version of the GraphClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.graph.graph_client.GraphClient') + + def get_identity_client(self): + """get_identity_client. + Gets the 7.0 version of the IdentityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.identity.identity_client.IdentityClient') + + def get_location_client(self): + """get_location_client. + Gets the 7.0 version of the LocationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.location.location_client.LocationClient') + + def get_maven_client(self): + """get_maven_client. + Gets the 7.0 version of the MavenClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.maven.maven_client.MavenClient') + + def get_member_entitlement_management_client(self): + """get_member_entitlement_management_client. + Gets the 7.0 version of the MemberEntitlementManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') + + def get_notification_client(self): + """get_notification_client. + Gets the 7.0 version of the NotificationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.notification.notification_client.NotificationClient') + + def get_npm_client(self): + """get_npm_client. + Gets the 7.0 version of the NpmClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.npm.npm_client.NpmClient') + + def get_nuget_client(self): + """get_nuget_client. + Gets the 7.0 version of the NuGetClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.nuget.nuget_client.NuGetClient') + + def get_operations_client(self): + """get_operations_client. + Gets the 7.0 version of the OperationsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.operations.operations_client.OperationsClient') + + def get_pipeline_permissions_client(self): + """get_pipeline_permissions_client. + Gets the 7.0 version of the PipelinePermissionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient') + + def get_pipelines_client(self): + """get_pipelines_client. + Gets the 7.0 version of the PipelinesClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipelines.pipelines_client.PipelinesClient') + + def get_pipelines_checks_client(self): + """get_pipelines_checks_client. + Gets the 7.0 version of the PipelinesChecksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipelines_checks.pipelines_checks_client.PipelinesChecksClient') + + def get_policy_client(self): + """get_policy_client. + Gets the 7.0 version of the PolicyClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.policy.policy_client.PolicyClient') + + def get_profile_client(self): + """get_profile_client. + Gets the 7.0 version of the ProfileClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.profile.profile_client.ProfileClient') + + def get_profile_regions_client(self): + """get_profile_regions_client. + Gets the 7.0 version of the ProfileRegionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.profile_regions.profile_regions_client.ProfileRegionsClient') + + def get_project_analysis_client(self): + """get_project_analysis_client. + Gets the 7.0 version of the ProjectAnalysisClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.project_analysis.project_analysis_client.ProjectAnalysisClient') + + def get_provenance_client(self): + """get_provenance_client. + Gets the 7.0 version of the ProvenanceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.provenance.provenance_client.ProvenanceClient') + + def get_py_pi_api_client(self): + """get_py_pi_api_client. + Gets the 7.0 version of the PyPiApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.py_pi_api.py_pi_api_client.PyPiApiClient') + + def get_release_client(self): + """get_release_client. + Gets the 7.0 version of the ReleaseClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.release.release_client.ReleaseClient') + + def get_sbom_client(self): + """get_sbom_client. + Gets the 7.0 version of the SBOMClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.sbom.sbom_client.SBOMClient') + + def get_search_client(self): + """get_search_client. + Gets the 7.0 version of the SearchClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.search.search_client.SearchClient') + + def get_security_client(self): + """get_security_client. + Gets the 7.0 version of the SecurityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.security.security_client.SecurityClient') + + def get_service_endpoint_client(self): + """get_service_endpoint_client. + Gets the 7.0 version of the ServiceEndpointClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') + + def get_service_hooks_client(self): + """get_service_hooks_client. + Gets the 7.0 version of the ServiceHooksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.service_hooks.service_hooks_client.ServiceHooksClient') + + def get_settings_client(self): + """get_settings_client. + Gets the 7.0 version of the SettingsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.settings.settings_client.SettingsClient') + + def get_symbol_client(self): + """get_symbol_client. + Gets the 7.0 version of the SymbolClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.symbol.symbol_client.SymbolClient') + + def get_task_client(self): + """get_task_client. + Gets the 7.0 version of the TaskClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.task.task_client.TaskClient') + + def get_task_agent_client(self): + """get_task_agent_client. + Gets the 7.0 version of the TaskAgentClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.task_agent.task_agent_client.TaskAgentClient') + + def get_test_client(self): + """get_test_client. + Gets the 7.0 version of the TestClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test.test_client.TestClient') + + def get_test_plan_client(self): + """get_test_plan_client. + Gets the 7.0 version of the TestPlanClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test_plan.test_plan_client.TestPlanClient') + + def get_test_results_client(self): + """get_test_results_client. + Gets the 7.0 version of the TestResultsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test_results.test_results_client.TestResultsClient') + + def get_tfvc_client(self): + """get_tfvc_client. + Gets the 7.0 version of the TfvcClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.tfvc.tfvc_client.TfvcClient') + + def get_token_admin_client(self): + """get_token_admin_client. + Gets the 7.0 version of the TokenAdminClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.token_admin.token_admin_client.TokenAdminClient') + + def get_upack_api_client(self): + """get_upack_api_client. + Gets the 7.0 version of the UPackApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_api.upack_api_client.UPackApiClient') + + def get_upack_packaging_client(self): + """get_upack_packaging_client. + Gets the 7.0 version of the UPackPackagingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_packaging.upack_packaging_client.UPackPackagingClient') + + def get_wiki_client(self): + """get_wiki_client. + Gets the 7.0 version of the WikiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.wiki.wiki_client.WikiClient') + + def get_work_client(self): + """get_work_client. + Gets the 7.0 version of the WorkClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work.work_client.WorkClient') + + def get_work_item_tracking_client(self): + """get_work_item_tracking_client. + Gets the 7.0 version of the WorkItemTrackingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_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 7.0 version of the WorkItemTrackingProcessClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_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 7.0 version of the WorkItemTrackingProcessTemplateClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') + diff --git a/azure-devops/azure/devops/released/core/__init__.py b/azure-devops/azure/devops/released/core/__init__.py new file mode 100644 index 00000000..b02506cc --- /dev/null +++ b/azure-devops/azure/devops/released/core/__init__.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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' +] diff --git a/azure-devops/azure/devops/released/core/core_client.py b/azure-devops/azure/devops/released/core/core_client.py new file mode 100644 index 00000000..d6a0823a --- /dev/null +++ b/azure-devops/azure/devops/released/core/core_client.py @@ -0,0 +1,314 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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='7.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='7.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='7.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: :class:`<[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='7.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='7.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='7.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, 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='7.0', + 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='7.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 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='7.0', + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WebApiTeam', response) + diff --git a/azure-devops/azure/devops/released/elastic/__init__.py b/azure-devops/azure/devops/released/elastic/__init__.py new file mode 100644 index 00000000..4077e361 --- /dev/null +++ b/azure-devops/azure/devops/released/elastic/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.elastic.models import * +from .elastic_client import ElasticClient + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPool', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'ElasticClient' +] diff --git a/azure-devops/azure/devops/released/elastic/elastic_client.py b/azure-devops/azure/devops/released/elastic/elastic_client.py new file mode 100644 index 00000000..dc44ed61 --- /dev/null +++ b/azure-devops/azure/devops/released/elastic/elastic_client.py @@ -0,0 +1,158 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.elastic import models + + +class ElasticClient(Client): + """Elastic + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ElasticClient, 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_elastic_pool_logs(self, pool_id, top=None): + """GetElasticPoolLogs. + Get elastic pool diagnostics logs for a specified Elastic Pool. + :param int pool_id: Pool Id of the Elastic Pool + :param int top: Number of elastic pool logs to retrieve + :rtype: [ElasticPoolLog] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_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='595b1769-61d5-4076-a72a-98a02105ca9a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticPoolLog]', self._unwrap_collection(response)) + + def create_elastic_pool(self, elastic_pool, pool_name, authorize_all_pipelines=None, auto_provision_project_pools=None, project_id=None): + """CreateElasticPool. + Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project. + :param :class:` ` elastic_pool: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool. + :param str pool_name: Name to use for the new TaskAgentPool + :param bool authorize_all_pipelines: Setting to determine if all pipelines are authorized to use this TaskAgentPool by default. + :param bool auto_provision_project_pools: Setting to automatically provision TaskAgentQueues in every project for the new pool. + :param str project_id: Optional: If provided, a new TaskAgentQueue will be created in the specified project. + :rtype: :class:` ` + """ + query_parameters = {} + if pool_name is not None: + query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') + if authorize_all_pipelines is not None: + query_parameters['authorizeAllPipelines'] = self._serialize.query('authorize_all_pipelines', authorize_all_pipelines, 'bool') + if auto_provision_project_pools is not None: + query_parameters['autoProvisionProjectPools'] = self._serialize.query('auto_provision_project_pools', auto_provision_project_pools, 'bool') + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + content = self._serialize.body(elastic_pool, 'ElasticPool') + response = self._send(http_method='POST', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('ElasticPoolCreationResult', response) + + def get_elastic_pool(self, pool_id): + """GetElasticPool. + Returns the Elastic Pool with the specified Pool Id. + :param int pool_id: Pool Id of the associated TaskAgentPool + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values) + return self._deserialize('ElasticPool', response) + + def get_elastic_pools(self): + """GetElasticPools. + Get a list of all Elastic Pools. + :rtype: [ElasticPool] + """ + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0') + return self._deserialize('[ElasticPool]', self._unwrap_collection(response)) + + def update_elastic_pool(self, elastic_pool_settings, pool_id): + """UpdateElasticPool. + Update settings on a specified Elastic Pool. + :param :class:` ` elastic_pool_settings: New Elastic Pool settings data + :param int pool_id: + :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(elastic_pool_settings, 'ElasticPoolSettings') + response = self._send(http_method='PATCH', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticPool', response) + + def get_elastic_nodes(self, pool_id, state=None): + """GetElasticNodes. + Get a list of ElasticNodes currently in the ElasticPool + :param int pool_id: Pool id of the ElasticPool + :param str state: Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState + :rtype: [ElasticNode] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + query_parameters = {} + if state is not None: + query_parameters['$state'] = self._serialize.query('state', state, 'str') + response = self._send(http_method='GET', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticNode]', self._unwrap_collection(response)) + + def update_elastic_node(self, elastic_node_settings, pool_id, elastic_node_id): + """UpdateElasticNode. + Update properties on a specified ElasticNode + :param :class:` ` elastic_node_settings: + :param int pool_id: + :param int elastic_node_id: + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + if elastic_node_id is not None: + route_values['elasticNodeId'] = self._serialize.url('elastic_node_id', elastic_node_id, 'int') + content = self._serialize.body(elastic_node_settings, 'ElasticNodeSettings') + response = self._send(http_method='PATCH', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticNode', response) + diff --git a/azure-devops/azure/devops/released/feed/__init__.py b/azure-devops/azure/devops/released/feed/__init__.py new file mode 100644 index 00000000..2939e52a --- /dev/null +++ b/azure-devops/azure/devops/released/feed/__init__.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.feed.models import * +from .feed_client import FeedClient + +__all__ = [ + 'Feed', + 'FeedBatchData', + 'FeedBatchOperationData', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'FeedClient' +] diff --git a/azure-devops/azure/devops/released/feed/feed_client.py b/azure-devops/azure/devops/released/feed/feed_client.py new file mode 100644 index 00000000..b7481e96 --- /dev/null +++ b/azure-devops/azure/devops/released/feed/feed_client.py @@ -0,0 +1,865 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.feed 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, project=None, **kwargs): + """GetBadge. + 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). + :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 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='7.0', + route_values=route_values, + 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_feed_change(self, feed_id, project=None): + """GetFeedChange. + Query a feed to determine its current state. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedChange', response) + + def get_feed_changes(self, project=None, include_deleted=None, continuation_token=None, batch_size=None): + """GetFeedChanges. + 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 str project: Project ID or project name + :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:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('FeedChangesResponse', response) + + def get_feeds_from_recycle_bin(self, project=None): + """GetFeedsFromRecycleBin. + Query for feeds within the recycle bin. + :param str project: Project ID or project name + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def permanent_delete_feed(self, feed_id, project=None): + """PermanentDeleteFeed. + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + self._send(http_method='DELETE', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + + def restore_deleted_feed(self, patch_json, feed_id, project=None): + """RestoreDeletedFeed. + :param :class:`<[JsonPatchOperation]> ` patch_json: + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(patch_json, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + + def create_feed(self, feed, project=None): + """CreateFeed. + 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. + :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(feed, 'Feed') + response = self._send(http_method='POST', + location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def delete_feed(self, feed_id, project=None): + """DeleteFeed. + Remove a feed and all its packages. The feed moves to the recycle bin and is reversible. + :param str feed_id: Name or Id of the feed. + :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 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='7.0', + route_values=route_values) + + def get_feed(self, feed_id, project=None, include_deleted_upstreams=None): + """GetFeed. + Get the settings for a specific feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Feed', response) + + def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None, include_urls=None): + """GetFeeds. + Get all feeds in an account where you have the provided role access. + :param str project: Project ID or project name + :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. + :param bool include_urls: Resolve names if true + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + 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='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def update_feed(self, feed, feed_id, project=None): + """UpdateFeed. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def get_global_permissions(self, include_ids=None): + """GetGlobalPermissions. + Get all service-wide feed creation and administration permissions. + :param bool include_ids: Set to true to add IdentityIds to the permission objects. + :rtype: [GlobalPermission] + """ + query_parameters = {} + if include_ids is not None: + query_parameters['includeIds'] = self._serialize.query('include_ids', include_ids, 'bool') + response = self._send(http_method='GET', + location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) + + def set_global_permissions(self, global_permissions): + """SetGlobalPermissions. + Set service-wide permissions that govern feed creation and administration. + :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='7.0', + content=content) + return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) + + def get_package_changes(self, feed_id, project=None, continuation_token=None, batch_size=None): + """GetPackageChanges. + 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 str project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageChangesResponse', response) + + def query_package_metrics(self, package_id_query, feed_id, project=None): + """QueryPackageMetrics. + :param :class:` ` package_id_query: + :param str feed_id: + :param str project: Project ID or project name + :rtype: [PackageMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(package_id_query, 'PackageMetricsQuery') + response = self._send(http_method='POST', + location_id='bddc9b3c-8a59-4a9f-9b40-ee1dcaa2cc0d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[PackageMetrics]', self._unwrap_collection(response)) + + def get_package(self, feed_id, package_id, project=None, include_all_versions=None, include_urls=None, is_listed=None, is_release=None, include_deleted=None, include_description=None): + """GetPackage. + 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 str project: Project ID or project 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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_packages(self, feed_id, project=None, 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. + 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 project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Package]', self._unwrap_collection(response)) + + def get_feed_permissions(self, feed_id, project=None, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None, include_deleted_feeds=None): + """GetFeedPermissions. + Get the permissions for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :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. + :param bool include_deleted_feeds: If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid. + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + if include_deleted_feeds is not None: + query_parameters['includeDeletedFeeds'] = self._serialize.query('include_deleted_feeds', include_deleted_feeds, 'bool') + response = self._send(http_method='GET', + location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', + version='7.0', + 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, project=None): + """SetFeedPermissions. + Update the permissions on a feed. + :param [FeedPermission] feed_permission: Permissions to set. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[FeedPermission]', self._unwrap_collection(response)) + + def empty_recycle_bin(self, feed_id, project=None): + """EmptyRecycleBin. + Queues a job to remove all package versions from a feed's recycle bin + :param str feed_id: Name or Id of the feed + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + response = self._send(http_method='DELETE', + location_id='2704e72c-f541-4141-99be-2004b50b05fa', + version='7.0', + route_values=route_values) + return self._deserialize('OperationReference', response) + + def get_recycle_bin_package(self, feed_id, package_id, project=None, include_urls=None): + """GetRecycleBinPackage. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_recycle_bin_packages(self, feed_id, project=None, protocol_type=None, package_name_query=None, include_urls=None, top=None, skip=None, include_all_versions=None): + """GetRecycleBinPackages. + Query for packages within the recycle bin. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + 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, project=None, include_urls=None): + """GetRecycleBinPackageVersion. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RecycleBinPackageVersion', response) + + def get_recycle_bin_package_versions(self, feed_id, package_id, project=None, include_urls=None): + """GetRecycleBinPackageVersions. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: [RecycleBinPackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RecycleBinPackageVersion]', self._unwrap_collection(response)) + + def delete_feed_retention_policies(self, feed_id, project=None): + """DeleteFeedRetentionPolicies. + Delete the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + + def get_feed_retention_policies(self, feed_id, project=None): + """GetFeedRetentionPolicies. + Get the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedRetentionPolicy', response) + + def set_feed_retention_policies(self, policy, feed_id, project=None): + """SetFeedRetentionPolicies. + Set the retention policy for a feed. + :param :class:` ` policy: Feed retention policy. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedRetentionPolicy', response) + + def query_package_version_metrics(self, package_version_id_query, feed_id, package_id, project=None): + """QueryPackageVersionMetrics. + :param :class:` ` package_version_id_query: + :param str feed_id: + :param str package_id: + :param str project: Project ID or project name + :rtype: [PackageVersionMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + content = self._serialize.body(package_version_id_query, 'PackageVersionMetricsQuery') + response = self._send(http_method='POST', + location_id='e6ae8caa-b6a8-4809-b840-91b2a42c19ad', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[PackageVersionMetrics]', self._unwrap_collection(response)) + + def get_package_version(self, feed_id, package_id, package_version_id, project=None, include_urls=None, is_listed=None, is_deleted=None): + """GetPackageVersion. + 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 str project: Project ID or project 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: This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageVersion', response) + + def get_package_versions(self, feed_id, package_id, project=None, include_urls=None, is_listed=None, is_deleted=None): + """GetPackageVersions. + 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 str project: Project ID or project 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: If set specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: [PackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[PackageVersion]', self._unwrap_collection(response)) + + def create_feed_view(self, view, feed_id, project=None): + """CreateFeedView. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + + def delete_feed_view(self, feed_id, view_id, project=None): + """DeleteFeedView. + Delete a feed view. + :param str feed_id: Name or Id of the feed. + :param str view_id: Name or Id of the view. + :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 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='7.0', + route_values=route_values) + + def get_feed_view(self, feed_id, view_id, project=None): + """GetFeedView. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedView', response) + + def get_feed_views(self, feed_id, project=None): + """GetFeedViews. + Get all views for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :rtype: [FeedView] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values) + return self._deserialize('[FeedView]', self._unwrap_collection(response)) + + def update_feed_view(self, view, feed_id, view_id, project=None): + """UpdateFeedView. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + diff --git a/azure-devops/azure/devops/released/git/__init__.py b/azure-devops/azure/devops/released/git/__init__.py new file mode 100644 index 00000000..45b4942c --- /dev/null +++ b/azure-devops/azure/devops/released/git/__init__.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.git.models import * +from .git_client import GitClient + +__all__ = [ + 'Attachment', + 'Comment', + 'CommentIterationContext', + 'CommentPosition', + 'CommentThread', + 'CommentThreadContext', + 'CommentTrackingCriteria', + 'FileContentMetadata', + 'FileDiff', + 'FileDiffParams', + 'FileDiffsCriteria', + 'GitAnnotatedTag', + 'GitAsyncRefOperation', + 'GitAsyncRefOperationDetail', + 'GitAsyncRefOperationParameters', + 'GitAsyncRefOperationSource', + 'GitBaseVersionDescriptor', + 'GitBlobRef', + 'GitBranchStats', + 'GitCommit', + 'GitCommitDiffs', + 'GitCommitChanges', + 'GitCommitRef', + 'GitConflict', + 'GitConflictUpdateResult', + 'GitDeletedRepository', + 'GitFilePathsCollection', + 'GitForkOperationStatusDetail', + 'GitForkRef', + 'GitForkSyncRequest', + 'GitForkSyncRequestParameters', + 'GitCherryPick', + 'GitImportGitSource', + 'GitImportRequest', + 'GitImportRequestParameters', + 'GitImportStatusDetail', + 'GitImportTfvcSource', + 'GitItem', + 'GitItemDescriptor', + 'GitItemRequestData', + 'GitMerge', + 'GitMergeOperationStatusDetail', + 'GitMergeOriginRef', + 'GitMergeParameters', + 'GitObject', + 'GitPolicyConfigurationResponse', + 'GitPullRequest', + 'GitPullRequestCommentThread', + 'GitPullRequestCommentThreadContext', + 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', + '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', + 'Change', + 'IdentityRef', + 'IdentityRefWithVote', + 'ImportRepositoryValidation', + 'ItemContent', + 'ItemModel', + 'JsonPatchOperation', + 'LineDiffBlock', + 'PolicyConfiguration', + 'PolicyConfigurationRef', + 'PolicyTypeRef', + 'ReferenceLinks', + 'ResourceRef', + 'ShareNotificationContext', + 'SourceToTargetRef', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'VersionedPolicyConfigurationRef', + 'VstsInfo', + 'WebApiCreateTagRequestData', + 'WebApiTagDefinition', + 'GitClient' +] diff --git a/azure-devops/azure/devops/released/git/git_client.py b/azure-devops/azure/devops/released/git/git_client.py new file mode 100644 index 00000000..c28e80df --- /dev/null +++ b/azure-devops/azure/devops/released/git/git_client.py @@ -0,0 +1,39 @@ +# 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) \ No newline at end of file diff --git a/azure-devops/azure/devops/released/git/git_client_base.py b/azure-devops/azure/devops/released/git/git_client_base.py new file mode 100644 index 00000000..0df755f7 --- /dev/null +++ b/azure-devops/azure/devops/released/git/git_client_base.py @@ -0,0 +1,3324 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 create_annotated_tag(self, tag_object, project, repository_id): + """CreateAnnotatedTag. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitAnnotatedTag', response) + + def get_annotated_tag(self, project, repository_id, object_id): + """GetAnnotatedTag. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitBranchStats]', self._unwrap_collection(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='7.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='7.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 search_criteria.show_oldest_commits_first is not None: + query_parameters['searchCriteria.showOldestCommitsFirst'] = search_criteria.show_oldest_commits_first + 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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + 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. + Request that another repository's refs be fetched into this one. It syncs two existing forks. To create a fork, please see the repositories endpoint + :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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitForkSyncRequest]', 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='7.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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick(self, project, cherry_pick_id, repository_id): + """GetCherryPick. + Retrieve information about a cherry pick operation 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='7.0', + route_values=route_values) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick_for_ref_name(self, project, repository_id, ref_name): + """GetCherryPickForRefName. + Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitCherryPick', response) + + def create_import_request(self, import_request, project, repository_id): + """CreateImportRequest. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitImportRequest', response) + + def get_import_request(self, project, repository_id, import_request_id): + """GetImportRequest. + 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='7.0', + route_values=route_values) + return self._deserialize('GitImportRequest', response) + + def query_import_requests(self, project, repository_id, include_abandoned=None): + """QueryImportRequests. + 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='7.0', + 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. + 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='7.0', + 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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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 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='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) + + def create_merge_request(self, merge_parameters, project, repository_name_or_id, include_links=None): + """CreateMergeRequest. + Request a git merge operation. Currently we support merging only 2 commits. + :param :class:` ` merge_parameters: Parents commitIds and merge commit messsage. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :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(merge_parameters, 'GitMergeParameters') + response = self._send(http_method='POST', + location_id='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('GitMerge', response) + + def get_merge_request(self, project, repository_name_or_id, merge_operation_id, include_links=None): + """GetMergeRequest. + Get a specific merge operation's details. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :param int merge_operation_id: OperationId of the merge request. + :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 merge_operation_id is not None: + route_values['mergeOperationId'] = self._serialize.url('merge_operation_id', merge_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='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitMerge', response) + + def get_policy_configurations(self, project, repository_id=None, ref_name=None, policy_type=None, top=None, continuation_token=None): + """GetPolicyConfigurations. + Retrieve a list of policy configurations by a given set of scope/filtering criteria. + :param str project: Project ID or project name + :param str repository_id: The repository id. + :param str ref_name: The fully-qualified Git ref name (e.g. refs/heads/master). + :param str policy_type: The policy type filter. + :param int top: Maximum number of policies to return. + :param str continuation_token: Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint. + :rtype: :class:` ` + """ + 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 ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + if policy_type is not None: + query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, '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='2c420070-a0a2-49cc-9639-c9f271c5ff07', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.GitPolicyConfigurationResponse() + response_object.policy_configurations = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) + response_object.continuation_token = response.headers.get('x-ms-continuationtoken') + return response_object + + def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None, **kwargs): + """CreateAttachment. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None, **kwargs): + """GetAttachmentContent. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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 create_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """CreateLike. + 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='7.0', + route_values=route_values) + + def delete_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """DeleteLike. + 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='7.0', + route_values=route_values) + + def get_likes(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """GetLikes. + 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='7.0', + 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, 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='7.0', + 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:`<[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') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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 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. Allowed values are between 1 and the maximum iteration on this pull request. + :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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): + """GetPullRequestIterationStatus. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def create_unmaterialized_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, project=None): + """CreateUnmaterializedPullRequestReviewer. + Add an unmaterialized identity to the reviewers of a pull request. + :param :class:` ` reviewer: Reviewer 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: :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(reviewer, 'IdentityRefWithVote') + response = self._send(http_method='PUT', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', 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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def update_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): + """UpdatePullRequestReviewer. + Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined + :param :class:` ` reviewer: Reviewer data.
If the reviewer's ID is included here, it must match the reviewerID parameter. + :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='PATCH', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', 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='7.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='7.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='7.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='7.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='7.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='7.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 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='7.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. + 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='7.0', + route_values=route_values, + content=content) + + def create_pull_request_status(self, status, repository_id, pull_request_id, project=None): + """CreatePullRequestStatus. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): + """GetPullRequestStatus. + 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='7.0', + route_values=route_values) + return self._deserialize('GitPullRequestStatus', response) + + def get_pull_request_statuses(self, repository_id, pull_request_id, project=None): + """GetPullRequestStatuses. + 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='7.0', + 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. + 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='7.0', + 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 (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='7.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='7.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='7.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='7.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. 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values) + + def get_recycle_bin_repositories(self, project): + """GetRecycleBinRepositories. + 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='7.0', + 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. + 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='7.0', + 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, 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:`<[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') + 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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRefFavorite', response) + + def delete_ref_favorite(self, project, favorite_id): + """DeleteRefFavorite. + 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='7.0', + route_values=route_values) + + def get_ref_favorite(self, project, favorite_id): + """GetRefFavorite. + 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='7.0', + route_values=route_values) + return self._deserialize('GitRefFavorite', response) + + def get_ref_favorites(self, project, repository_id=None, identity_id=None): + """GetRefFavorites. + 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='7.0', + 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 omitted 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='7.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 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='7.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='7.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='7.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='7.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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRepository', response) + + def get_stats(self, project, repository_id): + """GetStats. + Retrieves statistics of a repository. + :param str project: Project ID or project name + :param str repository_id: Friendly name or guid of 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') + response = self._send(http_method='GET', + location_id='616a5255-74b3-40f5-ae1d-bbae2eec8db5', + version='7.0', + route_values=route_values) + return self._deserialize('GitRepositoryStats', response) + + def create_revert(self, revert_to_create, project, repository_id): + """CreateRevert. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRevert', response) + + def get_revert(self, project, revert_id, repository_id): + """GetRevert. + 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='7.0', + route_values=route_values) + return self._deserialize('GitRevert', response) + + def get_revert_for_ref_name(self, project, repository_id, ref_name): + """GetRevertForRefName. + 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='7.0', + 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='7.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='7.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. + 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='7.0', + 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='7.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='7.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) + diff --git a/azure-devops/azure/devops/released/graph/__init__.py b/azure-devops/azure/devops/released/graph/__init__.py new file mode 100644 index 00000000..63889196 --- /dev/null +++ b/azure-devops/azure/devops/released/graph/__init__.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.graph.models import * +from .graph_client import GraphClient + +__all__ = [ + 'Avatar', + 'GraphCachePolicies', + 'GraphDescriptorResult', + 'GraphFederatedProviderData', + 'GraphGroup', + 'GraphGroupCreationContext', + 'GraphMember', + 'GraphMembership', + 'GraphMembershipState', + 'GraphMembershipTraversal', + 'GraphProviderInfo', + 'GraphScope', + 'GraphScopeCreationContext', + 'GraphStorageKeyResult', + 'GraphSubject', + 'GraphSubjectBase', + 'GraphSubjectLookup', + 'GraphSubjectLookupKey', + 'GraphSubjectQuery', + 'GraphUser', + 'GraphUserCreationContext', + 'GraphUserUpdateContext', + 'JsonPatchOperation', + 'PagedGraphGroups', + 'PagedGraphUsers', + 'ReferenceLinks', + 'GraphClient' +] diff --git a/azure-devops/azure/devops/released/graph/graph_client.py b/azure-devops/azure/devops/released/graph/graph_client.py new file mode 100644 index 00000000..4c1583a3 --- /dev/null +++ b/azure-devops/azure/devops/released/graph/graph_client.py @@ -0,0 +1,120 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.graph 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 delete_avatar(self, subject_descriptor): + """DeleteAvatar. + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + self._send(http_method='DELETE', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values) + + def get_avatar(self, subject_descriptor, size=None, format=None): + """GetAvatar. + :param str subject_descriptor: + :param str size: + :param str format: + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + query_parameters = {} + if size is not None: + query_parameters['size'] = self._serialize.query('size', size, 'str') + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + response = self._send(http_method='GET', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Avatar', response) + + def set_avatar(self, avatar, subject_descriptor): + """SetAvatar. + :param :class:` ` avatar: + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + content = self._serialize.body(avatar, 'Avatar') + self._send(http_method='PUT', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + content=content) + + def get_descriptor(self, storage_key): + """GetDescriptor. + 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='7.0', + route_values=route_values) + return self._deserialize('GraphDescriptorResult', response) + + def get_provider_info(self, user_descriptor): + """GetProviderInfo. + :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='7.0', + route_values=route_values) + return self._deserialize('GraphProviderInfo', response) + + def get_storage_key(self, subject_descriptor): + """GetStorageKey. + 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='7.0', + route_values=route_values) + return self._deserialize('GraphStorageKeyResult', response) + diff --git a/azure-devops/azure/devops/released/identity/__init__.py b/azure-devops/azure/devops/released/identity/__init__.py new file mode 100644 index 00000000..132f3f76 --- /dev/null +++ b/azure-devops/azure/devops/released/identity/__init__.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.identity.models import * +from .identity_client import IdentityClient + +__all__ = [ + 'AccessTokenResult', + 'AuthorizationGrant', + 'CreateScopeInfo', + 'FrameworkIdentityInfo', + 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', + 'Identity', + 'IdentityBase', + 'IdentityBatchInfo', + 'IdentityRightsTransferData', + 'IdentityScope', + 'IdentitySelf', + 'IdentitySnapshot', + 'IdentityUpdateData', + 'JsonPatchOperation', + 'JsonWebToken', + 'PagedIdentities', + 'RefreshTokenGrant', + 'SwapIdentityInfo', + 'TenantInfo', + 'IdentityClient' +] diff --git a/azure-devops/azure/devops/released/identity/identity_client.py b/azure-devops/azure/devops/released/identity/identity_client.py new file mode 100644 index 00000000..4e2652d6 --- /dev/null +++ b/azure-devops/azure/devops/released/identity/identity_client.py @@ -0,0 +1,262 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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='7.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='7.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, social_descriptors=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): + """ReadIdentities. + Resolve legacy identity information for use with older APIs such as the Security APIs + :param str descriptors: A comma separated list of identity descriptors to resolve + :param str identity_ids: A comma seperated list of storage keys to resolve + :param str subject_descriptors: A comma seperated list of subject descriptors to resolve + :param str social_descriptors: + :param str search_filter: The type of search to perform. Values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups). + :param str filter_value: The search value, as specified by the searchFilter. + :param str query_membership: The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only) + :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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Identity', response) + + def update_identities(self, identities, allow_meta_data_update=None): + """UpdateIdentities. + :param :class:` ` identities: + :param bool allow_meta_data_update: + :rtype: [IdentityUpdateData] + """ + query_parameters = {} + if allow_meta_data_update is not None: + query_parameters['allowMetaDataUpdate'] = self._serialize.query('allow_meta_data_update', allow_meta_data_update, 'bool') + content = self._serialize.body(identities, 'VssJsonCollectionWrapper') + response = self._send(http_method='PUT', + location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', + version='7.0', + query_parameters=query_parameters, + 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='7.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='7.0', + 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='7.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='7.0') + return self._deserialize('IdentitySelf', response) + diff --git a/azure-devops/azure/devops/released/member_entitlement_management/__init__.py b/azure-devops/azure/devops/released/member_entitlement_management/__init__.py new file mode 100644 index 00000000..a0105a5e --- /dev/null +++ b/azure-devops/azure/devops/released/member_entitlement_management/__init__.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.member_entitlement_management.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' +] diff --git a/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py b/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py new file mode 100644 index 00000000..a20a21fe --- /dev/null +++ b/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py @@ -0,0 +1,290 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.member_entitlement_management 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlement(self, group_id): + """GetGroupEntitlement. + 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='7.0', + route_values=route_values) + return self._deserialize('GroupEntitlement', response) + + def update_group_entitlement(self, document, group_id, rule_option=None): + """UpdateGroupEntitlement. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlements(self): + """GetGroupEntitlements. + Get the group entitlements for an account. + :rtype: [GroupEntitlement] + """ + response = self._send(http_method='GET', + location_id='9bce1f43-2629-419f-8f6c-7503be58a4f3', + version='7.0') + return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) + + def add_member_to_group(self, group_id, member_id): + """AddMemberToGroup. + 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='7.0', + route_values=route_values) + + def get_group_members(self, group_id, max_results=None, paging_token=None): + """GetGroupMembers. + 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 beginning 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PagedGraphMemberList', response) + + def remove_member_from_group(self, group_id, member_id): + """RemoveMemberFromGroup. + 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='7.0', + route_values=route_values) + + def add_user_entitlement(self, user_entitlement): + """AddUserEntitlement. + 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='7.0', + content=content) + return self._deserialize('UserEntitlementsPostResponse', response) + + def search_user_entitlements(self, continuation_token=None, select=None, filter=None, order_by=None): + """SearchUserEntitlements. + Get a paged set of user entitlements matching the filter and sort criteria built with properties that match the select input. + :param str continuation_token: Continuation token for getting the next page of data set. If null is passed, gets the first page. + :param str select: Comma (",") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'. + :param str filter: Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with "test" in email or displayname is "name eq 'test'". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'. + :param str order_by: PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name + :rtype: :class:` ` + """ + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') + if order_by is not None: + query_parameters['$orderBy'] = self._serialize.query('order_by', order_by, 'str') + response = self._send(http_method='GET', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('PagedGraphMemberList', response) + + def update_user_entitlements(self, document, do_not_send_invite_for_new_users=None): + """UpdateUserEntitlements. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_user_entitlement(self, user_id): + """GetUserEntitlement. + 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='7.0', + route_values=route_values) + return self._deserialize('UserEntitlement', response) + + def update_user_entitlement(self, document, user_id): + """UpdateUserEntitlement. + 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='7.0', + 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. + 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, 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='7.0', + query_parameters=query_parameters) + return self._deserialize('UsersSummary', response) + diff --git a/azure-devops/azure/devops/released/notification/__init__.py b/azure-devops/azure/devops/released/notification/__init__.py new file mode 100644 index 00000000..60ff5e5d --- /dev/null +++ b/azure-devops/azure/devops/released/notification/__init__.py @@ -0,0 +1,76 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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', + 'ISubscriptionFilter', + 'ISubscriptionChannel', + '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', + 'SubscriptionDiagnostics', + 'SubscriptionEvaluationRequest', + 'SubscriptionEvaluationResult', + 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', + 'SubscriptionManagement', + 'SubscriptionQuery', + 'SubscriptionQueryCondition', + 'SubscriptionScope', + 'SubscriptionTracing', + 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'ValueDefinition', + 'VssNotificationEvent', + 'NotificationClient' +] diff --git a/azure-devops/azure/devops/released/notification/notification_client.py b/azure-devops/azure/devops/released/notification/notification_client.py new file mode 100644 index 00000000..33b13f67 --- /dev/null +++ b/azure-devops/azure/devops/released/notification/notification_client.py @@ -0,0 +1,300 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0') + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0') + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionUserSettings', response) + diff --git a/azure-devops/azure/devops/released/npm/__init__.py b/azure-devops/azure/devops/released/npm/__init__.py new file mode 100644 index 00000000..54ce2d62 --- /dev/null +++ b/azure-devops/azure/devops/released/npm/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.npm.models import * +from .npm_client import NpmClient + +__all__ = [ + 'BatchDeprecateData', + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'NpmPackagesBatchRequest', + 'NpmPackageVersionDeletionState', + 'NpmRecycleBinPackageVersionDetails', + 'Package', + 'PackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NpmClient' +] diff --git a/azure-devops/azure/devops/released/npm/npm_client.py b/azure-devops/azure/devops/released/npm/npm_client.py new file mode 100644 index 00000000..0548842a --- /dev/null +++ b/azure-devops/azure/devops/released/npm/npm_client.py @@ -0,0 +1,586 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.npm 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, project=None, **kwargs): + """GetContentScopedPackage. + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :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 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='7.0', + 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, project=None, **kwargs): + """GetContentUnscopedPackage. + 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. + :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 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='7.0', + 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, project=None): + """UpdatePackages. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def get_readme_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None, **kwargs): + """GetReadmeScopedPackage. + 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. + :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 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='7.0', + 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, project=None, **kwargs): + """GetReadmeUnscopedPackage. + 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. + :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 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='7.0', + 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 update_recycle_bin_packages(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackages. + Delete or restore several package versions from the recycle bin. + :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. + :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 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='eefe03ef-a6a2-4a7a-a0ec-2e65a5efd64c', + version='7.0', + route_values=route_values, + content=content) + + def delete_scoped_package_version_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """DeleteScopedPackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values) + + def get_scoped_package_version_metadata_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageVersionMetadataFromRecycleBin. + 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. + :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 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='7.0', + 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, project=None): + """RestoreScopedPackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """DeletePackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """GetPackageVersionMetadataFromRecycleBin. + 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. + :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 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='7.0', + 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, project=None): + """RestorePackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def get_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, project=None): + """GetScopedUpstreamingBehavior. + Get the upstreaming behavior of the (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :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 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') + response = self._send(http_method='GET', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, behavior, project=None): + """SetScopedUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of the (unscoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values, + content=content) + + def get_scoped_package_info(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageInfo. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """UnpublishScopedPackage. + 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. + :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 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='7.0', + 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, project=None): + """UpdateScopedPackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + + def get_package_info(self, feed_id, package_name, package_version, project=None): + """GetPackageInfo. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_package(self, feed_id, package_name, package_version, project=None): + """UnpublishPackage. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def update_package(self, package_version_details, feed_id, package_name, package_version, project=None): + """UpdatePackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_name: + :param str package_version: + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + diff --git a/azure-devops/azure/devops/released/nuget/__init__.py b/azure-devops/azure/devops/released/nuget/__init__.py new file mode 100644 index 00000000..487ff6c7 --- /dev/null +++ b/azure-devops/azure/devops/released/nuget/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.nuget.models import * +from .nuget_client import NuGetClient + +__all__ = [ + 'BatchListData', + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'NuGetPackagesBatchRequest', + 'NuGetPackageVersionDeletionState', + 'NuGetRecycleBinPackageVersionDetails', + 'Package', + 'PackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NuGetClient' +] diff --git a/azure-devops/azure/devops/released/nuget/nuget_client.py b/azure-devops/azure/devops/released/nuget/nuget_client.py new file mode 100644 index 00000000..e3e57c07 --- /dev/null +++ b/azure-devops/azure/devops/released/nuget/nuget_client.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.nuget 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 get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """DeletePackageVersion. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, show_deleted=None): + """GetPackageVersion. + 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 str project: Project ID or project name + :param bool show_deleted: True to include deleted packages in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + 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, project=None): + """UpdatePackageVersion. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/released/operations/__init__.py b/azure-devops/azure/devops/released/operations/__init__.py new file mode 100644 index 00000000..167aaa0a --- /dev/null +++ b/azure-devops/azure/devops/released/operations/__init__.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.operations.models import * +from .operations_client import OperationsClient + +__all__ = [ + 'Operation', + 'OperationReference', + 'OperationResultReference', + 'ReferenceLinks', + 'OperationsClient' +] diff --git a/azure-devops/azure/devops/released/operations/operations_client.py b/azure-devops/azure/devops/released/operations/operations_client.py new file mode 100644 index 00000000..0f89f7f0 --- /dev/null +++ b/azure-devops/azure/devops/released/operations/operations_client.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Operation', response) + diff --git a/azure-devops/azure/devops/released/pipelines/__init__.py b/azure-devops/azure/devops/released/pipelines/__init__.py new file mode 100644 index 00000000..3ef4cab9 --- /dev/null +++ b/azure-devops/azure/devops/released/pipelines/__init__.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.pipelines.models import * +from .pipelines_client import PipelinesClient + +__all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'ContainerResourceParameters', + 'CreatePipelineConfigurationParameters', + 'CreatePipelineParameters', + 'Log', + 'LogCollection', + 'PackageResourceParameters', + 'Pipeline', + 'PipelineBase', + 'PipelineConfiguration', + 'PipelineReference', + 'PipelineResourceParameters', + 'PreviewRun', + 'ReferenceLinks', + 'Repository', + 'RepositoryResource', + 'RepositoryResourceParameters', + 'Run', + 'RunPipelineParameters', + 'RunReference', + 'RunResources', + 'RunResourcesParameters', + 'SignalRConnection', + 'SignedUrl', + 'Variable', + 'PipelinesClient' +] diff --git a/azure-devops/azure/devops/released/pipelines/pipelines_client.py b/azure-devops/azure/devops/released/pipelines/pipelines_client.py new file mode 100644 index 00000000..cf6e00c5 --- /dev/null +++ b/azure-devops/azure/devops/released/pipelines/pipelines_client.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.pipelines import models + + +class PipelinesClient(Client): + """Pipelines + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesClient, 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_artifact(self, project, pipeline_id, run_id, artifact_name, expand=None): + """GetArtifact. + Get a specific artifact from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str artifact_name: Name of the artifact. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if artifact_name is not None: + query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='85023071-bd5e-4438-89b0-2a5bf362a19d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Artifact', response) + + def get_log(self, project, pipeline_id, run_id, log_id, expand=None): + """GetLog. + Get a specific log from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param int log_id: ID of the log. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if log_id is not None: + route_values['logId'] = self._serialize.url('log_id', log_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Log', response) + + def list_logs(self, project, pipeline_id, run_id, expand=None): + """ListLogs. + Get a list of logs from a pipeline run. + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('LogCollection', response) + + def create_pipeline(self, input_parameters, project): + """CreatePipeline. + Create a pipeline. + :param :class:` ` input_parameters: Input 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(input_parameters, 'CreatePipelineParameters') + response = self._send(http_method='POST', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Pipeline', response) + + def get_pipeline(self, project, pipeline_id, pipeline_version=None): + """GetPipeline. + Gets a pipeline, optionally at the specified version + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID + :param int pipeline_version: The pipeline version + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + response = self._send(http_method='GET', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Pipeline', response) + + def list_pipelines(self, project, order_by=None, top=None, continuation_token=None): + """ListPipelines. + Get a list of pipelines. + :param str project: Project ID or project name + :param str order_by: A sort expression. Defaults to "name asc" + :param int top: The maximum number of pipelines to return + :param str continuation_token: A continuation token from a previous request, to retrieve the next page of results + :rtype: [Pipeline] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query('order_by', order_by, '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='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Pipeline]', self._unwrap_collection(response)) + + def preview(self, run_parameters, project, pipeline_id, pipeline_version=None): + """Preview. + Queues a dry run of the pipeline and returns an object containing the final yaml. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='53df2d18-29ea-46a9-bee0-933540f80abf', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('PreviewRun', response) + + def get_run(self, project, pipeline_id, run_id): + """GetRun. + Gets a run for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :param int run_id: The run id + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + 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='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('Run', response) + + def list_runs(self, project, pipeline_id): + """ListRuns. + Gets top 10000 runs for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :rtype: [Run] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + response = self._send(http_method='GET', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('[Run]', self._unwrap_collection(response)) + + def run_pipeline(self, run_parameters, project, pipeline_id, pipeline_version=None): + """RunPipeline. + Runs a pipeline. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Run', response) + diff --git a/azure-devops/azure/devops/released/policy/__init__.py b/azure-devops/azure/devops/released/policy/__init__.py new file mode 100644 index 00000000..b8e725b4 --- /dev/null +++ b/azure-devops/azure/devops/released/policy/__init__.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.policy.models import * +from .policy_client import PolicyClient + +__all__ = [ + 'GraphSubjectBase', + 'IdentityRef', + 'PolicyConfiguration', + 'PolicyConfigurationRef', + 'PolicyEvaluationRecord', + 'PolicyType', + 'PolicyTypeRef', + 'ReferenceLinks', + 'VersionedPolicyConfigurationRef', + 'PolicyClient' +] diff --git a/azure-devops/azure/devops/released/policy/policy_client.py b/azure-devops/azure/devops/released/policy/policy_client.py new file mode 100644 index 00000000..d64f936f --- /dev/null +++ b/azure-devops/azure/devops/released/policy/policy_client.py @@ -0,0 +1,212 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.0', + 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:`<[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 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='7.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='7.0', + 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='7.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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[PolicyType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/profile/__init__.py b/azure-devops/azure/devops/released/profile/__init__.py new file mode 100644 index 00000000..9b4c6462 --- /dev/null +++ b/azure-devops/azure/devops/released/profile/__init__.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.profile.models import * +from .profile_client import ProfileClient + +__all__ = [ + 'AttributeDescriptor', + 'AttributesContainer', + 'Avatar', + 'CoreProfileAttribute', + 'CreateProfileContext', + 'GeoRegion', + 'Profile', + 'ProfileAttribute', + 'ProfileAttributeBase', + 'ProfileRegion', + 'ProfileRegions', + 'ProfileClient' +] diff --git a/azure-devops/azure/devops/released/profile/profile_client.py b/azure-devops/azure/devops/released/profile/profile_client.py new file mode 100644 index 00000000..1f542536 --- /dev/null +++ b/azure-devops/azure/devops/released/profile/profile_client.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Profile', response) + diff --git a/azure-devops/azure/devops/released/project_analysis/__init__.py b/azure-devops/azure/devops/released/project_analysis/__init__.py new file mode 100644 index 00000000..16a943ff --- /dev/null +++ b/azure-devops/azure/devops/released/project_analysis/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.project_analysis.models import * +from .project_analysis_client import ProjectAnalysisClient + +__all__ = [ + 'CodeChangeTrendItem', + 'LanguageMetricsSecuredObject', + 'LanguageStatistics', + 'ProjectActivityMetrics', + 'ProjectLanguageAnalytics', + 'RepositoryActivityMetrics', + 'RepositoryLanguageAnalytics', + 'ProjectAnalysisClient' +] diff --git a/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py b/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py new file mode 100644 index 00000000..c2ecf05c --- /dev/null +++ b/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py @@ -0,0 +1,117 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.project_analysis 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. + :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='7.0', + route_values=route_values) + return self._deserialize('ProjectLanguageAnalytics', response) + + def get_project_activity_metrics(self, project, from_date, aggregation_type): + """GetProjectActivityMetrics. + :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='7.0', + 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. + 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='7.0', + 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. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RepositoryActivityMetrics', response) + diff --git a/azure-devops/azure/devops/released/release/__init__.py b/azure-devops/azure/devops/released/release/__init__.py new file mode 100644 index 00000000..39b637fe --- /dev/null +++ b/azure-devops/azure/devops/released/release/__init__.py @@ -0,0 +1,115 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.release.models import * +from .release_client import ReleaseClient + +__all__ = [ + 'AgentArtifactDefinition', + 'ApprovalOptions', + 'Artifact', + 'ArtifactMetadata', + 'ArtifactSourceReference', + 'ArtifactTriggerConfiguration', + 'ArtifactTypeDefinition', + 'ArtifactVersion', + 'ArtifactVersionQueryResult', + 'AuthorizationHeader', + 'AutoTriggerIssue', + 'BuildVersion', + 'ComplianceSettings', + 'Condition', + 'ConfigurationVariableValue', + 'DataSourceBindingBase', + 'DefinitionEnvironmentReference', + 'Deployment', + 'DeploymentAttempt', + 'DeploymentJob', + 'DeploymentQueryParameters', + 'EmailRecipients', + 'EnvironmentExecutionPolicy', + 'EnvironmentOptions', + 'EnvironmentRetentionPolicy', + 'EnvironmentTrigger', + 'FavoriteItem', + 'Folder', + 'GateUpdateMetadata', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'IgnoredGate', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'InputValuesQuery', + 'Issue', + 'MailMessage', + 'ManualIntervention', + 'ManualInterventionUpdateMetadata', + 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', + 'PipelineProcess', + 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', + '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', + 'ReleaseSettings', + 'ReleaseShallowReference', + 'ReleaseSchedule', + 'ReleaseStartEnvironmentMetadata', + 'ReleaseStartMetadata', + 'ReleaseTask', + 'ReleaseTaskAttachment', + 'ReleaseUpdateMetadata', + 'ReleaseWorkItemRef', + 'RetentionPolicy', + 'RetentionSettings', + 'SourcePullRequestVersion', + 'SummaryMailSection', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskSourceDefinitionBase', + 'VariableGroup', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'WorkflowTask', + 'WorkflowTaskReference', + 'ReleaseClient' +] diff --git a/azure-devops/azure/devops/released/release/release_client.py b/azure-devops/azure/devops/released/release/release_client.py new file mode 100644 index 00000000..9f691ce7 --- /dev/null +++ b/azure-devops/azure/devops/released/release/release_client.py @@ -0,0 +1,876 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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:`<[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='7.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='7.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. + Get a release task attachment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str timeline_id: Timeline Id of the task. + :param str record_id: Record Id of attachment. + :param str type: Type of the attachment. + :param str name: Name of the attachment. + :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='7.0', + 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. + Get the release task attachments. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str type: Type of the attachment. + :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='7.0', + 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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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: :class:`<[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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Deployment]', self._unwrap_collection(response)) + + def get_release_environment(self, project, release_id, environment_id, expand=None): + """GetReleaseEnvironment. + Get a release environment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param str expand: A property that should be expanded in the 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReleaseEnvironment', response) + + def update_release_environment(self, environment_update_data, project, release_id, environment_id): + """UpdateReleaseEnvironment. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseEnvironment', response) + + def delete_folder(self, project, path): + """DeleteFolder. + Deletes a definition folder for given folder name and path and all it's existing definitions. + :param str project: Project ID or project name + :param str path: Path of the folder to delete. + """ + 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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values) + + def get_folders(self, project, path=None, query_order=None): + """GetFolders. + Gets folders. + :param str project: Project ID or project name + :param str path: Path of the folder. + :param str query_order: Gets the results in the defined order. Default is 'None'. + :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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Folder]', self._unwrap_collection(response)) + + def update_folder(self, folder, project, path): + """UpdateFolder. + Updates an existing folder at given existing path. + :param :class:` ` folder: folder. + :param str project: Project ID or project name + :param str path: Path of the folder to update. + :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='PATCH', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Folder', response) + + def update_gates(self, gate_update_metadata, project, gate_step_id): + """UpdateGates. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseGates', response) + + def get_logs(self, project, release_id, **kwargs): + """GetLogs. + 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='7.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_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): + """GetTaskLog. + 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='7.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_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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Release', response) + + def get_definition_revision(self, project, definition_id, revision, **kwargs): + """GetDefinitionRevision. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/search/__init__.py b/azure-devops/azure/devops/released/search/__init__.py new file mode 100644 index 00000000..853ed4db --- /dev/null +++ b/azure-devops/azure/devops/released/search/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.search.models import * +from .search_client import SearchClient + +__all__ = [ + 'BoardResult', + 'BoardSearchRequest', + 'BoardSearchResponse', + 'BranchInfo', + 'CodeResult', + 'CodeSearchRequest', + 'CodeSearchResponse', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequest', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchRequest', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchRequest', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchRequest', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchRequest', + 'WorkItemSearchResponse', + 'SearchClient' +] diff --git a/azure-devops/azure/devops/released/search/search_client.py b/azure-devops/azure/devops/released/search/search_client.py new file mode 100644 index 00000000..07a7ffb2 --- /dev/null +++ b/azure-devops/azure/devops/released/search/search_client.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.search 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_scroll_code_search_results(self, request, project=None): + """FetchScrollCodeSearchResults. + 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, 'ScrollSearchRequest') + response = self._send(http_method='POST', + location_id='852dac94-e8f7-45a2-9910-927ae35766a2', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_code_search_results(self, request, project=None): + """FetchCodeSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_package_search_results(self, request): + """FetchPackageSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Package Search Request. + :rtype: :class:` ` + """ + content = self._serialize.body(request, 'PackageSearchRequest') + response = self._send(http_method='POST', + location_id='f62ada48-eedc-4c8e-93f0-de870e4ecce0', + version='7.0', + content=content) + response_object = models.PackageSearchResponse() + response_object.content = self._deserialize('PackageSearchResponseContent', response) + response_object.activity_id = response.headers.get('ActivityId') + return response_object + + def get_repository_status(self, project, repository): + """GetRepositoryStatus. + Provides status of Repository. + :param str project: Project ID or project name + :param str repository: Repository ID or repository name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository is not None: + route_values['repository'] = self._serialize.url('repository', repository, 'str') + response = self._send(http_method='GET', + location_id='1f60303c-7261-4387-80f1-742a2ecf2964', + version='7.0', + route_values=route_values) + return self._deserialize('RepositoryStatusResponse', response) + + def get_tfvc_repository_status(self, project): + """GetTfvcRepositoryStatus. + Provides status of TFVC 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') + response = self._send(http_method='GET', + location_id='d5bf4e52-e0af-4626-8c50-8a80b18fa69f', + version='7.0', + route_values=route_values) + return self._deserialize('TfvcRepositoryStatusResponse', response) + + def fetch_wiki_search_results(self, request, project=None): + """FetchWikiSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WikiSearchResponse', response) + + def fetch_work_item_search_results(self, request, project=None): + """FetchWorkItemSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemSearchResponse', response) + diff --git a/azure-devops/azure/devops/released/security/__init__.py b/azure-devops/azure/devops/released/security/__init__.py new file mode 100644 index 00000000..e6e0c12f --- /dev/null +++ b/azure-devops/azure/devops/released/security/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.security.models import * +from .security_client import SecurityClient + +__all__ = [ + 'AccessControlEntry', + 'AccessControlList', + 'AccessControlListsCollection', + 'AceExtendedInformation', + 'ActionDefinition', + 'PermissionEvaluation', + 'PermissionEvaluationBatch', + 'SecurityNamespaceDescription', + 'SecurityClient' +] diff --git a/azure-devops/azure/devops/released/security/security_client.py b/azure-devops/azure/devops/released/security/security_client.py new file mode 100644 index 00000000..d2209467 --- /dev/null +++ b/azure-devops/azure/devops/released/security/security_client.py @@ -0,0 +1,224 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/service_endpoint/__init__.py b/azure-devops/azure/devops/released/service_endpoint/__init__.py new file mode 100644 index 00000000..79f1e526 --- /dev/null +++ b/azure-devops/azure/devops/released/service_endpoint/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.service_endpoint.models import * +from .service_endpoint_client import ServiceEndpointClient + +__all__ = [ + 'AadOauthTokenRequest', + 'AadOauthTokenResult', + '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', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'ServiceEndpointClient' +] diff --git a/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py b/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py new file mode 100644 index 00000000..6509fd8c --- /dev/null +++ b/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.service_endpoint 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpointRequestResult', response) + + def create_service_endpoint(self, endpoint): + """CreateServiceEndpoint. + Creates a new service endpoint + :param :class:` ` endpoint: Service endpoint to create + :rtype: :class:` ` + """ + content = self._serialize.body(endpoint, 'ServiceEndpoint') + response = self._send(http_method='POST', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('ServiceEndpoint', response) + + def delete_service_endpoint(self, endpoint_id, project_ids, deep=None): + """DeleteServiceEndpoint. + Delete a service endpoint + :param str endpoint_id: Endpoint Id of endpoint to delete + :param [str] project_ids: project Ids from which endpoint needs to be deleted + :param bool deep: delete the spn created by endpoint + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + if deep is not None: + query_parameters['deep'] = self._serialize.query('deep', deep, 'bool') + self._send(http_method='DELETE', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_service_endpoint(self, endpoint_project_references, endpoint_id): + """ShareServiceEndpoint. + Share service endpoint across projects + :param [ServiceEndpointProjectReference] endpoint_project_references: Project reference details of the target project + :param str endpoint_id: Endpoint Id of the endpoint to share + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + content = self._serialize.body(endpoint_project_references, '[ServiceEndpointProjectReference]') + self._send(http_method='PATCH', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + content=content) + + def update_service_endpoint(self, endpoint, endpoint_id, operation=None): + """UpdateServiceEndpoint. + Update the service endpoint + :param :class:` ` endpoint: Updated data for the endpoint + :param str endpoint_id: Endpoint Id of the endpoint to update + :param str operation: operation type + :rtype: :class:` ` + """ + route_values = {} + 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='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpoint', response) + + def update_service_endpoints(self, endpoints): + """UpdateServiceEndpoints. + Update the service endpoints. + :param [ServiceEndpoint] endpoints: Names of the service endpoints to update. + :rtype: [ServiceEndpoint] + """ + content = self._serialize.body(endpoints, '[ServiceEndpoint]') + response = self._send(http_method='PUT', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_details(self, project, endpoint_id, action_filter=None): + """GetServiceEndpointDetails. + Get the service endpoint details. + :param str project: Project ID or project name + :param str endpoint_id: Id of the service endpoint. + :param str action_filter: Action filter for the service connection. It specifies the action which can be performed on the service connection. + :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 action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ServiceEndpoint', response) + + def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, owner=None, include_failed=None, include_details=None): + """GetServiceEndpoints. + 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 str owner: Owner 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 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.0', + 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, owner=None, include_failed=None, include_details=None): + """GetServiceEndpointsByNames. + 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 str owner: Owner 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoints_with_refreshed_authentication(self, refresh_authentication_parameters, project, endpoint_ids): + """GetServiceEndpointsWithRefreshedAuthentication. + Gets the service endpoints and patch new authorization parameters + :param [RefreshAuthenticationParameters] refresh_authentication_parameters: Scope, Validity of Token requested. + :param str project: Project ID or project name + :param [str] endpoint_ids: Ids of the service endpoints. + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_ids is not None: + endpoint_ids = ",".join(endpoint_ids) + query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') + content = self._serialize.body(refresh_authentication_parameters, '[RefreshAuthenticationParameters]') + response = self._send(http_method='POST', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_execution_records(self, project, endpoint_id, top=None, continuation_token=None): + """GetServiceEndpointExecutionRecords. + 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. + :param long continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of records + :rtype: :class:`<[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') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') + response = self._send(http_method='GET', + location_id='10a16738-9299-4cd1-9a81-fd23ad6200d0', + version='7.0', + 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. + 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='7.0', + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpointType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/service_hooks/__init__.py b/azure-devops/azure/devops/released/service_hooks/__init__.py new file mode 100644 index 00000000..cd0624cf --- /dev/null +++ b/azure-devops/azure/devops/released/service_hooks/__init__.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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' +] diff --git a/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py b/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py new file mode 100644 index 00000000..45d64dd1 --- /dev/null +++ b/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py @@ -0,0 +1,395 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters) + return self._deserialize('[Consumer]', self._unwrap_collection(response)) + + def get_subscription_diagnostics(self, subscription_id): + """GetSubscriptionDiagnostics. + :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='7.0', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + :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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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: 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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('Notification', response) + diff --git a/azure-devops/azure/devops/released/symbol/__init__.py b/azure-devops/azure/devops/released/symbol/__init__.py new file mode 100644 index 00000000..d7cae595 --- /dev/null +++ b/azure-devops/azure/devops/released/symbol/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.symbol.models import * +from .symbol_client import SymbolClient + +__all__ = [ + 'DebugEntry', + 'DebugEntryCreateBatch', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'Request', + 'ResourceBase', + 'SymbolClient' +] diff --git a/azure-devops/azure/devops/released/symbol/symbol_client.py b/azure-devops/azure/devops/released/symbol/symbol_client.py new file mode 100644 index 00000000..f3c4498f --- /dev/null +++ b/azure-devops/azure/devops/released/symbol/symbol_client.py @@ -0,0 +1,244 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.symbol 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. + 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='7.0') + + def get_client(self, client_type): + """GetClient. + 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='7.0', + route_values=route_values) + return self._deserialize('object', response) + + def head_client(self): + """HeadClient. + Get client version information. + """ + self._send(http_method='HEAD', + location_id='79c83865-4de3-460c-8a16-01be238e0818', + version='7.0') + + def get_debug_entry_content(self, request_id, debug_entry_id): + """GetDebugEntryContent. + Get a stitched debug entry for a symbol request as specified by symbol request identifier and debug entry identifier. + :param str request_id: The symbol request identifier. + :param str debug_entry_id: The debug entry identifier. + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + if debug_entry_id is not None: + route_values['debugEntryId'] = self._serialize.url('debug_entry_id', debug_entry_id, 'str') + self._send(http_method='GET', + location_id='0f98d9f5-caf7-44fd-a5c9-55f3a9b34399', + version='7.0', + route_values=route_values) + + def create_requests(self, request_to_create): + """CreateRequests. + 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='7.0', + content=content) + return self._deserialize('Request', response) + + def create_requests_request_id_debug_entries(self, batch, request_id, collection): + """CreateRequestsRequestIdDebugEntries. + 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='7.0', + 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. + 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: The symbol 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def delete_requests_request_name(self, request_name, synchronous=None): + """DeleteRequestsRequestName. + Delete a symbol request by request name. + :param str request_name: The symbol 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='7.0', + query_parameters=query_parameters) + + def get_requests_request_id(self, request_id): + """GetRequestsRequestId. + 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='7.0', + route_values=route_values) + return self._deserialize('Request', response) + + def get_requests_request_name(self, request_name): + """GetRequestsRequestName. + Get a symbol request by request name. + :param str request_name: The symbol 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='7.0', + query_parameters=query_parameters) + return self._deserialize('Request', response) + + def update_requests_request_id(self, update_request, request_id): + """UpdateRequestsRequestId. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Request', response) + + def update_requests_request_name(self, update_request, request_name): + """UpdateRequestsRequestName. + Update a symbol request by request name. + :param :class:` ` update_request: The symbol request. + :param str request_name: The symbol 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='7.0', + 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. + 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='7.0', + route_values=route_values) + diff --git a/azure-devops/azure/devops/released/task/__init__.py b/azure-devops/azure/devops/released/task/__init__.py new file mode 100644 index 00000000..25e84ac5 --- /dev/null +++ b/azure-devops/azure/devops/released/task/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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' +] diff --git a/azure-devops/azure/devops/released/task/task_client.py b/azure-devops/azure/devops/released/task/task_client.py new file mode 100644 index 00000000..35f8448f --- /dev/null +++ b/azure-devops/azure/devops/released/task/task_client.py @@ -0,0 +1,513 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 get_plan_attachments(self, scope_identifier, hub_name, plan_id, type): + """GetPlanAttachments. + :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='7.0', + 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. + :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='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskAttachment', response) + + def create_attachment_from_artifact(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, artifact_hash, length): + """CreateAttachmentFromArtifact. + :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: + :param str artifact_hash: + :param long length: + :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') + query_parameters = {} + if artifact_hash is not None: + query_parameters['artifactHash'] = self._serialize.query('artifact_hash', artifact_hash, 'str') + if length is not None: + query_parameters['length'] = self._serialize.query('length', length, 'long') + response = self._send(http_method='PUT', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAttachment', response) + + def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): + """GetAttachment. + :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='7.0', + 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. + :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='7.0', + 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. + :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='7.0', + 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='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskLog', response) + + def associate_log(self, scope_identifier, hub_name, plan_id, log_id, serialized_blob_id, line_count): + """AssociateLog. + :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 str serialized_blob_id: + :param int line_count: + :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') + query_parameters = {} + if serialized_blob_id is not None: + query_parameters['serializedBlobId'] = self._serialize.query('serialized_blob_id', serialized_blob_id, 'str') + if line_count is not None: + query_parameters['lineCount'] = self._serialize.query('line_count', line_count, 'int') + response = self._send(http_method='POST', + location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[Timeline]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/task_agent/__init__.py b/azure-devops/azure/devops/released/task_agent/__init__.py new file mode 100644 index 00000000..2322e8cf --- /dev/null +++ b/azure-devops/azure/devops/released/task_agent/__init__.py @@ -0,0 +1,138 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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', + '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', + 'TaskAgentJobRequest', + 'TaskAgentMessage', + 'TaskAgentPool', + 'TaskAgentPoolMaintenanceDefinition', + 'TaskAgentPoolMaintenanceJob', + 'TaskAgentPoolMaintenanceJobTargetAgent', + 'TaskAgentPoolMaintenanceOptions', + 'TaskAgentPoolMaintenanceRetentionPolicy', + 'TaskAgentPoolMaintenanceSchedule', + 'TaskAgentPoolReference', + 'TaskAgentPublicKey', + 'TaskAgentQueue', + 'TaskAgentReference', + 'TaskAgentSession', + 'TaskAgentSessionKey', + 'TaskAgentUpdate', + 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', + 'TaskDefinition', + 'TaskDefinitionEndpoint', + 'TaskDefinitionReference', + 'TaskExecution', + 'TaskGroup', + 'TaskGroupCreateParameter', + 'TaskGroupDefinition', + 'TaskGroupRevision', + 'TaskGroupStep', + 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', + 'TaskHubLicenseDetails', + 'TaskInputDefinition', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationOwner', + 'TaskOutputVariable', + 'TaskPackageMetadata', + 'TaskReference', + 'TaskRestrictions', + 'TaskSourceDefinition', + 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', + 'TaskVersion', + 'ValidationItem', + 'VariableGroup', + 'VariableGroupParameters', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'VirtualMachine', + 'VirtualMachineGroup', + 'VirtualMachineGroupCreateParameters', + 'TaskAgentClient' +] diff --git a/azure-devops/azure/devops/released/task_agent/task_agent_client.py b/azure-devops/azure/devops/released/task_agent/task_agent_client.py new file mode 100644 index 00000000..5f2a296b --- /dev/null +++ b/azure-devops/azure/devops/released/task_agent/task_agent_client.py @@ -0,0 +1,1195 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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_cloud(self, agent_cloud): + """AddAgentCloud. + :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='7.0', + content=content) + return self._deserialize('TaskAgentCloud', response) + + def delete_agent_cloud(self, agent_cloud_id): + """DeleteAgentCloud. + :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='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_cloud(self, agent_cloud_id): + """GetAgentCloud. + :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='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_clouds(self): + """GetAgentClouds. + :rtype: [TaskAgentCloud] + """ + response = self._send(http_method='GET', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0') + return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) + + def update_agent_cloud(self, updated_cloud, agent_cloud_id): + """UpdateAgentCloud. + :param :class:` ` updated_cloud: + :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') + content = self._serialize.body(updated_cloud, 'TaskAgentCloud') + response = self._send(http_method='PATCH', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentCloud', response) + + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgent', response) + + def add_deployment_group(self, deployment_group, project): + """AddDeploymentGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def delete_deployment_group(self, project, deployment_group_id): + """DeleteDeploymentGroup. + 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='7.0', + route_values=route_values) + + def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): + """GetDeploymentGroup. + 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='7.0', + 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. + 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: :class:`<[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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def get_environment_deployment_execution_records(self, project, environment_id, continuation_token=None, top=None): + """GetEnvironmentDeploymentExecutionRecords. + Get environment deployment execution history + :param str project: Project ID or project name + :param int environment_id: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentDeploymentExecutionRecord]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_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') + response = self._send(http_method='GET', + location_id='51bb5d21-4305-4ea6-9dbb-b7488af73334', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentDeploymentExecutionRecord]', self._unwrap_collection(response)) + + def add_environment(self, environment_create_parameter, project): + """AddEnvironment. + Create an environment. + :param :class:` ` environment_create_parameter: Environment 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(environment_create_parameter, 'EnvironmentCreateParameter') + response = self._send(http_method='POST', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def delete_environment(self, project, environment_id): + """DeleteEnvironment. + Delete the specified environment. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + self._send(http_method='DELETE', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values) + + def get_environment_by_id(self, project, environment_id, expands=None): + """GetEnvironmentById. + Get an environment by its ID. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :param str expands: 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 environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if expands is not None: + query_parameters['expands'] = self._serialize.query('expands', expands, 'str') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('EnvironmentInstance', response) + + def get_environments(self, project, name=None, continuation_token=None, top=None): + """GetEnvironments. + Get all environments. + :param str project: Project ID or project name + :param str name: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentInstance]> ` + """ + 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 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') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentInstance]', self._unwrap_collection(response)) + + def update_environment(self, environment_update_parameter, project, environment_id): + """UpdateEnvironment. + Update the specified environment. + :param :class:` ` environment_update_parameter: Environment data to update. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(environment_update_parameter, 'EnvironmentUpdateParameter') + response = self._send(http_method='PATCH', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def add_kubernetes_resource(self, create_parameters, project, environment_id): + """AddKubernetesResource. + :param :class:` ` create_parameters: + :param str project: Project ID or project name + :param int environment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(create_parameters, 'KubernetesResourceCreateParameters') + response = self._send(http_method='POST', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('KubernetesResource', response) + + def delete_kubernetes_resource(self, project, environment_id, resource_id): + """DeleteKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + self._send(http_method='DELETE', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + + def get_kubernetes_resource(self, project, environment_id, resource_id): + """GetKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + response = self._send(http_method='GET', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + return self._deserialize('KubernetesResource', 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentPool', response) + + def add_agent_queue(self, queue, project=None, authorize_pipelines=None): + """AddAgentQueue. + Create a new agent queue to connect a project to an agent pool. + :param :class:` ` queue: Details about the queue to create + :param str project: Project ID or project name + :param bool authorize_pipelines: Automatically authorize this queue when using YAML + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if authorize_pipelines is not None: + query_parameters['authorizePipelines'] = self._serialize.query('authorize_pipelines', authorize_pipelines, 'bool') + content = self._serialize.body(queue, 'TaskAgentQueue') + response = self._send(http_method='POST', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TaskAgentQueue', response) + + def delete_agent_queue(self, queue_id, project=None): + """DeleteAgentQueue. + Removes an agent queue from a project. + :param int queue_id: The agent queue 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 queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + self._send(http_method='DELETE', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values) + + def get_agent_queue(self, queue_id, project=None, action_filter=None): + """GetAgentQueue. + Get information about an agent queue. + :param int queue_id: The agent queue to get information about + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + query_parameters = {} + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAgentQueue', response) + + def get_agent_queues(self, project=None, queue_name=None, action_filter=None): + """GetAgentQueues. + Get a list of agent queues. + :param str project: Project ID or project name + :param str queue_name: Filter on the agent queue name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_name is not None: + query_parameters['queueName'] = self._serialize.query('queue_name', queue_name, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_ids(self, queue_ids, project=None, action_filter=None): + """GetAgentQueuesByIds. + Get a list of agent queues by their IDs + :param [int] queue_ids: A comma-separated list of agent queue IDs to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_ids is not None: + queue_ids = ",".join(map(str, queue_ids)) + query_parameters['queueIds'] = self._serialize.query('queue_ids', queue_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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_names(self, queue_names, project=None, action_filter=None): + """GetAgentQueuesByNames. + Get a list of agent queues by their names + :param [str] queue_names: A comma-separated list of agent names to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_names is not None: + queue_names = ",".join(queue_names) + query_parameters['queueNames'] = self._serialize.query('queue_names', queue_names, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_for_pools(self, pool_ids, project=None, action_filter=None): + """GetAgentQueuesForPools. + Get a list of agent queues by pool ids + :param [int] pool_ids: A comma-separated list of pool ids to get the corresponding queues for + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_cloud_requests(self, agent_cloud_id): + """GetAgentCloudRequests. + :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='7.0', + route_values=route_values) + return self._deserialize('[TaskAgentCloudRequest]', self._unwrap_collection(response)) + + def delete_deployment_target(self, project, deployment_group_id, target_id): + """DeleteDeploymentTarget. + 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='7.0', + route_values=route_values) + + def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): + """GetDeploymentTarget. + 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='7.0', + 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, property_filters=None): + """GetDeploymentTargets. + 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. + :param [str] property_filters: + :rtype: :class:`<[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') + 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='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) + + def add_task_group(self, task_group, project): + """AddTaskGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def delete_task_group(self, project, task_group_id, comment=None): + """DeleteTaskGroup. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def add_variable_group(self, variable_group_parameters): + """AddVariableGroup. + Add a variable group. + :param :class:` ` variable_group_parameters: + :rtype: :class:` ` + """ + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='POST', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + content=content) + return self._deserialize('VariableGroup', response) + + def delete_variable_group(self, group_id, project_ids): + """DeleteVariableGroup. + Delete a variable group + :param int group_id: Id of the variable group. + :param [str] project_ids: + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + self._send(http_method='DELETE', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_variable_group(self, variable_group_project_references, variable_group_id): + """ShareVariableGroup. + Add a variable group. + :param [VariableGroupProjectReference] variable_group_project_references: + :param int variable_group_id: + """ + query_parameters = {} + if variable_group_id is not None: + query_parameters['variableGroupId'] = self._serialize.query('variable_group_id', variable_group_id, 'int') + content = self._serialize.body(variable_group_project_references, '[VariableGroupProjectReference]') + self._send(http_method='PATCH', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + query_parameters=query_parameters, + content=content) + + def update_variable_group(self, variable_group_parameters, group_id): + """UpdateVariableGroup. + Update a variable group. + :param :class:` ` variable_group_parameters: + :param int group_id: Id of the variable group to update. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='PUT', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('VariableGroup', response) + + def get_variable_group(self, project, group_id): + """GetVariableGroup. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) + + def get_yaml_schema(self, validate_task_names=None): + """GetYamlSchema. + GET the Yaml schema used for Yaml file validation. + :param bool validate_task_names: Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). + :rtype: object + """ + query_parameters = {} + if validate_task_names is not None: + query_parameters['validateTaskNames'] = self._serialize.query('validate_task_names', validate_task_names, 'bool') + response = self._send(http_method='GET', + location_id='1f9990b9-1dba-441f-9c2e-6485888c42b6', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('object', response) + diff --git a/azure-devops/azure/devops/released/test/__init__.py b/azure-devops/azure/devops/released/test/__init__.py new file mode 100644 index 00000000..1f0b9122 --- /dev/null +++ b/azure-devops/azure/devops/released/test/__init__.py @@ -0,0 +1,129 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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' +] diff --git a/azure-devops/azure/devops/released/test/test_client.py b/azure-devops/azure/devops/released/test/test_client.py new file mode 100644 index 00000000..c4412112 --- /dev/null +++ b/azure-devops/azure/devops/released/test/test_client.py @@ -0,0 +1,1181 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id): + """CreateTestResultAttachment. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): + """GetTestSubResultAttachmentContent. + 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='7.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_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id): + """GetTestSubResultAttachments. + 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='7.0', + 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. + 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='7.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_test_run_attachment(self, attachment_request_model, project, run_id): + """CreateTestRunAttachment. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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_code_coverage(self, project, build_id, flags): + """GetBuildCodeCoverage. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestRunCoverage]', 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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestIterationDetailsModel]', 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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestPointsQuery', response) + + def get_result_retention_settings(self, project): + """GetResultRetentionSettings. + 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='7.0', + route_values=route_values) + return self._deserialize('ResultRetentionSettings', response) + + def update_result_retention_settings(self, retention_settings, project): + """UpdateResultRetentionSettings. + 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='7.0', + 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='7.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='7.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='7.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='7.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 , 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='7.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='7.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='7.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: Default value is true. It includes details like run statistics, release, build, test environment, 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='7.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='7.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 separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma separated 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 separated 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:`<[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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestRun', response) + + def create_test_session(self, test_session, team_context): + """CreateTestSession. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSession', 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) + + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + 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='7.0', + route_values=route_values) + + def query_test_history(self, filter, project): + """QueryTestHistory. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestHistoryQuery', response) + diff --git a/azure-devops/azure/devops/released/test_plan/__init__.py b/azure-devops/azure/devops/released/test_plan/__init__.py new file mode 100644 index 00000000..269ae715 --- /dev/null +++ b/azure-devops/azure/devops/released/test_plan/__init__.py @@ -0,0 +1,78 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.test_plan.models import * +from .test_plan_client import TestPlanClient + +__all__ = [ + 'BuildDefinitionReference', + 'CloneOperationCommonResponse', + 'CloneOptions', + 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', + 'CloneTestPlanOperationInformation', + 'CloneTestPlanParams', + 'CloneTestSuiteOperationInformation', + 'CloneTestSuiteParams', + 'Configuration', + 'DestinationTestPlanCloneParams', + 'DestinationTestSuiteInfo', + 'GraphSubjectBase', + 'IdentityRef', + 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', + 'NameValuePair', + 'PointAssignment', + 'ReferenceLinks', + 'ReleaseEnvironmentDefinitionReference', + 'Results', + 'SourceTestPlanInfo', + 'SourceTestplanResponse', + 'SourceTestSuiteInfo', + 'SourceTestSuiteResponse', + 'SuiteEntry', + 'SuiteEntryUpdateParams', + 'SuiteTestCaseCreateUpdateParameters', + 'TeamProjectReference', + 'TestCase', + 'TestCaseAssociatedResult', + 'TestCaseReference', + 'TestCaseResultsData', + 'TestConfiguration', + 'TestConfigurationCreateUpdateParameters', + 'TestConfigurationReference', + 'TestEntityCount', + 'TestEnvironment', + 'TestOutcomeSettings', + 'TestPlan', + 'TestPlanCreateParams', + 'TestPlanDetailedReference', + 'TestPlanReference', + 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', + 'TestPlanUpdateParams', + 'TestPoint', + 'TestPointDetailedReference', + 'TestPointResults', + 'TestPointUpdateParams', + 'TestSettings', + 'TestSuite', + 'TestSuiteCreateParams', + 'TestSuiteCreateUpdateCommonParams', + 'TestSuiteReference', + 'TestSuiteReferenceWithProject', + 'TestSuiteUpdateParams', + 'TestVariable', + 'TestVariableCreateUpdateParameters', + 'WorkItem', + 'WorkItemDetails', + 'TestPlanClient' +] diff --git a/azure-devops/azure/devops/released/test_plan/test_plan_client.py b/azure-devops/azure/devops/released/test_plan/test_plan_client.py new file mode 100644 index 00000000..d562675f --- /dev/null +++ b/azure-devops/azure/devops/released/test_plan/test_plan_client.py @@ -0,0 +1,910 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 create_test_configuration(self, test_configuration_create_update_parameters, project): + """CreateTestConfiguration. + Create a test configuration. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :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_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestConfiguration', response) + + def delete_test_confguration(self, project, test_configuartion_id): + """DeleteTestConfguration. + Delete a test configuration by its ID. + :param str project: Project ID or project name + :param int test_configuartion_id: ID of the test configuration to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + self._send(http_method='DELETE', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_test_configuration_by_id(self, project, test_configuration_id): + """GetTestConfigurationById. + 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='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values) + return self._deserialize('TestConfiguration', response) + + def get_test_configurations(self, project, continuation_token=None): + """GetTestConfigurations. + Get a list of test configurations. + :param str project: Project ID or project name + :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. + :rtype: :class:`<[TestConfiguration]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestConfiguration]', self._unwrap_collection(response)) + + def update_test_configuration(self, test_configuration_create_update_parameters, project, test_configuartion_id): + """UpdateTestConfiguration. + Update a test configuration by its ID. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :param str project: Project ID or project name + :param int test_configuartion_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') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + content = self._serialize.body(test_configuration_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestConfiguration', response) + + def create_test_plan(self, test_plan_create_params, project): + """CreateTestPlan. + Create a test plan. + :param :class:` ` test_plan_create_params: A testPlanCreateParams object.TestPlanCreateParams + :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_create_params, 'TestPlanCreateParams') + response = self._send(http_method='POST', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + + def get_test_plan_by_id(self, project, plan_id): + """GetTestPlanById. + Get a test plan by Id. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan 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') + response = self._send(http_method='GET', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + return self._deserialize('TestPlan', response) + + def get_test_plans(self, project, owner=None, continuation_token=None, include_plan_details=None, filter_active_plans=None): + """GetTestPlans. + 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 str continuation_token: If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. + :param bool include_plan_details: Get all properties of the test plan + :param bool filter_active_plans: Get just the active plans + :rtype: :class:`<[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 continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + + def update_test_plan(self, test_plan_update_params, project, plan_id): + """UpdateTestPlan. + Update a test plan. + :param :class:` ` test_plan_update_params: A testPlanUpdateParams object.TestPlanUpdateParams + :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(test_plan_update_params, 'TestPlanUpdateParams') + response = self._send(http_method='PATCH', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def get_suite_entries(self, project, suite_id, suite_entry_type=None): + """GetSuiteEntries. + 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. + :param str suite_entry_type: + :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') + query_parameters = {} + if suite_entry_type is not None: + query_parameters['suiteEntryType'] = self._serialize.query('suite_entry_type', suite_entry_type, 'str') + response = self._send(http_method='GET', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def reorder_suite_entries(self, suite_entries, project, suite_id): + """ReorderSuiteEntries. + Reorder test suite entries in the test suite. + :param [SuiteEntryUpdateParams] suite_entries: List of SuiteEntry 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, '[SuiteEntryUpdateParams]') + response = self._send(http_method='PATCH', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def create_test_suite(self, test_suite_create_params, project, plan_id): + """CreateTestSuite. + Create test suite. + :param :class:` ` test_suite_create_params: Parameters for suite creation + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :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(test_suite_create_params, 'TestSuiteCreateParams') + response = self._send(http_method='POST', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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 str 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, 'str') + response = self._send(http_method='GET', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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, continuation_token=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 str expand: Include the children suites and testers details. + :param str continuation_token: If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + :param bool as_tree_view: If the suites returned should be in a tree structure. + :rtype: :class:`<[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, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def update_test_suite(self, test_suite_update_params, project, plan_id, suite_id): + """UpdateTestSuite. + Update test suite. + :param :class:` ` test_suite_update_params: Parameters for suite updation + :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 parent suite. + :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(test_suite_update_params, 'TestSuiteUpdateParams') + response = self._send(http_method='PATCH', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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='a4080e84-f17b-4fad-84f1-7960b6525bf2', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def add_test_cases_to_suite(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """AddTestCasesToSuite. + Add test cases to a suite with specified configurations + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be added. + :param int suite_id: ID of the test suite to which test cases are to be added. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='POST', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case(self, project, plan_id, suite_id, test_case_id, wit_fields=None, return_identity_ref=None): + """GetTestCase. + Get a particular Test Case from a Suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_case_id: Test Case Id to be fetched. + :param str wit_fields: Get the list of witFields. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :rtype: [TestCase] + """ + 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_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'str') + query_parameters = {} + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case_list(self, project, plan_id, suite_id, test_ids=None, configuration_ids=None, wit_fields=None, continuation_token=None, return_identity_ref=None, expand=None, exclude_flags=None, is_recursive=None): + """GetTestCaseList. + Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_ids: Test Case Ids to be fetched. + :param str configuration_ids: Fetch Test Cases which contains all the configuration Ids specified. + :param str wit_fields: Get the list of witFields. + :param str continuation_token: If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :param bool expand: If set to false, will get a smaller payload containing only basic details about the suite test case object + :param str exclude_flags: Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2). + :param bool is_recursive: + :rtype: :class:`<[TestCase]> ` + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + if configuration_ids is not None: + query_parameters['configurationIds'] = self._serialize.query('configuration_ids', configuration_ids, 'str') + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'bool') + if exclude_flags is not None: + query_parameters['excludeFlags'] = self._serialize.query('exclude_flags', exclude_flags, 'str') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def remove_test_cases_from_suite(self, project, plan_id, suite_id, test_case_ids): + """RemoveTestCasesFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_case_ids: Test Case Ids to be removed. + """ + 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 test_case_ids is not None: + query_parameters['testCaseIds'] = self._serialize.query('test_case_ids', test_case_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def remove_test_cases_list_from_suite(self, project, plan_id, suite_id, test_ids): + """RemoveTestCasesListFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_ids: Comma separated string of Test Case Ids to be removed. + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def update_suite_test_cases(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """UpdateSuiteTestCases. + Update the configurations for test cases + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: A SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be updated. + :param int suite_id: ID of the test suite to which test cases are to be updated. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='PATCH', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def clone_test_case(self, clone_request_body, project): + """CloneTestCase. + :param :class:` ` clone_request_body: + :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(clone_request_body, 'CloneTestCaseParams') + response = self._send(http_method='POST', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def get_test_case_clone_information(self, project, clone_operation_id): + """GetTestCaseCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + Delete a test case. + :param str project: Project ID or project name + :param int test_case_id: Id of test case to be deleted. + """ + 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='29006fb5-816b-4ff7-a329-599943569229', + version='7.0', + route_values=route_values) + + def clone_test_plan(self, clone_request_body, project, deep_clone=None): + """CloneTestPlan. + Clone test plan + :param :class:` ` clone_request_body: Plan Clone Request Body detail TestPlanCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestPlanParams') + response = self._send(http_method='POST', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_clone_information(self, project, clone_operation_id): + """GetCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_points(self, project, plan_id, suite_id, point_id, return_identity_ref=None, include_point_details=None): + """GetPoints. + Get a particular Test Point from a suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param str point_id: ID of test point to be fetched. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :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 point_id is not None: + query_parameters['pointId'] = self._serialize.query('point_id', point_id, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def get_points_list(self, project, plan_id, suite_id, test_point_ids=None, test_case_id=None, continuation_token=None, return_identity_ref=None, include_point_details=None, is_recursive=None): + """GetPointsList. + Get all the points inside a suite based on some filters + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested + :param str test_point_ids: ID of test points to fetch. + :param str test_case_id: Get Test Points for specific test case Ids. + :param str continuation_token: If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool is_recursive: If set to true, will also fetch test points belonging to child suites recursively. + :rtype: :class:`<[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 test_point_ids is not None: + query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') + if test_case_id is not None: + query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def update_test_points(self, test_point_update_params, project, plan_id, suite_id, include_point_details=None, return_identity_ref=None): + """UpdateTestPoints. + Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point + :param [TestPointUpdateParams] test_point_update_params: A TestPointUpdateParams Object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :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 include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + content = self._serialize.body(test_point_update_params, '[TestPointUpdateParams]') + response = self._send(http_method='PATCH', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def clone_test_suite(self, clone_request_body, project, deep_clone=None): + """CloneTestSuite. + Clone test suite + :param :class:` ` clone_request_body: Suite Clone Request Body detail TestSuiteCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestSuiteParams') + response = self._send(http_method='POST', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def get_suite_clone_information(self, project, clone_operation_id): + """GetSuiteCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def create_test_variable(self, test_variable_create_update_parameters, project): + """CreateTestVariable. + Create a test variable. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + + def delete_test_variable(self, project, test_variable_id): + """DeleteTestVariable. + 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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + + def get_test_variable_by_id(self, project, test_variable_id): + """GetTestVariableById. + 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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + return self._deserialize('TestVariable', response) + + def get_test_variables(self, project, continuation_token=None): + """GetTestVariables. + Get a list of test variables. + :param str project: Project ID or project name + :param str continuation_token: If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables. + :rtype: :class:`<[TestVariable]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestVariable]', self._unwrap_collection(response)) + + def update_test_variable(self, test_variable_create_update_parameters, project, test_variable_id): + """UpdateTestVariable. + Update a test variable by its ID. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + diff --git a/azure-devops/azure/devops/released/test_results/__init__.py b/azure-devops/azure/devops/released/test_results/__init__.py new file mode 100644 index 00000000..e25398f2 --- /dev/null +++ b/azure-devops/azure/devops/released/test_results/__init__.py @@ -0,0 +1,113 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.test_results.models import * +from .test_results_client import TestResultsClient + +__all__ = [ + 'AggregatedDataForResultTrend', + 'AggregatedResultDetailsByOutcome', + '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', + 'NewTestResultLoggingSettings', + 'PhaseReference', + 'PipelineReference', + 'PipelineTestMetrics', + 'QueryModel', + 'ReferenceLinks', + 'ReleaseReference', + 'ResultsAnalysis', + 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', + 'RunCreateModel', + 'RunFilter', + 'RunStatistic', + 'RunSummary', + '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', + 'TestResultFailuresAnalysis', + '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' +] diff --git a/azure-devops/azure/devops/released/test_results/test_results_client.py b/azure-devops/azure/devops/released/test_results/test_results_client.py new file mode 100644 index 00000000..b714a4c7 --- /dev/null +++ b/azure-devops/azure/devops/released/test_results/test_results_client.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 = 'c83eaf52-edf3-4034-ae11-17d38f25404c' + diff --git a/azure-devops/azure/devops/released/tfvc/__init__.py b/azure-devops/azure/devops/released/tfvc/__init__.py new file mode 100644 index 00000000..f75f215b --- /dev/null +++ b/azure-devops/azure/devops/released/tfvc/__init__.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.tfvc.models import * +from .tfvc_client import TfvcClient + +__all__ = [ + 'AssociatedWorkItem', + 'FileContentMetadata', + 'GitRepository', + 'GitRepositoryRef', + 'GraphSubjectBase', + 'Change', + 'CheckinNote', + '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' +] diff --git a/azure-devops/azure/devops/released/tfvc/tfvc_client.py b/azure-devops/azure/devops/released/tfvc/tfvc_client.py new file mode 100644 index 00000000..233ac158 --- /dev/null +++ b/azure-devops/azure/devops/released/tfvc/tfvc_client.py @@ -0,0 +1,750 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, defaults to 100 when undefined + :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='7.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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters) + return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/token_admin/__init__.py b/azure-devops/azure/devops/released/token_admin/__init__.py new file mode 100644 index 00000000..3a008541 --- /dev/null +++ b/azure-devops/azure/devops/released/token_admin/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.token_admin.models import * +from .token_admin_client import TokenAdminClient + +__all__ = [ + 'SessionToken', + 'SessionTokenResult', + 'TokenAdminPagedSessionTokens', + 'TokenAdminRevocation', + 'TokenAdminRevocationRule', + 'TokenAdminClient' +] diff --git a/azure-devops/azure/devops/released/token_admin/token_admin_client.py b/azure-devops/azure/devops/released/token_admin/token_admin_client.py new file mode 100644 index 00000000..4874ad52 --- /dev/null +++ b/azure-devops/azure/devops/released/token_admin/token_admin_client.py @@ -0,0 +1,80 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.token_admin 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TokenAdminPagedSessionTokens', response) + + def create_revocation_rule(self, revocation_rule): + """CreateRevocationRule. + 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='7.0', + content=content) + + def revoke_authorizations(self, revocations, is_public=None): + """RevokeAuthorizations. + 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='7.0', + query_parameters=query_parameters, + content=content) + diff --git a/azure-devops/azure/devops/released/wiki/__init__.py b/azure-devops/azure/devops/released/wiki/__init__.py new file mode 100644 index 00000000..1342a5a7 --- /dev/null +++ b/azure-devops/azure/devops/released/wiki/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.wiki.models import * +from .wiki_client import WikiClient + +__all__ = [ + 'Comment', + 'CommentAttachment', + 'CommentCreateParameters', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentResourceReference', + 'CommentUpdateParameters', + 'GitRepository', + 'GitRepositoryRef', + 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WikiAttachment', + 'WikiAttachmentResponse', + 'WikiCreateBaseParameters', + 'WikiCreateParametersV2', + 'WikiPage', + 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', + 'WikiPageMove', + 'WikiPageMoveParameters', + 'WikiPageMoveResponse', + 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', + 'WikiPageViewStats', + 'WikiUpdateParameters', + 'WikiV2', + 'WikiClient' +] diff --git a/azure-devops/azure/devops/released/wiki/wiki_client.py b/azure-devops/azure/devops/released/wiki/wiki_client.py new file mode 100644 index 00000000..4787836d --- /dev/null +++ b/azure-devops/azure/devops/released/wiki/wiki_client.py @@ -0,0 +1,625 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 wiki 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='7.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, 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 wiki 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='7.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, 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 wiki 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='7.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, version_descriptor=None): + """DeletePage. + Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki 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='7.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 wiki 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='7.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 wiki 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='7.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 wiki 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='7.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 delete_page_by_id(self, project, wiki_identifier, id, comment=None): + """DeletePageById. + Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + response = self._send(http_method='DELETE', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id(self, project, wiki_identifier, id, recursion_level=None, include_content=None): + """GetPageById. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id_text(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdText. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id_zip(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdZip. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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 update_page_by_id(self, parameters, project, wiki_identifier, id, version, comment=None): + """UpdatePageById. + Edits a wiki page. + :param :class:` ` parameters: Wiki update operation parameters. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + 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='PATCH', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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 get_pages_batch(self, pages_batch_request, project, wiki_identifier, version_descriptor=None): + """GetPagesBatch. + Returns pageable list of Wiki Pages + :param :class:` ` pages_batch_request: Wiki batch page request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:`<[WikiPageDetail]> ` + """ + 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 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(pages_batch_request, 'WikiPagesBatchRequest') + response = self._send(http_method='POST', + location_id='71323c46-2592-4398-8771-ced73dd87207', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[WikiPageDetail]', self._unwrap_collection(response)) + + def get_page_data(self, project, wiki_identifier, page_id, page_views_for_days=None): + """GetPageData. + Returns page detail corresponding to Page ID. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int page_id: Wiki page ID. + :param int page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :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') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'int') + query_parameters = {} + if page_views_for_days is not None: + query_parameters['pageViewsForDays'] = self._serialize.query('page_views_for_days', page_views_for_days, 'int') + response = self._send(http_method='GET', + location_id='81c4e0fe-7663-4d62-ad46-6ab78459f274', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WikiPageDetail', response) + + 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='7.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 ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.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='7.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 ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.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 wiki name provided using the update parameters. + :param :class:` ` update_parameters: Update parameters. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WikiV2', response) + diff --git a/azure-devops/azure/devops/released/work/__init__.py b/azure-devops/azure/devops/released/work/__init__.py new file mode 100644 index 00000000..32d93b11 --- /dev/null +++ b/azure-devops/azure/devops/released/work/__init__.py @@ -0,0 +1,95 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work.models import * +from .work_client import WorkClient + +__all__ = [ + 'Activity', + 'BacklogColumn', + 'BacklogConfiguration', + 'BacklogFields', + 'BacklogLevel', + 'BacklogLevelConfiguration', + 'BacklogLevelWorkItems', + 'Board', + 'BoardBadge', + 'BoardCardRuleSettings', + 'BoardCardSettings', + 'BoardColumn', + 'BoardFields', + 'BoardChart', + 'BoardChartReference', + 'BoardReference', + 'BoardRow', + 'BoardSuggestedValue', + 'BoardUserSettings', + 'CapacityContractBase', + 'CapacityPatch', + 'CategoryConfiguration', + 'CreatePlan', + 'DateRange', + 'DeliveryViewData', + 'FieldReference', + 'FilterClause', + 'GraphSubjectBase', + 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', + 'IterationWorkItems', + 'Link', + 'Member', + 'ParentChildWIMap', + 'Plan', + 'PlanViewData', + 'PredefinedQuery', + 'ProcessConfiguration', + 'ReferenceLinks', + 'ReorderOperation', + 'ReorderResult', + 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', + 'TeamContext', + 'TeamFieldValue', + 'TeamFieldValues', + 'TeamFieldValuesPatch', + 'TeamIterationAttributes', + 'TeamMemberCapacity', + 'TeamMemberCapacityIdentityRef', + 'TeamSetting', + 'TeamSettingsDataContractBase', + 'TeamSettingsDaysOff', + 'TeamSettingsDaysOffPatch', + 'TeamSettingsIteration', + 'TeamSettingsPatch', + 'TimelineCriteriaStatus', + 'TimelineIterationStatus', + 'TimelineTeamData', + 'TimelineTeamIteration', + 'TimelineTeamStatus', + 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', + 'WorkItem', + 'WorkItemColor', + 'WorkItemCommentVersionRef', + 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeReference', + 'WorkItemTypeStateInfo', + 'WorkClient' +] diff --git a/azure-devops/azure/devops/released/work/work_client.py b/azure-devops/azure/devops/released/work/work_client.py new file mode 100644 index 00000000..1a84747e --- /dev/null +++ b/azure-devops/azure/devops/released/work/work_client.py @@ -0,0 +1,1644 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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='7.0', + route_values=route_values) + return self._deserialize('BacklogConfiguration', response) + + def get_backlog_level_work_items(self, team_context, backlog_id): + """GetBacklogLevelWorkItems. + 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='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelWorkItems', response) + + def get_backlog(self, team_context, id): + """GetBacklog. + 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='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelConfiguration', response) + + def get_backlogs(self, team_context): + """GetBacklogs. + 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='7.0', + 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='7.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. + 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='7.0', + 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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values) + return self._deserialize('BoardUserSettings', response) + + def update_board_user_settings(self, board_user_settings, team_context, board): + """UpdateBoardUserSettings. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardUserSettings', response) + + def get_capacities_with_identity_ref_and_totals(self, team_context, iteration_id): + """GetCapacitiesWithIdentityRefAndTotals. + Get a team's capacity including total capacity and days off + :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='74412d15-8c1a-4352-a48d-ef1ed5587d57', + version='7.0', + route_values=route_values) + return self._deserialize('TeamCapacity', 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='7.0', + 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='7.0', + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardCardRuleSettings', response) + + def update_taskboard_card_rule_settings(self, board_card_rule_settings, team_context): + """UpdateTaskboardCardRuleSettings. + Update taskboard card Rule settings + :param :class:` ` board_card_rule_settings: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_rule_settings, 'BoardCardRuleSettings') + self._send(http_method='PATCH', + location_id='3f84a8d1-1aab-423e-a94b-6dcbdcca511f', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardCardSettings', response) + + def update_taskboard_card_settings(self, board_card_settings_to_save, team_context): + """UpdateTaskboardCardSettings. + Update taskboard card settings + :param :class:` ` board_card_settings_to_save: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_settings_to_save, 'BoardCardSettings') + self._send(http_method='PUT', + location_id='0d63745f-31f3-4cf3-9056-2a064e567637', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeliveryViewData', 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardChart', response) + + def get_total_iteration_capacities(self, project, iteration_id): + """GetTotalIterationCapacities. + Get an iteration's capacity for all teams in iteration + :param str project: Project ID or project name + :param str iteration_id: ID of the iteration + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='1e385ce0-396b-4273-8171-d64562c18d37', + version='7.0', + route_values=route_values) + return self._deserialize('IterationCapacity', 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Plan', response) + + def get_process_configuration(self, project): + """GetProcessConfiguration. + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[BoardRow]', self._unwrap_collection(response)) + + def get_columns(self, team_context): + """GetColumns. + :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='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values) + return self._deserialize('TaskboardColumns', response) + + def update_columns(self, update_columns, team_context): + """UpdateColumns. + :param [UpdateTaskboardColumn] update_columns: + :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(update_columns, '[UpdateTaskboardColumn]') + response = self._send(http_method='PUT', + location_id='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskboardColumns', response) + + def get_work_item_columns(self, team_context, iteration_id): + """GetWorkItemColumns. + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :rtype: [TaskboardWorkItemColumn] + """ + 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='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskboardWorkItemColumn]', self._unwrap_collection(response)) + + def update_work_item_column(self, update_column, team_context, iteration_id, work_item_id): + """UpdateWorkItemColumn. + :param :class:` ` update_column: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :param int work_item_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 iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(update_column, 'UpdateTaskboardWorkItemColumn') + self._send(http_method='PATCH', + location_id='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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 containing 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TeamSetting', response) + + def get_iteration_work_items(self, team_context, iteration_id): + """GetIterationWorkItems. + 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='7.0', + route_values=route_values) + return self._deserialize('IterationWorkItems', response) + + def reorder_backlog_work_items(self, operation, team_context): + """ReorderBacklogWorkItems. + Reorder Product Backlog/Boards Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='1c22b714-e7e4-41b9-85e0-56ee13ef55ed', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + + def reorder_iteration_work_items(self, operation, team_context, iteration_id): + """ReorderIterationWorkItems. + Reorder Sprint Backlog/Taskboard Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: The id of the iteration + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='47755db2-d7eb-405a-8c25-675401525fc9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/work_item_tracking/__init__.py b/azure-devops/azure/devops/released/work_item_tracking/__init__.py new file mode 100644 index 00000000..4c7bc854 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking/__init__.py @@ -0,0 +1,103 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', + 'FieldDependentRule', + 'GraphSubjectBase', + 'IdentityRef', + 'IdentityReference', + 'JsonPatchOperation', + 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', + 'ProjectWorkItemStateColors', + 'ProvisioningResult', + 'QueryBatchGetRequest', + 'QueryHierarchyItem', + 'QueryHierarchyItemsResult', + 'ReferenceLinks', + 'ReportingWorkItemLinksBatch', + 'ReportingWorkItemRevisionsBatch', + 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', + 'StreamedBatch', + 'TeamContext', + 'UpdateWorkItemField', + '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', + 'WorkItemTagDefinition', + 'WorkItemTemplate', + 'WorkItemTemplateReference', + 'WorkItemTrackingReference', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemType', + 'WorkItemTypeCategory', + 'WorkItemTypeColor', + 'WorkItemTypeColorAndIcon', + 'WorkItemTypeFieldInstance', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', + 'WorkItemTypeReference', + 'WorkItemTypeStateColors', + 'WorkItemTypeTemplate', + 'WorkItemTypeTemplateUpdateModel', + 'WorkItemUpdate', + 'WorkItemTrackingClient' +] diff --git a/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py b/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py new file mode 100644 index 00000000..6a8344f0 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py @@ -0,0 +1,1754 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.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 get_recent_activity_data(self): + """GetRecentActivityData. + Gets recent work item activities + :rtype: [AccountRecentActivityWorkItemModel2] + """ + response = self._send(http_method='GET', + location_id='1bc988f4-c15f-4072-ad35-497c87e3a909', + version='7.0') + return self._deserialize('[AccountRecentActivityWorkItemModel2]', self._unwrap_collection(response)) + + def get_work_artifact_link_types(self): + """GetWorkArtifactLinkTypes. + 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='7.0') + return self._deserialize('[WorkArtifactLink]', self._unwrap_collection(response)) + + def query_work_items_for_artifact_uris(self, artifact_uri_query, project=None): + """QueryWorkItemsForArtifactUris. + 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='7.0', + 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='7.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='7.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='7.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 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='7.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='7.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='7.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='7.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='7.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='7.0', + 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='7.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. To undelete a filed, see "Update Field" API. + :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='7.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='7.0', + route_values=route_values) + return self._deserialize('WorkItemField', response) + + def get_fields(self, project=None, expand=None): + """GetFields. + Returns information for all fields. The project ID/name parameter is optional. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItemField]', self._unwrap_collection(response)) + + def update_field(self, payload, field_name_or_ref_name, project=None): + """UpdateField. + Update a field. + :param :class:` ` payload: Payload contains desired value of the field's properties + :param str field_name_or_ref_name: Name/reference name of the field 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') + 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') + content = self._serialize.body(payload, 'UpdateWorkItemField') + response = self._send(http_method='PATCH', + location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemField', response) + + def migrate_projects_process(self, new_process, project): + """MigrateProjectsProcess. + Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + :param :class:` ` new_process: + :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(new_process, 'ProcessIdModel') + response = self._send(http_method='POST', + location_id='19801631-d4e5-47e9-8166-0330de0ff1e6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessMigrationResultModel', 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='7.0', + 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='7.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='7.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, use_iso_date_format=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 + :param bool use_iso_date_format: DateTime query clauses will be formatted using a ISO 8601 compliant format + :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') + if use_iso_date_format is not None: + query_parameters['$useIsoDateFormat'] = self._serialize.query('use_iso_date_format', use_iso_date_format, 'bool') + response = self._send(http_method='GET', + location_id='a67d190c-c41f-424b-814d-0e906f659301', + version='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + + def send_mail(self, body, project=None): + """SendMail. + RESTful method to send mail for selected/queried work items. + :param :class:` ` body: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(body, 'SendMailBody') + self._send(http_method='POST', + location_id='12438500-2f84-4fa7-9f1a-c31871b4959d', + version='7.0', + route_values=route_values, + content=content) + + def delete_tag(self, project, tag_id_or_name): + """DeleteTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + self._send(http_method='DELETE', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + + def get_tag(self, project, tag_id_or_name): + """GetTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemTagDefinition', response) + + def get_tags(self, project): + """GetTags. + :param str project: Project ID or project name + :rtype: [WorkItemTagDefinition] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemTagDefinition]', self._unwrap_collection(response)) + + def update_tag(self, tag_data, project, tag_id_or_name): + """UpdateTag. + :param :class:` ` tag_data: + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + content = self._serialize.body(tag_data, 'WorkItemTagDefinition') + response = self._send(http_method='PATCH', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTagDefinition', response) + + def create_template(self, template, team_context): + """CreateTemplate. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTemplate', response) + + def get_templates(self, team_context, workitemtypename=None): + """GetTemplates. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_template(self, team_context, template_id): + """GetTemplate. + 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='7.0', + route_values=route_values) + return self._deserialize('WorkItemTemplate', response) + + def replace_template(self, template_content, team_context, template_id): + """ReplaceTemplate. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + 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='7.0') + 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='7.0', + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ReportingWorkItemRevisionsBatch', response) + + def read_reporting_discussions(self, project=None, continuation_token=None, max_page_size=None): + """ReadReportingDiscussions. + :param str project: Project ID or project name + :param str continuation_token: + :param int max_page_size: + :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 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='4a644469-90c5-4fcc-9a9f-be0827d369ec', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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='7.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='7.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. 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='7.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='7.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='7.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, 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='7.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='7.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. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WorkItemTypeFieldWithReferences', response) + + def get_work_item_type_states(self, project, type): + """GetWorkItemTypeStates. + 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='7.0', + route_values=route_values) + return self._deserialize('[WorkItemStateColor]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py b/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py new file mode 100644 index 00000000..6de73a2a --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process.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' +] diff --git a/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py b/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py new file mode 100644 index 00000000..c5435d82 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py @@ -0,0 +1,1211 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessBehavior', response) + + def delete_process_behavior(self, process_id, behavior_ref_name): + """DeleteProcessBehavior. + 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='7.0', + route_values=route_values) + + def get_process_behavior(self, process_id, behavior_ref_name, expand=None): + """GetProcessBehavior. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessBehavior', response) + + def get_process_behaviors(self, process_id, expand=None): + """GetProcessBehaviors. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_control(self, control, process_id, wit_ref_name, group_id, control_id): + """UpdateControl. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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, expand=None): + """GetWorkItemTypeField. + 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. + :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 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessWorkItemTypeField', response) + + def remove_work_item_type_field(self, process_id, wit_ref_name, field_ref_name): + """RemoveWorkItemTypeField. + 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='7.0', + route_values=route_values) + + def update_work_item_type_field(self, field, process_id, wit_ref_name, field_ref_name): + """UpdateWorkItemTypeField. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_group(self, group, process_id, wit_ref_name, page_id, section_id, group_id): + """UpdateGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Group', response) + + def get_form_layout(self, process_id, wit_ref_name): + """GetFormLayout. + 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='7.0', + route_values=route_values) + return self._deserialize('FormLayout', response) + + def create_list(self, picklist): + """CreateList. + 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='7.0', + content=content) + return self._deserialize('PickList', response) + + def delete_list(self, list_id): + """DeleteList. + 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='7.0', + route_values=route_values) + + def get_list(self, list_id): + """GetList. + 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='7.0', + route_values=route_values) + return self._deserialize('PickList', response) + + def get_lists_metadata(self): + """GetListsMetadata. + Returns meta data of the picklist. + :rtype: [PickListMetadata] + """ + response = self._send(http_method='GET', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0') + return self._deserialize('[PickListMetadata]', self._unwrap_collection(response)) + + def update_list(self, picklist, list_id): + """UpdateList. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('PickList', response) + + def add_page(self, page, process_id, wit_ref_name): + """AddPage. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def remove_page(self, process_id, wit_ref_name, page_id): + """RemovePage. + 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='7.0', + route_values=route_values) + + def update_page(self, page, process_id, wit_ref_name): + """UpdatePage. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def create_new_process(self, create_request): + """CreateNewProcess. + 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='7.0', + content=content) + return self._deserialize('ProcessInfo', response) + + def delete_process_by_id(self, process_type_id): + """DeleteProcessById. + 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='7.0', + route_values=route_values) + + def edit_process(self, update_request, process_type_id): + """EditProcess. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessInfo', response) + + def get_list_of_processes(self, expand=None): + """GetListOfProcesses. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): + """GetProcessWorkItemTypeRule. + 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='7.0', + route_values=route_values) + return self._deserialize('ProcessRule', response) + + def get_process_work_item_type_rules(self, process_id, wit_ref_name): + """GetProcessWorkItemTypeRules. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessRule', response) + + def create_state_definition(self, state_model, process_id, wit_ref_name): + """CreateStateDefinition. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_state_definition(self, process_id, wit_ref_name, state_id): + """DeleteStateDefinition. + 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='7.0', + route_values=route_values) + + def get_state_definition(self, process_id, wit_ref_name, state_id): + """GetStateDefinition. + 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='7.0', + route_values=route_values) + return self._deserialize('WorkItemStateResultModel', response) + + def get_state_definitions(self, process_id, wit_ref_name): + """GetStateDefinitions. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_system_control(self, process_id, wit_ref_name, control_id): + """DeleteSystemControl. + Deletes a system control modification on 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 control_id: The ID of the control. + :rtype: [Control] + """ + 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 control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + response = self._send(http_method='DELETE', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def get_system_controls(self, process_id, wit_ref_name): + """GetSystemControls. + Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: [Control] + """ + 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def update_system_control(self, control, process_id, wit_ref_name, control_id): + """UpdateSystemControl. + Updates/adds a system control on the work item form. + :param :class:` ` 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 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 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Control', response) + + def create_process_work_item_type(self, work_item_type, process_id): + """CreateProcessWorkItemType. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemType', response) + + def delete_process_work_item_type(self, process_id, wit_ref_name): + """DeleteProcessWorkItemType. + 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='7.0', + route_values=route_values) + + def get_process_work_item_type(self, process_id, wit_ref_name, expand=None): + """GetProcessWorkItemType. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): + """UpdateBehaviorToWorkItemType. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTypeBehavior', response) + diff --git a/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py b/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py new file mode 100644 index 00000000..61161f99 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process_template.models import * +from .work_item_tracking_process_template_client import WorkItemTrackingProcessTemplateClient + +__all__ = [ + 'AdminBehavior', + 'AdminBehaviorField', + 'CheckTemplateExistenceResult', + 'ProcessImportResult', + 'ProcessPromoteStatus', + 'ValidationIssue', + 'WorkItemTrackingProcessTemplateClient' +] diff --git a/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py b/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py new file mode 100644 index 00000000..8184330f --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py @@ -0,0 +1,128 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process_template 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('AdminBehavior', response) + + def get_behaviors(self, process_id): + """GetBehaviors. + 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='7.0', + route_values=route_values) + return self._deserialize('[AdminBehavior]', self._unwrap_collection(response)) + + def export_process_template(self, id, **kwargs): + """ExportProcessTemplate. + 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='7.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 import_process_template(self, upload_stream, ignore_warnings=None, replace_existing_template=None, **kwargs): + """ImportProcessTemplate. + Imports a process from zip file. + :param object upload_stream: Stream to upload + :param bool ignore_warnings: Ignores validation warnings. Default value is false. + :param bool replace_existing_template: Replaces the existing template. Default value is true. + :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 replace_existing_template is not None: + query_parameters['replaceExistingTemplate'] = self._serialize.query('replace_existing_template', replace_existing_template, '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='7.0', + 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. + 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='7.0', + route_values=route_values) + return self._deserialize('ProcessPromoteStatus', response) + diff --git a/azure-devops/azure/devops/v7_0/__init__.py b/azure-devops/azure/devops/v7_0/__init__.py new file mode 100644 index 00000000..f885a96e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------------------------- diff --git a/azure-devops/azure/devops/v7_0/accounts/__init__.py b/azure-devops/azure/devops/v7_0/accounts/__init__.py new file mode 100644 index 00000000..7b1322e4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/accounts/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/accounts/accounts_client.py b/azure-devops/azure/devops/v7_0/accounts/accounts_client.py new file mode 100644 index 00000000..0d9b8265 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/accounts/accounts_client.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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. One of the following parameters is required: ownerId, memberId. + :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='7.0', + query_parameters=query_parameters) + return self._deserialize('[Account]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/accounts/models.py b/azure-devops/azure/devops/v7_0/accounts/models.py new file mode 100644 index 00000000..6d5c5bd9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/accounts/models.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# 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', +] diff --git a/azure-devops/azure/devops/v7_0/audit/__init__.py b/azure-devops/azure/devops/v7_0/audit/__init__.py new file mode 100644 index 00000000..419e92ab --- /dev/null +++ b/azure-devops/azure/devops/v7_0/audit/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AuditActionInfo', + 'AuditLogEntry', + 'AuditLogQueryResult', + 'AuditStream', + 'DecoratedAuditLogEntry', + 'AuditClient' +] diff --git a/azure-devops/azure/devops/v7_0/audit/audit_client.py b/azure-devops/azure/devops/v7_0/audit/audit_client.py new file mode 100644 index 00000000..5b61a293 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/audit/audit_client.py @@ -0,0 +1,184 @@ +# -------------------------------------------------------------------------------------------- +# 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 get_actions(self, area_name=None): + """GetActions. + [Preview API] Get all auditable actions filterable by area. + :param str area_name: Optional. Get actions scoped to area + :rtype: [AuditActionInfo] + """ + query_parameters = {} + if area_name is not None: + query_parameters['areaName'] = self._serialize.query('area_name', area_name, 'str') + response = self._send(http_method='GET', + location_id='6fa30b9a-9558-4e3b-a95f-a12572caa6e6', + version='7.0-preview.1', + query_parameters=query_parameters) + return self._deserialize('[AuditActionInfo]', self._unwrap_collection(response)) + + 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='7.0-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='7.0-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) + + def create_stream(self, stream, days_to_backfill): + """CreateStream. + [Preview API] Create new Audit Stream + :param :class:` ` stream: Stream entry + :param int days_to_backfill: The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed. + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_backfill is not None: + query_parameters['daysToBackfill'] = self._serialize.query('days_to_backfill', days_to_backfill, 'int') + content = self._serialize.body(stream, 'AuditStream') + response = self._send(http_method='POST', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('AuditStream', response) + + def delete_stream(self, stream_id): + """DeleteStream. + [Preview API] Delete Audit Stream + :param int stream_id: Id of stream entry to delete + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + self._send(http_method='DELETE', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1', + route_values=route_values) + + def query_all_streams(self): + """QueryAllStreams. + [Preview API] Return all Audit Streams scoped to an organization + :rtype: [AuditStream] + """ + response = self._send(http_method='GET', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1') + return self._deserialize('[AuditStream]', self._unwrap_collection(response)) + + def query_stream_by_id(self, stream_id): + """QueryStreamById. + [Preview API] Return Audit Stream with id of streamId if one exists otherwise throw + :param int stream_id: Id of stream entry to retrieve + :rtype: :class:` ` + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + response = self._send(http_method='GET', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('AuditStream', response) + + def update_status(self, stream_id, status): + """UpdateStatus. + [Preview API] Update existing Audit Stream status + :param int stream_id: Id of stream entry to be updated + :param str status: Status of the stream + :rtype: :class:` ` + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + query_parameters = {} + if status is not None: + query_parameters['status'] = self._serialize.query('status', status, 'str') + response = self._send(http_method='PUT', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('AuditStream', response) + + def update_stream(self, stream): + """UpdateStream. + [Preview API] Update existing Audit Stream + :param :class:` ` stream: Stream entry + :rtype: :class:` ` + """ + content = self._serialize.body(stream, 'AuditStream') + response = self._send(http_method='PUT', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.0-preview.1', + content=content) + return self._deserialize('AuditStream', response) + diff --git a/azure-devops/azure/devops/v7_0/audit/models.py b/azure-devops/azure/devops/v7_0/audit/models.py new file mode 100644 index 00000000..a3fddd37 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/audit/models.py @@ -0,0 +1,285 @@ +# -------------------------------------------------------------------------------------------- +# 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 AuditActionInfo(Model): + """ + :param action_id: The action id for the event, i.e Git.CreateRepo, Project.RenameProject + :type action_id: str + :param area: Area of Azure DevOps the action occurred + :type area: str + :param category: Type of action executed + :type category: object + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'area': {'key': 'area', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'object'} + } + + def __init__(self, action_id=None, area=None, category=None): + super(AuditActionInfo, self).__init__() + self.action_id = action_id + self.area = area + self.category = category + + +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_uPN: The Actor's UPN + :type actor_uPN: 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 project_id: When specified, the id of the project this event is associated to + :type project_id: str + :param scope_id: The organization Id (Organization is the only scope currently supported) + :type scope_id: str + :param scope_type: The type of the scope (Organization is only scope currently supported) + :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_uPN': {'key': 'actorUPN', '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'}, + 'project_id': {'key': 'projectId', '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_uPN=None, actor_user_id=None, authentication_mechanism=None, correlation_id=None, data=None, id=None, ip_address=None, project_id=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_uPN = actor_uPN + 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.project_id = project_id + 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 AuditStream(Model): + """ + This class represents an audit stream + + :param consumer_inputs: Inputs used to communicate with external service. Inputs could be url, a connection string, a token, etc. + :type consumer_inputs: dict + :param consumer_type: Type of the consumer, i.e. splunk, azureEventHub, etc. + :type consumer_type: str + :param created_time: The time when the stream was created + :type created_time: datetime + :param display_name: Used to identify individual streams + :type display_name: str + :param id: Unique stream identifier + :type id: int + :param status: Status of the stream, Enabled, Disabled + :type status: object + :param status_reason: Reason for the current stream status, i.e. Disabled by the system, Invalid credentials, etc. + :type status_reason: str + :param updated_time: The time when the stream was last updated + :type updated_time: datetime + """ + + _attribute_map = { + 'consumer_inputs': {'key': 'consumerInputs', 'type': '{str}'}, + 'consumer_type': {'key': 'consumerType', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_reason': {'key': 'statusReason', 'type': 'str'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'} + } + + def __init__(self, consumer_inputs=None, consumer_type=None, created_time=None, display_name=None, id=None, status=None, status_reason=None, updated_time=None): + super(AuditStream, self).__init__() + self.consumer_inputs = consumer_inputs + self.consumer_type = consumer_type + self.created_time = created_time + self.display_name = display_name + self.id = id + self.status = status + self.status_reason = status_reason + self.updated_time = updated_time + + +class DecoratedAuditLogEntry(Model): + """ + :param action_id: The action id 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_uPN: The Actor's UPN + :type actor_uPN: 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 project_id: When specified, the id of the project this event is associated to + :type project_id: str + :param project_name: When specified, the name of the project this event is associated to + :type project_name: str + :param scope_display_name: DisplayName of the scope + :type scope_display_name: str + :param scope_id: The organization Id (Organization is the only scope currently supported) + :type scope_id: str + :param scope_type: The type of the scope (Organization is only scope currently supported) + :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_uPN': {'key': 'actorUPN', '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'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'project_name': {'key': 'projectName', '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_uPN=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, project_id=None, project_name=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_uPN = actor_uPN + 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.project_id = project_id + self.project_name = project_name + 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__ = [ + 'AuditActionInfo', + 'AuditLogEntry', + 'AuditLogQueryResult', + 'AuditStream', + 'DecoratedAuditLogEntry', +] diff --git a/azure-devops/azure/devops/v7_0/build/__init__.py b/azure-devops/azure/devops/v7_0/build/__init__.py new file mode 100644 index 00000000..c0d17df7 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/build/__init__.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'BuildRetentionHistory', + 'BuildRetentionSample', + 'BuildSettings', + 'DataSourceBindingBase', + 'DefinitionReference', + 'DefinitionResourceReference', + 'Deployment', + 'Folder', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'Issue', + 'JobReference', + 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', + 'ProcessParameters', + 'ProjectRetentionSetting', + 'PullRequest', + 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', + 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', + 'RetentionPolicy', + 'RetentionSetting', + 'SourceProviderAttributes', + 'SourceRepositories', + 'SourceRepository', + 'SourceRepositoryItem', + 'StageReference', + 'SupportedTrigger', + 'TaskAgentPoolReference', + 'TaskDefinitionReference', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationPlanReference', + 'TaskReference', + 'TaskSourceDefinitionBase', + 'TeamProjectReference', + 'TestResultsContext', + 'Timeline', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', + 'VariableGroup', + 'VariableGroupReference', + 'WebApiConnectedServiceRef', + 'XamlBuildControllerReference', + 'YamlBuild', + 'BuildClient' +] diff --git a/azure-devops/azure/devops/v7_0/build/build_client.py b/azure-devops/azure/devops/v7_0/build/build_client.py new file mode 100644 index 00000000..fb1c6689 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/build/build_client.py @@ -0,0 +1,2311 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + 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='7.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='7.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, branch_name=None): + """ListBranches. + 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='7.0', + 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='7.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='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('str', response) + + def get_retention_leases_for_build(self, project, build_id): + """GetRetentionLeasesForBuild. + Gets all retention leases that apply to a specific build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [RetentionLease] + """ + 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='3da19a6a-f088-45c4-83ce-2ad3a87be6c4', + version='7.0', + route_values=route_values) + return self._deserialize('[RetentionLease]', self._unwrap_collection(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='7.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='7.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: :class:`<[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='7.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, definition_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: + :param int definition_id: Optional definition id to queue a build without a body. Ignored if there's a valid body + :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') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + content = self._serialize.body(build, 'Build') + response = self._send(http_method='POST', + location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', + version='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[Build]', 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='7.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='7.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='7.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='7.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='7.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. To use this filter includeAllProperties should be set to true + :rtype: :class:`<[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='7.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='7.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 build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT. + :param :class:` ` definition: The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted. + :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='7.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. + 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='7.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 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='7.0-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='7.0-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='7.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') + 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='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Folder', response) + + def get_build_general_settings(self, project): + """GetBuildGeneralSettings. + Gets pipeline general 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='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values) + return self._deserialize('PipelineGeneralSettings', response) + + def update_build_general_settings(self, new_settings, project): + """UpdateBuildGeneralSettings. + Updates pipeline general settings. + :param :class:` ` 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(new_settings, 'PipelineGeneralSettings') + response = self._send(http_method='PATCH', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('PipelineGeneralSettings', response) + + def get_retention_history(self, days_to_lookback=None): + """GetRetentionHistory. + Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline. + :param int days_to_lookback: + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_lookback is not None: + query_parameters['daysToLookback'] = self._serialize.query('days_to_lookback', days_to_lookback, 'int') + response = self._send(http_method='GET', + location_id='1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('BuildRetentionHistory', 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:`<[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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(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. If not specified, the default branch is used. + :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='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Build', response) + + def add_retention_leases(self, new_leases, project): + """AddRetentionLeases. + Adds new leases for pipeline runs. + :param [NewRetentionLease] new_leases: + :param str project: Project ID or project name + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_leases, '[NewRetentionLease]') + response = self._send(http_method='POST', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_retention_leases_by_id(self, project, ids): + """DeleteRetentionLeasesById. + Removes specific retention leases. + :param str project: Project ID or project name + :param [int] ids: + """ + 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') + self._send(http_method='DELETE', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_retention_lease(self, project, lease_id): + """GetRetentionLease. + Returns the details of the retention lease given a lease id. + :param str project: Project ID or project name + :param int lease_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values) + return self._deserialize('RetentionLease', response) + + def get_retention_leases_by_minimal_retention_leases(self, project, leases_to_fetch): + """GetRetentionLeasesByMinimalRetentionLeases. + Returns any leases matching the specified MinimalRetentionLeases + :param str project: Project ID or project name + :param [MinimalRetentionLease] leases_to_fetch: List of JSON-serialized MinimalRetentionLeases separated by '|' + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if leases_to_fetch is not None: + leases_to_fetch = "|".join(map(str, leases_to_fetch)) + query_parameters['leasesToFetch'] = self._serialize.query('leases_to_fetch', leases_to_fetch, 'str') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_owner_id(self, project, owner_id=None, definition_id=None, run_id=None): + """GetRetentionLeasesByOwnerId. + Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str owner_id: + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner_id is not None: + query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_user_id(self, project, user_owner_id, definition_id=None, run_id=None): + """GetRetentionLeasesByUserId. + Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str user_owner_id: The user id to search for. + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if user_owner_id is not None: + query_parameters['userOwnerId'] = self._serialize.query('user_owner_id', user_owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def update_retention_lease(self, lease_update, project, lease_id): + """UpdateRetentionLease. + Updates the duration or pipeline protection status of a retention lease. + :param :class:` ` lease_update: The new data for the retention lease. + :param str project: Project ID or project name + :param int lease_id: The ID of the lease to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + content = self._serialize.body(lease_update, 'RetentionLeaseUpdate') + response = self._send(http_method='PATCH', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('RetentionLease', 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_build_properties(self, document, project, build_id): + """UpdateBuildProperties. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_definition_properties(self, document, project, definition_id): + """UpdateDefinitionProperties. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PullRequest', response) + + def get_build_report(self, project, build_id, type=None): + """GetBuildReport. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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='7.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='7.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='7.0-preview.2') + return self._deserialize('BuildResourceUsage', response) + + def get_retention_settings(self, project): + """GetRetentionSettings. + Gets the project's 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='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values) + return self._deserialize('ProjectRetentionSetting', response) + + def update_retention_settings(self, update_model, project): + """UpdateRetentionSettings. + Updates the project's retention settings. + :param :class:` ` update_model: + :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(update_model, 'UpdateProjectRetentionSettingModel') + response = self._send(http_method='PATCH', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProjectRetentionSetting', 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BuildSettings', response) + + def list_source_providers(self, project): + """ListSourceProviders. + 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='7.0', + route_values=route_values) + return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) + + def update_stage(self, update_parameters, build_id, stage_ref_name, project=None): + """UpdateStage. + Update a build stage + :param :class:` ` update_parameters: + :param int build_id: + :param str stage_ref_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 build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if stage_ref_name is not None: + route_values['stageRefName'] = self._serialize.url('stage_ref_name', stage_ref_name, 'str') + content = self._serialize.body(update_parameters, 'UpdateStageParameters') + self._send(http_method='PATCH', + location_id='b8aac6c9-744b-46e1-88fc-3550969f9313', + version='7.0', + route_values=route_values, + content=content) + + 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. If not specified, the default branch is used. + :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='7.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='7.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='7.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. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_build_tags(self, update_parameters, project, build_id): + """UpdateBuildTags. + Adds/Removes tags from a build. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tag(self, project, definition_id, tag): + """AddDefinitionTag. + 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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tags(self, tags, project, definition_id): + """AddDefinitionTags. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_definition_tag(self, project, definition_id, tag): + """DeleteDefinitionTag. + Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_definition_tags(self, project, definition_id, revision=None): + """GetDefinitionTags. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_definition_tags(self, update_parameters, project, definition_id): + """UpdateDefinitionTags. + Adds/Removes tags from a definition. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_tag(self, project, tag): + """DeleteTag. + Removes a tag from builds, definitions, and from the tag store + :param str project: Project ID or project name + :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 tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.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 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + + def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): + """ListWebhooks. + 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='7.0', + 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. Only work items in the same project are returned. + :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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + + def get_definition_yaml(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): + """GetDefinitionYaml. + Converts a definition to YAML, 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='7c3df3a1-7e51-4150-8cf7-540347f8697f', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('YamlBuild', response) + diff --git a/azure-devops/azure/devops/v7_0/build/models.py b/azure-devops/azure/devops/v7_0/build/models.py new file mode 100644 index 00000000..36b6eea8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/build/models.py @@ -0,0 +1,3583 @@ +# -------------------------------------------------------------------------------------------- +# 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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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. WARNING: this field is deprecated and does not corresponds to the jobs queues. + :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 template_parameters: Parameters to template expression evaluation + :type template_parameters: dict + :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]'}, + 'template_parameters': {'key': 'templateParameters', '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, template_parameters=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.template_parameters = template_parameters + 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. If an artifact is associated with multiple sources, this points to the first source. + :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 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 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 name: The name of the definition. + :type name: str + :param revision: The revision number. + :type revision: int + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, comment=None, definition_url=None, changed_by=None, changed_date=None, change_type=None, name=None, revision=None): + super(BuildDefinitionRevision, self).__init__() + self.comment = comment + self.definition_url = definition_url + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + 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 retry_count_on_task_failure: Number of retries. + :type retry_count_on_task_failure: int + :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'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + 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 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 checkout_submodules: Indicates whether to checkout submodules. + :type checkout_submodules: bool + :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 = { + 'clean': {'key': 'clean', 'type': 'str'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, + '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, clean=None, default_branch=None, checkout_submodules=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): + super(BuildRepository, self).__init__() + self.clean = clean + self.default_branch = default_branch + self.checkout_submodules = checkout_submodules + 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 BuildRetentionHistory(Model): + """ + A historical overview of build retention information. This includes a list of snapshots taken about build retention usage, and a list of builds that have exceeded the default 30 day retention policy. + + :param build_retention_samples: A list of builds that are older than the default retention policy, but are not marked as retained. Something is causing these builds to not get cleaned up. + :type build_retention_samples: list of :class:`BuildRetentionSample ` + """ + + _attribute_map = { + 'build_retention_samples': {'key': 'buildRetentionSamples', 'type': '[BuildRetentionSample]'} + } + + def __init__(self, build_retention_samples=None): + super(BuildRetentionHistory, self).__init__() + self.build_retention_samples = build_retention_samples + + +class BuildRetentionSample(Model): + """ + A snapshot of build retention information. This class takes a sample at the given time. It provides information about retained builds, files associated with those retained builds, and number of files being retained. + + :param builds: Summary of retention by build + :type builds: str + :param definitions: List of build definitions + :type definitions: str + :param files: Summary of files consumed by retained builds + :type files: str + :param sample_time: The date and time when the sample was taken + :type sample_time: datetime + """ + + _attribute_map = { + 'builds': {'key': 'builds', 'type': 'str'}, + 'definitions': {'key': 'definitions', 'type': 'str'}, + 'files': {'key': 'files', 'type': 'str'}, + 'sample_time': {'key': 'sampleTime', 'type': 'iso-8601'} + } + + def __init__(self, builds=None, definitions=None, files=None, sample_time=None): + super(BuildRetentionSample, self).__init__() + self.builds = builds + self.definitions = definitions + self.files = files + self.sample_time = sample_time + + +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 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 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 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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +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 MinimalRetentionLease(Model): + """ + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param owner_id: User-provided string that identifies the owner of a retention lease. + :type owner_id: str + :param run_id: The pipeline run to protect. + :type run_id: int + """ + + _attribute_map = { + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'int'} + } + + def __init__(self, definition_id=None, owner_id=None, run_id=None): + super(MinimalRetentionLease, self).__init__() + self.definition_id = definition_id + self.owner_id = owner_id + self.run_id = run_id + + +class NewRetentionLease(Model): + """ + Required information to create a new retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". + :type days_valid: int + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param owner_id: User-provided string that identifies the owner of a retention lease. + :type owner_id: str + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + :param run_id: The pipeline run to protect. + :type run_id: int + """ + + _attribute_map = { + 'days_valid': {'key': 'daysValid', 'type': 'int'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'}, + 'run_id': {'key': 'runId', 'type': 'int'} + } + + def __init__(self, days_valid=None, definition_id=None, owner_id=None, protect_pipeline=None, run_id=None): + super(NewRetentionLease, self).__init__() + self.days_valid = days_valid + self.definition_id = definition_id + self.owner_id = owner_id + self.protect_pipeline = protect_pipeline + self.run_id = run_id + + +class PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineGeneralSettings(Model): + """ + Contains pipeline general settings. + + :param enforce_job_auth_scope: If enabled, scope of access for all non-release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + :param enforce_job_auth_scope_for_releases: If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope_for_releases: bool + :param enforce_referenced_repo_scoped_token: Restricts the scope of access for all pipelines to only repositories explicitly referenced by the pipeline. + :type enforce_referenced_repo_scoped_token: bool + :param enforce_settable_var: If enabled, only those variables that are explicitly marked as "Settable at queue time" can be set at queue time. + :type enforce_settable_var: bool + :param publish_pipeline_metadata: Allows pipelines to record metadata. + :type publish_pipeline_metadata: bool + :param status_badges_are_private: Anonymous users can access the status badge API for all pipelines unless this option is enabled. + :type status_badges_are_private: bool + """ + + _attribute_map = { + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, + 'enforce_job_auth_scope_for_releases': {'key': 'enforceJobAuthScopeForReleases', 'type': 'bool'}, + 'enforce_referenced_repo_scoped_token': {'key': 'enforceReferencedRepoScopedToken', 'type': 'bool'}, + 'enforce_settable_var': {'key': 'enforceSettableVar', 'type': 'bool'}, + 'publish_pipeline_metadata': {'key': 'publishPipelineMetadata', 'type': 'bool'}, + 'status_badges_are_private': {'key': 'statusBadgesArePrivate', 'type': 'bool'} + } + + def __init__(self, enforce_job_auth_scope=None, enforce_job_auth_scope_for_releases=None, enforce_referenced_repo_scoped_token=None, enforce_settable_var=None, publish_pipeline_metadata=None, status_badges_are_private=None): + super(PipelineGeneralSettings, self).__init__() + self.enforce_job_auth_scope = enforce_job_auth_scope + self.enforce_job_auth_scope_for_releases = enforce_job_auth_scope_for_releases + self.enforce_referenced_repo_scoped_token = enforce_referenced_repo_scoped_token + self.enforce_settable_var = enforce_settable_var + self.publish_pipeline_metadata = publish_pipeline_metadata + self.status_badges_are_private = status_badges_are_private + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +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 ProjectRetentionSetting(Model): + """ + Contains the settings for the retention rules. + + :param purge_artifacts: The rules for artifact retention. Artifacts can not live longer than a run, so will be overridden by a shorter run purge setting. + :type purge_artifacts: :class:`RetentionSetting ` + :param purge_pull_request_runs: The rules for pull request pipeline run retention. + :type purge_pull_request_runs: :class:`RetentionSetting ` + :param purge_runs: The rules for pipeline run retention. + :type purge_runs: :class:`RetentionSetting ` + :param retain_runs_per_protected_branch: The rules for retaining runs per protected branch. + :type retain_runs_per_protected_branch: :class:`RetentionSetting ` + """ + + _attribute_map = { + 'purge_artifacts': {'key': 'purgeArtifacts', 'type': 'RetentionSetting'}, + 'purge_pull_request_runs': {'key': 'purgePullRequestRuns', 'type': 'RetentionSetting'}, + 'purge_runs': {'key': 'purgeRuns', 'type': 'RetentionSetting'}, + 'retain_runs_per_protected_branch': {'key': 'retainRunsPerProtectedBranch', 'type': 'RetentionSetting'} + } + + def __init__(self, purge_artifacts=None, purge_pull_request_runs=None, purge_runs=None, retain_runs_per_protected_branch=None): + super(ProjectRetentionSetting, self).__init__() + self.purge_artifacts = purge_artifacts + self.purge_pull_request_runs = purge_pull_request_runs + self.purge_runs = purge_runs + self.retain_runs_per_protected_branch = retain_runs_per_protected_branch + + +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 draft: Returns if pull request is draft + :type draft: bool + :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'}, + 'draft': {'key': 'draft', 'type': 'bool'}, + '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, draft=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.draft = draft + 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(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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 RetentionLease(Model): + """ + A valid retention lease prevents automated systems from deleting a pipeline run. + + :param created_on: When the lease was created. + :type created_on: datetime + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param lease_id: The unique identifier for this lease. + :type lease_id: int + :param owner_id: Non-unique string that identifies the owner of a retention lease. + :type owner_id: str + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + :param run_id: The pipeline run protected by this lease. + :type run_id: int + :param valid_until: The last day the lease is considered valid. + :type valid_until: datetime + """ + + _attribute_map = { + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'lease_id': {'key': 'leaseId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'valid_until': {'key': 'validUntil', 'type': 'iso-8601'} + } + + def __init__(self, created_on=None, definition_id=None, lease_id=None, owner_id=None, protect_pipeline=None, run_id=None, valid_until=None): + super(RetentionLease, self).__init__() + self.created_on = created_on + self.definition_id = definition_id + self.lease_id = lease_id + self.owner_id = owner_id + self.protect_pipeline = protect_pipeline + self.run_id = run_id + self.valid_until = valid_until + + +class RetentionLeaseUpdate(Model): + """ + An update to the retention parameters of a retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". + :type days_valid: int + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + """ + + _attribute_map = { + 'days_valid': {'key': 'daysValid', 'type': 'int'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'} + } + + def __init__(self, days_valid=None, protect_pipeline=None): + super(RetentionLeaseUpdate, self).__init__() + self.days_valid = days_valid + self.protect_pipeline = protect_pipeline + + +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 RetentionSetting(Model): + """ + Contains the minimum, maximum, and current value for a retention setting. + + :param max: + :type max: int + :param min: + :type min: int + :param value: + :type value: int + """ + + _attribute_map = { + 'max': {'key': 'max', 'type': 'int'}, + 'min': {'key': 'min', 'type': 'int'}, + 'value': {'key': 'value', 'type': 'int'} + } + + def __init__(self, max=None, min=None, value=None): + super(RetentionSetting, self).__init__() + self.max = max + self.min = min + self.value = value + + +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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +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 pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + 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 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 change_id: The change ID. + :type change_id: int + :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 queue_id: The queue ID of the queue that the operation ran on. + :type queue_id: int + :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'}, + 'current_operation': {'key': 'currentOperation', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TimelineReference'}, + 'error_count': {'key': 'errorCount', 'type': 'int'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'change_id': {'key': 'changeId', 'type': 'int'}, + '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]'}, + 'queue_id': {'key': 'queueId', 'type': 'int'}, + '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, current_operation=None, details=None, error_count=None, finish_time=None, change_id=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, queue_id=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.current_operation = current_operation + self.details = details + self.error_count = error_count + self.finish_time = finish_time + self.change_id = change_id + 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.queue_id = queue_id + 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 UpdateProjectRetentionSettingModel(Model): + """ + Contains members for updating the retention settings values. All fields are optional. + + :param artifacts_retention: + :type artifacts_retention: :class:`UpdateRetentionSettingModel ` + :param pull_request_run_retention: + :type pull_request_run_retention: :class:`UpdateRetentionSettingModel ` + :param retain_runs_per_protected_branch: + :type retain_runs_per_protected_branch: :class:`UpdateRetentionSettingModel ` + :param run_retention: + :type run_retention: :class:`UpdateRetentionSettingModel ` + """ + + _attribute_map = { + 'artifacts_retention': {'key': 'artifactsRetention', 'type': 'UpdateRetentionSettingModel'}, + 'pull_request_run_retention': {'key': 'pullRequestRunRetention', 'type': 'UpdateRetentionSettingModel'}, + 'retain_runs_per_protected_branch': {'key': 'retainRunsPerProtectedBranch', 'type': 'UpdateRetentionSettingModel'}, + 'run_retention': {'key': 'runRetention', 'type': 'UpdateRetentionSettingModel'} + } + + def __init__(self, artifacts_retention=None, pull_request_run_retention=None, retain_runs_per_protected_branch=None, run_retention=None): + super(UpdateProjectRetentionSettingModel, self).__init__() + self.artifacts_retention = artifacts_retention + self.pull_request_run_retention = pull_request_run_retention + self.retain_runs_per_protected_branch = retain_runs_per_protected_branch + self.run_retention = run_retention + + +class UpdateRetentionSettingModel(Model): + """ + :param value: + :type value: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'} + } + + def __init__(self, value=None): + super(UpdateRetentionSettingModel, self).__init__() + self.value = value + + +class UpdateStageParameters(Model): + """ + :param force_retry_all_jobs: + :type force_retry_all_jobs: bool + :param state: + :type state: object + """ + + _attribute_map = { + 'force_retry_all_jobs': {'key': 'forceRetryAllJobs', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, force_retry_all_jobs=None, state=None): + super(UpdateStageParameters, self).__init__() + self.force_retry_all_jobs = force_retry_all_jobs + self.state = state + + +class UpdateTagParameters(Model): + """ + :param tags_to_add: + :type tags_to_add: list of str + :param tags_to_remove: + :type tags_to_remove: list of str + """ + + _attribute_map = { + 'tags_to_add': {'key': 'tagsToAdd', 'type': '[str]'}, + 'tags_to_remove': {'key': 'tagsToRemove', 'type': '[str]'} + } + + def __init__(self, tags_to_add=None, tags_to_remove=None): + super(UpdateTagParameters, self).__init__() + self.tags_to_add = tags_to_add + self.tags_to_remove = tags_to_remove + + +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 YamlBuild(Model): + """ + Represents a yaml build. + + :param yaml: The yaml used to define the build + :type yaml: str + """ + + _attribute_map = { + 'yaml': {'key': 'yaml', 'type': 'str'} + } + + def __init__(self, yaml=None): + super(YamlBuild, self).__init__() + self.yaml = yaml + + +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', + 'BuildRetentionHistory', + 'BuildRetentionSample', + 'BuildSettings', + 'DataSourceBindingBase', + 'DefinitionReference', + 'DefinitionResourceReference', + 'Deployment', + 'Folder', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'Issue', + 'JobReference', + 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', + 'ProcessParameters', + 'ProjectRetentionSetting', + 'PullRequest', + 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', + 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', + 'RetentionPolicy', + 'RetentionSetting', + 'SourceProviderAttributes', + 'SourceRepositories', + 'SourceRepository', + 'SourceRepositoryItem', + 'StageReference', + 'SupportedTrigger', + 'TaskAgentPoolReference', + 'TaskDefinitionReference', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationPlanReference', + 'TaskReference', + 'TaskSourceDefinitionBase', + 'TeamProjectReference', + 'TestResultsContext', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', + 'VariableGroupReference', + 'WebApiConnectedServiceRef', + 'XamlBuildControllerReference', + 'YamlBuild', + 'BuildController', + 'BuildDefinitionReference', + 'BuildDefinitionReference3_2', + 'BuildLog', + 'BuildOptionDefinition', + 'Timeline', + 'VariableGroup', + 'BuildDefinition', + 'BuildDefinition3_2', +] diff --git a/azure-devops/azure/devops/v7_0/cix/__init__.py b/azure-devops/azure/devops/v7_0/cix/__init__.py new file mode 100644 index 00000000..28165779 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/cix/__init__.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'WebApiTeamRef', + 'CixClient' +] diff --git a/azure-devops/azure/devops/v7_0/cix/cix_client.py b/azure-devops/azure/devops/v7_0/cix/cix_client.py new file mode 100644 index 00000000..3c82565c --- /dev/null +++ b/azure-devops/azure/devops/v7_0/cix/cix_client.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) + + def create_resources(self, creation_parameters, project): + """CreateResources. + :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='7.0', + route_values=route_values, + content=content) + return self._deserialize('CreatedResources', response) + diff --git a/azure-devops/azure/devops/v7_0/cix/models.py b/azure-devops/azure/devops/v7_0/cix/models.py new file mode 100644 index 00000000..10bc5fe9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/cix/models.py @@ -0,0 +1,431 @@ +# -------------------------------------------------------------------------------------------- +# 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 ConfigurationFile(Model): + """ + :param content: The content of the file. + :type content: str + :param is_base64_encoded: Indicates if the content is base64 encoded. + :type is_base64_encoded: bool + :param path: The full path of the file, relative to the root of the repository. + :type path: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'is_base64_encoded': {'key': 'isBase64Encoded', 'type': 'bool'}, + 'path': {'key': 'path', 'type': 'str'} + } + + def __init__(self, content=None, is_base64_encoded=None, path=None): + super(ConfigurationFile, self).__init__() + self.content = content + self.is_base64_encoded = is_base64_encoded + self.path = path + + +class CreatedResources(Model): + """ + :param resources: + :type resources: dict + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '{object}'} + } + + def __init__(self, resources=None): + super(CreatedResources, self).__init__() + self.resources = resources + + +class CreatePipelineConnectionInputs(Model): + """ + This class is used to create a pipeline connection within the team project provided. If the team project does not exist, it will be created. + + :param project: The team project settings for an existing team project or for a new team project. + :type project: :class:`TeamProject ` + :param provider_data: This dictionary contains information that is specific to the provider. This data is opaque to the rest of the Pipelines infrastructure and does NOT contribute to the resources Token. The format of the string and its contents depend on the implementation of the provider. + :type provider_data: dict + :param provider_id: The external source provider id for which the connection is being made. + :type provider_id: str + :param redirect_url: If provided, this will be the URL returned with the PipelineConnection. This will override any other redirect URL that would have been generated for the connection. + :type redirect_url: str + :param request_source: Where the request to create the pipeline originated (such as 'GitHub Marketplace' or 'Azure DevOps') + :type request_source: str + """ + + _attribute_map = { + 'project': {'key': 'project', 'type': 'TeamProject'}, + 'provider_data': {'key': 'providerData', 'type': '{str}'}, + 'provider_id': {'key': 'providerId', 'type': 'str'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'request_source': {'key': 'requestSource', 'type': 'str'} + } + + def __init__(self, project=None, provider_data=None, provider_id=None, redirect_url=None, request_source=None): + super(CreatePipelineConnectionInputs, self).__init__() + self.project = project + self.provider_data = provider_data + self.provider_id = provider_id + self.redirect_url = redirect_url + self.request_source = request_source + + +class DetectedBuildFramework(Model): + """ + :param build_targets: List of build targets discovered for the framework to act upon. + :type build_targets: list of :class:`DetectedBuildTarget ` + :param id: The unique identifier of the build framework. + :type id: str + :param settings: Additional detected settings for the build framework. + :type settings: dict + :param version: The version of the framework if it can be determined from the sources. + :type version: str + """ + + _attribute_map = { + 'build_targets': {'key': 'buildTargets', 'type': '[DetectedBuildTarget]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': '{str}'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, build_targets=None, id=None, settings=None, version=None): + super(DetectedBuildFramework, self).__init__() + self.build_targets = build_targets + self.id = id + self.settings = settings + self.version = version + + +class DetectedBuildTarget(Model): + """ + :param path: + :type path: str + :param settings: + :type settings: dict + :param type: + :type type: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, path=None, settings=None, type=None): + super(DetectedBuildTarget, self).__init__() + self.path = path + self.settings = settings + self.type = type + + +class OperationReference(Model): + """ + Reference for an async 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 + """ + + _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): + """ + :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 PipelineConnection(Model): + """ + :param account_id: The account id that contains the team project for the connection. + :type account_id: str + :param definition_id: The definition id that was created for the connection. + :type definition_id: int + :param redirect_url: This is the URL that the user should be taken to in order to continue setup. + :type redirect_url: str + :param service_endpoint_id: The service endpoint that was created for the connection. + :type service_endpoint_id: str + :param team_project_id: The team project that contains the definition for the connection. + :type team_project_id: str + """ + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'team_project_id': {'key': 'teamProjectId', 'type': 'str'} + } + + def __init__(self, account_id=None, definition_id=None, redirect_url=None, service_endpoint_id=None, team_project_id=None): + super(PipelineConnection, self).__init__() + self.account_id = account_id + self.definition_id = definition_id + self.redirect_url = redirect_url + self.service_endpoint_id = service_endpoint_id + self.team_project_id = team_project_id + + +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 ResourceCreationParameter(Model): + """ + :param resource_to_create: + :type resource_to_create: :class:`object ` + :param type: + :type type: str + """ + + _attribute_map = { + 'resource_to_create': {'key': 'resourceToCreate', 'type': 'object'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, resource_to_create=None, type=None): + super(ResourceCreationParameter, self).__init__() + self.resource_to_create = resource_to_create + self.type = type + + +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 WebApiTeamRef(Model): + """ + :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 Operation(OperationReference): + """ + Contains information about the progress or result of an async 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 + + +class TeamProject(TeamProjectReference): + """ + Represents a Team Project object. + + :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 + :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'}, + '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'}, + '_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, last_update_time=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, last_update_time=last_update_time, name=name, revision=revision, state=state, url=url, visibility=visibility) + self._links = _links + self.capabilities = capabilities + self.default_team = default_team + + +__all__ = [ + 'ConfigurationFile', + 'CreatedResources', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', + 'ReferenceLinks', + 'ResourceCreationParameter', + 'TeamProjectReference', + 'WebApiTeamRef', + 'Operation', + 'TeamProject', +] diff --git a/azure-devops/azure/devops/v7_0/client_factory.py b/azure-devops/azure/devops/v7_0/client_factory.py new file mode 100644 index 00000000..a9474371 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/client_factory.py @@ -0,0 +1,416 @@ +# -------------------------------------------------------------------------------------------- +# 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 ClientFactoryV7_0(object): + """ClientFactoryV7_0. + A factory class to get the 7.0 clients. + """ + + def __init__(self, connection): + self._connection = connection + + def get_accounts_client(self): + """get_accounts_client. + Gets the 7.0 version of the AccountsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.accounts.accounts_client.AccountsClient') + + def get_audit_client(self): + """get_audit_client. + Gets the 7.0 version of the AuditClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.audit.audit_client.AuditClient') + + def get_build_client(self): + """get_build_client. + Gets the 7.0 version of the BuildClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.build.build_client.BuildClient') + + def get_cix_client(self): + """get_cix_client. + Gets the 7.0 version of the CixClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.cix.cix_client.CixClient') + + def get_client_trace_client(self): + """get_client_trace_client. + Gets the 7.0 version of the ClientTraceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.client_trace.client_trace_client.ClientTraceClient') + + def get_contributions_client(self): + """get_contributions_client. + Gets the 7.0 version of the ContributionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.contributions.contributions_client.ContributionsClient') + + def get_core_client(self): + """get_core_client. + Gets the 7.0 version of the CoreClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.core.core_client.CoreClient') + + def get_customer_intelligence_client(self): + """get_customer_intelligence_client. + Gets the 7.0 version of the CustomerIntelligenceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') + + def get_dashboard_client(self): + """get_dashboard_client. + Gets the 7.0 version of the DashboardClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.dashboard.dashboard_client.DashboardClient') + + def get_elastic_client(self): + """get_elastic_client. + Gets the 7.0 version of the ElasticClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.elastic.elastic_client.ElasticClient') + + def get_extension_management_client(self): + """get_extension_management_client. + Gets the 7.0 version of the ExtensionManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.extension_management.extension_management_client.ExtensionManagementClient') + + def get_feature_availability_client(self): + """get_feature_availability_client. + Gets the 7.0 version of the FeatureAvailabilityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') + + def get_feature_management_client(self): + """get_feature_management_client. + Gets the 7.0 version of the FeatureManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feature_management.feature_management_client.FeatureManagementClient') + + def get_feed_client(self): + """get_feed_client. + Gets the 7.0 version of the FeedClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feed.feed_client.FeedClient') + + def get_file_container_client(self): + """get_file_container_client. + Gets the 7.0 version of the FileContainerClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.file_container.file_container_client.FileContainerClient') + + def get_gallery_client(self): + """get_gallery_client. + Gets the 7.0 version of the GalleryClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.gallery.gallery_client.GalleryClient') + + def get_git_client(self): + """get_git_client. + Gets the 7.0 version of the GitClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.git.git_client.GitClient') + + def get_graph_client(self): + """get_graph_client. + Gets the 7.0 version of the GraphClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.graph.graph_client.GraphClient') + + def get_identity_client(self): + """get_identity_client. + Gets the 7.0 version of the IdentityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.identity.identity_client.IdentityClient') + + def get_location_client(self): + """get_location_client. + Gets the 7.0 version of the LocationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.location.location_client.LocationClient') + + def get_maven_client(self): + """get_maven_client. + Gets the 7.0 version of the MavenClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.maven.maven_client.MavenClient') + + def get_member_entitlement_management_client(self): + """get_member_entitlement_management_client. + Gets the 7.0 version of the MemberEntitlementManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') + + def get_notification_client(self): + """get_notification_client. + Gets the 7.0 version of the NotificationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.notification.notification_client.NotificationClient') + + def get_npm_client(self): + """get_npm_client. + Gets the 7.0 version of the NpmClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.npm.npm_client.NpmClient') + + def get_nuget_client(self): + """get_nuget_client. + Gets the 7.0 version of the NuGetClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.nuget.nuget_client.NuGetClient') + + def get_operations_client(self): + """get_operations_client. + Gets the 7.0 version of the OperationsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.operations.operations_client.OperationsClient') + + def get_pipeline_permissions_client(self): + """get_pipeline_permissions_client. + Gets the 7.0 version of the PipelinePermissionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient') + + def get_pipelines_client(self): + """get_pipelines_client. + Gets the 7.0 version of the PipelinesClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipelines.pipelines_client.PipelinesClient') + + def get_pipelines_checks_client(self): + """get_pipelines_checks_client. + Gets the 7.0 version of the PipelinesChecksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipelines_checks.pipelines_checks_client.PipelinesChecksClient') + + def get_policy_client(self): + """get_policy_client. + Gets the 7.0 version of the PolicyClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.policy.policy_client.PolicyClient') + + def get_profile_client(self): + """get_profile_client. + Gets the 7.0 version of the ProfileClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.profile.profile_client.ProfileClient') + + def get_profile_regions_client(self): + """get_profile_regions_client. + Gets the 7.0 version of the ProfileRegionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.profile_regions.profile_regions_client.ProfileRegionsClient') + + def get_project_analysis_client(self): + """get_project_analysis_client. + Gets the 7.0 version of the ProjectAnalysisClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.project_analysis.project_analysis_client.ProjectAnalysisClient') + + def get_provenance_client(self): + """get_provenance_client. + Gets the 7.0 version of the ProvenanceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.provenance.provenance_client.ProvenanceClient') + + def get_py_pi_api_client(self): + """get_py_pi_api_client. + Gets the 7.0 version of the PyPiApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.py_pi_api.py_pi_api_client.PyPiApiClient') + + def get_release_client(self): + """get_release_client. + Gets the 7.0 version of the ReleaseClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.release.release_client.ReleaseClient') + + def get_sbom_client(self): + """get_sbom_client. + Gets the 7.0 version of the SBOMClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.sbom.sbom_client.SBOMClient') + + def get_search_client(self): + """get_search_client. + Gets the 7.0 version of the SearchClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.search.search_client.SearchClient') + + def get_security_client(self): + """get_security_client. + Gets the 7.0 version of the SecurityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.security.security_client.SecurityClient') + + def get_service_endpoint_client(self): + """get_service_endpoint_client. + Gets the 7.0 version of the ServiceEndpointClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') + + def get_service_hooks_client(self): + """get_service_hooks_client. + Gets the 7.0 version of the ServiceHooksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.service_hooks.service_hooks_client.ServiceHooksClient') + + def get_settings_client(self): + """get_settings_client. + Gets the 7.0 version of the SettingsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.settings.settings_client.SettingsClient') + + def get_symbol_client(self): + """get_symbol_client. + Gets the 7.0 version of the SymbolClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.symbol.symbol_client.SymbolClient') + + def get_task_client(self): + """get_task_client. + Gets the 7.0 version of the TaskClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.task.task_client.TaskClient') + + def get_task_agent_client(self): + """get_task_agent_client. + Gets the 7.0 version of the TaskAgentClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.task_agent.task_agent_client.TaskAgentClient') + + def get_test_client(self): + """get_test_client. + Gets the 7.0 version of the TestClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test.test_client.TestClient') + + def get_test_plan_client(self): + """get_test_plan_client. + Gets the 7.0 version of the TestPlanClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test_plan.test_plan_client.TestPlanClient') + + def get_test_results_client(self): + """get_test_results_client. + Gets the 7.0 version of the TestResultsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.test_results.test_results_client.TestResultsClient') + + def get_tfvc_client(self): + """get_tfvc_client. + Gets the 7.0 version of the TfvcClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.tfvc.tfvc_client.TfvcClient') + + def get_token_admin_client(self): + """get_token_admin_client. + Gets the 7.0 version of the TokenAdminClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.token_admin.token_admin_client.TokenAdminClient') + + def get_upack_api_client(self): + """get_upack_api_client. + Gets the 7.0 version of the UPackApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_api.upack_api_client.UPackApiClient') + + def get_upack_packaging_client(self): + """get_upack_packaging_client. + Gets the 7.0 version of the UPackPackagingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_packaging.upack_packaging_client.UPackPackagingClient') + + def get_wiki_client(self): + """get_wiki_client. + Gets the 7.0 version of the WikiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.wiki.wiki_client.WikiClient') + + def get_work_client(self): + """get_work_client. + Gets the 7.0 version of the WorkClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work.work_client.WorkClient') + + def get_work_item_tracking_client(self): + """get_work_item_tracking_client. + Gets the 7.0 version of the WorkItemTrackingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_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 7.0 version of the WorkItemTrackingProcessClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_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 7.0 version of the WorkItemTrackingProcessTemplateClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') + diff --git a/azure-devops/azure/devops/v7_0/client_trace/__init__.py b/azure-devops/azure/devops/v7_0/client_trace/__init__.py new file mode 100644 index 00000000..c1bc03a3 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/client_trace/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/client_trace/client_trace_client.py b/azure-devops/azure/devops/v7_0/client_trace/client_trace_client.py new file mode 100644 index 00000000..43fb5842 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/client_trace/client_trace_client.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.0-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_0/client_trace/models.py b/azure-devops/azure/devops/v7_0/client_trace/models.py new file mode 100644 index 00000000..32e0dec5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/client_trace/models.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/contributions/__init__.py b/azure-devops/azure/devops/v7_0/contributions/__init__.py new file mode 100644 index 00000000..e8b6c6c3 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/contributions/__init__.py @@ -0,0 +1,39 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/contributions/contributions_client.py b/azure-devops/azure/devops/v7_0/contributions/contributions_client.py new file mode 100644 index 00000000..9d6dfe2b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/contributions/contributions_client.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('InstalledExtension', response) + diff --git a/azure-devops/azure/devops/v7_0/contributions/models.py b/azure-devops/azure/devops/v7_0/contributions/models.py new file mode 100644 index 00000000..74f52f21 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/contributions/models.py @@ -0,0 +1,824 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Representation of a ContributionNode that can be used for serialized to clients. + + :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): + """ + Representation of a ContributionNode that can be used for serialized to clients. + + :param contribution: Contribution associated with this node. + :type contribution: :class:`ClientContribution ` + :param children: List of ids for contributions which are children to the current contribution. + :type children: list of str + :param parents: List of ids for contributions which are parents to the current contribution. + :type parents: list of str + """ + + _attribute_map = { + 'contribution': {'key': 'contribution', 'type': 'ClientContribution'}, + 'children': {'key': 'children', 'type': '[str]'}, + 'parents': {'key': 'parents', 'type': '[str]'} + } + + def __init__(self, contribution=None, children=None, parents=None): + super(ClientContributionNode, self).__init__() + self.contribution = contribution + self.children = children + self.parents = parents + + +class ClientContributionProviderDetails(Model): + """ + :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 associated 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): + """ + Base class shared by contributions and contribution types + + :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): + """ + Specifies a constraint that can be used to dynamically include/exclude a given contribution + + :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 eliminate 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): + """ + A query that can be issued for contribution nodes + + :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): + """ + Result of a contribution node query. Wraps the resulting contribution nodes and provider details. + + :param nodes: Map of contribution ids to corresponding node. + :type nodes: dict + :param provider_details: Map of provider 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): + """ + Description about a property of a contribution type + + :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): + """ + A contribution type, given by a json schema + + :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): + """ + Contextual information that data providers can examine when populating their data + + :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): + """ + :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): + """ + A query that can be issued for data provider data + + :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): + """ + Result structure from calls to GetDataProviderData + + :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): + """ + Base class for an event callback for an extension + + :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): + """ + Collection of event callbacks - endpoints called when particular extension events occur. + + :param post_disable: Optional. Defines an endpoint that gets called via a POST request 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 request 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 request 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 request 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 request 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 request 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): + """ + :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): + """ + How an extension should handle including contributions based on licensing + + :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): + """ + Base class for extension properties which are shared by the extension manifest and the extension model + + :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 specified 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): + """ + Represents a VSTS extension along with its installation state + + :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 specified 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): + """ + The state of an installed extension + + :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): + """ + Represents an installation issue + + :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): + """ + Maps a contribution to a licensing behavior + + :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): + """ + Entry for a specific data provider's resulting data + + :param duration: The total time the data provider took to resolve its data (in milliseconds) + :type duration: float + :param error: + :type error: str + :param id: + :type id: str + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'float'}, + '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): + """ + A client data provider are the details needed to make the data provider request from the client. + + :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): + """ + An individual contribution made by an extension + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/core/__init__.py b/azure-devops/azure/devops/v7_0/core/__init__.py new file mode 100644 index 00000000..cb87e9b4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/core/__init__.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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', + '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' +] diff --git a/azure-devops/azure/devops/v7_0/core/core_client.py b/azure-devops/azure/devops/v7_0/core/core_client.py new file mode 100644 index 00000000..9bdf8aca --- /dev/null +++ b/azure-devops/azure/devops/v7_0/core/core_client.py @@ -0,0 +1,505 @@ +# -------------------------------------------------------------------------------------------- +# 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 remove_project_avatar(self, project_id): + """RemoveProjectAvatar. + [Preview API] Removes the avatar for the project. + :param str project_id: The ID or name of the project. + """ + route_values = {} + if project_id is not None: + route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') + self._send(http_method='DELETE', + location_id='54b2a2a0-859b-4d05-827c-ec4c862f641a', + version='7.0-preview.1', + route_values=route_values) + + def set_project_avatar(self, avatar_blob, project_id): + """SetProjectAvatar. + [Preview API] Sets the avatar for the project. + :param :class:` ` avatar_blob: The avatar blob data object to upload. + :param str project_id: The ID or name of the project. + """ + route_values = {} + if project_id is not None: + route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') + content = self._serialize.body(avatar_blob, 'ProjectAvatar') + self._send(http_method='PUT', + location_id='54b2a2a0-859b-4d05-827c-ec4c862f641a', + version='7.0-preview.1', + route_values=route_values, + content=content) + + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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: :class:`<[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='7.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='7.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='7.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, 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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 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='7.0', + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WebApiTeam', response) + + def get_all_teams(self, mine=None, top=None, skip=None, expand_identity=None): + """GetAllTeams. + [Preview API] Get a list of all teams. + :param bool mine: If true, then return all teams requesting user is member. Otherwise return all 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] + """ + 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='7a4d9ee9-3433-4347-b47a-7a80f1cf307e', + version='7.0-preview.3', + query_parameters=query_parameters) + return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/core/models.py b/azure-devops/azure/devops/v7_0/core/models.py new file mode 100644 index 00000000..9397a76c --- /dev/null +++ b/azure-devops/azure/devops/v7_0/core/models.py @@ -0,0 +1,952 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 IdentityBase(Model): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class IdentityData(Model): + """ + :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): + """ + :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 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 OperationReference(Model): + """ + Reference for an async 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 + """ + + _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): + """ + :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 ProjectAvatar(Model): + """ + Contains the image data for project avatar. + + :param image: The avatar image represented as a byte array. + :type image: str + """ + + _attribute_map = { + 'image': {'key': 'image', 'type': 'str'} + } + + def __init__(self, image=None): + super(ProjectAvatar, self).__init__() + self.image = image + + +class ProjectInfo(Model): + """ + Contains information describing a project. + + :param abbreviation: The abbreviated name of the project. + :type abbreviation: str + :param description: The description of the project. + :type description: str + :param id: The id of the project. + :type id: str + :param last_update_time: The time that this project was last updated. + :type last_update_time: datetime + :param name: The name of the project. + :type name: str + :param properties: A set of name-value pairs storing additional property data related to the project. + :type properties: list of :class:`ProjectProperty ` + :param revision: The current revision of the project. + :type revision: long + :param state: The current state of the project. + :type state: object + :param uri: A Uri that can be used to refer to this project. + :type uri: str + :param version: The version number of the project. + :type version: long + :param visibility: Indicates whom the project is visible to. + :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 ProjectProperties(Model): + """ + :param project_id: The team project Id + :type project_id: str + :param properties: The collection of team project properties + :type properties: list of :class:`ProjectProperty ` + """ + + _attribute_map = { + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '[ProjectProperty]'} + } + + def __init__(self, project_id=None, properties=None): + super(ProjectProperties, self).__init__() + self.project_id = project_id + self.properties = properties + + +class ProjectProperty(Model): + """ + A named value associated with a project. + + :param name: The name of the property. + :type name: str + :param value: The value of the property. + :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): + """ + :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): + """ + :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): + """ + Represents the public key portion of an RSA asymmetric key. + + :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): + """ + 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 TeamMember(Model): + """ + :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): + """ + Reference object for a TeamProjectCollection. + + :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): + """ + 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 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 WebApiTeamRef(Model): + """ + :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 Identity(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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +class Process(ProcessReference): + """ + :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): + """ + Represents a Team Project object. + + :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 + :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'}, + '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'}, + '_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, last_update_time=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, last_update_time=last_update_time, name=name, revision=revision, state=state, url=url, visibility=visibility) + self._links = _links + self.capabilities = capabilities + self.default_team = default_team + + +class TeamProjectCollection(TeamProjectCollectionReference): + """ + Data contract for a 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 customization 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): + """ + :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): + """ + :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): + """ + :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: Team identity. + :type identity: :class:`Identity ` + :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': {'key': 'identity', 'type': 'Identity'}, + '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=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 = identity + self.identity_url = identity_url + self.project_id = project_id + self.project_name = project_name + + +__all__ = [ + 'GraphSubjectBase', + 'IdentityBase', + 'IdentityData', + 'IdentityRef', + 'JsonPatchOperation', + 'OperationReference', + 'ProcessReference', + 'ProjectAvatar', + 'ProjectInfo', + 'ProjectProperties', + 'ProjectProperty', + 'Proxy', + 'ProxyAuthorization', + 'PublicKey', + 'ReferenceLinks', + 'TeamMember', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WebApiConnectedServiceRef', + 'WebApiTeamRef', + 'Identity', + 'Process', + 'TeamProject', + 'TeamProjectCollection', + 'WebApiConnectedService', + 'WebApiConnectedServiceDetails', + 'WebApiTeam', +] diff --git a/azure-devops/azure/devops/v7_0/customer_intelligence/__init__.py b/azure-devops/azure/devops/v7_0/customer_intelligence/__init__.py new file mode 100644 index 00000000..f08358c6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/customer_intelligence/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/customer_intelligence/customer_intelligence_client.py b/azure-devops/azure/devops/v7_0/customer_intelligence/customer_intelligence_client.py new file mode 100644 index 00000000..3a4f0c4b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/customer_intelligence/customer_intelligence_client.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.0-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_0/customer_intelligence/models.py b/azure-devops/azure/devops/v7_0/customer_intelligence/models.py new file mode 100644 index 00000000..c61ab811 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/customer_intelligence/models.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/dashboard/__init__.py b/azure-devops/azure/devops/v7_0/dashboard/__init__.py new file mode 100644 index 00000000..1accd678 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/dashboard/__init__.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'CopyDashboardOptions', + 'CopyDashboardResponse', + 'Dashboard', + 'DashboardGroup', + 'DashboardGroupEntry', + 'DashboardGroupEntryResponse', + 'DashboardResponse', + 'LightboxOptions', + 'ReferenceLinks', + 'SemanticVersion', + 'TeamContext', + 'Widget', + 'WidgetMetadata', + 'WidgetMetadataResponse', + 'WidgetPosition', + 'WidgetResponse', + 'WidgetSize', + 'WidgetsVersionedList', + 'WidgetTypesResponse', + 'DashboardClient' +] diff --git a/azure-devops/azure/devops/v7_0/dashboard/dashboard_client.py b/azure-devops/azure/devops/v7_0/dashboard/dashboard_client.py new file mode 100644 index 00000000..aaeaaf7f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/dashboard/dashboard_client.py @@ -0,0 +1,562 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.0-preview.3', + 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='7.0-preview.3', + 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='7.0-preview.3', + route_values=route_values) + return self._deserialize('Dashboard', response) + + def get_dashboards_by_project(self, team_context): + """GetDashboardsByProject. + [Preview API] Get a list of dashboards under a project. + :param :class:` ` team_context: The team context for the operation + :rtype: [Dashboard] + """ + 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='7.0-preview.3', + route_values=route_values) + return self._deserialize('[Dashboard]', self._unwrap_collection(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='7.0-preview.3', + 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='7.0-preview.3', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, including widgets marked with isVisibleFromCatalog == false. + :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='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WidgetTypesResponse', response) + diff --git a/azure-devops/azure/devops/v7_0/dashboard/models.py b/azure-devops/azure/devops/v7_0/dashboard/models.py new file mode 100644 index 00000000..5f28e616 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/dashboard/models.py @@ -0,0 +1,817 @@ +# -------------------------------------------------------------------------------------------- +# 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 CopyDashboardOptions(Model): + """ + Copy options of a Dashboard. + + :param copy_dashboard_scope: Dashboard Scope. Can be either Project or Project_Team + :type copy_dashboard_scope: object + :param copy_queries_flag: When this flag is set to true,option to select the folder to copy Queries of copy dashboard will appear. + :type copy_queries_flag: bool + :param description: Description of the dashboard + :type description: str + :param name: Name of the dashboard + :type name: str + :param project_id: ID of the project. Provided by service at creation time. + :type project_id: str + :param query_folder_path: Path to which the queries should be copied of copy dashboard + :type query_folder_path: str + :param refresh_interval: Refresh interval of dashboard + :type refresh_interval: int + :param team_id: ID of the team. Provided by service at creation time + :type team_id: str + """ + + _attribute_map = { + 'copy_dashboard_scope': {'key': 'copyDashboardScope', 'type': 'object'}, + 'copy_queries_flag': {'key': 'copyQueriesFlag', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'query_folder_path': {'key': 'queryFolderPath', 'type': 'str'}, + 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, + 'team_id': {'key': 'teamId', 'type': 'str'} + } + + def __init__(self, copy_dashboard_scope=None, copy_queries_flag=None, description=None, name=None, project_id=None, query_folder_path=None, refresh_interval=None, team_id=None): + super(CopyDashboardOptions, self).__init__() + self.copy_dashboard_scope = copy_dashboard_scope + self.copy_queries_flag = copy_queries_flag + self.description = description + self.name = name + self.project_id = project_id + self.query_folder_path = query_folder_path + self.refresh_interval = refresh_interval + self.team_id = team_id + + +class CopyDashboardResponse(Model): + """ + :param copied_dashboard: Copied Dashboard + :type copied_dashboard: :class:`Dashboard ` + :param copy_dashboard_options: Copy Dashboard options + :type copy_dashboard_options: :class:`CopyDashboardOptions ` + """ + + _attribute_map = { + 'copied_dashboard': {'key': 'copiedDashboard', 'type': 'Dashboard'}, + 'copy_dashboard_options': {'key': 'copyDashboardOptions', 'type': 'CopyDashboardOptions'} + } + + def __init__(self, copied_dashboard=None, copy_dashboard_options=None): + super(CopyDashboardResponse, self).__init__() + self.copied_dashboard = copied_dashboard + self.copy_dashboard_options = copy_dashboard_options + + +class Dashboard(Model): + """ + Model of a Dashboard. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: 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 team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', '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, dashboard_scope=None, description=None, eTag=None, group_id=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.dashboard_scope = dashboard_scope + self.description = description + self.eTag = eTag + self.group_id = group_id + 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): + """ + Describes a list of dashboards associated to an owner. Currently, teams own dashboard groups. + + :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): + """ + Dashboard group entry, wrapping around Dashboard (needed?) + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: 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 team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardGroupEntry, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class DashboardGroupEntryResponse(DashboardGroupEntry): + """ + Response from RestAPI when saving and editing DashboardGroupEntry + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: 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 team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardGroupEntryResponse, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class DashboardResponse(DashboardGroupEntry): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: 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 team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardResponse, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class LightboxOptions(Model): + """ + Lightbox configuration + + :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): + """ + 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 SemanticVersion(Model): + """ + versioning for an artifact as described at: http://semver.org/, of the form major.minor.patch. + + :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): + """ + The Team Context for an operation. + + :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 data + + :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): + """ + Contribution based information describing Dashboard Widgets. + + :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 keywords: Keywords associated with this widget, non-filterable and invisible + :type keywords: list of str + :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 tags: Tags associated with this widget, visible on each widget and filterable. + :type tags: list of str + :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'}, + 'keywords': {'key': 'keywords', 'type': '[str]'}, + '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]'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + '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, keywords=None, lightbox_options=None, loading_image_url=None, name=None, publisher_name=None, supported_scopes=None, tags=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.keywords = keywords + 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.tags = tags + self.targets = targets + self.type_id = type_id + + +class WidgetMetadataResponse(Model): + """ + :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): + """ + :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): + """ + Response from RestAPI when saving and editing 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(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): + """ + :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): + """ + Wrapper class to support HTTP header generation using CreateResponse, ClientHeaderParameter and ClientResponseType in WidgetV2Controller + + :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): + """ + :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__ = [ + 'CopyDashboardOptions', + 'CopyDashboardResponse', + 'Dashboard', + 'DashboardGroup', + 'DashboardGroupEntry', + 'DashboardGroupEntryResponse', + 'DashboardResponse', + 'LightboxOptions', + 'ReferenceLinks', + 'SemanticVersion', + 'TeamContext', + 'Widget', + 'WidgetMetadata', + 'WidgetMetadataResponse', + 'WidgetPosition', + 'WidgetResponse', + 'WidgetSize', + 'WidgetsVersionedList', + 'WidgetTypesResponse', +] diff --git a/azure-devops/azure/devops/v7_0/elastic/__init__.py b/azure-devops/azure/devops/v7_0/elastic/__init__.py new file mode 100644 index 00000000..a93388a9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/elastic/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 .elastic_client import ElasticClient + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPool', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'ElasticClient' +] diff --git a/azure-devops/azure/devops/v7_0/elastic/elastic_client.py b/azure-devops/azure/devops/v7_0/elastic/elastic_client.py new file mode 100644 index 00000000..2cdb69f9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/elastic/elastic_client.py @@ -0,0 +1,158 @@ +# -------------------------------------------------------------------------------------------- +# 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 ElasticClient(Client): + """Elastic + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ElasticClient, 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_elastic_pool_logs(self, pool_id, top=None): + """GetElasticPoolLogs. + Get elastic pool diagnostics logs for a specified Elastic Pool. + :param int pool_id: Pool Id of the Elastic Pool + :param int top: Number of elastic pool logs to retrieve + :rtype: [ElasticPoolLog] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_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='595b1769-61d5-4076-a72a-98a02105ca9a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticPoolLog]', self._unwrap_collection(response)) + + def create_elastic_pool(self, elastic_pool, pool_name, authorize_all_pipelines=None, auto_provision_project_pools=None, project_id=None): + """CreateElasticPool. + Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project. + :param :class:` ` elastic_pool: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool. + :param str pool_name: Name to use for the new TaskAgentPool + :param bool authorize_all_pipelines: Setting to determine if all pipelines are authorized to use this TaskAgentPool by default. + :param bool auto_provision_project_pools: Setting to automatically provision TaskAgentQueues in every project for the new pool. + :param str project_id: Optional: If provided, a new TaskAgentQueue will be created in the specified project. + :rtype: :class:` ` + """ + query_parameters = {} + if pool_name is not None: + query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') + if authorize_all_pipelines is not None: + query_parameters['authorizeAllPipelines'] = self._serialize.query('authorize_all_pipelines', authorize_all_pipelines, 'bool') + if auto_provision_project_pools is not None: + query_parameters['autoProvisionProjectPools'] = self._serialize.query('auto_provision_project_pools', auto_provision_project_pools, 'bool') + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + content = self._serialize.body(elastic_pool, 'ElasticPool') + response = self._send(http_method='POST', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('ElasticPoolCreationResult', response) + + def get_elastic_pool(self, pool_id): + """GetElasticPool. + Returns the Elastic Pool with the specified Pool Id. + :param int pool_id: Pool Id of the associated TaskAgentPool + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values) + return self._deserialize('ElasticPool', response) + + def get_elastic_pools(self): + """GetElasticPools. + Get a list of all Elastic Pools. + :rtype: [ElasticPool] + """ + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0') + return self._deserialize('[ElasticPool]', self._unwrap_collection(response)) + + def update_elastic_pool(self, elastic_pool_settings, pool_id): + """UpdateElasticPool. + Update settings on a specified Elastic Pool. + :param :class:` ` elastic_pool_settings: New Elastic Pool settings data + :param int pool_id: + :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(elastic_pool_settings, 'ElasticPoolSettings') + response = self._send(http_method='PATCH', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticPool', response) + + def get_elastic_nodes(self, pool_id, state=None): + """GetElasticNodes. + Get a list of ElasticNodes currently in the ElasticPool + :param int pool_id: Pool id of the ElasticPool + :param str state: Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState + :rtype: [ElasticNode] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + query_parameters = {} + if state is not None: + query_parameters['$state'] = self._serialize.query('state', state, 'str') + response = self._send(http_method='GET', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticNode]', self._unwrap_collection(response)) + + def update_elastic_node(self, elastic_node_settings, pool_id, elastic_node_id): + """UpdateElasticNode. + Update properties on a specified ElasticNode + :param :class:` ` elastic_node_settings: + :param int pool_id: + :param int elastic_node_id: + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + if elastic_node_id is not None: + route_values['elasticNodeId'] = self._serialize.url('elastic_node_id', elastic_node_id, 'int') + content = self._serialize.body(elastic_node_settings, 'ElasticNodeSettings') + response = self._send(http_method='PATCH', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticNode', response) + diff --git a/azure-devops/azure/devops/v7_0/elastic/models.py b/azure-devops/azure/devops/v7_0/elastic/models.py new file mode 100644 index 00000000..a9d722b6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/elastic/models.py @@ -0,0 +1,535 @@ +# -------------------------------------------------------------------------------------------- +# 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 ElasticNode(Model): + """ + Data and settings for an elastic node + + :param agent_id: Distributed Task's Agent Id + :type agent_id: int + :param agent_state: Summary of the state of the agent + :type agent_state: object + :param compute_id: Compute Id. VMSS's InstanceId + :type compute_id: str + :param compute_state: State of the compute host + :type compute_state: object + :param desired_state: Users can force state changes to specific states (ToReimage, ToDelete, Save) + :type desired_state: object + :param id: Unique identifier since the agent and/or VM may be null + :type id: int + :param name: Computer name. Used to match a scaleset VM with an agent + :type name: str + :param pool_id: Pool Id that this node belongs to + :type pool_id: int + :param request_id: Last job RequestId assigned to this agent + :type request_id: long + :param state: State of the ElasticNode + :type state: object + :param state_changed_on: Last state change. Only updated by SQL. + :type state_changed_on: datetime + """ + + _attribute_map = { + 'agent_id': {'key': 'agentId', 'type': 'int'}, + 'agent_state': {'key': 'agentState', 'type': 'object'}, + 'compute_id': {'key': 'computeId', 'type': 'str'}, + 'compute_state': {'key': 'computeState', 'type': 'object'}, + 'desired_state': {'key': 'desiredState', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'request_id': {'key': 'requestId', 'type': 'long'}, + 'state': {'key': 'state', 'type': 'object'}, + 'state_changed_on': {'key': 'stateChangedOn', 'type': 'iso-8601'} + } + + def __init__(self, agent_id=None, agent_state=None, compute_id=None, compute_state=None, desired_state=None, id=None, name=None, pool_id=None, request_id=None, state=None, state_changed_on=None): + super(ElasticNode, self).__init__() + self.agent_id = agent_id + self.agent_state = agent_state + self.compute_id = compute_id + self.compute_state = compute_state + self.desired_state = desired_state + self.id = id + self.name = name + self.pool_id = pool_id + self.request_id = request_id + self.state = state + self.state_changed_on = state_changed_on + + +class ElasticNodeSettings(Model): + """ + Class used for updating an elastic node where only certain members are populated + + :param state: State of the ElasticNode + :type state: object + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, state=None): + super(ElasticNodeSettings, self).__init__() + self.state = state + + +class ElasticPool(Model): + """ + Data and settings for an elastic pool + + :param agent_interactive_uI: Set whether agents should be configured to run with interactive UI + :type agent_interactive_uI: bool + :param azure_id: Azure string representing to location of the resource + :type azure_id: str + :param desired_idle: Number of agents to have ready waiting for jobs + :type desired_idle: int + :param desired_size: The desired size of the pool + :type desired_size: int + :param max_capacity: Maximum number of nodes that will exist in the elastic pool + :type max_capacity: int + :param max_saved_node_count: Keep nodes in the pool on failure for investigation + :type max_saved_node_count: int + :param offline_since: Timestamp the pool was first detected to be offline + :type offline_since: datetime + :param os_type: Operating system type of the nodes in the pool + :type os_type: object + :param pool_id: Id of the associated TaskAgentPool + :type pool_id: int + :param recycle_after_each_use: Discard node after each job completes + :type recycle_after_each_use: bool + :param service_endpoint_id: Id of the Service Endpoint used to connect to Azure + :type service_endpoint_id: str + :param service_endpoint_scope: Scope the Service Endpoint belongs to + :type service_endpoint_scope: str + :param sizing_attempts: The number of sizing attempts executed while trying to achieve a desired size + :type sizing_attempts: int + :param state: State of the pool + :type state: object + :param time_to_live_minutes: The minimum time in minutes to keep idle agents alive + :type time_to_live_minutes: int + """ + + _attribute_map = { + 'agent_interactive_uI': {'key': 'agentInteractiveUI', 'type': 'bool'}, + 'azure_id': {'key': 'azureId', 'type': 'str'}, + 'desired_idle': {'key': 'desiredIdle', 'type': 'int'}, + 'desired_size': {'key': 'desiredSize', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + 'max_saved_node_count': {'key': 'maxSavedNodeCount', 'type': 'int'}, + 'offline_since': {'key': 'offlineSince', 'type': 'iso-8601'}, + 'os_type': {'key': 'osType', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'recycle_after_each_use': {'key': 'recycleAfterEachUse', 'type': 'bool'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_scope': {'key': 'serviceEndpointScope', 'type': 'str'}, + 'sizing_attempts': {'key': 'sizingAttempts', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'object'}, + 'time_to_live_minutes': {'key': 'timeToLiveMinutes', 'type': 'int'} + } + + def __init__(self, agent_interactive_uI=None, azure_id=None, desired_idle=None, desired_size=None, max_capacity=None, max_saved_node_count=None, offline_since=None, os_type=None, pool_id=None, recycle_after_each_use=None, service_endpoint_id=None, service_endpoint_scope=None, sizing_attempts=None, state=None, time_to_live_minutes=None): + super(ElasticPool, self).__init__() + self.agent_interactive_uI = agent_interactive_uI + self.azure_id = azure_id + self.desired_idle = desired_idle + self.desired_size = desired_size + self.max_capacity = max_capacity + self.max_saved_node_count = max_saved_node_count + self.offline_since = offline_since + self.os_type = os_type + self.pool_id = pool_id + self.recycle_after_each_use = recycle_after_each_use + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_scope = service_endpoint_scope + self.sizing_attempts = sizing_attempts + self.state = state + self.time_to_live_minutes = time_to_live_minutes + + +class ElasticPoolCreationResult(Model): + """ + Returned result from creating a new elastic pool + + :param agent_pool: Created agent pool + :type agent_pool: :class:`TaskAgentPool ` + :param agent_queue: Created agent queue + :type agent_queue: :class:`TaskAgentQueue ` + :param elastic_pool: Created elastic pool + :type elastic_pool: :class:`ElasticPool ` + """ + + _attribute_map = { + 'agent_pool': {'key': 'agentPool', 'type': 'TaskAgentPool'}, + 'agent_queue': {'key': 'agentQueue', 'type': 'TaskAgentQueue'}, + 'elastic_pool': {'key': 'elasticPool', 'type': 'ElasticPool'} + } + + def __init__(self, agent_pool=None, agent_queue=None, elastic_pool=None): + super(ElasticPoolCreationResult, self).__init__() + self.agent_pool = agent_pool + self.agent_queue = agent_queue + self.elastic_pool = elastic_pool + + +class ElasticPoolLog(Model): + """ + Log data for an Elastic Pool + + :param id: Log Id + :type id: long + :param level: E.g. error, warning, info + :type level: object + :param message: Log contents + :type message: str + :param operation: Operation that triggered the message being logged + :type operation: object + :param pool_id: Id of the associated TaskAgentPool + :type pool_id: int + :param timestamp: Datetime that the log occurred + :type timestamp: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'long'}, + 'level': {'key': 'level', 'type': 'object'}, + 'message': {'key': 'message', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'} + } + + def __init__(self, id=None, level=None, message=None, operation=None, pool_id=None, timestamp=None): + super(ElasticPoolLog, self).__init__() + self.id = id + self.level = level + self.message = message + self.operation = operation + self.pool_id = pool_id + self.timestamp = timestamp + + +class ElasticPoolSettings(Model): + """ + Class used for updating an elastic pool where only certain members are populated + + :param agent_interactive_uI: Set whether agents should be configured to run with interactive UI + :type agent_interactive_uI: bool + :param azure_id: Azure string representing to location of the resource + :type azure_id: str + :param desired_idle: Number of machines to have ready waiting for jobs + :type desired_idle: int + :param max_capacity: Maximum number of machines that will exist in the elastic pool + :type max_capacity: int + :param max_saved_node_count: Keep machines in the pool on failure for investigation + :type max_saved_node_count: int + :param os_type: Operating system type of the machines in the pool + :type os_type: object + :param recycle_after_each_use: Discard machines after each job completes + :type recycle_after_each_use: bool + :param service_endpoint_id: Id of the Service Endpoint used to connect to Azure + :type service_endpoint_id: str + :param service_endpoint_scope: Scope the Service Endpoint belongs to + :type service_endpoint_scope: str + :param time_to_live_minutes: The minimum time in minutes to keep idle agents alive + :type time_to_live_minutes: int + """ + + _attribute_map = { + 'agent_interactive_uI': {'key': 'agentInteractiveUI', 'type': 'bool'}, + 'azure_id': {'key': 'azureId', 'type': 'str'}, + 'desired_idle': {'key': 'desiredIdle', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + 'max_saved_node_count': {'key': 'maxSavedNodeCount', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'object'}, + 'recycle_after_each_use': {'key': 'recycleAfterEachUse', 'type': 'bool'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_scope': {'key': 'serviceEndpointScope', 'type': 'str'}, + 'time_to_live_minutes': {'key': 'timeToLiveMinutes', 'type': 'int'} + } + + def __init__(self, agent_interactive_uI=None, azure_id=None, desired_idle=None, max_capacity=None, max_saved_node_count=None, os_type=None, recycle_after_each_use=None, service_endpoint_id=None, service_endpoint_scope=None, time_to_live_minutes=None): + super(ElasticPoolSettings, self).__init__() + self.agent_interactive_uI = agent_interactive_uI + self.azure_id = azure_id + self.desired_idle = desired_idle + self.max_capacity = max_capacity + self.max_saved_node_count = max_saved_node_count + self.os_type = os_type + self.recycle_after_each_use = recycle_after_each_use + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_scope = service_endpoint_scope + self.time_to_live_minutes = time_to_live_minutes + + +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 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 TaskAgentPoolReference(Model): + """ + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + 'pool_type': {'key': 'poolType', 'type': 'object'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None): + super(TaskAgentPoolReference, self).__init__() + self.id = id + self.is_hosted = is_hosted + self.is_legacy = is_legacy + self.name = name + self.options = options + self.pool_type = pool_type + self.scope = scope + self.size = size + + +class TaskAgentQueue(Model): + """ + An agent queue. + + :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 TaskAgentPool(TaskAgentPoolReference): + """ + An organization-level grouping of agents. + + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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: The ID of the associated agent cloud. + :type agent_cloud_id: int + :param auto_provision: Whether or not a queue should be automatically provisioned for each project collection. + :type auto_provision: bool + :param auto_size: Whether or not the pool should autosize itself based on the Agent Cloud Provider settings. + :type auto_size: bool + :param auto_update: Whether or not agents in this pool are allowed to automatically update + :type auto_update: bool + :param created_by: Creator of the 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: The date/time of the pool creation. + :type created_on: datetime + :param owner: Owner or administrator of the pool. + :type owner: :class:`IdentityRef ` + :param properties: + :type properties: :class:`object ` + :param target_size: Target parallelism. + :type target_size: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + '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'}, + 'auto_update': {'key': 'autoUpdate', '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'}, + 'target_size': {'key': 'targetSize', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None, agent_cloud_id=None, auto_provision=None, auto_size=None, auto_update=None, created_by=None, created_on=None, owner=None, properties=None, target_size=None): + super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, is_legacy=is_legacy, name=name, options=options, 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.auto_update = auto_update + self.created_by = created_by + self.created_on = created_on + self.owner = owner + self.properties = properties + self.target_size = target_size + + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'TaskAgentPool', +] diff --git a/azure-devops/azure/devops/v7_0/extension_management/__init__.py b/azure-devops/azure/devops/v7_0/extension_management/__init__.py new file mode 100644 index 00000000..47e66434 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/extension_management/__init__.py @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ExtensionAuditLog', + 'ExtensionAuditLogEntry', + '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' +] diff --git a/azure-devops/azure/devops/v7_0/extension_management/extension_management_client.py b/azure-devops/azure/devops/v7_0/extension_management/extension_management_client.py new file mode 100644 index 00000000..c001326f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/extension_management/extension_management_client.py @@ -0,0 +1,134 @@ +# -------------------------------------------------------------------------------------------- +# 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: Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific 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='7.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='7.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: Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific 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='7.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='7.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='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + diff --git a/azure-devops/azure/devops/v7_0/extension_management/models.py b/azure-devops/azure/devops/v7_0/extension_management/models.py new file mode 100644 index 00000000..878073ff --- /dev/null +++ b/azure-devops/azure/devops/v7_0/extension_management/models.py @@ -0,0 +1,1361 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + Market item acquisition options (install, buy, etc) for an installation target. + + :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): + """ + Base class shared by contributions and contribution types + + :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): + """ + Specifies a constraint that can be used to dynamically include/exclude a given contribution + + :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 eliminate 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): + """ + Description about a property of a contribution type + + :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): + """ + A contribution type, given by a json schema + + :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): + """ + Contract for handling the extension acquisition process + + :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 ExtensionAuditLog(Model): + """ + Audit log for an extension + + :param entries: Collection of audit log entries + :type entries: list of :class:`ExtensionAuditLogEntry ` + :param extension_name: Extension that the change was made for + :type extension_name: str + :param publisher_name: Publisher that the extension is part of + :type publisher_name: str + """ + + _attribute_map = { + 'entries': {'key': 'entries', 'type': '[ExtensionAuditLogEntry]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, entries=None, extension_name=None, publisher_name=None): + super(ExtensionAuditLog, self).__init__() + self.entries = entries + self.extension_name = extension_name + self.publisher_name = publisher_name + + +class ExtensionAuditLogEntry(Model): + """ + An audit log entry for an extension + + :param audit_action: Change that was made to extension + :type audit_action: str + :param audit_date: Date at which the change was made + :type audit_date: datetime + :param comment: Extra information about the change + :type comment: str + :param updated_by: Represents the user who made the change + :type updated_by: :class:`IdentityRef ` + """ + + _attribute_map = { + 'audit_action': {'key': 'auditAction', 'type': 'str'}, + 'audit_date': {'key': 'auditDate', 'type': 'iso-8601'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'updated_by': {'key': 'updatedBy', 'type': 'IdentityRef'} + } + + def __init__(self, audit_action=None, audit_date=None, comment=None, updated_by=None): + super(ExtensionAuditLogEntry, self).__init__() + self.audit_action = audit_action + self.audit_date = audit_date + self.comment = comment + self.updated_by = updated_by + + +class ExtensionAuthorization(Model): + """ + :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): + """ + :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): + """ + Represents a single collection for extension data documents + + :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): + """ + Represents a query to receive a set of extension data collections + + :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): + """ + Base class for an event callback for an extension + + :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): + """ + Collection of event callbacks - endpoints called when particular extension events occur. + + :param post_disable: Optional. Defines an endpoint that gets called via a POST request 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 request 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 request 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 request 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 request 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 request 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): + """ + :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): + """ + Represents the component pieces of an extensions fully qualified name, along with the fully qualified name. + + :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): + """ + How an extension should handle including contributions based on licensing + + :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): + """ + Base class for extension properties which are shared by the extension manifest and the extension model + + :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 specified 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): + """ + Policy with a set of permissions on extension operations + + :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): + """ + A request for an extension (to be installed or have a license assigned) + + :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): + """ + :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): + """ + :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): + """ + :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 target_platform: + :type target_platform: 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 }]'}, + 'target_platform': {'key': 'targetPlatform', 'type': '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, target_platform=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.target_platform = target_platform + self.validation_result_message = validation_result_message + self.version = version + self.version_description = version_description + + +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 InstallationTarget(Model): + """ + :param extension_version: + :type extension_version: str + :param product_architecture: + :type product_architecture: str + :param target: + :type target: str + :param target_platform: + :type target_platform: str + :param target_version: + :type target_version: str + """ + + _attribute_map = { + 'extension_version': {'key': 'extensionVersion', 'type': 'str'}, + 'product_architecture': {'key': 'productArchitecture', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'target_platform': {'key': 'targetPlatform', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'} + } + + def __init__(self, extension_version=None, product_architecture=None, target=None, target_platform=None, target_version=None): + super(InstallationTarget, self).__init__() + self.extension_version = extension_version + self.product_architecture = product_architecture + self.target = target + self.target_platform = target_platform + self.target_version = target_version + + +class InstalledExtension(ExtensionManifest): + """ + Represents a VSTS extension along with its installation state + + :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 specified 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): + """ + :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): + """ + The state of an installed extension + + :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): + """ + Represents an installation issue + + :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): + """ + Maps a contribution to a licensing behavior + + :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): + """ + :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 present_in_conflict_list: Check if Extension is in conflict list or not. Taking as String and not as boolean because we don't want end customer to see this flag and by making it Boolean it is coming as false for all the cases. + :type present_in_conflict_list: 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'}, + 'present_in_conflict_list': {'key': 'presentInConflictList', '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, present_in_conflict_list=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.present_in_conflict_list = present_in_conflict_list + 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): + """ + High-level information about the publisher, like id's and names + + :param display_name: + :type display_name: str + :param domain: + :type domain: str + :param flags: + :type flags: object + :param is_domain_verified: + :type is_domain_verified: bool + :param publisher_id: + :type publisher_id: str + :param publisher_name: + :type publisher_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'flags': {'key': 'flags', 'type': 'object'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 'publisher_id': {'key': 'publisherId', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, display_name=None, domain=None, flags=None, is_domain_verified=None, publisher_id=None, publisher_name=None): + super(PublisherFacts, self).__init__() + self.display_name = display_name + self.domain = domain + self.flags = flags + self.is_domain_verified = is_domain_verified + self.publisher_id = publisher_id + self.publisher_name = publisher_name + + +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 RequestedExtension(Model): + """ + A request for an extension (to be installed or have a license assigned) + + :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): + """ + Represents the extension policy applied to a given user + + :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): + """ + An individual contribution made by an extension + + :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): + """ + The state of an extension + + :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', + 'ExtensionAuditLog', + 'ExtensionAuditLogEntry', + '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', +] diff --git a/azure-devops/azure/devops/v7_0/feature_availability/__init__.py b/azure-devops/azure/devops/v7_0/feature_availability/__init__.py new file mode 100644 index 00000000..d2d7dbd7 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_availability/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/feature_availability/feature_availability_client.py b/azure-devops/azure/devops/v7_0/feature_availability/feature_availability_client.py new file mode 100644 index 00000000..27493317 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_availability/feature_availability_client.py @@ -0,0 +1,137 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('FeatureFlag', response) + diff --git a/azure-devops/azure/devops/v7_0/feature_availability/models.py b/azure-devops/azure/devops/v7_0/feature_availability/models.py new file mode 100644 index 00000000..335a11e6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_availability/models.py @@ -0,0 +1,63 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + This is passed to the FeatureFlagController to edit the status of a feature flag + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/feature_management/__init__.py b/azure-devops/azure/devops/v7_0/feature_management/__init__.py new file mode 100644 index 00000000..43a3bcca --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_management/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/feature_management/feature_management_client.py b/azure-devops/azure/devops/v7_0/feature_management/feature_management_client.py new file mode 100644 index 00000000..6035b09d --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_management/feature_management_client.py @@ -0,0 +1,218 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ContributedFeatureStateQuery', response) + diff --git a/azure-devops/azure/devops/v7_0/feature_management/models.py b/azure-devops/azure/devops/v7_0/feature_management/models.py new file mode 100644 index 00000000..9a1180a9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feature_management/models.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + A feature that can be enabled or disabled + + :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 occurred + :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): + """ + :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): + """ + An identifier and properties used to pass into a handler for a listener or plugin + + :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): + """ + The scope to which a feature setting applies + + :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): + """ + A contributed feature/state pair + + :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): + """ + A query for the effective contributed feature states for a list of feature ids + + :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): + """ + A rule for dynamically getting the enabled/disabled state of a feature + + :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): + """ + 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 + + +__all__ = [ + 'ContributedFeature', + 'ContributedFeatureHandlerSettings', + 'ContributedFeatureListener', + 'ContributedFeatureSettingScope', + 'ContributedFeatureState', + 'ContributedFeatureStateQuery', + 'ContributedFeatureValueRule', + 'ReferenceLinks', +] diff --git a/azure-devops/azure/devops/v7_0/feed/__init__.py b/azure-devops/azure/devops/v7_0/feed/__init__.py new file mode 100644 index 00000000..9778080a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feed/__init__.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'FeedClient' +] diff --git a/azure-devops/azure/devops/v7_0/feed/feed_client.py b/azure-devops/azure/devops/v7_0/feed/feed_client.py new file mode 100644 index 00000000..6263b354 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feed/feed_client.py @@ -0,0 +1,889 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """GetBadge. + 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). + :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 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='7.0', + route_values=route_values, + 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_feed_change(self, feed_id, project=None): + """GetFeedChange. + Query a feed to determine its current state. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedChange', response) + + def get_feed_changes(self, project=None, include_deleted=None, continuation_token=None, batch_size=None): + """GetFeedChanges. + 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 str project: Project ID or project name + :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:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('FeedChangesResponse', response) + + def get_feeds_from_recycle_bin(self, project=None): + """GetFeedsFromRecycleBin. + Query for feeds within the recycle bin. + :param str project: Project ID or project name + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def permanent_delete_feed(self, feed_id, project=None): + """PermanentDeleteFeed. + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + self._send(http_method='DELETE', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + + def restore_deleted_feed(self, patch_json, feed_id, project=None): + """RestoreDeletedFeed. + :param :class:`<[JsonPatchOperation]> ` patch_json: + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(patch_json, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + + def create_feed(self, feed, project=None): + """CreateFeed. + 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. + :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(feed, 'Feed') + response = self._send(http_method='POST', + location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def delete_feed(self, feed_id, project=None): + """DeleteFeed. + Remove a feed and all its packages. The feed moves to the recycle bin and is reversible. + :param str feed_id: Name or Id of the feed. + :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 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='7.0', + route_values=route_values) + + def get_feed(self, feed_id, project=None, include_deleted_upstreams=None): + """GetFeed. + Get the settings for a specific feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Feed', response) + + def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None, include_urls=None): + """GetFeeds. + Get all feeds in an account where you have the provided role access. + :param str project: Project ID or project name + :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. + :param bool include_urls: Resolve names if true + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + 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='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def update_feed(self, feed, feed_id, project=None): + """UpdateFeed. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def get_global_permissions(self, include_ids=None): + """GetGlobalPermissions. + Get all service-wide feed creation and administration permissions. + :param bool include_ids: Set to true to add IdentityIds to the permission objects. + :rtype: [GlobalPermission] + """ + query_parameters = {} + if include_ids is not None: + query_parameters['includeIds'] = self._serialize.query('include_ids', include_ids, 'bool') + response = self._send(http_method='GET', + location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) + + def set_global_permissions(self, global_permissions): + """SetGlobalPermissions. + Set service-wide permissions that govern feed creation and administration. + :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='7.0', + content=content) + return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) + + def get_package_changes(self, feed_id, project=None, continuation_token=None, batch_size=None): + """GetPackageChanges. + 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 str project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageChangesResponse', response) + + def query_package_metrics(self, package_id_query, feed_id, project=None): + """QueryPackageMetrics. + :param :class:` ` package_id_query: + :param str feed_id: + :param str project: Project ID or project name + :rtype: [PackageMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(package_id_query, 'PackageMetricsQuery') + response = self._send(http_method='POST', + location_id='bddc9b3c-8a59-4a9f-9b40-ee1dcaa2cc0d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[PackageMetrics]', self._unwrap_collection(response)) + + def get_package(self, feed_id, package_id, project=None, include_all_versions=None, include_urls=None, is_listed=None, is_release=None, include_deleted=None, include_description=None): + """GetPackage. + 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 str project: Project ID or project 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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_packages(self, feed_id, project=None, 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. + 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 project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Package]', self._unwrap_collection(response)) + + def get_feed_permissions(self, feed_id, project=None, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None, include_deleted_feeds=None): + """GetFeedPermissions. + Get the permissions for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :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. + :param bool include_deleted_feeds: If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid. + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + if include_deleted_feeds is not None: + query_parameters['includeDeletedFeeds'] = self._serialize.query('include_deleted_feeds', include_deleted_feeds, 'bool') + response = self._send(http_method='GET', + location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', + version='7.0', + 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, project=None): + """SetFeedPermissions. + Update the permissions on a feed. + :param [FeedPermission] feed_permission: Permissions to set. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + 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, project=None): + """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). + :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 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='7.0-preview.1', + route_values=route_values) + return self._deserialize('PackageVersionProvenance', response) + + def empty_recycle_bin(self, feed_id, project=None): + """EmptyRecycleBin. + Queues a job to remove all package versions from a feed's recycle bin + :param str feed_id: Name or Id of the feed + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + response = self._send(http_method='DELETE', + location_id='2704e72c-f541-4141-99be-2004b50b05fa', + version='7.0', + route_values=route_values) + return self._deserialize('OperationReference', response) + + def get_recycle_bin_package(self, feed_id, package_id, project=None, include_urls=None): + """GetRecycleBinPackage. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_recycle_bin_packages(self, feed_id, project=None, protocol_type=None, package_name_query=None, include_urls=None, top=None, skip=None, include_all_versions=None): + """GetRecycleBinPackages. + Query for packages within the recycle bin. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + 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, project=None, include_urls=None): + """GetRecycleBinPackageVersion. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RecycleBinPackageVersion', response) + + def get_recycle_bin_package_versions(self, feed_id, package_id, project=None, include_urls=None): + """GetRecycleBinPackageVersions. + 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: [RecycleBinPackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RecycleBinPackageVersion]', self._unwrap_collection(response)) + + def delete_feed_retention_policies(self, feed_id, project=None): + """DeleteFeedRetentionPolicies. + Delete the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + + def get_feed_retention_policies(self, feed_id, project=None): + """GetFeedRetentionPolicies. + Get the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedRetentionPolicy', response) + + def set_feed_retention_policies(self, policy, feed_id, project=None): + """SetFeedRetentionPolicies. + Set the retention policy for a feed. + :param :class:` ` policy: Feed retention policy. + :param str feed_id: Name or ID of the feed. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedRetentionPolicy', response) + + def query_package_version_metrics(self, package_version_id_query, feed_id, package_id, project=None): + """QueryPackageVersionMetrics. + :param :class:` ` package_version_id_query: + :param str feed_id: + :param str package_id: + :param str project: Project ID or project name + :rtype: [PackageVersionMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + content = self._serialize.body(package_version_id_query, 'PackageVersionMetricsQuery') + response = self._send(http_method='POST', + location_id='e6ae8caa-b6a8-4809-b840-91b2a42c19ad', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[PackageVersionMetrics]', self._unwrap_collection(response)) + + def get_package_version(self, feed_id, package_id, package_version_id, project=None, include_urls=None, is_listed=None, is_deleted=None): + """GetPackageVersion. + 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 str project: Project ID or project 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: This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageVersion', response) + + def get_package_versions(self, feed_id, package_id, project=None, include_urls=None, is_listed=None, is_deleted=None): + """GetPackageVersions. + 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 str project: Project ID or project 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: If set specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: [PackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[PackageVersion]', self._unwrap_collection(response)) + + def create_feed_view(self, view, feed_id, project=None): + """CreateFeedView. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + + def delete_feed_view(self, feed_id, view_id, project=None): + """DeleteFeedView. + Delete a feed view. + :param str feed_id: Name or Id of the feed. + :param str view_id: Name or Id of the view. + :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 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='7.0', + route_values=route_values) + + def get_feed_view(self, feed_id, view_id, project=None): + """GetFeedView. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('FeedView', response) + + def get_feed_views(self, feed_id, project=None): + """GetFeedViews. + Get all views for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :rtype: [FeedView] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + route_values=route_values) + return self._deserialize('[FeedView]', self._unwrap_collection(response)) + + def update_feed_view(self, view, feed_id, view_id, project=None): + """UpdateFeedView. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + diff --git a/azure-devops/azure/devops/v7_0/feed/models.py b/azure-devops/azure/devops/v7_0/feed/models.py new file mode 100644 index 00000000..b0d758ad --- /dev/null +++ b/azure-devops/azure/devops/v7_0/feed/models.py @@ -0,0 +1,1246 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(FeedBatchOperationData, self).__init__() + + +class FeedCore(Model): + """ + An object that contains all of the settings for a specific 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 project: The project that this feed is associated with. + :type project: :class:`ProjectReference ` + :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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + '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, project=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.project = project + self.upstream_enabled = upstream_enabled + self.upstream_sources = upstream_sources + self.view = view + self.view_id = view_id + self.view_name = view_name + + +class FeedChange(Model): + """ + A container that encapsulates the state of the feed after a create, update, or delete. + + :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 change_type: The type of operation. + :type change_type: object + :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 = { + 'feed': {'key': 'feed', 'type': 'Feed'}, + 'feed_continuation_token': {'key': 'feedContinuationToken', 'type': 'long'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'latest_package_continuation_token': {'key': 'latestPackageContinuationToken', 'type': 'long'} + } + + def __init__(self, feed=None, feed_continuation_token=None, change_type=None, latest_package_continuation_token=None): + super(FeedChange, self).__init__() + self.feed = feed + self.feed_continuation_token = feed_continuation_token + self.change_type = change_type + self.latest_package_continuation_token = latest_package_continuation_token + + +class FeedChangesResponse(Model): + """ + A result set containing the feed changes for the range that was requested. + + :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 FeedPermission(Model): + """ + Permissions for a feed. + + :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 is_inherited_role: Boolean indicating whether the role is inherited or set directly. + :type is_inherited_role: bool + :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'}, + 'is_inherited_role': {'key': 'isInheritedRole', 'type': 'bool'}, + 'role': {'key': 'role', 'type': 'object'} + } + + def __init__(self, display_name=None, identity_descriptor=None, identity_id=None, is_inherited_role=None, role=None): + super(FeedPermission, self).__init__() + self.display_name = display_name + self.identity_descriptor = identity_descriptor + self.identity_id = identity_id + self.is_inherited_role = is_inherited_role + self.role = role + + +class FeedRetentionPolicy(Model): + """ + Retention policy settings. + + :param age_limit_in_days: This attribute is deprecated and is not honoured by retention + :type age_limit_in_days: int + :param count_limit: Maximum versions to preserve per package and package type. + :type count_limit: int + :param days_to_keep_recently_downloaded_packages: Number of days to preserve a package version after its latest download. + :type days_to_keep_recently_downloaded_packages: int + """ + + _attribute_map = { + 'age_limit_in_days': {'key': 'ageLimitInDays', 'type': 'int'}, + 'count_limit': {'key': 'countLimit', 'type': 'int'}, + 'days_to_keep_recently_downloaded_packages': {'key': 'daysToKeepRecentlyDownloadedPackages', 'type': 'int'} + } + + def __init__(self, age_limit_in_days=None, count_limit=None, days_to_keep_recently_downloaded_packages=None): + super(FeedRetentionPolicy, self).__init__() + self.age_limit_in_days = age_limit_in_days + self.count_limit = count_limit + self.days_to_keep_recently_downloaded_packages = days_to_keep_recently_downloaded_packages + + +class FeedUpdate(Model): + """ + Update a feed definition with these new values. + + :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): + """ + A view on top of a feed. + + :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): + """ + Permissions for feed service-wide operations such as the creation of new feeds. + + :param identity_descriptor: Identity of the user with the provided Role. + :type identity_descriptor: :class:`str ` + :param identity_id: IdentityId corresponding to the IdentityDescriptor + :type identity_id: str + :param role: Role associated with the Identity. + :type role: object + """ + + _attribute_map = { + 'identity_descriptor': {'key': 'identityDescriptor', 'type': 'str'}, + 'identity_id': {'key': 'identityId', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'object'} + } + + def __init__(self, identity_descriptor=None, identity_id=None, role=None): + super(GlobalPermission, self).__init__() + self.identity_descriptor = identity_descriptor + self.identity_id = identity_id + self.role = role + + +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 MinimalPackageVersion(Model): + """ + Core data about any package, including its id and version information and basic state. + + :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 OperationReference(Model): + """ + Reference for an async 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 + """ + + _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 Package(Model): + """ + A package, which is a container for one or more package versions. + + :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 PackageDependency(Model): + """ + A dependency on another package version. + + :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 PackageFile(Model): + """ + A package file for a specific package version, only relevant to package types that contain multiple files per version. + + :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 PackageChange(Model): + """ + A single change to a feed's packages. + + :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): + """ + A set of change operations to a feed's packages. + + :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 PackageMetrics(Model): + """ + All metrics for a certain package id + + :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(PackageMetrics, 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 PackageMetricsQuery(Model): + """ + Query to get package metrics + + :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(PackageMetricsQuery, self).__init__() + self.package_ids = package_ids + + +class PackageVersion(MinimalPackageVersion): + """ + A specific version of a package. + + :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): + """ + A change to a single package version. + + :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 change_type: The type of change that was performed. + :type change_type: object + :param package_version: Package version that was changed. + :type package_version: :class:`PackageVersion ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'long'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'package_version': {'key': 'packageVersion', 'type': 'PackageVersion'} + } + + def __init__(self, continuation_token=None, change_type=None, package_version=None): + super(PackageVersionChange, self).__init__() + self.continuation_token = continuation_token + self.change_type = change_type + self.package_version = package_version + + +class PackageVersionMetrics(Model): + """ + All metrics for a certain package version id + + :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 PackageVersionMetricsQuery(Model): + """ + Query to get package version metrics + + :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(PackageVersionMetricsQuery, self).__init__() + self.package_version_ids = package_version_ids + + +class PackageVersionProvenance(Model): + """ + Provenance for a published package version + + :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 ProjectReference(Model): + """ + :param id: Gets or sets id of the project. + :type id: str + :param name: Gets or sets name of the project. + :type name: str + :param visibility: Gets or sets 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 ProtocolMetadata(Model): + """ + Extended metadata for a specific package type. + + :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): + """ + Data about the origin of a published package + + :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): + """ + A single package version within the recycle bin. + + :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): + """ + 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 UpstreamSource(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param deleted_date: UTC date that this upstream was deleted. + :type deleted_date: datetime + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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_project_id: For an internal upstream type, track the project of the feed being referenced. + :type internal_upstream_project_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: Consistent 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 service_endpoint_id: The identity of the service endpoint that holds credentials to use when accessing the upstream. + :type service_endpoint_id: str + :param service_endpoint_project_id: Specifies the projectId of the Service Endpoint. + :type service_endpoint_project_id: str + :param status: Specifies the status of the upstream. + :type status: object + :param status_details: Provides a human-readable reason for the status of the upstream. + :type status_details: list of :class:`UpstreamStatusDetail ` + :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'}, + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'internal_upstream_collection_id': {'key': 'internalUpstreamCollectionId', 'type': 'str'}, + 'internal_upstream_feed_id': {'key': 'internalUpstreamFeedId', 'type': 'str'}, + 'internal_upstream_project_id': {'key': 'internalUpstreamProjectId', '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'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_project_id': {'key': 'serviceEndpointProjectId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_details': {'key': 'statusDetails', 'type': '[UpstreamStatusDetail]'}, + 'upstream_source_type': {'key': 'upstreamSourceType', 'type': 'object'} + } + + def __init__(self, deleted_date=None, display_location=None, id=None, internal_upstream_collection_id=None, internal_upstream_feed_id=None, internal_upstream_project_id=None, internal_upstream_view_id=None, location=None, name=None, protocol=None, service_endpoint_id=None, service_endpoint_project_id=None, status=None, status_details=None, upstream_source_type=None): + super(UpstreamSource, self).__init__() + self.deleted_date = deleted_date + self.display_location = display_location + self.id = id + self.internal_upstream_collection_id = internal_upstream_collection_id + self.internal_upstream_feed_id = internal_upstream_feed_id + self.internal_upstream_project_id = internal_upstream_project_id + self.internal_upstream_view_id = internal_upstream_view_id + self.location = location + self.name = name + self.protocol = protocol + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_project_id = service_endpoint_project_id + self.status = status + self.status_details = status_details + self.upstream_source_type = upstream_source_type + + +class UpstreamStatusDetail(Model): + """ + :param reason: Provides a human-readable reason for the status of the upstream. + :type reason: str + """ + + _attribute_map = { + 'reason': {'key': 'reason', 'type': 'str'} + } + + def __init__(self, reason=None): + super(UpstreamStatusDetail, self).__init__() + self.reason = reason + + +class Feed(FeedCore): + """ + A container for artifacts. + + :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 project: The project that this feed is associated with. + :type project: :class:`ProjectReference ` + :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 permanent_deleted_date: The date that this feed was permanently deleted. + :type permanent_deleted_date: datetime + :param permissions: Explicit permissions for the feed. + :type permissions: list of :class:`FeedPermission ` + :param scheduled_permanent_delete_date: The date that this feed is scheduled to be permanently deleted. + :type scheduled_permanent_delete_date: datetime + :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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + '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'}, + 'permanent_deleted_date': {'key': 'permanentDeletedDate', 'type': 'iso-8601'}, + 'permissions': {'key': 'permissions', 'type': '[FeedPermission]'}, + 'scheduled_permanent_delete_date': {'key': 'scheduledPermanentDeleteDate', 'type': 'iso-8601'}, + '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, project=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, permanent_deleted_date=None, permissions=None, scheduled_permanent_delete_date=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, project=project, 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.permanent_deleted_date = permanent_deleted_date + self.permissions = permissions + self.scheduled_permanent_delete_date = scheduled_permanent_delete_date + self.upstream_enabled_changed_date = upstream_enabled_changed_date + self.url = url + + +__all__ = [ + 'FeedBatchData', + 'FeedBatchOperationData', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'Feed', +] diff --git a/azure-devops/azure/devops/v7_0/file_container/__init__.py b/azure-devops/azure/devops/v7_0/file_container/__init__.py new file mode 100644 index 00000000..93d64706 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/file_container/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'ContainerItemBlobReference', + 'FileContainer', + 'FileContainerItem', + 'FileContainerClient' +] diff --git a/azure-devops/azure/devops/v7_0/file_container/file_container_client.py b/azure-devops/azure/devops/v7_0/file_container/file_container_client.py new file mode 100644 index 00000000..52478bf5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/file_container/file_container_client.py @@ -0,0 +1,136 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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, ignore_requested_media_type=None, include_blob_metadata=None, save_absolute_path=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: + :param bool ignore_requested_media_type: + :param bool include_blob_metadata: + :param bool save_absolute_path: + :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') + if ignore_requested_media_type is not None: + query_parameters['ignoreRequestedMediaType'] = self._serialize.query('ignore_requested_media_type', ignore_requested_media_type, 'bool') + if include_blob_metadata is not None: + query_parameters['includeBlobMetadata'] = self._serialize.query('include_blob_metadata', include_blob_metadata, 'bool') + if save_absolute_path is not None: + query_parameters['saveAbsolutePath'] = self._serialize.query('save_absolute_path', save_absolute_path, 'bool') + response = self._send(http_method='GET', + location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', + version='7.0-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[FileContainerItem]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/file_container/models.py b/azure-devops/azure/devops/v7_0/file_container/models.py new file mode 100644 index 00000000..a6480f3d --- /dev/null +++ b/azure-devops/azure/devops/v7_0/file_container/models.py @@ -0,0 +1,211 @@ +# -------------------------------------------------------------------------------------------- +# 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 ContainerItemBlobReference(Model): + """ + Represents an reference to a file in Blobstore + + :param artifact_hash: + :type artifact_hash: str + :param artifact_id: + :type artifact_id: long + :param compression_type: + :type compression_type: object + :param scope_identifier: + :type scope_identifier: str + :param session_id: + :type session_id: str + """ + + _attribute_map = { + 'artifact_hash': {'key': 'artifactHash', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'long'}, + 'compression_type': {'key': 'compressionType', 'type': 'object'}, + 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, + 'session_id': {'key': 'sessionId', 'type': 'str'} + } + + def __init__(self, artifact_hash=None, artifact_id=None, compression_type=None, scope_identifier=None, session_id=None): + super(ContainerItemBlobReference, self).__init__() + self.artifact_hash = artifact_hash + self.artifact_id = artifact_id + self.compression_type = compression_type + self.scope_identifier = scope_identifier + self.session_id = session_id + + +class FileContainer(Model): + """ + Represents a container that encapsulates a hierarchical file system. + + :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): + """ + Represents an item in a container. + + :param artifact_id: Id for Blobstore reference + :type artifact_id: long + :param blob_metadata: + :type blob_metadata: :class:`ContainerItemBlobReference ` + :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 = { + 'artifact_id': {'key': 'artifactId', 'type': 'long'}, + 'blob_metadata': {'key': 'blobMetadata', 'type': 'ContainerItemBlobReference'}, + '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, artifact_id=None, blob_metadata=None, 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.artifact_id = artifact_id + self.blob_metadata = blob_metadata + 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__ = [ + 'ContainerItemBlobReference', + 'FileContainer', + 'FileContainerItem', +] diff --git a/azure-devops/azure/devops/v7_0/gallery/__init__.py b/azure-devops/azure/devops/v7_0/gallery/__init__.py new file mode 100644 index 00000000..9801c2bc --- /dev/null +++ b/azure-devops/azure/devops/v7_0/gallery/__init__.py @@ -0,0 +1,79 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'CustomerSupportRequest', + 'EventCounts', + 'ExtensionAcquisitionRequest', + 'ExtensionBadge', + 'ExtensionCategory', + 'ExtensionDailyStat', + 'ExtensionDailyStats', + 'ExtensionDraft', + 'ExtensionDraftAsset', + 'ExtensionDraftPatch', + 'ExtensionEvent', + 'ExtensionEvents', + 'ExtensionFile', + 'ExtensionFilterResult', + 'ExtensionFilterResultMetadata', + 'ExtensionPackage', + 'ExtensionPayload', + 'ExtensionQuery', + 'ExtensionQueryResult', + 'ExtensionShare', + 'ExtensionStatistic', + 'ExtensionStatisticUpdate', + 'ExtensionVersion', + 'FilterCriteria', + 'GraphSubjectBase', + 'IdentityRef', + 'InstallationTarget', + 'MetadataItem', + 'NotificationsData', + 'ProductCategoriesResult', + 'ProductCategory', + 'PublishedExtension', + 'Publisher', + 'PublisherBase', + 'PublisherFacts', + 'PublisherFilterResult', + 'PublisherQuery', + 'PublisherQueryResult', + 'PublisherRoleAssignment', + 'PublisherSecurityRole', + 'PublisherUserRoleAssignmentRef', + 'QnAItem', + 'QueryFilter', + 'Question', + 'QuestionsResult', + 'RatingCountPerRating', + 'ReferenceLinks', + 'Response', + 'Review', + 'ReviewPatch', + 'ReviewReply', + 'ReviewsResult', + 'ReviewSummary', + 'UnpackagedExtensionData', + 'UserIdentityRef', + 'UserReportedConcern', + 'GalleryClient' +] diff --git a/azure-devops/azure/devops/v7_0/gallery/gallery_client.py b/azure-devops/azure/devops/v7_0/gallery/gallery_client.py new file mode 100644 index 00000000..703269cd --- /dev/null +++ b/azure-devops/azure/devops/v7_0/gallery/gallery_client.py @@ -0,0 +1,1956 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, product_architecture=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: + :param str product_architecture: + :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') + if product_architecture is not None: + query_parameters['productArchitecture'] = self._serialize.query('product_architecture', product_architecture, 'str') + response = self._send(http_method='GET', + location_id='1102bb42-82b0-4955-8d8a-435d6b4cedd3', + version='7.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='7.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='7.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='7.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_support_request(self, customer_support_request): + """CreateSupportRequest. + [Preview API] + :param :class:` ` customer_support_request: + """ + content = self._serialize.body(customer_support_request, 'CustomerSupportRequest') + self._send(http_method='POST', + location_id='8eded385-026a-4c15-b810-b8eb402771f1', + version='7.0-preview.1', + content=content) + + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + query_parameters=query_parameters, + additional_headers=additional_headers, + content=content) + return self._deserialize('ExtensionQueryResult', response) + + def create_extension(self, upload_stream, extension_type=None, re_captcha_token=None, **kwargs): + """CreateExtension. + [Preview API] + :param object upload_stream: Stream to upload + :param str extension_type: + :param str re_captcha_token: + :rtype: :class:` ` + """ + query_parameters = {} + if extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, '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='a41192c8-9525-4b58-bc86-179fa549d80d', + version='7.0-preview.2', + query_parameters=query_parameters, + 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='7.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='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PublishedExtension', response) + + def update_extension_by_id(self, extension_id, re_captcha_token=None): + """UpdateExtensionById. + [Preview API] + :param str extension_id: + :param str re_captcha_token: + :rtype: :class:` ` + """ + route_values = {} + if extension_id is not None: + route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') + query_parameters = {} + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, 'str') + response = self._send(http_method='PUT', + location_id='a41192c8-9525-4b58-bc86-179fa549d80d', + version='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PublishedExtension', response) + + def create_extension_with_publisher(self, upload_stream, publisher_name, extension_type=None, re_captcha_token=None, **kwargs): + """CreateExtensionWithPublisher. + [Preview API] + :param object upload_stream: Stream to upload + :param str publisher_name: + :param str extension_type: + :param str re_captcha_token: + :rtype: :class:` ` + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, '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='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters, + 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='7.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='7.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, extension_type=None, re_captcha_token=None, 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 str extension_type: + :param str re_captcha_token: + :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 extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, 'str') + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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 fetch_domain_token(self, publisher_name): + """FetchDomainToken. + [Preview API] + :param str publisher_name: + :rtype: str + """ + 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='67a609ef-fa74-4b52-8664-78d76f7b3634', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('str', response) + + def verify_domain_token(self, publisher_name): + """VerifyDomainToken. + [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='PUT', + location_id='67a609ef-fa74-4b52-8664-78d76f7b3634', + version='7.0-preview.1', + route_values=route_values) + + 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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Publisher', response) + + def update_publisher_members(self, role_assignments, publisher_name, limit_to_caller_identity_domain=None): + """UpdatePublisherMembers. + [Preview API] Endpoint to add/modify publisher membership. Currently Supports only addition/modification of 1 user at a time Works only for adding members of same tenant. + :param [PublisherUserRoleAssignmentRef] role_assignments: List of user identifiers(email address) and role to be added. Currently only one entry is supported. + :param str publisher_name: The name/id of publisher to which users have to be added + :param bool limit_to_caller_identity_domain: Should cross tenant addtions be allowed or not. + :rtype: [PublisherRoleAssignment] + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if limit_to_caller_identity_domain is not None: + query_parameters['limitToCallerIdentityDomain'] = self._serialize.query('limit_to_caller_identity_domain', limit_to_caller_identity_domain, 'bool') + content = self._serialize.body(role_assignments, '[PublisherUserRoleAssignmentRef]') + response = self._send(http_method='POST', + location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[PublisherRoleAssignment]', self._unwrap_collection(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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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 publisher 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='7.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 publisher 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, target_platform=None): + """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 + :param str target_platform: + """ + 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') + if target_platform is not None: + query_parameters['targetPlatform'] = self._serialize.query('target_platform', target_platform, 'str') + self._send(http_method='POST', + location_id='4fa7adb6-ca65-4075-a232-5f28323288ea', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + + def get_verification_log(self, publisher_name, extension_name, version, target_platform=None, **kwargs): + """GetVerificationLog. + [Preview API] + :param str publisher_name: + :param str extension_name: + :param str version: + :param str target_platform: + :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 target_platform is not None: + query_parameters['targetPlatform'] = self._serialize.query('target_platform', target_platform, 'str') + response = self._send(http_method='GET', + location_id='c5523abe-b843-437f-875b-5833064efe4d', + version='7.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_vSCode_web_extension_statistics(self, item_name, version, stat_type): + """UpdateVSCodeWebExtensionStatistics. + [Preview API] + :param str item_name: + :param str version: + :param VSCodeWebExtensionStatisicsType stat_type: + """ + route_values = {} + if item_name is not None: + route_values['itemName'] = self._serialize.url('item_name', item_name, 'str') + if version is not None: + route_values['version'] = self._serialize.url('version', version, 'str') + if stat_type is not None: + route_values['statType'] = self._serialize.url('stat_type', stat_type, 'VSCodeWebExtensionStatisicsType') + self._send(http_method='POST', + location_id='205c91a8-7841-4fd3-ae4f-5a745d5a8df5', + version='7.0-preview.1', + route_values=route_values) + diff --git a/azure-devops/azure/devops/v7_0/gallery/models.py b/azure-devops/azure/devops/v7_0/gallery/models.py new file mode 100644 index 00000000..2601e2dc --- /dev/null +++ b/azure-devops/azure/devops/v7_0/gallery/models.py @@ -0,0 +1,2152 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + Market item acquisition options (install, buy, etc) for an installation target. + + :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): + """ + :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 publisher 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): + """ + :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): + """ + :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): + """ + :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): + """ + This is the set of categories in response to the get category query + + :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): + """ + Definition of one title of a category + + :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 CustomerSupportRequest(Model): + """ + An entity representing the data required to create a Customer Support Request. + + :param display_name: Display name of extension in concern + :type display_name: str + :param email_id: Email of user making the support request + :type email_id: str + :param extension_name: Extension name + :type extension_name: str + :param extension_uRL: Link to the extension details page + :type extension_uRL: str + :param message: User-provided support request message. + :type message: str + :param publisher_name: Publisher name + :type publisher_name: str + :param reason: Reason for support request + :type reason: str + :param re_captcha_token: + :type re_captcha_token: str + :param reporter_vSID: VSID of the user making the support request + :type reporter_vSID: str + :param review: Review under concern + :type review: :class:`Review ` + :param source_link: The UI source through which the request was made + :type source_link: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'email_id': {'key': 'emailId', 'type': 'str'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_uRL': {'key': 'extensionURL', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'}, + 'reporter_vSID': {'key': 'reporterVSID', 'type': 'str'}, + 'review': {'key': 'review', 'type': 'Review'}, + 'source_link': {'key': 'sourceLink', 'type': 'str'} + } + + def __init__(self, display_name=None, email_id=None, extension_name=None, extension_uRL=None, message=None, publisher_name=None, reason=None, re_captcha_token=None, reporter_vSID=None, review=None, source_link=None): + super(CustomerSupportRequest, self).__init__() + self.display_name = display_name + self.email_id = email_id + self.extension_name = extension_name + self.extension_uRL = extension_uRL + self.message = message + self.publisher_name = publisher_name + self.reason = reason + self.re_captcha_token = re_captcha_token + self.reporter_vSID = reporter_vSID + self.review = review + self.source_link = source_link + + +class EventCounts(Model): + """ + :param average_rating: Average rating on the day for extension + :type average_rating: float + :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': 'float'}, + '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): + """ + Contract for handling the extension acquisition process + + :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): + """ + :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): + """ + :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 language 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): + """ + :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): + """ + :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): + """ + :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): + """ + :param extension_data: + :type extension_data: :class:`UnpackagedExtensionData ` + :param operation: + :type operation: object + :param re_captcha_token: + :type re_captcha_token: str + """ + + _attribute_map = { + 'extension_data': {'key': 'extensionData', 'type': 'UnpackagedExtensionData'}, + 'operation': {'key': 'operation', 'type': 'object'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + def __init__(self, extension_data=None, operation=None, re_captcha_token=None): + super(ExtensionDraftPatch, self).__init__() + self.extension_data = extension_data + self.operation = operation + self.re_captcha_token = re_captcha_token + + +class ExtensionEvent(Model): + """ + Stores details of each event + + :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): + """ + Container object for all extension events. Stores all install and uninstall events related to an extension. The events container is generic so can store data of any type of event. New event types can be added without altering the contract. + + :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): + """ + :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): + """ + The FilterResult is the set of extensions that matched a particular query filter. + + :param extensions: This is the set of applications 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 is one set of metadata for the result e.g. Total count. There can be multiple metadata items for one metadata. + + :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): + """ + Package that will be used to create or update a published extension + + :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): + """ + :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): + """ + An ExtensionQuery is used to search the gallery for a set of extensions that match one of many filter values. + + :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 determine 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): + """ + This is the set of extensions that matched a supplied query through the filters given. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 target_platform: + :type target_platform: 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 }]'}, + 'target_platform': {'key': 'targetPlatform', 'type': '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, target_platform=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.target_platform = target_platform + self.validation_result_message = validation_result_message + self.version = version + self.version_description = version_description + + +class FilterCriteria(Model): + """ + One condition in a QueryFilter. + + :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 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 InstallationTarget(Model): + """ + :param extension_version: + :type extension_version: str + :param product_architecture: + :type product_architecture: str + :param target: + :type target: str + :param target_platform: + :type target_platform: str + :param target_version: + :type target_version: str + """ + + _attribute_map = { + 'extension_version': {'key': 'extensionVersion', 'type': 'str'}, + 'product_architecture': {'key': 'productArchitecture', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'target_platform': {'key': 'targetPlatform', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'} + } + + def __init__(self, extension_version=None, product_architecture=None, target=None, target_platform=None, target_version=None): + super(InstallationTarget, self).__init__() + self.extension_version = extension_version + self.product_architecture = product_architecture + self.target = target + self.target_platform = target_platform + self.target_version = target_version + + +class MetadataItem(Model): + """ + MetadataItem is one value of metadata under a given category of metadata + + :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): + """ + Information needed for sending mail notification + + :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): + """ + This is the set of categories in response to the get category query + + :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): + """ + This is the interface object to be used by Root Categories and Category Tree APIs for Visual Studio Ide. + + :param has_children: Indicator whether this is a leaf or there are children under this category + :type has_children: bool + :param children: + :type children: list of :class:`ProductCategory ` + :param id: Individual Guid of the Category + :type id: str + :param title: Category Title in the requested language + :type title: str + """ + + _attribute_map = { + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[ProductCategory]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'} + } + + def __init__(self, has_children=None, children=None, id=None, title=None): + super(ProductCategory, self).__init__() + self.has_children = has_children + self.children = children + self.id = id + self.title = title + + +class PublishedExtension(Model): + """ + :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 present_in_conflict_list: Check if Extension is in conflict list or not. Taking as String and not as boolean because we don't want end customer to see this flag and by making it Boolean it is coming as false for all the cases. + :type present_in_conflict_list: 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'}, + 'present_in_conflict_list': {'key': 'presentInConflictList', '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, present_in_conflict_list=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.present_in_conflict_list = present_in_conflict_list + 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): + """ + Keeping base class separate since publisher DB model class and publisher contract class share these common properties + + :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): + """ + High-level information about the publisher, like id's and names + + :param display_name: + :type display_name: str + :param domain: + :type domain: str + :param flags: + :type flags: object + :param is_domain_verified: + :type is_domain_verified: bool + :param publisher_id: + :type publisher_id: str + :param publisher_name: + :type publisher_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'flags': {'key': 'flags', 'type': 'object'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 'publisher_id': {'key': 'publisherId', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, display_name=None, domain=None, flags=None, is_domain_verified=None, publisher_id=None, publisher_name=None): + super(PublisherFacts, self).__init__() + self.display_name = display_name + self.domain = domain + self.flags = flags + self.is_domain_verified = is_domain_verified + self.publisher_id = publisher_id + self.publisher_name = publisher_name + + +class PublisherFilterResult(Model): + """ + The FilterResult is the set of publishers that matched a particular query filter. + + :param publishers: This is the set of applications 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): + """ + An PublisherQuery is used to search the gallery for a set of publishers that match one of many filter values. + + :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 determine 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): + """ + This is the set of publishers that matched a supplied query through the filters given. + + :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 PublisherRoleAssignment(Model): + """ + :param access: Designates the role as explicitly assigned or inherited. + :type access: object + :param access_display_name: User friendly description of access assignment. + :type access_display_name: str + :param identity: The user to whom the role is assigned. + :type identity: :class:`IdentityRef ` + :param role: The role assigned to the user. + :type role: :class:`PublisherSecurityRole ` + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'object'}, + 'access_display_name': {'key': 'accessDisplayName', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'IdentityRef'}, + 'role': {'key': 'role', 'type': 'PublisherSecurityRole'} + } + + def __init__(self, access=None, access_display_name=None, identity=None, role=None): + super(PublisherRoleAssignment, self).__init__() + self.access = access + self.access_display_name = access_display_name + self.identity = identity + self.role = role + + +class PublisherSecurityRole(Model): + """ + :param allow_permissions: Permissions the role is allowed. + :type allow_permissions: int + :param deny_permissions: Permissions the role is denied. + :type deny_permissions: int + :param description: Description of user access defined by the role + :type description: str + :param display_name: User friendly name of the role. + :type display_name: str + :param identifier: Globally unique identifier for the role. + :type identifier: str + :param name: Unique name of the role in the scope. + :type name: str + :param scope: Returns the id of the ParentScope. + :type scope: str + """ + + _attribute_map = { + 'allow_permissions': {'key': 'allowPermissions', 'type': 'int'}, + 'deny_permissions': {'key': 'denyPermissions', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'identifier': {'key': 'identifier', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'} + } + + def __init__(self, allow_permissions=None, deny_permissions=None, description=None, display_name=None, identifier=None, name=None, scope=None): + super(PublisherSecurityRole, self).__init__() + self.allow_permissions = allow_permissions + self.deny_permissions = deny_permissions + self.description = description + self.display_name = display_name + self.identifier = identifier + self.name = name + self.scope = scope + + +class PublisherUserRoleAssignmentRef(Model): + """ + :param role_name: The name of the role assigned. + :type role_name: str + :param unique_name: Identifier of the user given the role assignment. + :type unique_name: str + :param user_id: Unique id of the user given the role assignment. + :type user_id: str + """ + + _attribute_map = { + 'role_name': {'key': 'roleName', 'type': 'str'}, + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'} + } + + def __init__(self, role_name=None, unique_name=None, user_id=None): + super(PublisherUserRoleAssignmentRef, self).__init__() + self.role_name = role_name + self.unique_name = unique_name + self.user_id = user_id + + +class QnAItem(Model): + """ + The core structure of a QnA item + + :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): + """ + A filter used to define a set of extensions to return during a query. + + :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 embedded 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): + """ + The structure of the question / thread + + :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 re_captcha_token: + :type re_captcha_token: str + :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'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'}, + 'responses': {'key': 'responses', 'type': '[Response]'} + } + + def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, re_captcha_token=None, responses=None): + super(Question, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) + self.re_captcha_token = re_captcha_token + self.responses = responses + + +class QuestionsResult(Model): + """ + :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): + """ + :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): + """ + 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 Response(QnAItem): + """ + The structure of a 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 ` + :param re_captcha_token: + :type re_captcha_token: str + """ + + _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'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, re_captcha_token=None): + super(Response, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) + self.re_captcha_token = re_captcha_token + + +class Review(Model): + """ + :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 provided by the user + :type rating: str + :param re_captcha_token: + :type re_captcha_token: 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'}, + 're_captcha_token': {'key': 'reCaptchaToken', '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, re_captcha_token=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.re_captcha_token = re_captcha_token + 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): + """ + :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): + """ + :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): + """ + :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): + """ + :param average_rating: Average Rating + :type average_rating: float + :param rating_count: Count of total ratings + :type rating_count: long + :param rating_split: Split of count across rating + :type rating_split: list of :class:`RatingCountPerRating ` + """ + + _attribute_map = { + 'average_rating': {'key': 'averageRating', 'type': 'float'}, + '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): + """ + :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): + """ + Identity reference with name and guid + + :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): + """ + :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): + """ + The structure of a Concern Rather than defining a separate data structure having same fields as QnAItem, we are inheriting from the 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 ` + :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): + """ + :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): + """ + :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 ` + :param domain: + :type domain: str + :param is_dns_token_verified: + :type is_dns_token_verified: bool + :param is_domain_verified: + :type is_domain_verified: bool + :param re_captcha_token: + :type re_captcha_token: str + """ + + _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'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'is_dns_token_verified': {'key': 'isDnsTokenVerified', 'type': 'bool'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + 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, domain=None, is_dns_token_verified=None, is_domain_verified=None, re_captcha_token=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 + self.domain = domain + self.is_dns_token_verified = is_dns_token_verified + self.is_domain_verified = is_domain_verified + self.re_captcha_token = re_captcha_token + + +__all__ = [ + 'AcquisitionOperation', + 'AcquisitionOptions', + 'Answers', + 'AssetDetails', + 'AzurePublisher', + 'AzureRestApiRequestModel', + 'CategoriesResult', + 'CategoryLanguageTitle', + 'CustomerSupportRequest', + 'EventCounts', + 'ExtensionAcquisitionRequest', + 'ExtensionBadge', + 'ExtensionCategory', + 'ExtensionDailyStat', + 'ExtensionDailyStats', + 'ExtensionDraft', + 'ExtensionDraftPatch', + 'ExtensionEvent', + 'ExtensionEvents', + 'ExtensionFile', + 'ExtensionFilterResult', + 'ExtensionFilterResultMetadata', + 'ExtensionPackage', + 'ExtensionPayload', + 'ExtensionQuery', + 'ExtensionQueryResult', + 'ExtensionShare', + 'ExtensionStatistic', + 'ExtensionStatisticUpdate', + 'ExtensionVersion', + 'FilterCriteria', + 'GraphSubjectBase', + 'IdentityRef', + 'InstallationTarget', + 'MetadataItem', + 'NotificationsData', + 'ProductCategoriesResult', + 'ProductCategory', + 'PublishedExtension', + 'PublisherBase', + 'PublisherFacts', + 'PublisherFilterResult', + 'PublisherQuery', + 'PublisherQueryResult', + 'PublisherRoleAssignment', + 'PublisherSecurityRole', + 'PublisherUserRoleAssignmentRef', + 'QnAItem', + 'QueryFilter', + 'Question', + 'QuestionsResult', + 'RatingCountPerRating', + 'ReferenceLinks', + 'Response', + 'Review', + 'ReviewPatch', + 'ReviewReply', + 'ReviewsResult', + 'ReviewSummary', + 'UnpackagedExtensionData', + 'UserIdentityRef', + 'UserReportedConcern', + 'Concern', + 'ExtensionDraftAsset', + 'Publisher', +] diff --git a/azure-devops/azure/devops/v7_0/git/__init__.py b/azure-devops/azure/devops/v7_0/git/__init__.py new file mode 100644 index 00000000..23679ab2 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/git/__init__.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'Comment', + 'CommentIterationContext', + 'CommentPosition', + 'CommentThread', + 'CommentThreadContext', + 'CommentTrackingCriteria', + 'FileContentMetadata', + 'FileDiff', + 'FileDiffParams', + 'FileDiffsCriteria', + 'GitAnnotatedTag', + 'GitAsyncRefOperation', + 'GitAsyncRefOperationDetail', + 'GitAsyncRefOperationParameters', + 'GitAsyncRefOperationSource', + 'GitBaseVersionDescriptor', + 'GitBlobRef', + 'GitBranchStats', + 'GitCommit', + 'GitCommitDiffs', + 'GitCommitChanges', + 'GitCommitRef', + 'GitConflict', + 'GitConflictUpdateResult', + 'GitDeletedRepository', + 'GitFilePathsCollection', + 'GitForkOperationStatusDetail', + 'GitForkRef', + 'GitForkSyncRequest', + 'GitForkSyncRequestParameters', + 'GitCherryPick', + 'GitImportGitSource', + 'GitImportRequest', + 'GitImportRequestParameters', + 'GitImportStatusDetail', + 'GitImportTfvcSource', + 'GitItem', + 'GitItemDescriptor', + 'GitItemRequestData', + 'GitMerge', + 'GitMergeOperationStatusDetail', + 'GitMergeOriginRef', + 'GitMergeParameters', + 'GitObject', + 'GitPolicyConfigurationResponse', + 'GitPullRequest', + 'GitPullRequestCommentThread', + 'GitPullRequestCommentThreadContext', + 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', + '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', + 'Change', + 'IdentityRef', + 'IdentityRefWithVote', + 'ImportRepositoryValidation', + 'ItemContent', + 'ItemModel', + 'JsonPatchOperation', + 'LineDiffBlock', + 'PolicyConfiguration', + 'PolicyConfigurationRef', + 'PolicyTypeRef', + 'ReferenceLinks', + 'ResourceRef', + 'ShareNotificationContext', + 'SourceToTargetRef', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'VersionedPolicyConfigurationRef', + 'VstsInfo', + 'WebApiCreateTagRequestData', + 'WebApiTagDefinition', + 'GitClient' +] diff --git a/azure-devops/azure/devops/v7_0/git/git_client.py b/azure-devops/azure/devops/v7_0/git/git_client.py new file mode 100644 index 00000000..c28e80df --- /dev/null +++ b/azure-devops/azure/devops/v7_0/git/git_client.py @@ -0,0 +1,39 @@ +# 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) \ No newline at end of file diff --git a/azure-devops/azure/devops/v7_0/git/git_client_base.py b/azure-devops/azure/devops/v7_0/git/git_client_base.py new file mode 100644 index 00000000..15211618 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/git/git_client_base.py @@ -0,0 +1,3324 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitAnnotatedTag', response) + + def get_annotated_tag(self, project, repository_id, object_id): + """GetAnnotatedTag. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitBranchStats]', self._unwrap_collection(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='7.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='7.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 search_criteria.show_oldest_commits_first is not None: + query_parameters['searchCriteria.showOldestCommitsFirst'] = search_criteria.show_oldest_commits_first + 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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + 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. + Request that another repository's refs be fetched into this one. It syncs two existing forks. To create a fork, please see the repositories endpoint + :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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitForkSyncRequest]', 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='7.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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick(self, project, cherry_pick_id, repository_id): + """GetCherryPick. + Retrieve information about a cherry pick operation 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='7.0', + route_values=route_values) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick_for_ref_name(self, project, repository_id, ref_name): + """GetCherryPickForRefName. + Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitCherryPick', response) + + def create_import_request(self, import_request, project, repository_id): + """CreateImportRequest. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitImportRequest', response) + + def get_import_request(self, project, repository_id, import_request_id): + """GetImportRequest. + 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='7.0', + route_values=route_values) + return self._deserialize('GitImportRequest', response) + + def query_import_requests(self, project, repository_id, include_abandoned=None): + """QueryImportRequests. + 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='7.0', + 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. + 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='7.0', + 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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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 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='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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, sanitize=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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) + + def create_merge_request(self, merge_parameters, project, repository_name_or_id, include_links=None): + """CreateMergeRequest. + Request a git merge operation. Currently we support merging only 2 commits. + :param :class:` ` merge_parameters: Parents commitIds and merge commit messsage. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :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(merge_parameters, 'GitMergeParameters') + response = self._send(http_method='POST', + location_id='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('GitMerge', response) + + def get_merge_request(self, project, repository_name_or_id, merge_operation_id, include_links=None): + """GetMergeRequest. + Get a specific merge operation's details. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :param int merge_operation_id: OperationId of the merge request. + :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 merge_operation_id is not None: + route_values['mergeOperationId'] = self._serialize.url('merge_operation_id', merge_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='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitMerge', response) + + def get_policy_configurations(self, project, repository_id=None, ref_name=None, policy_type=None, top=None, continuation_token=None): + """GetPolicyConfigurations. + Retrieve a list of policy configurations by a given set of scope/filtering criteria. + :param str project: Project ID or project name + :param str repository_id: The repository id. + :param str ref_name: The fully-qualified Git ref name (e.g. refs/heads/master). + :param str policy_type: The policy type filter. + :param int top: Maximum number of policies to return. + :param str continuation_token: Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint. + :rtype: :class:` ` + """ + 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 ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + if policy_type is not None: + query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, '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='2c420070-a0a2-49cc-9639-c9f271c5ff07', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.GitPolicyConfigurationResponse() + response_object.policy_configurations = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) + response_object.continuation_token = response.headers.get('x-ms-continuationtoken') + return response_object + + def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None, **kwargs): + """CreateAttachment. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None, **kwargs): + """GetAttachmentContent. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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 create_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """CreateLike. + 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='7.0', + route_values=route_values) + + def delete_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """DeleteLike. + 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='7.0', + route_values=route_values) + + def get_likes(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """GetLikes. + 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='7.0', + 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, 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='7.0', + 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:`<[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') + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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 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. Allowed values are between 1 and the maximum iteration on this pull request. + :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='7.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='7.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='7.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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): + """GetPullRequestIterationStatus. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def create_unmaterialized_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, project=None): + """CreateUnmaterializedPullRequestReviewer. + Add an unmaterialized identity to the reviewers of a pull request. + :param :class:` ` reviewer: Reviewer 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: :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(reviewer, 'IdentityRefWithVote') + response = self._send(http_method='PUT', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', 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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def update_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): + """UpdatePullRequestReviewer. + Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined + :param :class:` ` reviewer: Reviewer data.
If the reviewer's ID is included here, it must match the reviewerID parameter. + :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='PATCH', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', 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='7.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='7.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='7.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='7.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='7.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='7.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 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='7.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. + 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='7.0', + route_values=route_values, + content=content) + + def create_pull_request_status(self, status, repository_id, pull_request_id, project=None): + """CreatePullRequestStatus. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): + """GetPullRequestStatus. + 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='7.0', + route_values=route_values) + return self._deserialize('GitPullRequestStatus', response) + + def get_pull_request_statuses(self, repository_id, pull_request_id, project=None): + """GetPullRequestStatuses. + 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='7.0', + 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. + 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='7.0', + 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 (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='7.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='7.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='7.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='7.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. 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values) + + def get_recycle_bin_repositories(self, project): + """GetRecycleBinRepositories. + 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='7.0', + 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. + 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='7.0', + 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, 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:`<[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') + 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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRefFavorite', response) + + def delete_ref_favorite(self, project, favorite_id): + """DeleteRefFavorite. + 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='7.0', + route_values=route_values) + + def get_ref_favorite(self, project, favorite_id): + """GetRefFavorite. + 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='7.0', + route_values=route_values) + return self._deserialize('GitRefFavorite', response) + + def get_ref_favorites(self, project, repository_id=None, identity_id=None): + """GetRefFavorites. + 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='7.0', + 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 omitted 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='7.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 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='7.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='7.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='7.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='7.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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRepository', response) + + def get_stats(self, project, repository_id): + """GetStats. + Retrieves statistics of a repository. + :param str project: Project ID or project name + :param str repository_id: Friendly name or guid of 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') + response = self._send(http_method='GET', + location_id='616a5255-74b3-40f5-ae1d-bbae2eec8db5', + version='7.0', + route_values=route_values) + return self._deserialize('GitRepositoryStats', response) + + def create_revert(self, revert_to_create, project, repository_id): + """CreateRevert. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRevert', response) + + def get_revert(self, project, revert_id, repository_id): + """GetRevert. + 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='7.0', + route_values=route_values) + return self._deserialize('GitRevert', response) + + def get_revert_for_ref_name(self, project, repository_id, ref_name): + """GetRevertForRefName. + 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='7.0', + 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='7.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='7.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. + 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='7.0', + 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='7.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='7.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) + diff --git a/azure-devops/azure/devops/v7_0/git/models.py b/azure-devops/azure/devops/v7_0/git/models.py new file mode 100644 index 00000000..4aca8973 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/git/models.py @@ -0,0 +1,3830 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Meta data for a file attached to an artifact. + + :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 Comment(Model): + """ + Represents a comment which is one of potentially many in a comment thread. + + :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): + """ + Comment iteration context is used to identify which diff was being viewed when the thread was created. + + :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): + """ + :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): + """ + Represents a comment thread of a pull request. A thread contains meta data about the file it was left on along with one or more comments (an initial comment and the subsequent replies). + + :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): + """ + :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): + """ + Comment tracking criteria is used to identify which iteration context the thread has been tracked to (if any) along with some detail about the original position and filename. + + :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): + """ + :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): + """ + Provides properties that describe file differences + + :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): + """ + Provides parameters that describe inputs for the file diff + + :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): + """ + Provides properties that describe inputs for the file diffs + + :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): + """ + A Git annotated tag. + + :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): + """ + :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): + """ + Information about the progress of a cherry pick or revert operation. + + :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): + """ + Parameters that are provided in the request body when requesting to cherry pick or revert. + + :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 specifies the pull request or list of commits to use when making a cherry pick and revert operation request. Only one should be provided. + + :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): + """ + :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): + """ + Ahead and behind counts for a particular ref. + + :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 GitCommitDiffs(Model): + """ + :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 common_commit: + :type common_commit: str + :param change_counts: + :type change_counts: dict + :param changes: + :type changes: list of :class:`object ` + :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'}, + 'common_commit': {'key': 'commonCommit', 'type': 'str'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + 'target_commit': {'key': 'targetCommit', 'type': 'str'} + } + + def __init__(self, ahead_count=None, all_changes_included=None, base_commit=None, behind_count=None, common_commit=None, change_counts=None, changes=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.common_commit = common_commit + self.change_counts = change_counts + self.changes = changes + self.target_commit = target_commit + + +class GitCommitChanges(Model): + """ + :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 GitCommitRef(Model): + """ + Provides properties that describe a Git commit and associated metadata. + + :param _links: A collection of related REST reference links. + :type _links: :class:`ReferenceLinks ` + :param author: Author of the commit. + :type author: :class:`GitUserDate ` + :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 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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'committer': {'key': 'committer', 'type': 'GitUserDate'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + '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, comment=None, comment_truncated=None, commit_id=None, committer=None, change_counts=None, changes=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.comment = comment + self.comment_truncated = comment_truncated + self.commit_id = commit_id + self.committer = committer + self.change_counts = change_counts + self.changes = changes + 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Status information about a requested fork operation. + + :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): + """ + Request to sync data between two forks. + + :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): + """ + Parameters for creating a fork request + + :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 GitCherryPick(GitAsyncRefOperation): + """ + This object is returned from Cherry Pick operations and provides the id and status of the operation + + :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 GitImportGitSource(Model): + """ + Parameter for creating a git import request when source is Git version control + + :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): + """ + A request to import data from a remote source control system. + + :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): + """ + Parameters for creating an import request + + :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): + """ + Additional status information about an import request. + + :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): + """ + Parameter for creating a git import request when source is tfvc version control + + :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): + """ + :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): + """ + :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): + """ + Status information about a requested merge operation. + + :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): + """ + :param cherry_pick_id: + :type cherry_pick_id: int + :param pull_request_id: + :type pull_request_id: int + :param revert_id: + :type revert_id: int + """ + + _attribute_map = { + 'cherry_pick_id': {'key': 'cherryPickId', 'type': 'int'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'}, + 'revert_id': {'key': 'revertId', 'type': 'int'} + } + + def __init__(self, cherry_pick_id=None, pull_request_id=None, revert_id=None): + super(GitMergeOriginRef, self).__init__() + self.cherry_pick_id = cherry_pick_id + self.pull_request_id = pull_request_id + self.revert_id = revert_id + + +class GitMergeParameters(Model): + """ + Parameters required for performing git merge. + + :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): + """ + Git object identifier and type information. + + :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 GitPolicyConfigurationResponse(Model): + """ + :param continuation_token: The HTTP client methods find the continuation token header in the response and populate this field. + :type continuation_token: str + :param policy_configurations: + :type policy_configurations: list of :class:`PolicyConfiguration ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'policy_configurations': {'key': 'policyConfigurations', 'type': '[PolicyConfiguration]'} + } + + def __init__(self, continuation_token=None, policy_configurations=None): + super(GitPolicyConfigurationResponse, self).__init__() + self.continuation_token = continuation_token + self.policy_configurations = policy_configurations + + +class GitPullRequest(Model): + """ + Represents all the data associated with a pull request. + + :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 has_multiple_merge_bases: Multiple mergebases warning + :type has_multiple_merge_bases: bool + :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'}, + 'has_multiple_merge_bases': {'key': 'hasMultipleMergeBases', 'type': 'bool'}, + '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, has_multiple_merge_bases=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.has_multiple_merge_bases = has_multiple_merge_bases + 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 GitPullRequestCommentThread(CommentThread): + """ + Represents a comment thread of a pull request. A thread contains meta data about the file it was left on (if any) along with one or more comments (an initial comment and the subsequent replies). + + :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): + """ + Comment thread context contains details about what diffs were being viewed at the time of thread creation and whether or not the thread has been tracked from that original diff. + + :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): + """ + Preferences about how the pull request should be completed. + + :param auto_complete_ignore_config_ids: List of any policy configuration Id's which auto-complete should not wait for. Only applies to optional policies (isBlocking == false). Auto-complete always waits for required policies (isBlocking == true). + :type auto_complete_ignore_config_ids: list of int + :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 merge_strategy: Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored. + :type merge_strategy: object + :param squash_merge: SquashMerge is deprecated. You should explicitly set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true. + :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 = { + 'auto_complete_ignore_config_ids': {'key': 'autoCompleteIgnoreConfigIds', 'type': '[int]'}, + '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'}, + 'merge_strategy': {'key': 'mergeStrategy', 'type': 'object'}, + 'squash_merge': {'key': 'squashMerge', 'type': 'bool'}, + 'transition_work_items': {'key': 'transitionWorkItems', 'type': 'bool'}, + 'triggered_by_auto_complete': {'key': 'triggeredByAutoComplete', 'type': 'bool'} + } + + def __init__(self, auto_complete_ignore_config_ids=None, bypass_policy=None, bypass_reason=None, delete_source_branch=None, merge_commit_message=None, merge_strategy=None, squash_merge=None, transition_work_items=None, triggered_by_auto_complete=None): + super(GitPullRequestCompletionOptions, self).__init__() + self.auto_complete_ignore_config_ids = auto_complete_ignore_config_ids + 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.merge_strategy = merge_strategy + self.squash_merge = squash_merge + self.transition_work_items = transition_work_items + self.triggered_by_auto_complete = triggered_by_auto_complete + + +class GitPullRequestChange(Model): + """ + Change made in a pull request. + + :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 GitPullRequestIteration(Model): + """ + Provides properties that describe a Git pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request. + + :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 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 change_list: Changes included with the pull request iteration. + :type change_list: list of :class:`GitPullRequestChange ` + :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'}, + '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'}, + 'change_list': {'key': 'changeList', 'type': '[GitPullRequestChange]'}, + '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, commits=None, common_ref_commit=None, created_date=None, description=None, has_more_commits=None, change_list=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.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.change_list = change_list + 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): + """ + Collection of changes made in a pull request. + + :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): + """ + The options which are used when a pull request merge is created. + + :param conflict_authorship_commits: If true, conflict resolutions applied during the merge will be put in separate commits to preserve authorship info for git blame, etc. + :type conflict_authorship_commits: bool + :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 = { + 'conflict_authorship_commits': {'key': 'conflictAuthorshipCommits', 'type': 'bool'}, + 'detect_rename_false_positives': {'key': 'detectRenameFalsePositives', 'type': 'bool'}, + 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} + } + + def __init__(self, conflict_authorship_commits=None, detect_rename_false_positives=None, disable_renames=None): + super(GitPullRequestMergeOptions, self).__init__() + self.conflict_authorship_commits = conflict_authorship_commits + self.detect_rename_false_positives = detect_rename_false_positives + self.disable_renames = disable_renames + + +class GitPullRequestQuery(Model): + """ + A set of pull request queries and their results. + + :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): + """ + Pull request query input parameters. + + :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): + """ + Pull requests can be searched for matching this criteria. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 show_oldest_commits_first: If enabled, this option will ignore the itemVersion and compareVersion parameters + :type show_oldest_commits_first: bool + :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'}, + 'show_oldest_commits_first': {'key': 'showOldestCommitsFirst', 'type': 'bool'}, + '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, show_oldest_commits_first=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.show_oldest_commits_first = show_oldest_commits_first + self.to_commit_id = to_commit_id + self.to_date = to_date + self.user = user + + +class GitRecycleBinRepositoryDetails(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=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, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + 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 + self.web_url = web_url + + +class GitRepositoryCreateOptions(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + This class contains the metadata of a service/extension posting a status. + + :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): + """ + Status context that uniquely identifies the status. + + :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): + """ + An object describing the git suggestion. Git suggestions are currently limited to suggested pull requests. + + :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): + """ + :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): + """ + :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 yield 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + User info and date for Git operations. + + :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): + """ + :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): + """ + Globally unique key for a repository. + + :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): + """ + :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 Change(Model): + """ + :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 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 IdentityRefWithVote(IdentityRef): + """ + Identity information including a vote on a pull request. + + :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 + :param has_declined: Indicates if this reviewer has declined to review this pull request. + :type has_declined: bool + :param is_flagged: Indicates if this reviewer is flagged for attention on this pull request. + :type is_flagged: bool + :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'}, + 'has_declined': {'key': 'hasDeclined', 'type': 'bool'}, + 'is_flagged': {'key': 'isFlagged', 'type': 'bool'}, + '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, has_declined=None, is_flagged=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.has_declined = has_declined + self.is_flagged = is_flagged + self.is_required = is_required + self.reviewer_url = reviewer_url + self.vote = vote + self.voted_for = voted_for + + +class ImportRepositoryValidation(Model): + """ + :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): + """ + :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): + """ + :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): + """ + 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 LineDiffBlock(Model): + """ + The class to represent the line diff block + + :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): + """ + Policy configuration reference. + + :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): + """ + Policy type reference. + + :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): + """ + 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 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 ShareNotificationContext(Model): + """ + Context used while sharing a pull request. + + :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): + """ + :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): + """ + Reference object for a TeamProjectCollection. + + :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): + """ + 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 VersionedPolicyConfigurationRef(PolicyConfigurationRef): + """ + A particular revision for a policy configuration. + + :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): + """ + :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): + """ + The representation of data needed to create a tag definition which is sent across the wire. + + :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): + """ + The representation of a tag definition which is sent across the wire. + + :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): + """ + :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): + """ + :param _links: A collection of related REST reference links. + :type _links: :class:`ReferenceLinks ` + :param author: Author of the commit. + :type author: :class:`GitUserDate ` + :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 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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'committer': {'key': 'committer', 'type': 'GitUserDate'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + '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, comment=None, comment_truncated=None, commit_id=None, committer=None, change_counts=None, changes=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, comment=comment, comment_truncated=comment_truncated, commit_id=commit_id, committer=committer, change_counts=change_counts, changes=changes, parents=parents, push=push, remote_url=remote_url, statuses=statuses, url=url, work_items=work_items) + self.tree_id = tree_id + + +class GitForkRef(GitRef): + """ + Information about a fork ref. + + :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): + """ + :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): + """ + :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): + """ + This class contains the metadata of a service/extension posting pull request status. Status can be associated with a pull request or an iteration. + + :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): + """ + :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): + """ + :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): + """ + The full policy configuration with settings. + + :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 is_enterprise_managed: If set, this policy requires "Manage Enterprise Policies" permission to create, edit, or delete. + :type is_enterprise_managed: 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'}, + 'is_enterprise_managed': {'key': 'isEnterpriseManaged', '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, is_enterprise_managed=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.is_enterprise_managed = is_enterprise_managed + self.settings = settings + + +__all__ = [ + 'Attachment', + 'Comment', + 'CommentIterationContext', + 'CommentPosition', + 'CommentThread', + 'CommentThreadContext', + 'CommentTrackingCriteria', + 'FileContentMetadata', + 'FileDiff', + 'FileDiffParams', + 'FileDiffsCriteria', + 'GitAnnotatedTag', + 'GitAsyncRefOperation', + 'GitAsyncRefOperationDetail', + 'GitAsyncRefOperationParameters', + 'GitAsyncRefOperationSource', + 'GitBlobRef', + 'GitBranchStats', + 'GitCommitDiffs', + 'GitCommitChanges', + 'GitCommitRef', + 'GitConflict', + 'GitConflictUpdateResult', + 'GitDeletedRepository', + 'GitFilePathsCollection', + 'GitForkOperationStatusDetail', + 'GitForkSyncRequest', + 'GitForkSyncRequestParameters', + 'GitCherryPick', + 'GitImportGitSource', + 'GitImportRequest', + 'GitImportRequestParameters', + 'GitImportStatusDetail', + 'GitImportTfvcSource', + 'GitItemDescriptor', + 'GitItemRequestData', + 'GitMergeOperationStatusDetail', + 'GitMergeOriginRef', + 'GitMergeParameters', + 'GitObject', + 'GitPolicyConfigurationResponse', + 'GitPullRequest', + 'GitPullRequestCommentThread', + 'GitPullRequestCommentThreadContext', + 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', + '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', + 'Change', + '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', +] diff --git a/azure-devops/azure/devops/v7_0/graph/__init__.py b/azure-devops/azure/devops/v7_0/graph/__init__.py new file mode 100644 index 00000000..ce784bbd --- /dev/null +++ b/azure-devops/azure/devops/v7_0/graph/__init__.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'Avatar', + 'GraphCachePolicies', + 'GraphDescriptorResult', + 'GraphFederatedProviderData', + 'GraphGroup', + 'GraphGroupCreationContext', + 'GraphMember', + 'GraphMembership', + 'GraphMembershipState', + 'GraphMembershipTraversal', + 'GraphProviderInfo', + 'GraphScope', + 'GraphScopeCreationContext', + 'GraphStorageKeyResult', + 'GraphSubject', + 'GraphSubjectBase', + 'GraphSubjectLookup', + 'GraphSubjectLookupKey', + 'GraphSubjectQuery', + 'GraphUser', + 'GraphUserCreationContext', + 'GraphUserUpdateContext', + 'JsonPatchOperation', + 'PagedGraphGroups', + 'PagedGraphUsers', + 'ReferenceLinks', + 'GraphClient' +] diff --git a/azure-devops/azure/devops/v7_0/graph/graph_client.py b/azure-devops/azure/devops/v7_0/graph/graph_client.py new file mode 100644 index 00000000..5af4fa59 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/graph/graph_client.py @@ -0,0 +1,447 @@ +# -------------------------------------------------------------------------------------------- +# 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 delete_avatar(self, subject_descriptor): + """DeleteAvatar. + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + self._send(http_method='DELETE', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values) + + def get_avatar(self, subject_descriptor, size=None, format=None): + """GetAvatar. + :param str subject_descriptor: + :param str size: + :param str format: + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + query_parameters = {} + if size is not None: + query_parameters['size'] = self._serialize.query('size', size, 'str') + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + response = self._send(http_method='GET', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Avatar', response) + + def set_avatar(self, avatar, subject_descriptor): + """SetAvatar. + :param :class:` ` avatar: + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + content = self._serialize.body(avatar, 'Avatar') + self._send(http_method='PUT', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + content=content) + + def get_descriptor(self, storage_key): + """GetDescriptor. + 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='7.0', + 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 Azure DevOps 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='7.0-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('GraphGroup', response) + + def delete_group(self, group_descriptor): + """DeleteGroup. + [Preview API] Removes an Azure DevOps 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='7.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='7.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='7.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 an Azure DevOps 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='7.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='7.0-preview.1', + route_values=route_values) + return self._deserialize('GraphMembership', response) + + 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='7.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='7.0-preview.1', + route_values=route_values) + + 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='7.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='7.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='7.0-preview.1', + route_values=route_values) + return self._deserialize('GraphMembershipState', response) + + def get_provider_info(self, user_descriptor): + """GetProviderInfo. + :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='7.0', + route_values=route_values) + return self._deserialize('GraphProviderInfo', response) + + def request_access(self, jsondocument): + """RequestAccess. + [Preview API] + :param :class:` ` jsondocument: + """ + content = self._serialize.body(jsondocument, 'object') + self._send(http_method='POST', + location_id='8d54bf92-8c99-47f2-9972-b21341f1722e', + version='7.0-preview.1', + content=content) + + def get_storage_key(self, subject_descriptor): + """GetStorageKey. + 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='7.0', + 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='7.0-preview.1', + content=content) + return self._deserialize('{GraphSubject}', self._unwrap_collection(response)) + + def query_subjects(self, subject_query): + """QuerySubjects. + [Preview API] Search for Azure Devops users, or/and groups. Results will be returned in a batch with no more than 100 graph subjects. + :param :class:` ` subject_query: The query that we'll be using to search includes the following: Query: the search term. The search will be prefix matching only. SubjectKind: "User" or "Group" can be specified, both or either ScopeDescriptor: Non-default scope can be specified, i.e. project scope descriptor + :rtype: [GraphSubject] + """ + content = self._serialize.body(subject_query, 'GraphSubjectQuery') + response = self._send(http_method='POST', + location_id='05942c89-006a-48ce-bb79-baeb8abf99c6', + version='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values) + return self._deserialize('GraphUser', response) + + def list_users(self, subject_types=None, continuation_token=None, scope_descriptor=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. + :param str scope_descriptor: Specify a non-default scope (collection, project) to search for users. + :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') + if scope_descriptor is not None: + query_parameters['scopeDescriptor'] = self._serialize.query('scope_descriptor', scope_descriptor, 'str') + response = self._send(http_method='GET', + location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', + version='7.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 + + def update_user(self, update_context, user_descriptor): + """UpdateUser. + [Preview API] Map an existing user to a different identity + :param :class:` ` update_context: The subset of the full graph user used to uniquely find the graph subject in an external provider. + :param str user_descriptor: the descriptor of the user to update + :rtype: :class:` ` + """ + route_values = {} + if user_descriptor is not None: + route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') + content = self._serialize.body(update_context, 'GraphUserUpdateContext') + response = self._send(http_method='PATCH', + location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', + version='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('GraphUser', response) + diff --git a/azure-devops/azure/devops/v7_0/graph/models.py b/azure-devops/azure/devops/v7_0/graph/models.py new file mode 100644 index 00000000..779004f2 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/graph/models.py @@ -0,0 +1,811 @@ +# -------------------------------------------------------------------------------------------- +# 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 Avatar(Model): + """ + :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 GraphCachePolicies(Model): + """ + :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): + """ + Subject descriptor of a Graph entity + + :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): + """ + Represents a set of data used to communicate with a federated provider on behalf of a particular user. + + :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 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'}, + 'provider_name': {'key': 'providerName', 'type': 'str'}, + 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'} + } + + def __init__(self, access_token=None, provider_name=None, subject_descriptor=None, version=None): + super(GraphFederatedProviderData, self).__init__() + self.access_token = access_token + self.provider_name = provider_name + self.subject_descriptor = subject_descriptor + self.version = version + + +class GraphGroupCreationContext(Model): + """ + Do not attempt to use this type to create a new group. This type does not contain sufficient fields to create a new group. + + :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): + """ + Relationship between a container and a member + + :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): + """ + Status of a Graph membership (active/inactive) + + :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): + """ + :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): + """ + Who is the provider for this user and what is the identifier and domain that is used to uniquely identify the user. + + :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): + """ + This type is the subset of fields that can be provided by the user to create a Vsts scope. Scope creation is currently limited to internal back-compat scenarios. End users that attempt to create a scope with this API will fail. + + :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): + """ + Storage key of a Graph entity + + :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): + """ + :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): + """ + Batching of subjects to lookup using the Graph API + + :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): + """ + :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 GraphSubjectQuery(Model): + """ + Subject to search using the Graph API + + :param query: Search term to search for Azure Devops users or/and groups + :type query: str + :param scope_descriptor: Optional parameter. Specify a non-default scope (collection, project) to search for users or groups within the scope. + :type scope_descriptor: :class:`str ` + :param subject_kind: "User" or "Group" can be specified, both or either + :type subject_kind: list of str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'scope_descriptor': {'key': 'scopeDescriptor', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': '[str]'} + } + + def __init__(self, query=None, scope_descriptor=None, subject_kind=None): + super(GraphSubjectQuery, self).__init__() + self.query = query + self.scope_descriptor = scope_descriptor + self.subject_kind = subject_kind + + +class GraphUserCreationContext(Model): + """ + Do not attempt to use this type to create a new user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user. + + :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 GraphUserUpdateContext(Model): + """ + Do not attempt to use this type to update user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user. + + :param storage_key: Storage key should not be specified in case of updating user + :type storage_key: str + """ + + _attribute_map = { + 'storage_key': {'key': 'storageKey', 'type': 'str'} + } + + def __init__(self, storage_key=None): + super(GraphUserUpdateContext, self).__init__() + self.storage_key = storage_key + + +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 PagedGraphGroups(Model): + """ + :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): + """ + :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): + """ + 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 GraphSubject(GraphSubjectBase): + """ + Top-level graph entity + + :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): + """ + :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): + """ + Container where a graph entity is defined (organization, project, team) + + :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): + """ + Graph user entity + + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=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.directory_alias = directory_alias + self.is_deleted_in_origin = is_deleted_in_origin + self.metadata_update_date = metadata_update_date + self.meta_type = meta_type + + +class GraphGroup(GraphMember): + """ + Graph group entity + + :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__ = [ + 'Avatar', + 'GraphCachePolicies', + 'GraphDescriptorResult', + 'GraphFederatedProviderData', + 'GraphGroupCreationContext', + 'GraphMembership', + 'GraphMembershipState', + 'GraphMembershipTraversal', + 'GraphProviderInfo', + 'GraphScopeCreationContext', + 'GraphStorageKeyResult', + 'GraphSubjectBase', + 'GraphSubjectLookup', + 'GraphSubjectLookupKey', + 'GraphSubjectQuery', + 'GraphUserCreationContext', + 'GraphUserUpdateContext', + 'JsonPatchOperation', + 'PagedGraphGroups', + 'PagedGraphUsers', + 'ReferenceLinks', + 'GraphSubject', + 'GraphMember', + 'GraphScope', + 'GraphUser', + 'GraphGroup', +] diff --git a/azure-devops/azure/devops/v7_0/identity/__init__.py b/azure-devops/azure/devops/v7_0/identity/__init__.py new file mode 100644 index 00000000..4b0c102e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/identity/__init__.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'CreateScopeInfo', + 'FrameworkIdentityInfo', + 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', + 'Identity', + 'IdentityBase', + 'IdentityBatchInfo', + 'IdentityRightsTransferData', + 'IdentityScope', + 'IdentitySelf', + 'IdentitySnapshot', + 'IdentityUpdateData', + 'JsonPatchOperation', + 'JsonWebToken', + 'PagedIdentities', + 'RefreshTokenGrant', + 'SwapIdentityInfo', + 'TenantInfo', + 'IdentityClient' +] diff --git a/azure-devops/azure/devops/v7_0/identity/identity_client.py b/azure-devops/azure/devops/v7_0/identity/identity_client.py new file mode 100644 index 00000000..492dd560 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/identity/identity_client.py @@ -0,0 +1,601 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, social_descriptors=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): + """ReadIdentities. + Resolve legacy identity information for use with older APIs such as the Security APIs + :param str descriptors: A comma separated list of identity descriptors to resolve + :param str identity_ids: A comma seperated list of storage keys to resolve + :param str subject_descriptors: A comma seperated list of subject descriptors to resolve + :param str social_descriptors: + :param str search_filter: The type of search to perform. Values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups). + :param str filter_value: The search value, as specified by the searchFilter. + :param str query_membership: The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only) + :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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Identity', response) + + def update_identities(self, identities, allow_meta_data_update=None): + """UpdateIdentities. + :param :class:` ` identities: + :param bool allow_meta_data_update: + :rtype: [IdentityUpdateData] + """ + query_parameters = {} + if allow_meta_data_update is not None: + query_parameters['allowMetaDataUpdate'] = self._serialize.query('allow_meta_data_update', allow_meta_data_update, 'bool') + content = self._serialize.body(identities, 'VssJsonCollectionWrapper') + response = self._send(http_method='PUT', + location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', + version='7.0', + query_parameters=query_parameters, + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values) + return self._deserialize('bool', response) + + def force_remove_member(self, container_id, member_id, force_remove): + """ForceRemoveMember. + [Preview API] + :param str container_id: + :param str member_id: + :param bool force_remove: + :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') + query_parameters = {} + if force_remove is not None: + query_parameters['forceRemove'] = self._serialize.query('force_remove', force_remove, 'bool') + response = self._send(http_method='DELETE', + location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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='7.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='7.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='7.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='7.0-preview.2', + 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='7.0-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def refresh_members_of(self, member_id, query_membership=None): + """RefreshMembersOf. + [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='POST', + location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', + version='7.0-preview.2', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values) + return self._deserialize('TenantInfo', response) + diff --git a/azure-devops/azure/devops/v7_0/identity/models.py b/azure-devops/azure/devops/v7_0/identity/models.py new file mode 100644 index 00000000..2c3926af --- /dev/null +++ b/azure-devops/azure/devops/v7_0/identity/models.py @@ -0,0 +1,702 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 is_first_party_client: + :type is_first_party_client: bool + :param refresh_token: + :type refresh_token: :class:`RefreshTokenGrant ` + :param scope: + :type scope: str + :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'}, + 'is_first_party_client': {'key': 'isFirstPartyClient', 'type': 'bool'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'RefreshTokenGrant'}, + 'scope': {'key': 'scope', 'type': 'str'}, + '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, is_first_party_client=None, refresh_token=None, scope=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.is_first_party_client = is_first_party_client + self.refresh_token = refresh_token + self.scope = scope + self.token_type = token_type + self.valid_to = valid_to + + +class AuthorizationGrant(Model): + """ + :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 CreateScopeInfo(Model): + """ + :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): + """ + :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): + """ + :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 ChangedIdentities(Model): + """ + Container class for changed identities + + :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): + """ + Context class for changed identities + + :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 IdentityBase(Model): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class IdentityBatchInfo(Model): + """ + :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 social_descriptors: + :type social_descriptors: list of :class:`str ` + :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'}, + 'social_descriptors': {'key': 'socialDescriptors', 'type': '[str]'}, + 'subject_descriptors': {'key': 'subjectDescriptors', 'type': '[str]'} + } + + def __init__(self, descriptors=None, identity_ids=None, include_restricted_visibility=None, property_names=None, query_membership=None, social_descriptors=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.social_descriptors = social_descriptors + self.subject_descriptors = subject_descriptors + + +class IdentityRightsTransferData(Model): + """ + :param user_principal_name_mappings: + :type user_principal_name_mappings: dict + """ + + _attribute_map = { + 'user_principal_name_mappings': {'key': 'userPrincipalNameMappings', 'type': '{str}'} + } + + def __init__(self, user_principal_name_mappings=None): + super(IdentityRightsTransferData, self).__init__() + self.user_principal_name_mappings = user_principal_name_mappings + + +class IdentityScope(Model): + """ + :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): + """ + Identity information. + + :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): + """ + :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): + """ + :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): + """ + 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 JsonWebToken(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(JsonWebToken, self).__init__() + + +class PagedIdentities(Model): + """ + :param continuation_token: + :type continuation_token: list of str + :param identities: + :type identities: list of :class:`Identity ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, + 'identities': {'key': 'identities', 'type': '[Identity]'} + } + + def __init__(self, continuation_token=None, identities=None): + super(PagedIdentities, self).__init__() + self.continuation_token = continuation_token + self.identities = identities + + +class RefreshTokenGrant(AuthorizationGrant): + """ + :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): + """ + :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): + """ + :param home_tenant: + :type home_tenant: bool + :param tenant_id: + :type tenant_id: str + :param tenant_name: + :type tenant_name: str + :param verified_domains: + :type verified_domains: list of str + """ + + _attribute_map = { + 'home_tenant': {'key': 'homeTenant', 'type': 'bool'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_name': {'key': 'tenantName', 'type': 'str'}, + 'verified_domains': {'key': 'verifiedDomains', 'type': '[str]'} + } + + def __init__(self, home_tenant=None, tenant_id=None, tenant_name=None, verified_domains=None): + super(TenantInfo, self).__init__() + self.home_tenant = home_tenant + self.tenant_id = tenant_id + self.tenant_name = tenant_name + self.verified_domains = verified_domains + + +class Identity(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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +__all__ = [ + 'AccessTokenResult', + 'AuthorizationGrant', + 'CreateScopeInfo', + 'FrameworkIdentityInfo', + 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', + 'IdentityBase', + 'IdentityBatchInfo', + 'IdentityRightsTransferData', + 'IdentityScope', + 'IdentitySelf', + 'IdentitySnapshot', + 'IdentityUpdateData', + 'JsonPatchOperation', + 'JsonWebToken', + 'PagedIdentities', + 'RefreshTokenGrant', + 'SwapIdentityInfo', + 'TenantInfo', + 'Identity', +] diff --git a/azure-devops/azure/devops/v7_0/location/__init__.py b/azure-devops/azure/devops/v7_0/location/__init__.py new file mode 100644 index 00000000..37761f5d --- /dev/null +++ b/azure-devops/azure/devops/v7_0/location/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/location/location_client.py b/azure-devops/azure/devops/v7_0/location/location_client.py new file mode 100644 index 00000000..053e0087 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/location/location_client.py @@ -0,0 +1,192 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_0/location/models.py b/azure-devops/azure/devops/v7_0/location/models.py new file mode 100644 index 00000000..aadbe408 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/location/models.py @@ -0,0 +1,403 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + Data transfer class that holds information needed to set up a connection with a VSS server. + + :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): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class LocationMapping(Model): + """ + :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): + """ + Data transfer class used to transfer data about the location service data over the web service. + + :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): + """ + :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): + """ + :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): + """ + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +__all__ = [ + 'AccessMapping', + 'ConnectionData', + 'IdentityBase', + 'LocationMapping', + 'LocationServiceData', + 'ResourceAreaInfo', + 'ServiceDefinition', + 'Identity', +] diff --git a/azure-devops/azure/devops/v7_0/maven/__init__.py b/azure-devops/azure/devops/v7_0/maven/__init__.py new file mode 100644 index 00000000..fd366dbf --- /dev/null +++ b/azure-devops/azure/devops/v7_0/maven/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'JsonPatchOperation', + 'MavenDistributionManagement', + 'MavenMinimalPackageDetails', + 'MavenPackage', + 'MavenPackagesBatchRequest', + 'MavenPackageVersionDeletionState', + 'MavenPomBuild', + 'MavenPomCi', + 'MavenPomCiNotifier', + 'MavenPomDependency', + 'MavenPomDependencyManagement', + 'MavenPomGav', + 'MavenPomIssueManagement', + 'MavenPomLicense', + 'MavenPomMailingList', + 'MavenPomMetadata', + 'MavenPomOrganization', + 'MavenPomParent', + 'MavenPomPerson', + 'MavenPomScm', + 'MavenRecycleBinPackageVersionDetails', + 'MavenRepository', + 'MavenSnapshotRepository', + 'Package', + 'PackageVersionDetails', + 'Plugin', + 'PluginConfiguration', + 'ReferenceLink', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'MavenClient' +] diff --git a/azure-devops/azure/devops/v7_0/maven/maven_client.py b/azure-devops/azure/devops/v7_0/maven/maven_client.py new file mode 100644 index 00000000..451285b6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/maven/maven_client.py @@ -0,0 +1,314 @@ +# -------------------------------------------------------------------------------------------- +# 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 download_package(self, feed_id, group_id, artifact_id, version, file_name, project=None, **kwargs): + """DownloadPackage. + [Preview API] Fulfills Maven package file download requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem), returning the content as a stream. + :param str feed_id: Name or ID of the feed. + :param str group_id: GroupId of the maven package + :param str artifact_id: ArtifactId of the maven package + :param str version: Version of the package + :param str file_name: File name to download + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, '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') + 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='c338d4b5-d30a-47e2-95b7-f157ef558833', + version='7.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_package_versions(self, batch_request, feed_id, project=None): + """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: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'MavenPackagesBatchRequest') + self._send(http_method='POST', + location_id='b7c586b0-d947-4d35-811a-f1161de80e6c', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_packages(self, batch_request, feed, project=None): + """UpdateRecycleBinPackages. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. + :param str feed: + :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 feed is not None: + route_values['feed'] = self._serialize.url('feed', feed, 'str') + content = self._serialize.body(batch_request, 'MavenPackagesBatchRequest') + self._send(http_method='POST', + location_id='5dd6f547-c76f-4d9d-b2ec-4720feda641f', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed, group_id, artifact_id, version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed, group_id, artifact_id, version, project=None): + """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. + :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 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed, group_id, artifact_id, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of a package within the context of a feed + :param str feed: The name or id of the feed + :param str group_id: The group id of the package + :param str artifact_id: The artifact id of the package + :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 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') + response = self._send(http_method='GET', + location_id='fba7ba8c-d1f5-4aeb-8f5d-f017a7d5e719', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed, group_id, artifact_id, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a package within the context of a feed + :param str feed: The name or id of the feed + :param str group_id: + :param str artifact_id: + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='fba7ba8c-d1f5-4aeb-8f5d-f017a7d5e719', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def get_package_version(self, feed, group_id, artifact_id, version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted packages. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + + def update_package_version(self, package_version_details, feed, group_id, artifact_id, version, project=None): + """UpdatePackageVersion. + [Preview API] Update state for a package version. + :param :class:` ` package_version_details: Details to be updated. + :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 str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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, 'PackageVersionDetails') + self._send(http_method='PATCH', + location_id='180ed967-377a-4112-986b-607adb14ded4', + version='7.0-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/maven/models.py b/azure-devops/azure/devops/v7_0/maven/models.py new file mode 100644 index 00000000..a8f42350 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/maven/models.py @@ -0,0 +1,906 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MavenDistributionManagement(Model): + """ + :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): + """ + Identifies a particular Maven package version + + :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): + """ + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a maven package. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 version metadata for a Maven 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): + """ + :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 Plugin(MavenPomGav): + """ + :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): + """ + :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): + """ + The class to represent a REST reference link. RFC: http://tools.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them. + + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class MavenPomDependency(MavenPomGav): + """ + :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): + """ + :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', + 'JsonPatchOperation', + 'MavenDistributionManagement', + 'MavenMinimalPackageDetails', + 'MavenPackage', + 'MavenPackagesBatchRequest', + 'MavenPackageVersionDeletionState', + 'MavenPomBuild', + 'MavenPomCi', + 'MavenPomCiNotifier', + 'MavenPomDependencyManagement', + 'MavenPomGav', + 'MavenPomIssueManagement', + 'MavenPomMailingList', + 'MavenPomMetadata', + 'MavenPomOrganization', + 'MavenPomParent', + 'MavenPomPerson', + 'MavenPomScm', + 'MavenRecycleBinPackageVersionDetails', + 'MavenRepository', + 'MavenSnapshotRepository', + 'Package', + 'PackageVersionDetails', + 'Plugin', + 'PluginConfiguration', + 'ReferenceLink', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'MavenPomDependency', + 'MavenPomLicense', +] diff --git a/azure-devops/azure/devops/v7_0/member_entitlement_management/__init__.py b/azure-devops/azure/devops/v7_0/member_entitlement_management/__init__.py new file mode 100644 index 00000000..ebe2a1f5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/member_entitlement_management/__init__.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/member_entitlement_management/member_entitlement_management_client.py b/azure-devops/azure/devops/v7_0/member_entitlement_management/member_entitlement_management_client.py new file mode 100644 index 00000000..1853865b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/member_entitlement_management/member_entitlement_management_client.py @@ -0,0 +1,290 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlement(self, group_id): + """GetGroupEntitlement. + 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='7.0', + route_values=route_values) + return self._deserialize('GroupEntitlement', response) + + def update_group_entitlement(self, document, group_id, rule_option=None): + """UpdateGroupEntitlement. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlements(self): + """GetGroupEntitlements. + Get the group entitlements for an account. + :rtype: [GroupEntitlement] + """ + response = self._send(http_method='GET', + location_id='9bce1f43-2629-419f-8f6c-7503be58a4f3', + version='7.0') + return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) + + def add_member_to_group(self, group_id, member_id): + """AddMemberToGroup. + 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='7.0', + route_values=route_values) + + def get_group_members(self, group_id, max_results=None, paging_token=None): + """GetGroupMembers. + 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 beginning 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PagedGraphMemberList', response) + + def remove_member_from_group(self, group_id, member_id): + """RemoveMemberFromGroup. + 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='7.0', + route_values=route_values) + + def add_user_entitlement(self, user_entitlement): + """AddUserEntitlement. + 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='7.0', + content=content) + return self._deserialize('UserEntitlementsPostResponse', response) + + def search_user_entitlements(self, continuation_token=None, select=None, filter=None, order_by=None): + """SearchUserEntitlements. + Get a paged set of user entitlements matching the filter and sort criteria built with properties that match the select input. + :param str continuation_token: Continuation token for getting the next page of data set. If null is passed, gets the first page. + :param str select: Comma (",") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'. + :param str filter: Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with "test" in email or displayname is "name eq 'test'". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'. + :param str order_by: PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name + :rtype: :class:` ` + """ + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') + if order_by is not None: + query_parameters['$orderBy'] = self._serialize.query('order_by', order_by, 'str') + response = self._send(http_method='GET', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('PagedGraphMemberList', response) + + def update_user_entitlements(self, document, do_not_send_invite_for_new_users=None): + """UpdateUserEntitlements. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_user_entitlement(self, user_id): + """GetUserEntitlement. + 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='7.0', + route_values=route_values) + return self._deserialize('UserEntitlement', response) + + def update_user_entitlement(self, document, user_id): + """UpdateUserEntitlement. + 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='7.0', + 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. + 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, 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='7.0', + query_parameters=query_parameters) + return self._deserialize('UsersSummary', response) + diff --git a/azure-devops/azure/devops/v7_0/member_entitlement_management/models.py b/azure-devops/azure/devops/v7_0/member_entitlement_management/models.py new file mode 100644 index 00000000..518392d0 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/member_entitlement_management/models.py @@ -0,0 +1,1253 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + License assigned to a user + + :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): + """ + :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): + """ + An extension assigned to a user + + :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): + """ + :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): + """ + Project Group (e.g. Contributor, Reader etc.) + + :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): + """ + A group entity with additional properties including its license, extensions, and project membership + + :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): + """ + :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): + """ + Group option to add a user to + + :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): + """ + 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 MemberEntitlementsResponseBase(Model): + """ + :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): + """ + Reference for an async 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 + """ + + _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): + """ + :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): + """ + :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): + """ + Relation between a project and the user's effective permissions in that project. + + :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: [Deprecated] Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership. + :type is_project_permission_inherited: bool + :param project_permission_inherited: Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership. + :type project_permission_inherited: object + :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_permission_inherited': {'key': 'projectPermissionInherited', 'type': 'object'}, + '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_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_permission_inherited = project_permission_inherited + self.project_ref = project_ref + self.team_refs = team_refs + + +class ProjectRef(Model): + """ + A reference to a project + + :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): + """ + 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 SummaryData(Model): + """ + :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): + """ + A reference to a team + + :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): + """ + A user entity with additional properties including their license, extensions, and project membership + + :param access_level: User's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the user was added to the collection. + :type date_created: datetime + :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'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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, date_created=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.date_created = date_created + 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): + """ + :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): + """ + :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': '[{ key: int; value: str }]'}, + '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): + """ + :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): + """ + Summary of licenses and extensions assigned to users in the organization + + :param available_access_levels: Available Access Levels + :type available_access_levels: list of :class:`AccessLevel ` + :param default_access_level: Default Access Level + :type default_access_level: :class:`AccessLevel ` + :param extensions: Summary of Extensions in the organization + :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 organization + :type licenses: list of :class:`LicenseSummaryData ` + :param project_refs: Summary of Projects in the organization + :type project_refs: list of :class:`ProjectRef ` + """ + + _attribute_map = { + 'available_access_levels': {'key': 'availableAccessLevels', 'type': '[AccessLevel]'}, + 'default_access_level': {'key': 'defaultAccessLevel', '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, default_access_level=None, extensions=None, group_options=None, licenses=None, project_refs=None): + super(UsersSummary, self).__init__() + self.available_access_levels = available_access_levels + self.default_access_level = default_access_level + self.extensions = extensions + self.group_options = group_options + self.licenses = licenses + self.project_refs = project_refs + + +class ExtensionSummaryData(SummaryData): + """ + Summary of Extensions in the organization. + + :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): + """ + Top-level graph entity + + :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): + """ + :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): + """ + Summary of Licenses in the organization. + + :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): + """ + Deprecated: Use UserEntitlement instead + + :param access_level: User's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the user was added to the collection. + :type date_created: datetime + :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'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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, date_created=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, date_created=date_created, 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): + """ + :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): + """ + :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): + """ + :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): + """ + A page of users + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Graph user entity + + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=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.directory_alias = directory_alias + self.is_deleted_in_origin = is_deleted_in_origin + self.metadata_update_date = metadata_update_date + self.meta_type = meta_type + + +class GraphGroup(GraphMember): + """ + Graph group entity + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/notification/__init__.py b/azure-devops/azure/devops/v7_0/notification/__init__.py new file mode 100644 index 00000000..9a25d3d0 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/notification/__init__.py @@ -0,0 +1,76 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ISubscriptionFilter', + 'ISubscriptionChannel', + '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', + 'SubscriptionDiagnostics', + 'SubscriptionEvaluationRequest', + 'SubscriptionEvaluationResult', + 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', + 'SubscriptionManagement', + 'SubscriptionQuery', + 'SubscriptionQueryCondition', + 'SubscriptionScope', + 'SubscriptionTracing', + 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'ValueDefinition', + 'VssNotificationEvent', + 'NotificationClient' +] diff --git a/azure-devops/azure/devops/v7_0/notification/models.py b/azure-devops/azure/devops/v7_0/notification/models.py new file mode 100644 index 00000000..3449b8c4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/notification/models.py @@ -0,0 +1,1784 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + Defines an "actor" for an event. + + :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): + """ + Defines a scope for an event. + + :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): + """ + Encapsulates events result properties. It defines the total number of events used and the number of matched events. + + :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): + """ + A transform request specify the properties of a notification event to be transformed. + + :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): + """ + Result of transforming a notification event. + + :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): + """ + Subscription Filter Clause represents a single clause in a subscription filter e.g. If the subscription has the following criteria "Project Name = [Current Project] AND Assigned To = [Me] it will be represented as two Filter Clauses Clause 1: Index = 1, Logical Operator: NULL , FieldName = 'Project Name', Operator = '=', Value = '[Current Project]' Clause 2: Index = 2, Logical Operator: 'AND' , FieldName = 'Assigned To' , Operator = '=', Value = '[Me]' + + :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): + """ + Represents a hierarchy of SubscritionFilterClauses that have been grouped together through either adding a group in the WebUI or using parethesis in the Subscription condition string + + :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): + """ + :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): + """ + :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 INotificationDiagnosticLog(Model): + """ + Abstraction interface for the diagnostic log. Primarily for deserialization. + + :param activity_id: Identifier used for correlating to other diagnostics that may have been recorded elsewhere. + :type activity_id: str + :param description: Description of what subscription or notification job is being logged. + :type description: str + :param end_time: Time the log ended. + :type end_time: datetime + :param id: Unique instance identifier. + :type id: str + :param log_type: Type of information being logged. + :type log_type: str + :param messages: List of log messages. + :type messages: list of :class:`NotificationDiagnosticLogMessage ` + :param properties: Dictionary of log properties and settings for the job. + :type properties: dict + :param source: This identifier depends on the logType. For notification jobs, this will be the job Id. For subscription tracing, this will be a special root Guid with the subscription Id encoded. + :type source: str + :param start_time: Time the log started. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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 ISubscriptionFilter(Model): + """ + :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 ISubscriptionChannel(Model): + """ + :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 NotificationAdminSettings(Model): + """ + :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): + """ + :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): + """ + :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): + """ + Encapsulates the properties of a filterable field. A filterable field is a field in an event that can used to filter notifications for a certain event type. + + :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): + """ + Encapsulates the properties of a field type. It includes a unique id for the operator and a localized string for display name + + :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): + """ + Encapsulates the properties of a field type. It describes the data type of a field, the operators it support and how to populate it in the UI + + :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): + """ + Encapsulates the properties of a notification event publisher. + + :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): + """ + Encapsulates the properties of an event role. An event Role is used for role based subscription for example for a buildCompletedEvent, one role is request by field + + :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): + """ + Encapsulates the properties of an event type. It defines the fields, that can be used for filtering, for that event type. + + :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): + """ + Encapsulates the properties of a category. A category will be used by the UI to group event types + + :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): + """ + :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): + """ + :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): + """ + Encapsulates notifications result properties. It defines the number of notifications and the recipients of notifications. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + A subscriber is a user or group that has the potential to receive notifications. + + :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): + """ + Updates to a subscriber. Typically used to change (or set) a preferred email address or default delivery preference. + + :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): + """ + A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. + + :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 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 channel: Channel for delivering notifications triggered by the subscription. + :type channel: :class:`ISubscriptionChannel ` + :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'}, + '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'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + '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, description=None, diagnostics=None, extended_properties=None, filter=None, flags=None, channel=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.description = description + self.diagnostics = diagnostics + self.extended_properties = extended_properties + self.filter = filter + self.flags = flags + self.channel = channel + 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): + """ + Parameters for creating a new subscription. A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. + + :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 channel: Channel for delivering notifications triggered by the new subscription. + :type channel: :class:`ISubscriptionChannel ` + :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 = { + 'description': {'key': 'description', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + 'scope': {'key': 'scope', 'type': 'SubscriptionScope'}, + 'subscriber': {'key': 'subscriber', 'type': 'IdentityRef'} + } + + def __init__(self, description=None, filter=None, channel=None, scope=None, subscriber=None): + super(NotificationSubscriptionCreateParameters, self).__init__() + self.description = description + self.filter = filter + self.channel = channel + self.scope = scope + self.subscriber = subscriber + + +class NotificationSubscriptionTemplate(Model): + """ + :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): + """ + Parameters for updating an existing subscription. A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. Note: only the fields to be updated should be set. + + :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 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 channel: Channel for delivering notifications triggered by the subscription. + :type channel: :class:`ISubscriptionChannel ` + :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'}, + 'description': {'key': 'description', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + '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, description=None, filter=None, channel=None, scope=None, status=None, status_message=None, user_settings=None): + super(NotificationSubscriptionUpdateParameters, self).__init__() + self.admin_settings = admin_settings + self.description = description + self.filter = filter + self.channel = channel + self.scope = scope + self.status = status + self.status_message = status_message + self.user_settings = user_settings + + +class OperatorConstraint(Model): + """ + Encapsulates the properties of an operator constraint. An operator constraint defines if some operator is available only for specific scope like a project scope. + + :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): + """ + 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 SubscriptionAdminSettings(Model): + """ + Admin-managed settings for a group subscription. + + :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 SubscriptionDiagnostics(Model): + """ + Contains all the diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`SubscriptionTracing ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`SubscriptionTracing ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Encapsulates the properties of a SubscriptionEvaluationRequest. It defines the subscription to be evaluated and time interval for events used in evaluation. + + :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): + """ + Encapsulates the subscription evaluation results. It defines the Date Interval that was used, number of events evaluated and events and notifications results + + :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): + """ + Encapsulates the subscription evaluation settings needed for the UI + + :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 SubscriptionChannelWithAddress(Model): + """ + :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 SubscriptionManagement(Model): + """ + Encapsulates the properties needed to manage subscriptions, opt in and out of subscriptions. + + :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): + """ + Notification subscriptions query input. + + :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): + """ + Conditions a subscription must match to qualify for the query result set. Not all fields are required. A subscription must match all conditions specified in order to qualify for the result set. + + :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): + """ + A resource, typically an account or project, in which events are published from. + + :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): + """ + Data controlling a single diagnostic setting for a subscription. + + :param enabled: Indicates whether the diagnostic tracing is enabled or not. + :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): + """ + User-managed settings for a group subscription. + + :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): + """ + Parameters to update diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Parameters to update a specific diagnostic setting. + + :param enabled: Indicates whether to enable to disable the diagnostic tracing. + :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): + """ + Encapsulates the properties of a field value definition. It has the information needed to retrieve the list of possible values for a certain field and how to handle that field values in the UI. This information includes what type of object this value represents, which property to use for UI display and which property to use for saving the subscription + + :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): + """ + This is the type used for firing notifications intended for the subsystem in the Notifications SDK. For components that can't take a dependency on the Notifications SDK directly, they can use ITeamFoundationEventService.PublishNotification and the Notifications SDK ISubscriber implementation will get it. + + :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): + """ + Artifact filter options. Used in "follow" subscriptions. + + :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): + """ + :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): + """ + :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', + 'ISubscriptionFilter', + 'ISubscriptionChannel', + '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', + 'SubscriptionDiagnostics', + 'SubscriptionEvaluationRequest', + 'SubscriptionEvaluationResult', + 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', + 'SubscriptionManagement', + 'SubscriptionQuery', + 'SubscriptionQueryCondition', + 'SubscriptionScope', + 'SubscriptionTracing', + 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'ValueDefinition', + 'VssNotificationEvent', + 'ArtifactFilter', + 'FieldInputValues', + 'FieldValuesQuery', +] diff --git a/azure-devops/azure/devops/v7_0/notification/notification_client.py b/azure-devops/azure/devops/v7_0/notification/notification_client.py new file mode 100644 index 00000000..fd44a96e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/notification/notification_client.py @@ -0,0 +1,300 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0') + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0') + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionUserSettings', response) + diff --git a/azure-devops/azure/devops/v7_0/npm/__init__.py b/azure-devops/azure/devops/v7_0/npm/__init__.py new file mode 100644 index 00000000..c9a2655f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/npm/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NpmClient' +] diff --git a/azure-devops/azure/devops/v7_0/npm/models.py b/azure-devops/azure/devops/v7_0/npm/models.py new file mode 100644 index 00000000..3bf71816 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/npm/models.py @@ -0,0 +1,301 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of an npm package. + + :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): + """ + :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 version metadata for an npm 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): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class BatchDeprecateData(BatchOperationData): + """ + Data required to deprecate multiple package versions. Pass this while performing NpmBatchOperationTypes.Deprecate batch operation. + + :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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'BatchDeprecateData', +] diff --git a/azure-devops/azure/devops/v7_0/npm/npm_client.py b/azure-devops/azure/devops/v7_0/npm/npm_client.py new file mode 100644 index 00000000..a700639c --- /dev/null +++ b/azure-devops/azure/devops/v7_0/npm/npm_client.py @@ -0,0 +1,586 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """GetContentScopedPackage. + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :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 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='7.0', + 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, project=None, **kwargs): + """GetContentUnscopedPackage. + 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. + :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 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='7.0', + 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, project=None): + """UpdatePackages. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def get_readme_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None, **kwargs): + """GetReadmeScopedPackage. + 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. + :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 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='7.0', + 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, project=None, **kwargs): + """GetReadmeUnscopedPackage. + 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. + :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 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='7.0', + 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 update_recycle_bin_packages(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackages. + Delete or restore several package versions from the recycle bin. + :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. + :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 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='eefe03ef-a6a2-4a7a-a0ec-2e65a5efd64c', + version='7.0', + route_values=route_values, + content=content) + + def delete_scoped_package_version_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """DeleteScopedPackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values) + + def get_scoped_package_version_metadata_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageVersionMetadataFromRecycleBin. + 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. + :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 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='7.0', + 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, project=None): + """RestoreScopedPackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """DeletePackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """GetPackageVersionMetadataFromRecycleBin. + 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. + :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 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='7.0', + 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, project=None): + """RestorePackageVersionFromRecycleBin. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + + def get_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, project=None): + """GetScopedUpstreamingBehavior. + Get the upstreaming behavior of the (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :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 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') + response = self._send(http_method='GET', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, behavior, project=None): + """SetScopedUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of the (unscoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values, + content=content) + + def get_scoped_package_info(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageInfo. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """UnpublishScopedPackage. + 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. + :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 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='7.0', + 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, project=None): + """UpdateScopedPackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + + def get_package_info(self, feed_id, package_name, package_version, project=None): + """GetPackageInfo. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_package(self, feed_id, package_name, package_version, project=None): + """UnpublishPackage. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def update_package(self, package_version_details, feed_id, package_name, package_version, project=None): + """UpdatePackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_name: + :param str package_version: + :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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + diff --git a/azure-devops/azure/devops/v7_0/nuget/__init__.py b/azure-devops/azure/devops/v7_0/nuget/__init__.py new file mode 100644 index 00000000..5c8bf666 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/nuget/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NuGetClient' +] diff --git a/azure-devops/azure/devops/v7_0/nuget/models.py b/azure-devops/azure/devops/v7_0/nuget/models.py new file mode 100644 index 00000000..98fb8ac8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/nuget/models.py @@ -0,0 +1,297 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a NuGet package. + + :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): + """ + :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 version metadata for a NuGet 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): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class BatchListData(BatchOperationData): + """ + Data required to unlist or relist multiple package versions. Pass this while performing NuGetBatchOperationTypes.List batch operation. + + :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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'BatchListData', +] diff --git a/azure-devops/azure/devops/v7_0/nuget/nuget_client.py b/azure-devops/azure/devops/v7_0/nuget/nuget_client.py new file mode 100644 index 00000000..6ecb0cde --- /dev/null +++ b/azure-devops/azure/devops/v7_0/nuget/nuget_client.py @@ -0,0 +1,291 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, source_protocol_version=None, **kwargs): + """DownloadPackage. + [Preview API] Download a package version directly. + :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 project: Project ID or project name + :param str source_protocol_version: Unused + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Name or ID of the feed. + :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 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='6479ac16-32f4-40f7-aa96-9414de861352', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """DeletePackageVersion. + 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. + :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 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='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, show_deleted=None): + """GetPackageVersion. + 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 str project: Project ID or project name + :param bool show_deleted: True to include deleted packages in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.0', + 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, project=None): + """UpdatePackageVersion. + 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. + :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 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='7.0', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/operations/__init__.py b/azure-devops/azure/devops/v7_0/operations/__init__.py new file mode 100644 index 00000000..cd7611eb --- /dev/null +++ b/azure-devops/azure/devops/v7_0/operations/__init__.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/operations/models.py b/azure-devops/azure/devops/v7_0/operations/models.py new file mode 100644 index 00000000..5df3e331 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/operations/models.py @@ -0,0 +1,119 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Reference for an async 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 + """ + + _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): + """ + :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): + """ + 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 Operation(OperationReference): + """ + Contains information about the progress or result of an async 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', +] diff --git a/azure-devops/azure/devops/v7_0/operations/operations_client.py b/azure-devops/azure/devops/v7_0/operations/operations_client.py new file mode 100644 index 00000000..34c69668 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/operations/operations_client.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Operation', response) + diff --git a/azure-devops/azure/devops/v7_0/pipeline_permissions/__init__.py b/azure-devops/azure/devops/v7_0/pipeline_permissions/__init__.py new file mode 100644 index 00000000..7d3014fa --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipeline_permissions/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipeline_permissions_client import PipelinePermissionsClient + +__all__ = [ + 'GraphSubjectBase', + 'IdentityRef', + 'Permission', + 'PipelinePermission', + 'ReferenceLinks', + 'Resource', + 'ResourcePipelinePermissions', + 'PipelinePermissionsClient' +] diff --git a/azure-devops/azure/devops/v7_0/pipeline_permissions/models.py b/azure-devops/azure/devops/v7_0/pipeline_permissions/models.py new file mode 100644 index 00000000..e82fa882 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipeline_permissions/models.py @@ -0,0 +1,216 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 Permission(Model): + """ + :param authorized: + :type authorized: bool + :param authorized_by: + :type authorized_by: :class:`IdentityRef ` + :param authorized_on: + :type authorized_on: datetime + """ + + _attribute_map = { + 'authorized': {'key': 'authorized', 'type': 'bool'}, + 'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'}, + 'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'} + } + + def __init__(self, authorized=None, authorized_by=None, authorized_on=None): + super(Permission, self).__init__() + self.authorized = authorized + self.authorized_by = authorized_by + self.authorized_on = authorized_on + + +class PipelinePermission(Permission): + """ + :param authorized: + :type authorized: bool + :param authorized_by: + :type authorized_by: :class:`IdentityRef ` + :param authorized_on: + :type authorized_on: datetime + :param id: + :type id: int + """ + + _attribute_map = { + 'authorized': {'key': 'authorized', 'type': 'bool'}, + 'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'}, + 'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, authorized=None, authorized_by=None, authorized_on=None, id=None): + super(PipelinePermission, self).__init__(authorized=authorized, authorized_by=authorized_by, authorized_on=authorized_on) + self.id = id + + +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 Resource(Model): + """ + :param id: Id of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :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(Resource, self).__init__() + self.id = id + self.name = name + self.type = type + + +class ResourcePipelinePermissions(Model): + """ + :param all_pipelines: + :type all_pipelines: :class:`Permission ` + :param pipelines: + :type pipelines: list of :class:`PipelinePermission ` + :param resource: + :type resource: :class:`Resource ` + """ + + _attribute_map = { + 'all_pipelines': {'key': 'allPipelines', 'type': 'Permission'}, + 'pipelines': {'key': 'pipelines', 'type': '[PipelinePermission]'}, + 'resource': {'key': 'resource', 'type': 'Resource'} + } + + def __init__(self, all_pipelines=None, pipelines=None, resource=None): + super(ResourcePipelinePermissions, self).__init__() + self.all_pipelines = all_pipelines + self.pipelines = pipelines + self.resource = resource + + +__all__ = [ + 'GraphSubjectBase', + 'IdentityRef', + 'Permission', + 'PipelinePermission', + 'ReferenceLinks', + 'Resource', + 'ResourcePipelinePermissions', +] diff --git a/azure-devops/azure/devops/v7_0/pipeline_permissions/pipeline_permissions_client.py b/azure-devops/azure/devops/v7_0/pipeline_permissions/pipeline_permissions_client.py new file mode 100644 index 00000000..92194e0f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipeline_permissions/pipeline_permissions_client.py @@ -0,0 +1,90 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinePermissionsClient(Client): + """PipelinePermissions + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinePermissionsClient, 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 = 'a81a0441-de52-4000-aa15-ff0e07bfbbaa' + + def get_pipeline_permissions_for_resource(self, project, resource_type, resource_id): + """GetPipelinePermissionsForResource. + [Preview API] Given a ResourceType and ResourceId, returns authorized definitions for that resource. + :param str project: Project ID or project name + :param str resource_type: + :param str resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if resource_type is not None: + route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str') + response = self._send(http_method='GET', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('ResourcePipelinePermissions', response) + + def update_pipeline_permisions_for_resource(self, resource_authorization, project, resource_type, resource_id): + """UpdatePipelinePermisionsForResource. + [Preview API] Authorizes/Unauthorizes a list of definitions for a given resource. + :param :class:` ` resource_authorization: + :param str project: Project ID or project name + :param str resource_type: + :param str resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if resource_type is not None: + route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str') + content = self._serialize.body(resource_authorization, 'ResourcePipelinePermissions') + response = self._send(http_method='PATCH', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ResourcePipelinePermissions', response) + + def update_pipeline_permisions_for_resources(self, resource_authorizations, project): + """UpdatePipelinePermisionsForResources. + [Preview API] Batch API to authorize/unauthorize a list of definitions for a multiple resources. + :param [ResourcePipelinePermissions] resource_authorizations: + :param str project: Project ID or project name + :rtype: [ResourcePipelinePermissions] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(resource_authorizations, '[ResourcePipelinePermissions]') + response = self._send(http_method='PATCH', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[ResourcePipelinePermissions]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/pipelines/__init__.py b/azure-devops/azure/devops/v7_0/pipelines/__init__.py new file mode 100644 index 00000000..66e503f8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines/__init__.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipelines_client import PipelinesClient + +__all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'ContainerResourceParameters', + 'CreatePipelineConfigurationParameters', + 'CreatePipelineParameters', + 'Log', + 'LogCollection', + 'PackageResourceParameters', + 'Pipeline', + 'PipelineBase', + 'PipelineConfiguration', + 'PipelineReference', + 'PipelineResourceParameters', + 'PreviewRun', + 'ReferenceLinks', + 'Repository', + 'RepositoryResource', + 'RepositoryResourceParameters', + 'Run', + 'RunPipelineParameters', + 'RunReference', + 'RunResources', + 'RunResourcesParameters', + 'SignalRConnection', + 'SignedUrl', + 'Variable', + 'PipelinesClient' +] diff --git a/azure-devops/azure/devops/v7_0/pipelines/models.py b/azure-devops/azure/devops/v7_0/pipelines/models.py new file mode 100644 index 00000000..1e57413f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines/models.py @@ -0,0 +1,647 @@ +# -------------------------------------------------------------------------------------------- +# 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 Artifact(Model): + """ + Artifacts are collections of files produced by a pipeline. Use artifacts to share files between stages in a pipeline or between different pipelines. + + :param name: The name of the artifact. + :type name: str + :param signed_content: Signed url for downloading this artifact + :type signed_content: :class:`SignedUrl ` + :param url: Self-referential url + :type url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, name=None, signed_content=None, url=None): + super(Artifact, self).__init__() + self.name = name + self.signed_content = signed_content + self.url = url + + +class BuildResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(BuildResourceParameters, self).__init__() + self.version = version + + +class ContainerResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(ContainerResourceParameters, self).__init__() + self.version = version + + +class CreatePipelineConfigurationParameters(Model): + """ + Configuration parameters of the pipeline. + + :param type: Type of configuration. + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(CreatePipelineConfigurationParameters, self).__init__() + self.type = type + + +class CreatePipelineParameters(Model): + """ + Parameters to create a pipeline. + + :param configuration: Configuration parameters of the pipeline. + :type configuration: :class:`CreatePipelineConfigurationParameters ` + :param folder: Folder of the pipeline. + :type folder: str + :param name: Name of the pipeline. + :type name: str + """ + + _attribute_map = { + 'configuration': {'key': 'configuration', 'type': 'CreatePipelineConfigurationParameters'}, + 'folder': {'key': 'folder', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, configuration=None, folder=None, name=None): + super(CreatePipelineParameters, self).__init__() + self.configuration = configuration + self.folder = folder + self.name = name + + +class Log(Model): + """ + Log for a pipeline. + + :param created_on: The date and time the log was created. + :type created_on: datetime + :param id: The ID of the log. + :type id: int + :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 + :param signed_content: + :type signed_content: :class:`SignedUrl ` + :param url: + :type url: str + """ + + _attribute_map = { + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'}, + 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, + 'line_count': {'key': 'lineCount', 'type': 'long'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, created_on=None, id=None, last_changed_on=None, line_count=None, signed_content=None, url=None): + super(Log, self).__init__() + self.created_on = created_on + self.id = id + self.last_changed_on = last_changed_on + self.line_count = line_count + self.signed_content = signed_content + self.url = url + + +class LogCollection(Model): + """ + A collection of logs. + + :param logs: The list of logs. + :type logs: list of :class:`Log ` + :param signed_content: + :type signed_content: :class:`SignedUrl ` + :param url: URL of the log. + :type url: str + """ + + _attribute_map = { + 'logs': {'key': 'logs', 'type': '[Log]'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, logs=None, signed_content=None, url=None): + super(LogCollection, self).__init__() + self.logs = logs + self.signed_content = signed_content + self.url = url + + +class PackageResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(PackageResourceParameters, self).__init__() + self.version = version + + +class PipelineBase(Model): + """ + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None): + super(PipelineBase, self).__init__() + self.folder = folder + self.id = id + self.name = name + self.revision = revision + + +class PipelineConfiguration(Model): + """ + :param type: + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(PipelineConfiguration, self).__init__() + self.type = type + + +class PipelineReference(PipelineBase): + """ + A reference to a Pipeline. + + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + :param url: + :type url: str + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None, url=None): + super(PipelineReference, self).__init__(folder=folder, id=id, name=name, revision=revision) + self.url = url + + +class PipelineResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(PipelineResourceParameters, self).__init__() + self.version = version + + +class PreviewRun(Model): + """ + :param final_yaml: + :type final_yaml: str + """ + + _attribute_map = { + 'final_yaml': {'key': 'finalYaml', 'type': 'str'} + } + + def __init__(self, final_yaml=None): + super(PreviewRun, self).__init__() + self.final_yaml = final_yaml + + +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 Repository(Model): + """ + :param type: + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(Repository, self).__init__() + self.type = type + + +class RepositoryResource(Model): + """ + :param ref_name: + :type ref_name: str + :param repository: + :type repository: :class:`Repository ` + :param version: + :type version: str + """ + + _attribute_map = { + 'ref_name': {'key': 'refName', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'Repository'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, ref_name=None, repository=None, version=None): + super(RepositoryResource, self).__init__() + self.ref_name = ref_name + self.repository = repository + self.version = version + + +class RepositoryResourceParameters(Model): + """ + :param ref_name: + :type ref_name: str + :param token: This is the security token to use when connecting to the repository. + :type token: str + :param token_type: Optional. This is the type of the token given. If not provided, a type of "Bearer" is assumed. Note: Use "Basic" for a PAT token. + :type token_type: str + :param version: + :type version: str + """ + + _attribute_map = { + 'ref_name': {'key': 'refName', 'type': 'str'}, + 'token': {'key': 'token', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, ref_name=None, token=None, token_type=None, version=None): + super(RepositoryResourceParameters, self).__init__() + self.ref_name = ref_name + self.token = token + self.token_type = token_type + self.version = version + + +class RunPipelineParameters(Model): + """ + Settings which influence pipeline runs. + + :param preview_run: If true, don't actually create a new run. Instead, return the final YAML document after parsing templates. + :type preview_run: bool + :param resources: The resources the run requires. + :type resources: :class:`RunResourcesParameters ` + :param stages_to_skip: + :type stages_to_skip: list of str + :param template_parameters: + :type template_parameters: dict + :param variables: + :type variables: dict + :param yaml_override: If you use the preview run option, you may optionally supply different YAML. This allows you to preview the final YAML document without committing a changed file. + :type yaml_override: str + """ + + _attribute_map = { + 'preview_run': {'key': 'previewRun', 'type': 'bool'}, + 'resources': {'key': 'resources', 'type': 'RunResourcesParameters'}, + 'stages_to_skip': {'key': 'stagesToSkip', 'type': '[str]'}, + 'template_parameters': {'key': 'templateParameters', 'type': '{str}'}, + 'variables': {'key': 'variables', 'type': '{Variable}'}, + 'yaml_override': {'key': 'yamlOverride', 'type': 'str'} + } + + def __init__(self, preview_run=None, resources=None, stages_to_skip=None, template_parameters=None, variables=None, yaml_override=None): + super(RunPipelineParameters, self).__init__() + self.preview_run = preview_run + self.resources = resources + self.stages_to_skip = stages_to_skip + self.template_parameters = template_parameters + self.variables = variables + self.yaml_override = yaml_override + + +class RunReference(Model): + """ + :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(RunReference, self).__init__() + self.id = id + self.name = name + + +class RunResources(Model): + """ + :param repositories: + :type repositories: dict + """ + + _attribute_map = { + 'repositories': {'key': 'repositories', 'type': '{RepositoryResource}'} + } + + def __init__(self, repositories=None): + super(RunResources, self).__init__() + self.repositories = repositories + + +class RunResourcesParameters(Model): + """ + :param builds: + :type builds: dict + :param containers: + :type containers: dict + :param packages: + :type packages: dict + :param pipelines: + :type pipelines: dict + :param repositories: + :type repositories: dict + """ + + _attribute_map = { + 'builds': {'key': 'builds', 'type': '{BuildResourceParameters}'}, + 'containers': {'key': 'containers', 'type': '{ContainerResourceParameters}'}, + 'packages': {'key': 'packages', 'type': '{PackageResourceParameters}'}, + 'pipelines': {'key': 'pipelines', 'type': '{PipelineResourceParameters}'}, + 'repositories': {'key': 'repositories', 'type': '{RepositoryResourceParameters}'} + } + + def __init__(self, builds=None, containers=None, packages=None, pipelines=None, repositories=None): + super(RunResourcesParameters, self).__init__() + self.builds = builds + self.containers = containers + self.packages = packages + self.pipelines = pipelines + self.repositories = repositories + + +class SignalRConnection(Model): + """ + :param signed_content: + :type signed_content: :class:`SignedUrl ` + """ + + _attribute_map = { + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'} + } + + def __init__(self, signed_content=None): + super(SignalRConnection, self).__init__() + self.signed_content = signed_content + + +class SignedUrl(Model): + """ + A signed url allowing limited-time anonymous access to private resources. + + :param signature_expires: Timestamp when access expires. + :type signature_expires: datetime + :param url: The URL to allow access to. + :type url: str + """ + + _attribute_map = { + 'signature_expires': {'key': 'signatureExpires', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, signature_expires=None, url=None): + super(SignedUrl, self).__init__() + self.signature_expires = signature_expires + self.url = url + + +class Variable(Model): + """ + :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(Variable, self).__init__() + self.is_secret = is_secret + self.value = value + + +class Pipeline(PipelineBase): + """ + Definition of a pipeline. + + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + :param _links: + :type _links: :class:`ReferenceLinks ` + :param configuration: + :type configuration: :class:`PipelineConfiguration ` + :param url: URL of the pipeline + :type url: str + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'configuration': {'key': 'configuration', 'type': 'PipelineConfiguration'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None, _links=None, configuration=None, url=None): + super(Pipeline, self).__init__(folder=folder, id=id, name=name, revision=revision) + self._links = _links + self.configuration = configuration + self.url = url + + +class Run(RunReference): + """ + :param id: + :type id: int + :param name: + :type name: str + :param _links: + :type _links: :class:`ReferenceLinks ` + :param created_date: + :type created_date: datetime + :param final_yaml: + :type final_yaml: str + :param finished_date: + :type finished_date: datetime + :param pipeline: + :type pipeline: :class:`PipelineReference ` + :param resources: + :type resources: :class:`RunResources ` + :param result: + :type result: object + :param state: + :type state: object + :param url: + :type url: str + :param variables: + :type variables: dict + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'final_yaml': {'key': 'finalYaml', 'type': 'str'}, + 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, + 'pipeline': {'key': 'pipeline', 'type': 'PipelineReference'}, + 'resources': {'key': 'resources', 'type': 'RunResources'}, + 'result': {'key': 'result', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'variables': {'key': 'variables', 'type': '{Variable}'} + } + + def __init__(self, id=None, name=None, _links=None, created_date=None, final_yaml=None, finished_date=None, pipeline=None, resources=None, result=None, state=None, url=None, variables=None): + super(Run, self).__init__(id=id, name=name) + self._links = _links + self.created_date = created_date + self.final_yaml = final_yaml + self.finished_date = finished_date + self.pipeline = pipeline + self.resources = resources + self.result = result + self.state = state + self.url = url + self.variables = variables + + +__all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'ContainerResourceParameters', + 'CreatePipelineConfigurationParameters', + 'CreatePipelineParameters', + 'Log', + 'LogCollection', + 'PackageResourceParameters', + 'PipelineBase', + 'PipelineConfiguration', + 'PipelineReference', + 'PipelineResourceParameters', + 'PreviewRun', + 'ReferenceLinks', + 'Repository', + 'RepositoryResource', + 'RepositoryResourceParameters', + 'RunPipelineParameters', + 'RunReference', + 'RunResources', + 'RunResourcesParameters', + 'SignalRConnection', + 'SignedUrl', + 'Variable', + 'Pipeline', + 'Run', +] diff --git a/azure-devops/azure/devops/v7_0/pipelines/pipelines_client.py b/azure-devops/azure/devops/v7_0/pipelines/pipelines_client.py new file mode 100644 index 00000000..3eeb2e17 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines/pipelines_client.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinesClient(Client): + """Pipelines + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesClient, 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_artifact(self, project, pipeline_id, run_id, artifact_name, expand=None): + """GetArtifact. + Get a specific artifact from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str artifact_name: Name of the artifact. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if artifact_name is not None: + query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='85023071-bd5e-4438-89b0-2a5bf362a19d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Artifact', response) + + def get_log(self, project, pipeline_id, run_id, log_id, expand=None): + """GetLog. + Get a specific log from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param int log_id: ID of the log. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if log_id is not None: + route_values['logId'] = self._serialize.url('log_id', log_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Log', response) + + def list_logs(self, project, pipeline_id, run_id, expand=None): + """ListLogs. + Get a list of logs from a pipeline run. + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('LogCollection', response) + + def create_pipeline(self, input_parameters, project): + """CreatePipeline. + Create a pipeline. + :param :class:` ` input_parameters: Input 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(input_parameters, 'CreatePipelineParameters') + response = self._send(http_method='POST', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Pipeline', response) + + def get_pipeline(self, project, pipeline_id, pipeline_version=None): + """GetPipeline. + Gets a pipeline, optionally at the specified version + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID + :param int pipeline_version: The pipeline version + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + response = self._send(http_method='GET', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Pipeline', response) + + def list_pipelines(self, project, order_by=None, top=None, continuation_token=None): + """ListPipelines. + Get a list of pipelines. + :param str project: Project ID or project name + :param str order_by: A sort expression. Defaults to "name asc" + :param int top: The maximum number of pipelines to return + :param str continuation_token: A continuation token from a previous request, to retrieve the next page of results + :rtype: [Pipeline] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query('order_by', order_by, '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='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Pipeline]', self._unwrap_collection(response)) + + def preview(self, run_parameters, project, pipeline_id, pipeline_version=None): + """Preview. + Queues a dry run of the pipeline and returns an object containing the final yaml. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='53df2d18-29ea-46a9-bee0-933540f80abf', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('PreviewRun', response) + + def get_run(self, project, pipeline_id, run_id): + """GetRun. + Gets a run for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :param int run_id: The run id + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + 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='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('Run', response) + + def list_runs(self, project, pipeline_id): + """ListRuns. + Gets top 10000 runs for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :rtype: [Run] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + response = self._send(http_method='GET', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('[Run]', self._unwrap_collection(response)) + + def run_pipeline(self, run_parameters, project, pipeline_id, pipeline_version=None): + """RunPipeline. + Runs a pipeline. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Run', response) + diff --git a/azure-devops/azure/devops/v7_0/pipelines_checks/__init__.py b/azure-devops/azure/devops/v7_0/pipelines_checks/__init__.py new file mode 100644 index 00000000..e297bb73 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines_checks/__init__.py @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipelines_checks_client import PipelinesChecksClient + +__all__ = [ + 'ApprovalConfig', + 'ApprovalConfigSettings', + 'GraphSubjectBase', + 'CheckConfiguration', + 'CheckConfigurationRef', + 'CheckRun', + 'CheckRunResult', + 'CheckSuite', + 'CheckSuiteRef', + 'CheckSuiteRequest', + 'CheckType', + 'IdentityRef', + 'ReferenceLinks', + 'Resource', + 'TaskCheckConfig', + 'TaskCheckDefinitionReference', + 'PipelinesChecksClient' +] diff --git a/azure-devops/azure/devops/v7_0/pipelines_checks/models.py b/azure-devops/azure/devops/v7_0/pipelines_checks/models.py new file mode 100644 index 00000000..c0d911df --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines_checks/models.py @@ -0,0 +1,500 @@ +# -------------------------------------------------------------------------------------------- +# 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 ApprovalConfig(Model): + """ + Config to create a new approval. + + :param approvers: Ordered list of approvers. + :type approvers: list of :class:`IdentityRef ` + :param blocked_approvers: Identities which are not allowed to approve. + :type blocked_approvers: list of :class:`IdentityRef ` + :param execution_order: Order in which approvers will be actionable. + :type execution_order: object + :param instructions: Instructions for the approver. + :type instructions: str + :param min_required_approvers: Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all. + :type min_required_approvers: int + """ + + _attribute_map = { + 'approvers': {'key': 'approvers', 'type': '[IdentityRef]'}, + 'blocked_approvers': {'key': 'blockedApprovers', 'type': '[IdentityRef]'}, + 'execution_order': {'key': 'executionOrder', 'type': 'object'}, + 'instructions': {'key': 'instructions', 'type': 'str'}, + 'min_required_approvers': {'key': 'minRequiredApprovers', 'type': 'int'} + } + + def __init__(self, approvers=None, blocked_approvers=None, execution_order=None, instructions=None, min_required_approvers=None): + super(ApprovalConfig, self).__init__() + self.approvers = approvers + self.blocked_approvers = blocked_approvers + self.execution_order = execution_order + self.instructions = instructions + self.min_required_approvers = min_required_approvers + + +class ApprovalConfigSettings(ApprovalConfig): + """ + Config to create a new approval. + + :param approvers: Ordered list of approvers. + :type approvers: list of :class:`IdentityRef ` + :param blocked_approvers: Identities which are not allowed to approve. + :type blocked_approvers: list of :class:`IdentityRef ` + :param execution_order: Order in which approvers will be actionable. + :type execution_order: object + :param instructions: Instructions for the approver. + :type instructions: str + :param min_required_approvers: Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all. + :type min_required_approvers: int + :param requester_cannot_be_approver: Determines whether check requester can approve the check. + :type requester_cannot_be_approver: bool + """ + + _attribute_map = { + 'approvers': {'key': 'approvers', 'type': '[IdentityRef]'}, + 'blocked_approvers': {'key': 'blockedApprovers', 'type': '[IdentityRef]'}, + 'execution_order': {'key': 'executionOrder', 'type': 'object'}, + 'instructions': {'key': 'instructions', 'type': 'str'}, + 'min_required_approvers': {'key': 'minRequiredApprovers', 'type': 'int'}, + 'requester_cannot_be_approver': {'key': 'requesterCannotBeApprover', 'type': 'bool'} + } + + def __init__(self, approvers=None, blocked_approvers=None, execution_order=None, instructions=None, min_required_approvers=None, requester_cannot_be_approver=None): + super(ApprovalConfigSettings, self).__init__(approvers=approvers, blocked_approvers=blocked_approvers, execution_order=execution_order, instructions=instructions, min_required_approvers=min_required_approvers) + self.requester_cannot_be_approver = requester_cannot_be_approver + + +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 CheckConfigurationRef(Model): + """ + :param id: Check configuration id. + :type id: int + :param resource: Resource on which check get configured. + :type resource: :class:`Resource ` + :param type: Check configuration type + :type type: :class:`CheckType ` + :param url: The URL from which one can fetch the configured check. + :type url: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'resource': {'key': 'resource', 'type': 'Resource'}, + 'type': {'key': 'type', 'type': 'CheckType'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, id=None, resource=None, type=None, url=None): + super(CheckConfigurationRef, self).__init__() + self.id = id + self.resource = resource + self.type = type + self.url = url + + +class CheckRunResult(Model): + """ + :param result_message: + :type result_message: str + :param status: + :type status: object + """ + + _attribute_map = { + 'result_message': {'key': 'resultMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, result_message=None, status=None): + super(CheckRunResult, self).__init__() + self.result_message = result_message + self.status = status + + +class CheckSuiteRef(Model): + """ + :param context: Evaluation context for the check suite request + :type context: :class:`object ` + :param id: Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage + :type id: str + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, context=None, id=None): + super(CheckSuiteRef, self).__init__() + self.context = context + self.id = id + + +class CheckSuiteRequest(Model): + """ + :param context: + :type context: :class:`object ` + :param id: + :type id: str + :param resources: + :type resources: list of :class:`Resource ` + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[Resource]'} + } + + def __init__(self, context=None, id=None, resources=None): + super(CheckSuiteRequest, self).__init__() + self.context = context + self.id = id + self.resources = resources + + +class CheckType(Model): + """ + :param id: Gets or sets check type id. + :type id: str + :param name: Name of the check type. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(CheckType, self).__init__() + self.id = id + self.name = name + + +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 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 Resource(Model): + """ + :param id: Id of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :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(Resource, self).__init__() + self.id = id + self.name = name + self.type = type + + +class TaskCheckConfig(Model): + """ + Config to facilitate task check + + :param definition_ref: + :type definition_ref: :class:`TaskCheckDefinitionReference ` + :param display_name: + :type display_name: str + :param inputs: + :type inputs: dict + :param linked_variable_group: + :type linked_variable_group: str + :param retry_interval: + :type retry_interval: int + """ + + _attribute_map = { + 'definition_ref': {'key': 'definitionRef', 'type': 'TaskCheckDefinitionReference'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '{str}'}, + 'linked_variable_group': {'key': 'linkedVariableGroup', 'type': 'str'}, + 'retry_interval': {'key': 'retryInterval', 'type': 'int'} + } + + def __init__(self, definition_ref=None, display_name=None, inputs=None, linked_variable_group=None, retry_interval=None): + super(TaskCheckConfig, self).__init__() + self.definition_ref = definition_ref + self.display_name = display_name + self.inputs = inputs + self.linked_variable_group = linked_variable_group + self.retry_interval = retry_interval + + +class TaskCheckDefinitionReference(Model): + """ + :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(TaskCheckDefinitionReference, self).__init__() + self.id = id + self.name = name + self.version = version + + +class CheckConfiguration(CheckConfigurationRef): + """ + :param id: Check configuration id. + :type id: int + :param resource: Resource on which check get configured. + :type resource: :class:`Resource ` + :param type: Check configuration type + :type type: :class:`CheckType ` + :param url: The URL from which one can fetch the configured check. + :type url: str + :param _links: Reference links. + :type _links: :class:`ReferenceLinks ` + :param created_by: Identity of person who configured check. + :type created_by: :class:`IdentityRef ` + :param created_on: Time when check got configured. + :type created_on: datetime + :param modified_by: Identity of person who modified the configured check. + :type modified_by: :class:`IdentityRef ` + :param modified_on: Time when configured check was modified. + :type modified_on: datetime + :param timeout: Timeout in minutes for the check. + :type timeout: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'resource': {'key': 'resource', 'type': 'Resource'}, + 'type': {'key': 'type', 'type': 'CheckType'}, + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'timeout': {'key': 'timeout', 'type': 'int'} + } + + def __init__(self, id=None, resource=None, type=None, url=None, _links=None, created_by=None, created_on=None, modified_by=None, modified_on=None, timeout=None): + super(CheckConfiguration, self).__init__(id=id, resource=resource, type=type, url=url) + self._links = _links + self.created_by = created_by + self.created_on = created_on + self.modified_by = modified_by + self.modified_on = modified_on + self.timeout = timeout + + +class CheckRun(CheckRunResult): + """ + :param result_message: + :type result_message: str + :param status: + :type status: object + :param completed_date: + :type completed_date: datetime + :param created_date: + :type created_date: datetime + :param check_configuration_ref: + :type check_configuration_ref: :class:`CheckConfigurationRef ` + :param id: + :type id: str + """ + + _attribute_map = { + 'result_message': {'key': 'resultMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'check_configuration_ref': {'key': 'checkConfigurationRef', 'type': 'CheckConfigurationRef'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, result_message=None, status=None, completed_date=None, created_date=None, check_configuration_ref=None, id=None): + super(CheckRun, self).__init__(result_message=result_message, status=status) + self.completed_date = completed_date + self.created_date = created_date + self.check_configuration_ref = check_configuration_ref + self.id = id + + +class CheckSuite(CheckSuiteRef): + """ + :param context: Evaluation context for the check suite request + :type context: :class:`object ` + :param id: Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage + :type id: str + :param _links: Reference links. + :type _links: :class:`ReferenceLinks ` + :param completed_date: Completed date of the given check suite request + :type completed_date: datetime + :param check_runs: List of check runs associated with the given check suite request. + :type check_runs: list of :class:`CheckRun ` + :param message: Optional message for the given check suite request + :type message: str + :param status: Overall check runs status for the given suite request. This is check suite status + :type status: object + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'check_runs': {'key': 'checkRuns', 'type': '[CheckRun]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, context=None, id=None, _links=None, completed_date=None, check_runs=None, message=None, status=None): + super(CheckSuite, self).__init__(context=context, id=id) + self._links = _links + self.completed_date = completed_date + self.check_runs = check_runs + self.message = message + self.status = status + + +__all__ = [ + 'ApprovalConfig', + 'ApprovalConfigSettings', + 'GraphSubjectBase', + 'CheckConfigurationRef', + 'CheckRunResult', + 'CheckSuiteRef', + 'CheckSuiteRequest', + 'CheckType', + 'IdentityRef', + 'ReferenceLinks', + 'Resource', + 'TaskCheckConfig', + 'TaskCheckDefinitionReference', + 'CheckConfiguration', + 'CheckRun', + 'CheckSuite', +] diff --git a/azure-devops/azure/devops/v7_0/pipelines_checks/pipelines_checks_client.py b/azure-devops/azure/devops/v7_0/pipelines_checks/pipelines_checks_client.py new file mode 100644 index 00000000..99bbc195 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/pipelines_checks/pipelines_checks_client.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinesChecksClient(Client): + """PipelinesChecks + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesChecksClient, 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 = '4a933897-0488-45af-bd82-6fd3ad33f46a' + + def add_check_configuration(self, configuration, project): + """AddCheckConfiguration. + [Preview API] Add a check configuration + :param :class:` ` 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(configuration, 'CheckConfiguration') + response = self._send(http_method='POST', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CheckConfiguration', response) + + def delete_check_configuration(self, project, id): + """DeleteCheckConfiguration. + [Preview API] Delete check configuration by id + :param str project: Project ID or project name + :param int id: check configuration id + """ + 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='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.0-preview.1', + route_values=route_values) + + def get_check_configuration(self, project, id, expand=None): + """GetCheckConfiguration. + [Preview API] Get Check configuration by Id + :param str project: Project ID or project name + :param int id: + :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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CheckConfiguration', response) + + def get_check_configurations_on_resource(self, project, resource_type=None, resource_id=None, expand=None): + """GetCheckConfigurationsOnResource. + [Preview API] Get Check configuration by resource type and id + :param str project: Project ID or project name + :param str resource_type: resource type + :param str resource_id: resource id + :param str expand: + :rtype: [CheckConfiguration] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if resource_type is not None: + query_parameters['resourceType'] = self._serialize.query('resource_type', resource_type, 'str') + if resource_id is not None: + query_parameters['resourceId'] = self._serialize.query('resource_id', resource_id, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[CheckConfiguration]', self._unwrap_collection(response)) + + def update_check_configuration(self, configuration, project, id): + """UpdateCheckConfiguration. + [Preview API] Update check configuration + :param :class:` ` configuration: check configuration + :param str project: Project ID or project name + :param int id: check configuration id + :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(configuration, 'CheckConfiguration') + response = self._send(http_method='PATCH', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CheckConfiguration', response) + + def query_check_configurations_on_resources(self, resources, project, expand=None): + """QueryCheckConfigurationsOnResources. + [Preview API] Get check configurations for multiple resources by resource type and id. + :param [Resource] resources: List of resources. + :param str project: Project ID or project name + :param str expand: The properties that should be expanded in the list of check configurations. + :rtype: [CheckConfiguration] + """ + 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') + content = self._serialize.body(resources, '[Resource]') + response = self._send(http_method='POST', + location_id='5f3d0e64-f943-4584-8811-77eb495e831e', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[CheckConfiguration]', self._unwrap_collection(response)) + + def evaluate_check_suite(self, request, project, expand=None): + """EvaluateCheckSuite. + [Preview API] Initiate an evaluation for a check in a pipeline + :param :class:` ` request: + :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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + content = self._serialize.body(request, 'CheckSuiteRequest') + response = self._send(http_method='POST', + location_id='91282c1d-c183-444f-9554-1485bfb3879d', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CheckSuite', response) + + def get_check_suite(self, project, check_suite_id, expand=None): + """GetCheckSuite. + [Preview API] Get details for a specific check evaluation + :param str project: Project ID or project name + :param str check_suite_id: + :param str expand: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if check_suite_id is not None: + route_values['checkSuiteId'] = self._serialize.url('check_suite_id', check_suite_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='91282c1d-c183-444f-9554-1485bfb3879d', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CheckSuite', response) + diff --git a/azure-devops/azure/devops/v7_0/policy/__init__.py b/azure-devops/azure/devops/v7_0/policy/__init__.py new file mode 100644 index 00000000..1279c3e8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/policy/__init__.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/policy/models.py b/azure-devops/azure/devops/v7_0/policy/models.py new file mode 100644 index 00000000..8d7ff992 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/policy/models.py @@ -0,0 +1,333 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 PolicyConfigurationRef(Model): + """ + Policy configuration reference. + + :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): + """ + This record encapsulates the current state of a policy as it applies to one specific pull request. Each pull request has a unique PolicyEvaluationRecord for each pull request which the policy applies to. + + :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): + """ + Policy type reference. + + :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): + """ + 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 VersionedPolicyConfigurationRef(PolicyConfigurationRef): + """ + A particular revision for a policy configuration. + + :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): + """ + The full policy configuration with settings. + + :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 is_enterprise_managed: If set, this policy requires "Manage Enterprise Policies" permission to create, edit, or delete. + :type is_enterprise_managed: 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'}, + 'is_enterprise_managed': {'key': 'isEnterpriseManaged', '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, is_enterprise_managed=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.is_enterprise_managed = is_enterprise_managed + self.settings = settings + + +class PolicyType(PolicyTypeRef): + """ + User-friendly policy type with description (used for querying policy types). + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/policy/policy_client.py b/azure-devops/azure/devops/v7_0/policy/policy_client.py new file mode 100644 index 00000000..f08c95ba --- /dev/null +++ b/azure-devops/azure/devops/v7_0/policy/policy_client.py @@ -0,0 +1,277 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.0', + 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:`<[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 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[PolicyType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/profile/__init__.py b/azure-devops/azure/devops/v7_0/profile/__init__.py new file mode 100644 index 00000000..c9b00c7e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile/__init__.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ProfileClient' +] diff --git a/azure-devops/azure/devops/v7_0/profile/models.py b/azure-devops/azure/devops/v7_0/profile/models.py new file mode 100644 index 00000000..e10bf059 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile/models.py @@ -0,0 +1,299 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Identifies an attribute with a name and a container. + + :param attribute_name: The name of the attribute. + :type attribute_name: str + :param container_name: The container the attribute resides in. + :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): + """ + Stores a set of named profile attributes. + + :param attributes: The attributes stored by the container. + :type attributes: dict + :param container_name: The name of the container. + :type container_name: str + :param revision: The maximum revision number of any attribute within the container. + :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): + """ + :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): + """ + :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: The current state of the profile. + :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): + """ + :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): + """ + A user profile. + + :param application_container: The attributes of this profile. + :type application_container: :class:`AttributesContainer ` + :param core_attributes: The core attributes of this profile. + :type core_attributes: dict + :param core_revision: The maximum revision number of any attribute. + :type core_revision: int + :param id: The unique identifier of the profile. + :type id: str + :param profile_state: The current state of the profile. + :type profile_state: object + :param revision: The maximum revision number of any attribute. + :type revision: int + :param time_stamp: The time at which this profile was last changed. + :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): + """ + :param descriptor: The descriptor of the attribute. + :type descriptor: :class:`AttributeDescriptor ` + :param revision: The revision number of the attribute. + :type revision: int + :param time_stamp: The time the attribute was last changed. + :type time_stamp: datetime + :param value: The value of the attribute. + :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): + """ + Country/region information + + :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): + """ + Container of country/region information + + :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 CoreProfileAttribute(ProfileAttributeBase): + """ + A profile attribute which always has a value for each profile. + + """ + + _attribute_map = { + } + + def __init__(self): + super(CoreProfileAttribute, self).__init__() + + +class ProfileAttribute(ProfileAttributeBase): + """ + A named object associated with a profile. + + """ + + _attribute_map = { + } + + def __init__(self): + super(ProfileAttribute, self).__init__() + + +__all__ = [ + 'AttributeDescriptor', + 'AttributesContainer', + 'Avatar', + 'CreateProfileContext', + 'GeoRegion', + 'Profile', + 'ProfileAttributeBase', + 'ProfileRegion', + 'ProfileRegions', + 'CoreProfileAttribute', + 'ProfileAttribute', +] diff --git a/azure-devops/azure/devops/v7_0/profile/profile_client.py b/azure-devops/azure/devops/v7_0/profile/profile_client.py new file mode 100644 index 00000000..cb3cc767 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile/profile_client.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Profile', response) + diff --git a/azure-devops/azure/devops/v7_0/profile_regions/__init__.py b/azure-devops/azure/devops/v7_0/profile_regions/__init__.py new file mode 100644 index 00000000..b9ae801f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile_regions/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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_regions_client import ProfileRegionsClient + +__all__ = [ + 'GeoRegion', + 'ProfileRegion', + 'ProfileRegions', + 'ProfileRegionsClient' +] diff --git a/azure-devops/azure/devops/v7_0/profile_regions/models.py b/azure-devops/azure/devops/v7_0/profile_regions/models.py new file mode 100644 index 00000000..5c2f3a97 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile_regions/models.py @@ -0,0 +1,77 @@ +# -------------------------------------------------------------------------------------------- +# 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 GeoRegion(Model): + """ + :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 ProfileRegion(Model): + """ + Country/region information + + :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): + """ + Container of country/region information + + :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 + + +__all__ = [ + 'GeoRegion', + 'ProfileRegion', + 'ProfileRegions', +] diff --git a/azure-devops/azure/devops/v7_0/profile_regions/profile_regions_client.py b/azure-devops/azure/devops/v7_0/profile_regions/profile_regions_client.py new file mode 100644 index 00000000..fd49c2b9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/profile_regions/profile_regions_client.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------------------------- +# 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 ProfileRegionsClient(Client): + """ProfileRegions + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ProfileRegionsClient, 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_geo_region(self, ip): + """GetGeoRegion. + [Preview API] Lookup up country/region based on provided IPv4, null if using the remote IPv4 address. + :param str ip: + :rtype: :class:` ` + """ + query_parameters = {} + if ip is not None: + query_parameters['ip'] = self._serialize.query('ip', ip, 'str') + response = self._send(http_method='GET', + location_id='35b3ff1d-ab4c-4d1c-98bb-f6ea21d86bd9', + version='7.0-preview.1', + query_parameters=query_parameters) + return self._deserialize('GeoRegion', response) + + def get_regions(self): + """GetRegions. + [Preview API] + :rtype: :class:` ` + """ + response = self._send(http_method='GET', + location_id='b129ca90-999d-47bb-ab37-0dcf784ee633', + version='7.0-preview.1') + return self._deserialize('ProfileRegions', response) + diff --git a/azure-devops/azure/devops/v7_0/project_analysis/__init__.py b/azure-devops/azure/devops/v7_0/project_analysis/__init__.py new file mode 100644 index 00000000..a38ea5dc --- /dev/null +++ b/azure-devops/azure/devops/v7_0/project_analysis/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/project_analysis/models.py b/azure-devops/azure/devops/v7_0/project_analysis/models.py new file mode 100644 index 00000000..e8f63dea --- /dev/null +++ b/azure-devops/azure/devops/v7_0/project_analysis/models.py @@ -0,0 +1,240 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/project_analysis/project_analysis_client.py b/azure-devops/azure/devops/v7_0/project_analysis/project_analysis_client.py new file mode 100644 index 00000000..333e0a65 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/project_analysis/project_analysis_client.py @@ -0,0 +1,117 @@ +# -------------------------------------------------------------------------------------------- +# 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. + :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='7.0', + route_values=route_values) + return self._deserialize('ProjectLanguageAnalytics', response) + + def get_project_activity_metrics(self, project, from_date, aggregation_type): + """GetProjectActivityMetrics. + :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='7.0', + 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. + 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='7.0', + 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. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RepositoryActivityMetrics', response) + diff --git a/azure-devops/azure/devops/v7_0/provenance/__init__.py b/azure-devops/azure/devops/v7_0/provenance/__init__.py new file mode 100644 index 00000000..47a6a388 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/provenance/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/provenance/models.py b/azure-devops/azure/devops/v7_0/provenance/models.py new file mode 100644 index 00000000..45158e2f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/provenance/models.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/provenance/provenance_client.py b/azure-devops/azure/devops/v7_0/provenance/provenance_client.py new file mode 100644 index 00000000..69baa5d0 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/provenance/provenance_client.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None): + """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 + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SessionResponse', response) + diff --git a/azure-devops/azure/devops/v7_0/py_pi_api/__init__.py b/azure-devops/azure/devops/v7_0/py_pi_api/__init__.py new file mode 100644 index 00000000..8c8bd71b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/py_pi_api/__init__.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'PyPiApiClient' +] diff --git a/azure-devops/azure/devops/v7_0/py_pi_api/models.py b/azure-devops/azure/devops/v7_0/py_pi_api/models.py new file mode 100644 index 00000000..d28208d9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/py_pi_api/models.py @@ -0,0 +1,275 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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 version metadata for a Python 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): + """ + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a Python package. + + :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): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +__all__ = [ + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'Package', + 'PackageVersionDetails', + 'PyPiPackagesBatchRequest', + 'PyPiPackageVersionDeletionState', + 'PyPiRecycleBinPackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', +] diff --git a/azure-devops/azure/devops/v7_0/py_pi_api/py_pi_api_client.py b/azure-devops/azure/devops/v7_0/py_pi_api/py_pi_api_client.py new file mode 100644 index 00000000..1ea6ee28 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/py_pi_api/py_pi_api_client.py @@ -0,0 +1,289 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """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 + :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 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='7.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_package_versions(self, batch_request, feed_id, project=None): + """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. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'PyPiPackagesBatchRequest') + self._send(http_method='POST', + location_id='4e53d561-70c1-4c98-b937-0f22acb27b0b', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'PyPiPackagesBatchRequest') + self._send(http_method='POST', + location_id='d2d89918-c69e-4ef4-b357-1c3ccb4d28d2', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='21b8c9a7-7080-45be-a5ba-e50bb4c18130', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='21b8c9a7-7080-45be-a5ba-e50bb4c18130', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted package versions. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/release/__init__.py b/azure-devops/azure/devops/v7_0/release/__init__.py new file mode 100644 index 00000000..e4dc0746 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/release/__init__.py @@ -0,0 +1,115 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ComplianceSettings', + 'Condition', + 'ConfigurationVariableValue', + 'DataSourceBindingBase', + 'DefinitionEnvironmentReference', + 'Deployment', + 'DeploymentAttempt', + 'DeploymentJob', + 'DeploymentQueryParameters', + 'EmailRecipients', + 'EnvironmentExecutionPolicy', + 'EnvironmentOptions', + 'EnvironmentRetentionPolicy', + 'EnvironmentTrigger', + 'FavoriteItem', + 'Folder', + 'GateUpdateMetadata', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'IgnoredGate', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'InputValuesQuery', + 'Issue', + 'MailMessage', + 'ManualIntervention', + 'ManualInterventionUpdateMetadata', + 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', + 'PipelineProcess', + 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', + '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', + 'ReleaseSettings', + 'ReleaseShallowReference', + 'ReleaseSchedule', + 'ReleaseStartEnvironmentMetadata', + 'ReleaseStartMetadata', + 'ReleaseTask', + 'ReleaseTaskAttachment', + 'ReleaseUpdateMetadata', + 'ReleaseWorkItemRef', + 'RetentionPolicy', + 'RetentionSettings', + 'SourcePullRequestVersion', + 'SummaryMailSection', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskSourceDefinitionBase', + 'VariableGroup', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'WorkflowTask', + 'WorkflowTaskReference', + 'ReleaseClient' +] diff --git a/azure-devops/azure/devops/v7_0/release/models.py b/azure-devops/azure/devops/v7_0/release/models.py new file mode 100644 index 00000000..7051b420 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/release/models.py @@ -0,0 +1,3848 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param alias: Gets or sets the artifact definition alias. + :type alias: str + :param artifact_type: Gets or sets the artifact type. + :type artifact_type: object + :param details: Gets or sets the artifact definition details. + :type details: str + :param name: Gets or sets the name of artifact definition. + :type name: str + :param version: Gets or sets the version of artifact definition. + :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): + """ + :param auto_triggered_and_previous_environment_approved_can_be_skipped: Specify whether the approval can be skipped if the same approver approved the previous stage. + :type auto_triggered_and_previous_environment_approved_can_be_skipped: bool + :param enforce_identity_revalidation: Specify whether revalidate identity of approver before completing the approval. + :type enforce_identity_revalidation: bool + :param execution_order: Approvals execution order. + :type execution_order: object + :param release_creator_can_be_approver: Specify whether the user requesting a release or deployment should allow to approver. + :type release_creator_can_be_approver: bool + :param required_approver_count: The number of approvals required to move release forward. '0' means all approvals required. + :type required_approver_count: int + :param timeout_in_minutes: Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days. + :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): + """ + :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: Indicates whether artifact is primary or not. + :type is_primary: bool + :param is_retained: Indicates whether artifact is retained by release or not. + :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): + """ + :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): + """ + :param id: ID of the artifact source. + :type id: str + :param name: Name of the artifact source. + :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): + """ + :param is_trigger_supported: Gets or sets the whether trigger is supported or not. + :type is_trigger_supported: bool + :param is_trigger_supported_only_in_hosted: Gets or sets the whether trigger is supported only on hosted environment. + :type is_trigger_supported_only_in_hosted: bool + :param is_webhook_supported_at_server_level: Gets or sets the whether webhook is supported at server level. + :type is_webhook_supported_at_server_level: bool + :param payload_hash_header_name: Gets or sets the payload hash header name for the artifact trigger configuration. + :type payload_hash_header_name: str + :param resources: Gets or sets the resources for artifact trigger configuration. + :type resources: dict + :param webhook_payload_mapping: Gets or sets the webhook payload mapping for artifact trigger configuration. + :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): + """ + :param artifact_trigger_configuration: Gets or sets the artifact trigger configuration of artifact type definition. + :type artifact_trigger_configuration: :class:`ArtifactTriggerConfiguration ` + :param artifact_type: Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'. + :type artifact_type: str + :param display_name: Gets or sets the display name of artifact type definition. + :type display_name: str + :param endpoint_type_id: Gets or sets the endpoint type id of artifact type definition. + :type endpoint_type_id: str + :param input_descriptors: Gets or sets the input descriptors of artifact type definition. + :type input_descriptors: list of :class:`InputDescriptor ` + :param is_commits_traceability_supported: Gets or sets the is commits tracebility supported value of artifact type defintion. + :type is_commits_traceability_supported: bool + :param is_workitems_traceability_supported: Gets or sets the is workitems tracebility supported value of artifact type defintion. + :type is_workitems_traceability_supported: bool + :param name: Gets or sets the name of artifact type definition. + :type name: str + :param unique_source_identifier: Gets or sets the unique source identifier of artifact type definition. + :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]'}, + 'is_commits_traceability_supported': {'key': 'isCommitsTraceabilitySupported', 'type': 'bool'}, + 'is_workitems_traceability_supported': {'key': 'isWorkitemsTraceabilitySupported', 'type': 'bool'}, + '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, is_commits_traceability_supported=None, is_workitems_traceability_supported=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.is_commits_traceability_supported = is_commits_traceability_supported + self.is_workitems_traceability_supported = is_workitems_traceability_supported + self.name = name + self.unique_source_identifier = unique_source_identifier + + +class ArtifactVersion(Model): + """ + :param alias: Gets or sets the alias of artifact. + :type alias: str + :param default_version: Gets or sets the default version of artifact. + :type default_version: :class:`BuildVersion ` + :param error_message: Gets or sets the error message encountered during querying of versions for artifact. + :type error_message: str + :param source_id: + :type source_id: str + :param versions: Gets or sets the list of build versions of artifact. + :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): + """ + :param artifact_versions: Gets or sets the list for artifact versions of artifact version query result. + :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): + """ + :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): + """ + :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): + """ + :param commit_message: Gets or sets the commit message for the artifact. + :type commit_message: str + :param definition_id: Gets or sets the definition id. + :type definition_id: str + :param definition_name: Gets or sets the definition name. + :type definition_name: str + :param id: Gets or sets the build id. + :type id: str + :param is_multi_definition_type: Gets or sets if the artifact supports multiple definitions. + :type is_multi_definition_type: bool + :param name: Gets or sets the build number. + :type name: str + :param source_branch: Gets or sets the source branch for the artifact. + :type source_branch: str + :param source_pull_request_version: Gets or sets the source pull request version for the artifact. + :type source_pull_request_version: :class:`SourcePullRequestVersion ` + :param source_repository_id: Gets or sets the repository id for the artifact. + :type source_repository_id: str + :param source_repository_type: Gets or sets the repository type for the artifact. + :type source_repository_type: str + :param source_version: Gets or sets the source version for the artifact. + :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 ComplianceSettings(Model): + """ + :param check_for_credentials_and_other_secrets: Scan the release definition for secrets + :type check_for_credentials_and_other_secrets: bool + """ + + _attribute_map = { + 'check_for_credentials_and_other_secrets': {'key': 'checkForCredentialsAndOtherSecrets', 'type': 'bool'} + } + + def __init__(self, check_for_credentials_and_other_secrets=None): + super(ComplianceSettings, self).__init__() + self.check_for_credentials_and_other_secrets = check_for_credentials_and_other_secrets + + +class Condition(Model): + """ + :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): + """ + :param allow_override: Gets and 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 and 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): + """ + 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 DefinitionEnvironmentReference(Model): + """ + :param definition_environment_id: Definition environment ID. + :type definition_environment_id: int + :param definition_environment_name: Definition environment name. + :type definition_environment_name: str + :param release_definition_id: ReleaseDefinition ID. + :type release_definition_id: int + :param release_definition_name: ReleaseDefinition 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): + """ + :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): + """ + :param attempt: Deployment attempt. + :type attempt: int + :param deployment_id: ID of the deployment. + :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: ID of deployment. + :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: Identity who last modified this deployment. + :type last_modified_by: :class:`IdentityRef ` + :param last_modified_on: Time when this deployment last modified. + :type last_modified_on: datetime + :param operation_status: Deployment operation status. + :type operation_status: object + :param post_deployment_gates: Post deployment gates that executed in this deployment. + :type post_deployment_gates: :class:`ReleaseGates ` + :param pre_deployment_gates: Pre deployment gates that executed in this deployment. + :type pre_deployment_gates: :class:`ReleaseGates ` + :param queued_on: When this deployment queued on. + :type queued_on: datetime + :param reason: Reason for the deployment. + :type reason: object + :param release_deploy_phases: List of release deployphases executed in this deployment. + :type release_deploy_phases: list of :class:`ReleaseDeployPhase ` + :param requested_by: Identity who requested this deployment. + :type requested_by: :class:`IdentityRef ` + :param requested_for: Identity for this deployment requested. + :type requested_for: :class:`IdentityRef ` + :param run_plan_id: + :type run_plan_id: str + :param status: status of the deployment. + :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): + """ + :param job: Parent task of all executed tasks. + :type job: :class:`ReleaseTask ` + :param tasks: List of executed tasks with in job. + :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): + """ + :param artifact_source_id: Query deployments based specified artifact source id. + :type artifact_source_id: str + :param artifact_type_id: Query deployments based specified artifact type id. + :type artifact_type_id: str + :param artifact_versions: Query deployments based specified artifact versions. + :type artifact_versions: list of str + :param deployments_per_environment: Query deployments number of deployments per environment. + :type deployments_per_environment: int + :param deployment_status: Query deployment based on deployment status. + :type deployment_status: object + :param environments: Query deployments of specified environments. + :type environments: list of :class:`DefinitionEnvironmentReference ` + :param expands: Query deployments based specified expands. + :type expands: object + :param is_deleted: Specify deleted deployments should return or not. + :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: Query deployment based on deployment operation status. + :type operation_status: object + :param query_order: + :type query_order: object + :param query_type: Query deployments based query type. + :type query_type: object + :param source_branch: Query deployments based specified 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): + """ + :param email_addresses: List of email addresses. + :type email_addresses: list of str + :param tfs_ids: List of TFS IDs guids. + :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): + """ + Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied. + + :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): + """ + :param auto_link_work_items: Gets and sets as the auto link workitems or not. + :type auto_link_work_items: bool + :param badge_enabled: Gets and sets as the badge enabled or not. + :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: Gets and sets as the publish deployment status or not. + :type publish_deployment_status: bool + :param pull_request_deployment_enabled: Gets and sets as the.pull request deployment enabled or not. + :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): + """ + :param days_to_keep: Gets and sets the number of days to keep environment. + :type days_to_keep: int + :param releases_to_keep: Gets and sets the number of releases to keep. + :type releases_to_keep: int + :param retain_build: Gets and sets as the build to be retained or not. + :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): + """ + :param definition_environment_id: Definition environment ID on which this trigger applicable. + :type definition_environment_id: int + :param release_definition_id: ReleaseDefinition ID on which this trigger applicable. + :type release_definition_id: int + :param trigger_content: Gets or sets the trigger content. + :type trigger_content: str + :param trigger_type: Gets or sets the 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): + """ + Class to represent favorite entry. + + :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): + """ + :param created_by: Identity who created this folder. + :type created_by: :class:`IdentityRef ` + :param created_on: Time when this folder created. + :type created_on: datetime + :param description: Description of the folder. + :type description: str + :param last_changed_by: Identity who last changed this folder. + :type last_changed_by: :class:`IdentityRef ` + :param last_changed_date: Time when this folder last changed. + :type last_changed_date: datetime + :param path: path of the folder. + :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): + """ + :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): + """ + :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 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 change_type: The type of source. "TfsVersionControl", "TfsGit", etc. + :type change_type: 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'}, + 'display_uri': {'key': 'displayUri', 'type': 'str'}, + 'change_type': {'key': 'changeType', '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, display_uri=None, change_type=None, id=None, location=None, message=None, pushed_by=None, pusher=None, timestamp=None): + super(Change, self).__init__() + self.author = author + self.display_uri = display_uri + self.change_type = change_type + self.id = id + self.location = location + self.message = message + self.pushed_by = pushed_by + self.pusher = pusher + self.timestamp = timestamp + + +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 IgnoredGate(Model): + """ + :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): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + :param data: Issue data. + :type data: dict + :param issue_type: Issue type, for example error, warning or info. + :type issue_type: str + :param message: Issue 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): + """ + :param body: Body of mail. + :type body: str + :param cc: Mail CC recipients. + :type cc: :class:`EmailRecipients ` + :param in_reply_to: Reply to. + :type in_reply_to: str + :param message_id: Message ID of the mail. + :type message_id: str + :param reply_by: Data when should be replied to mail. + :type reply_by: datetime + :param reply_to: Reply to Email recipients. + :type reply_to: :class:`EmailRecipients ` + :param sections: List of mail section types. + :type sections: list of MailSectionType + :param sender_type: Mail sender type. + :type sender_type: object + :param subject: Subject of the mail. + :type subject: str + :param to: Mail To recipients. + :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): + """ + :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): + """ + :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): + """ + :param name: Name of the Metric. + :type name: str + :param value: Value of the Metric. + :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 OrgPipelineReleaseSettings(Model): + """ + :param has_manage_pipeline_policies_permission: Defines whether user can manage pipeline settings. + :type has_manage_pipeline_policies_permission: bool + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'has_manage_pipeline_policies_permission': {'key': 'hasManagePipelinePoliciesPermission', 'type': 'bool'}, + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, has_manage_pipeline_policies_permission=None, org_enforce_job_auth_scope=None): + super(OrgPipelineReleaseSettings, self).__init__() + self.has_manage_pipeline_policies_permission = has_manage_pipeline_policies_permission + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + + +class OrgPipelineReleaseSettingsUpdateParameters(Model): + """ + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, org_enforce_job_auth_scope=None): + super(OrgPipelineReleaseSettingsUpdateParameters, self).__init__() + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + + +class PipelineProcess(Model): + """ + :param type: Pipeline process 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): + """ + :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 ProjectPipelineReleaseSettings(Model): + """ + :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + :param has_manage_settings_permission: Defines whether user can manage pipeline settings. + :type has_manage_settings_permission: bool + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + :param public_project: Defines whether project is public. + :type public_project: bool + """ + + _attribute_map = { + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, + 'has_manage_settings_permission': {'key': 'hasManageSettingsPermission', 'type': 'bool'}, + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'}, + 'public_project': {'key': 'publicProject', 'type': 'bool'} + } + + def __init__(self, enforce_job_auth_scope=None, has_manage_settings_permission=None, org_enforce_job_auth_scope=None, public_project=None): + super(ProjectPipelineReleaseSettings, self).__init__() + self.enforce_job_auth_scope = enforce_job_auth_scope + self.has_manage_settings_permission = has_manage_settings_permission + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + self.public_project = public_project + + +class ProjectPipelineReleaseSettingsUpdateParameters(Model): + """ + :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, enforce_job_auth_scope=None): + super(ProjectPipelineReleaseSettingsUpdateParameters, self).__init__() + self.enforce_job_auth_scope = enforce_job_auth_scope + + +class ProjectReference(Model): + """ + :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): + """ + :param project_id: Project ID of the release. + :type project_id: str + :param queue_position: Release queue position. + :type queue_position: int + :param release_id: Queued 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): + """ + 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 Release(Model): + """ + :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_for: Gets or sets the identity for whom release was created. + :type created_for: :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_definition_revision: Gets or sets the release definition revision. + :type release_definition_revision: int + :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_for': {'key': 'createdFor', '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_definition_revision': {'key': 'releaseDefinitionRevision', 'type': 'int'}, + '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_for=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_definition_revision=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_for = created_for + 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_definition_revision = release_definition_revision + 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): + """ + :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): + """ + :param approver: Identity of the approver. + :type approver: :class:`IdentityRef ` + :param comments: Approval history comments. + :type comments: str + :param created_on: Time when this approval created. + :type created_on: datetime + :param changed_by: Identity of the object who changed approval. + :type changed_by: :class:`IdentityRef ` + :param modified_on: Time when this approval modified. + :type modified_on: datetime + :param revision: Approval history revision. + :type revision: int + """ + + _attribute_map = { + 'approver': {'key': 'approver', 'type': 'IdentityRef'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, approver=None, comments=None, created_on=None, changed_by=None, modified_on=None, revision=None): + super(ReleaseApprovalHistory, self).__init__() + self.approver = approver + self.comments = comments + self.created_on = created_on + self.changed_by = changed_by + self.modified_on = modified_on + self.revision = revision + + +class ReleaseCondition(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 + :param result: The release condition 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): + """ + :param approval_options: Gets or sets the approval options. + :type approval_options: :class:`ApprovalOptions ` + :param approvals: Gets or sets the 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): + """ + :param badge_url: Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment. + :type badge_url: str + :param conditions: Gets or sets the environment conditions. + :type conditions: list of :class:`Condition ` + :param current_release: Gets or sets the current release reference. + :type current_release: :class:`ReleaseShallowReference ` + :param demands: Gets or sets the demands. + :type demands: list of :class:`object ` + :param deploy_phases: Gets or sets the deploy phases of environment. + :type deploy_phases: list of :class:`object ` + :param deploy_step: Gets or sets the deploystep. + :type deploy_step: :class:`ReleaseDefinitionDeployStep ` + :param environment_options: Gets or sets the environment options. + :type environment_options: :class:`EnvironmentOptions ` + :param environment_triggers: Gets or sets the triggers on environment. + :type environment_triggers: list of :class:`EnvironmentTrigger ` + :param execution_policy: Gets or sets the environment execution policy. + :type execution_policy: :class:`EnvironmentExecutionPolicy ` + :param id: Gets and sets the ID of the ReleaseDefinitionEnvironment. + :type id: int + :param name: Gets and sets the name of the ReleaseDefinitionEnvironment. + :type name: str + :param owner: Gets and sets the Owner of the ReleaseDefinitionEnvironment. + :type owner: :class:`IdentityRef ` + :param post_deploy_approvals: Gets or sets the post deployment approvals. + :type post_deploy_approvals: :class:`ReleaseDefinitionApprovals ` + :param post_deployment_gates: Gets or sets the post deployment gates. + :type post_deployment_gates: :class:`ReleaseDefinitionGatesStep ` + :param pre_deploy_approvals: Gets or sets the pre deployment approvals. + :type pre_deploy_approvals: :class:`ReleaseDefinitionApprovals ` + :param pre_deployment_gates: Gets or sets the pre deployment gates. + :type pre_deployment_gates: :class:`ReleaseDefinitionGatesStep ` + :param process_parameters: Gets or sets the environment process parameters. + :type process_parameters: :class:`ProcessParameters ` + :param properties: Gets or sets the properties on environment. + :type properties: :class:`object ` + :param queue_id: Gets or sets the queue ID. + :type queue_id: int + :param rank: Gets and sets the rank of the ReleaseDefinitionEnvironment. + :type rank: int + :param retention_policy: Gets or sets the environment retention policy. + :type retention_policy: :class:`EnvironmentRetentionPolicy ` + :param run_options: + :type run_options: dict + :param schedules: Gets or sets the schedules + :type schedules: list of :class:`ReleaseSchedule ` + :param variable_groups: Gets or sets the variable groups. + :type variable_groups: list of int + :param variables: Gets and sets the 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): + """ + :param id: ID of the approval or deploy step. + :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): + """ + :param id: ID of ReleaseDefinition environment summary. + :type id: int + :param last_releases: List of release shallow reference deployed using this ReleaseDefinition. + :type last_releases: list of :class:`ReleaseShallowReference ` + :param name: Name of ReleaseDefinition environment summary. + :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): + """ + :param can_delete: Indicates whether template can be deleted or not. + :type can_delete: bool + :param category: Category of the ReleaseDefinition environment template. + :type category: str + :param description: Description of the ReleaseDefinition environment template. + :type description: str + :param environment: ReleaseDefinition environment data which used to create this template. + :type environment: :class:`ReleaseDefinitionEnvironment ` + :param icon_task_id: ID of the task which used to display icon used for this template. + :type icon_task_id: str + :param icon_uri: Icon uri of the template. + :type icon_uri: str + :param id: ID of the ReleaseDefinition environment template. + :type id: str + :param is_deleted: Indicates whether template deleted or not. + :type is_deleted: bool + :param name: Name of the ReleaseDefinition environment template. + :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): + """ + :param tasks: Gets or sets the gates workflow. + :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): + """ + :param is_enabled: Gets or sets as the gates enabled or not. + :type is_enabled: bool + :param minimum_success_duration: Gets or sets the minimum duration for steady results after a successful gates evaluation. + :type minimum_success_duration: int + :param sampling_interval: Gets or sets the time between re-evaluation of gates. + :type sampling_interval: int + :param stabilization_time: Gets or sets the delay before evaluation. + :type stabilization_time: int + :param timeout: Gets or sets the timeout after which gates fail. + :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): + """ + :param gates: Gets or sets the gates. + :type gates: list of :class:`ReleaseDefinitionGate ` + :param gates_options: Gets or sets the gate options. + :type gates_options: :class:`ReleaseDefinitionGatesOptions ` + :param id: ID of the ReleaseDefinitionGateStep. + :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): + """ + :param api_version: Gets api-version for revision object. + :type api_version: str + :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 changed_by: Gets the identity who did change. + :type changed_by: :class:`IdentityRef ` + :param changed_date: Gets date on which ReleaseDefinition changed. + :type changed_date: datetime + :param change_type: Gets type of change. + :type change_type: object + :param revision: Get revision number of the definition. + :type revision: int + """ + + _attribute_map = { + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, api_version=None, comment=None, definition_id=None, definition_url=None, changed_by=None, changed_date=None, change_type=None, revision=None): + super(ReleaseDefinitionRevision, self).__init__() + self.api_version = api_version + self.comment = comment + self.definition_id = definition_id + self.definition_url = definition_url + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + self.revision = revision + + +class ReleaseDefinitionShallowReference(Model): + """ + :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): + """ + :param environments: List of Release Definition environment summary. + :type environments: list of :class:`ReleaseDefinitionEnvironmentSummary ` + :param release_definition: Release Definition reference. + :type release_definition: :class:`ReleaseDefinitionShallowReference ` + :param releases: List of releases deployed using this Release Definition. + :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): + """ + :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): + """ + :param deployment_jobs: Deployment jobs of the phase. + :type deployment_jobs: list of :class:`DeploymentJob ` + :param error_log: Phase execution error logs. + :type error_log: str + :param id: ID of the phase. + :type id: int + :param manual_interventions: List of manual intervention tasks execution information in phase. + :type manual_interventions: list of :class:`ManualIntervention ` + :param name: Name of the phase. + :type name: str + :param phase_id: ID of the phase. + :type phase_id: str + :param phase_type: Type of the phase. + :type phase_type: object + :param rank: Rank of the phase. + :type rank: int + :param run_plan_id: Run Plan ID of the phase. + :type run_plan_id: str + :param started_on: Phase start time. + :type started_on: datetime + :param status: Status of the phase. + :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): + """ + :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: Post deployment gates snapshot data. + :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: Pre deployment gates snapshot data. + :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): + """ + :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): + """ + :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): + """ + :param deployment_jobs: Contains the gates job details of each evaluation. + :type deployment_jobs: list of :class:`DeploymentJob ` + :param id: ID of release gates. + :type id: int + :param ignored_gates: List of ignored gates. + :type ignored_gates: list of :class:`IgnoredGate ` + :param last_modified_on: Gates last modified time. + :type last_modified_on: datetime + :param run_plan_id: Run plan ID of the gates. + :type run_plan_id: str + :param stabilization_completed_on: Gates stabilization completed date and time. + :type stabilization_completed_on: datetime + :param started_on: Gates evaluation started time. + :type started_on: datetime + :param status: Status of release gates. + :type status: object + :param succeeding_since: Date and time at which all gates executed successfully. + :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): + """ + :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 release. + :type created_by: :class:`IdentityRef ` + :param created_on: Gets date on when this release created. + :type created_on: datetime + :param description: Gets description. + :type description: str + :param id: ID of the Release. + :type id: int + :param modified_by: Gets the identity who modified release. + :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): + """ + :param comment: Comment of the revision. + :type comment: str + :param definition_snapshot_revision: Release ID of which this revision belongs. + :type definition_snapshot_revision: int + :param changed_by: Gets or sets the identity who changed. + :type changed_by: :class:`IdentityRef ` + :param changed_date: Change date of the revision. + :type changed_date: datetime + :param change_details: Change details of the revision. + :type change_details: str + :param change_type: Change details of the revision. Typically ChangeDetails values are Add and Update. + :type change_type: str + :param release_id: Gets or sets the release ID of which this revision belongs. + :type release_id: int + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, + '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'}, + 'release_id': {'key': 'releaseId', 'type': 'int'} + } + + def __init__(self, comment=None, definition_snapshot_revision=None, changed_by=None, changed_date=None, change_details=None, change_type=None, release_id=None): + super(ReleaseRevision, self).__init__() + self.comment = comment + self.definition_snapshot_revision = definition_snapshot_revision + self.changed_by = changed_by + self.changed_date = changed_date + self.change_details = change_details + self.change_type = change_type + self.release_id = release_id + + +class ReleaseSettings(Model): + """ + :param compliance_settings: Release Compliance settings. + :type compliance_settings: :class:`ComplianceSettings ` + :param retention_settings: Release retention settings. + :type retention_settings: :class:`RetentionSettings ` + """ + + _attribute_map = { + 'compliance_settings': {'key': 'complianceSettings', 'type': 'ComplianceSettings'}, + 'retention_settings': {'key': 'retentionSettings', 'type': 'RetentionSettings'} + } + + def __init__(self, compliance_settings=None, retention_settings=None): + super(ReleaseSettings, self).__init__() + self.compliance_settings = compliance_settings + self.retention_settings = retention_settings + + +class ReleaseShallowReference(Model): + """ + :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 ReleaseSchedule(Model): + """ + :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 schedule_only_with_changes: Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed. + :type schedule_only_with_changes: bool + :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'}, + 'schedule_only_with_changes': {'key': 'scheduleOnlyWithChanges', 'type': 'bool'}, + '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, schedule_only_with_changes=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.schedule_only_with_changes = schedule_only_with_changes + self.start_hours = start_hours + self.start_minutes = start_minutes + self.time_zone_id = time_zone_id + + +class ReleaseStartEnvironmentMetadata(Model): + """ + :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): + """ + :param artifacts: Sets list of artifact to create a release. + :type artifacts: list of :class:`ArtifactMetadata ` + :param created_for: Optionally provide a requestor identity + :type created_for: str + :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]'}, + 'created_for': {'key': 'createdFor', 'type': 'str'}, + '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, created_for=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.created_for = created_for + 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): + """ + :param agent_name: Agent name on which task executed. + :type agent_name: str + :param date_ended: + :type date_ended: datetime + :param date_started: + :type date_started: datetime + :param finish_time: Finish time of the release task. + :type finish_time: datetime + :param id: ID of the release task. + :type id: int + :param issues: List of issues occurred while execution of task. + :type issues: list of :class:`Issue ` + :param line_count: Number of lines log release task has. + :type line_count: long + :param log_url: Log URL of the task. + :type log_url: str + :param name: Name of the task. + :type name: str + :param percent_complete: Task execution complete precent. + :type percent_complete: int + :param rank: Rank of the release task. + :type rank: int + :param result_code: Result code of the task. + :type result_code: str + :param start_time: ID of the release task. + :type start_time: datetime + :param status: Status of release task. + :type status: object + :param task: Workflow task reference. + :type task: :class:`WorkflowTaskReference ` + :param timeline_record_id: Timeline record ID of the release task. + :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): + """ + :param _links: Reference links of task. + :type _links: :class:`ReferenceLinks ` + :param created_on: Data and time when it created. + :type created_on: datetime + :param modified_by: Identity who modified. + :type modified_by: :class:`IdentityRef ` + :param modified_on: Data and time when modified. + :type modified_on: datetime + :param name: Name of the task attachment. + :type name: str + :param record_id: Record ID of the task. + :type record_id: str + :param timeline_id: Timeline ID of the task. + :type timeline_id: str + :param type: Type of task attachment. + :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): + """ + :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 name: Sets name of the release. + :type name: 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]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, comment=None, keep_forever=None, manual_environments=None, name=None, status=None): + super(ReleaseUpdateMetadata, self).__init__() + self.comment = comment + self.keep_forever = keep_forever + self.manual_environments = manual_environments + self.name = name + self.status = status + + +class ReleaseWorkItemRef(Model): + """ + :param assignee: + :type assignee: str + :param id: Gets or sets the ID. + :type id: str + :param provider: Gets or sets the provider. + :type provider: str + :param state: Gets or sets the state. + :type state: str + :param title: Gets or sets the title. + :type title: str + :param type: Gets or sets the type. + :type type: str + :param url: Gets or sets the workitem url. + :type url: str + """ + + _attribute_map = { + 'assignee': {'key': 'assignee', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', '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, provider=None, state=None, title=None, type=None, url=None): + super(ReleaseWorkItemRef, self).__init__() + self.assignee = assignee + self.id = id + self.provider = provider + self.state = state + self.title = title + self.type = type + self.url = url + + +class RetentionPolicy(Model): + """ + :param days_to_keep: Indicates the number of days to keep deployment. + :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): + """ + :param days_to_keep_deleted_releases: Number of days to keep deleted releases. + :type days_to_keep_deleted_releases: int + :param default_environment_retention_policy: Specifies the default environment retention policy. + :type default_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` + :param maximum_environment_retention_policy: Specifies the 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): + """ + :param iteration_id: Pull Request Iteration Id for which the release will publish status. + :type iteration_id: str + :param pull_request_id: Pull Request Id for which the release will publish status. + :type pull_request_id: str + :param pull_request_merged_at: Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request. + :type pull_request_merged_at: datetime + :param source_branch: Source branch of the Pull Request. + :type source_branch: str + :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 + :param target_branch: Target branch of the Pull Request. + :type target_branch: str + """ + + _attribute_map = { + 'iteration_id': {'key': 'iterationId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'str'}, + 'pull_request_merged_at': {'key': 'pullRequestMergedAt', 'type': 'iso-8601'}, + 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, + 'source_branch_commit_id': {'key': 'sourceBranchCommitId', 'type': 'str'}, + 'target_branch': {'key': 'targetBranch', 'type': 'str'} + } + + def __init__(self, iteration_id=None, pull_request_id=None, pull_request_merged_at=None, source_branch=None, source_branch_commit_id=None, target_branch=None): + super(SourcePullRequestVersion, self).__init__() + self.iteration_id = iteration_id + self.pull_request_id = pull_request_id + self.pull_request_merged_at = pull_request_merged_at + self.source_branch = source_branch + self.source_branch_commit_id = source_branch_commit_id + self.target_branch = target_branch + + +class SummaryMailSection(Model): + """ + :param html_content: Html content of summary mail. + :type html_content: str + :param rank: Rank of the summary mail. + :type rank: int + :param section_type: Summary mail section type. MailSectionType has section types. + :type section_type: object + :param title: Title of the summary mail. + :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): + """ + :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 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 VariableGroup(Model): + """ + :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 variable_group_project_references: all project references where the variable group is shared with other projects. + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :param variables: Gets and sets the dictionary of 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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + '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, variable_group_project_references=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.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupProjectReference(Model): + """ + A variable group reference is a shallow reference to variable group. + + :param description: Gets or sets description of the variable group. + :type description: str + :param name: Gets or sets name of the variable group. + :type name: str + :param project_reference: Gets or sets project reference of the variable group. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(VariableGroupProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class VariableGroupProviderData(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(VariableGroupProviderData, self).__init__() + + +class VariableValue(Model): + """ + :param is_read_only: Gets or sets if the variable is read only or not. + :type is_read_only: bool + :param is_secret: Gets or sets as the variable is secret or not. + :type is_secret: bool + :param value: Gets or sets the value. + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class WorkflowTask(Model): + """ + :param always_run: Gets or sets as the task always run or not. + :type always_run: bool + :param condition: Gets or sets the task condition. + :type condition: str + :param continue_on_error: Gets or sets as the task continue run on error or not. + :type continue_on_error: bool + :param definition_type: Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'. + :type definition_type: str + :param enabled: Gets or sets as the task enabled or not. + :type enabled: bool + :param environment: Gets or sets the task environment variables. + :type environment: dict + :param inputs: Gets or sets the task inputs. + :type inputs: dict + :param name: Gets or sets the name of the task. + :type name: str + :param override_inputs: Gets or sets the task override inputs. + :type override_inputs: dict + :param ref_name: Gets or sets the reference name of the task. + :type ref_name: str + :param retry_count_on_task_failure: Gets or sets the task retryCount. + :type retry_count_on_task_failure: int + :param task_id: Gets or sets the ID of the task. + :type task_id: str + :param timeout_in_minutes: Gets or sets the task timeout. + :type timeout_in_minutes: int + :param version: Gets or sets the version of the task. + :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'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + self.task_id = task_id + self.timeout_in_minutes = timeout_in_minutes + self.version = version + + +class WorkflowTaskReference(Model): + """ + :param id: Task identifier. + :type id: str + :param name: Name of the task. + :type name: str + :param version: Version of the task. + :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): + """ + :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): + """ + :param id: ID of the approval or deploy step. + :type id: int + :param approver: Gets and sets the approver. + :type approver: :class:`IdentityRef ` + :param is_automated: Indicates whether the approval automated. + :type is_automated: bool + :param is_notification_on: Indicates whether the approval notification set. + :type is_notification_on: bool + :param rank: Gets or sets the rank of approval step. + :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): + """ + :param id: ID of the approval or deploy step. + :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', + 'ComplianceSettings', + 'Condition', + 'ConfigurationVariableValue', + 'DataSourceBindingBase', + 'DefinitionEnvironmentReference', + 'Deployment', + 'DeploymentAttempt', + 'DeploymentJob', + 'DeploymentQueryParameters', + 'EmailRecipients', + 'EnvironmentExecutionPolicy', + 'EnvironmentOptions', + 'EnvironmentRetentionPolicy', + 'EnvironmentTrigger', + 'FavoriteItem', + 'Folder', + 'GateUpdateMetadata', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'IgnoredGate', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'InputValuesQuery', + 'Issue', + 'MailMessage', + 'ManualIntervention', + 'ManualInterventionUpdateMetadata', + 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', + 'PipelineProcess', + 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', + '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', + 'ReleaseSettings', + 'ReleaseShallowReference', + 'ReleaseSchedule', + 'ReleaseStartEnvironmentMetadata', + 'ReleaseStartMetadata', + 'ReleaseTask', + 'ReleaseTaskAttachment', + 'ReleaseUpdateMetadata', + 'ReleaseWorkItemRef', + 'RetentionPolicy', + 'RetentionSettings', + 'SourcePullRequestVersion', + 'SummaryMailSection', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskSourceDefinitionBase', + 'VariableGroup', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'WorkflowTask', + 'WorkflowTaskReference', + 'ReleaseDefinition', + 'ReleaseDefinitionApprovalStep', + 'ReleaseDefinitionDeployStep', +] diff --git a/azure-devops/azure/devops/v7_0/release/release_client.py b/azure-devops/azure/devops/v7_0/release/release_client.py new file mode 100644 index 00000000..f65c0f3b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/release/release_client.py @@ -0,0 +1,876 @@ +# -------------------------------------------------------------------------------------------- +# 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: :class:`<[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='7.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='7.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. + Get a release task attachment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str timeline_id: Timeline Id of the task. + :param str record_id: Record Id of attachment. + :param str type: Type of the attachment. + :param str name: Name of the attachment. + :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='7.0', + 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. + Get the release task attachments. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str type: Type of the attachment. + :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='7.0', + 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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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: :class:`<[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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Deployment]', self._unwrap_collection(response)) + + def get_release_environment(self, project, release_id, environment_id, expand=None): + """GetReleaseEnvironment. + Get a release environment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param str expand: A property that should be expanded in the 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReleaseEnvironment', response) + + def update_release_environment(self, environment_update_data, project, release_id, environment_id): + """UpdateReleaseEnvironment. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseEnvironment', response) + + def delete_folder(self, project, path): + """DeleteFolder. + Deletes a definition folder for given folder name and path and all it's existing definitions. + :param str project: Project ID or project name + :param str path: Path of the folder to delete. + """ + 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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values) + + def get_folders(self, project, path=None, query_order=None): + """GetFolders. + Gets folders. + :param str project: Project ID or project name + :param str path: Path of the folder. + :param str query_order: Gets the results in the defined order. Default is 'None'. + :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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Folder]', self._unwrap_collection(response)) + + def update_folder(self, folder, project, path): + """UpdateFolder. + Updates an existing folder at given existing path. + :param :class:` ` folder: folder. + :param str project: Project ID or project name + :param str path: Path of the folder to update. + :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='PATCH', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Folder', response) + + def update_gates(self, gate_update_metadata, project, gate_step_id): + """UpdateGates. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseGates', response) + + def get_logs(self, project, release_id, **kwargs): + """GetLogs. + 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='7.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_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): + """GetTaskLog. + 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='7.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_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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Release', response) + + def get_definition_revision(self, project, definition_id, revision, **kwargs): + """GetDefinitionRevision. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/sbom/__init__.py b/azure-devops/azure/devops/v7_0/sbom/__init__.py new file mode 100644 index 00000000..35cd2743 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/sbom/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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 .sbom_client import SBOMClient + +__all__ = [ + 'Configuration', + 'ConfigurationSetting', + 'FileHash', + 'ManifestInfo', + 'SBOMFile', + 'SBOMTelemetry', + 'SignResponseBase', + 'SignStatusResponse', + 'SBOMClient' +] diff --git a/azure-devops/azure/devops/v7_0/sbom/models.py b/azure-devops/azure/devops/v7_0/sbom/models.py new file mode 100644 index 00000000..9f255b2e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/sbom/models.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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 Configuration(Model): + """ + This holds the configuration for the ManifestTool. The values in this file are populated from the command line, config file and default. + + :param additional_component_detector_args: Additional set of command-line arguments for Component Detector. + :type additional_component_detector_args: :class:`ConfigurationSetting ` + :param build_component_path: The folder containing the build components and packages. + :type build_component_path: :class:`ConfigurationSetting ` + :param build_drop_path: The root folder of the drop directory to validate or generate. + :type build_drop_path: :class:`ConfigurationSetting ` + :param build_list_file: Full file name of a list file that contains all files to be validated. + :type build_list_file: :class:`ConfigurationSetting ` + :param catalog_file_path: The path of the signed catalog file used to validate the manifest.json. + :type catalog_file_path: :class:`ConfigurationSetting ` + :param config_file_path: The json file that contains the configuration for the DropValidator. + :type config_file_path: :class:`ConfigurationSetting ` + :param docker_images_to_scan: Comma separated list of docker image names or hashes to be scanned for packages, ex: ubuntu:16.04, 56bab49eef2ef07505f6a1b0d5bd3a601dfc3c76ad4460f24c91d6fa298369ab. + :type docker_images_to_scan: :class:`ConfigurationSetting ` + :param external_document_reference_list_file: Full file path to a file that contains list of external SBOMs to be included as External document reference. + :type external_document_reference_list_file: :class:`ConfigurationSetting ` + :param hash_algorithm: The Hash algorithm to use while verifying the hash value of a file. + :type hash_algorithm: :class:`ConfigurationSetting ` + :param ignore_missing: If set, will not fail validation on the files presented in Manifest but missing on the disk. + :type ignore_missing: :class:`ConfigurationSetting ` + :param manifest_dir_path: The root folder where the generated manifest (and other files like bsi.json) files will be placed. By default we will generate this folder in the same level as the build drop with the name '_manifest' + :type manifest_dir_path: :class:`ConfigurationSetting ` + :param manifest_info: A list of name and version of the manifest that we are generating. + :type manifest_info: :class:`ConfigurationSetting ` + :param manifest_tool_action: The action currently being performed by the manifest tool. + :type manifest_tool_action: object + :param package_name: The name of the package this SBOM represents. + :type package_name: :class:`ConfigurationSetting ` + :param package_version: The version of the package this SBOM represents. + :type package_version: :class:`ConfigurationSetting ` + :param parallelism: The number of parallel threads to use for the workflows. + :type parallelism: :class:`ConfigurationSetting ` + :param root_path_filter: If you're downloading only a part of the drop using the '-r' or 'root' parameter in the drop client, specify the same string value here in order to skip validating paths that are not downloaded. + :type root_path_filter: :class:`ConfigurationSetting ` + :param telemetry_file_path: If specified, we will store the generated telemetry for the execution of the SBOM tool at this path. + :type telemetry_file_path: :class:`ConfigurationSetting ` + :param validate_signature: If set, will validate the manifest using the signed catalog file. + :type validate_signature: :class:`ConfigurationSetting ` + """ + + _attribute_map = { + 'additional_component_detector_args': {'key': 'additionalComponentDetectorArgs', 'type': 'ConfigurationSetting'}, + 'build_component_path': {'key': 'buildComponentPath', 'type': 'ConfigurationSetting'}, + 'build_drop_path': {'key': 'buildDropPath', 'type': 'ConfigurationSetting'}, + 'build_list_file': {'key': 'buildListFile', 'type': 'ConfigurationSetting'}, + 'catalog_file_path': {'key': 'catalogFilePath', 'type': 'ConfigurationSetting'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'ConfigurationSetting'}, + 'docker_images_to_scan': {'key': 'dockerImagesToScan', 'type': 'ConfigurationSetting'}, + 'external_document_reference_list_file': {'key': 'externalDocumentReferenceListFile', 'type': 'ConfigurationSetting'}, + 'hash_algorithm': {'key': 'hashAlgorithm', 'type': 'ConfigurationSetting'}, + 'ignore_missing': {'key': 'ignoreMissing', 'type': 'ConfigurationSetting'}, + 'manifest_dir_path': {'key': 'manifestDirPath', 'type': 'ConfigurationSetting'}, + 'manifest_info': {'key': 'manifestInfo', 'type': 'ConfigurationSetting'}, + 'manifest_tool_action': {'key': 'manifestToolAction', 'type': 'object'}, + 'package_name': {'key': 'packageName', 'type': 'ConfigurationSetting'}, + 'package_version': {'key': 'packageVersion', 'type': 'ConfigurationSetting'}, + 'parallelism': {'key': 'parallelism', 'type': 'ConfigurationSetting'}, + 'root_path_filter': {'key': 'rootPathFilter', 'type': 'ConfigurationSetting'}, + 'telemetry_file_path': {'key': 'telemetryFilePath', 'type': 'ConfigurationSetting'}, + 'validate_signature': {'key': 'validateSignature', 'type': 'ConfigurationSetting'} + } + + def __init__(self, additional_component_detector_args=None, build_component_path=None, build_drop_path=None, build_list_file=None, catalog_file_path=None, config_file_path=None, docker_images_to_scan=None, external_document_reference_list_file=None, hash_algorithm=None, ignore_missing=None, manifest_dir_path=None, manifest_info=None, manifest_tool_action=None, package_name=None, package_version=None, parallelism=None, root_path_filter=None, telemetry_file_path=None, validate_signature=None): + super(Configuration, self).__init__() + self.additional_component_detector_args = additional_component_detector_args + self.build_component_path = build_component_path + self.build_drop_path = build_drop_path + self.build_list_file = build_list_file + self.catalog_file_path = catalog_file_path + self.config_file_path = config_file_path + self.docker_images_to_scan = docker_images_to_scan + self.external_document_reference_list_file = external_document_reference_list_file + self.hash_algorithm = hash_algorithm + self.ignore_missing = ignore_missing + self.manifest_dir_path = manifest_dir_path + self.manifest_info = manifest_info + self.manifest_tool_action = manifest_tool_action + self.package_name = package_name + self.package_version = package_version + self.parallelism = parallelism + self.root_path_filter = root_path_filter + self.telemetry_file_path = telemetry_file_path + self.validate_signature = validate_signature + + +class ConfigurationSetting(Model): + """ + Encapsulates a configuration setting to provide metadata about the setting source and type. + + :param source: The source where this setting came from. + :type source: str + :param value: The actual value of the setting. + :type value: object + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'} + } + + def __init__(self, source=None, value=None): + super(ConfigurationSetting, self).__init__() + self.source = source + self.value = value + + +class FileHash(Model): + """ + Used to provide the filename and hash of the SBOM file to be added to the catalog file. + + :param file_name: The filename of the SBOM. + :type file_name: str + :param hash: The string hash of the SBOM file. + :type hash: str + :param hash_algorithm_name: The HashAlgorithmName used to generate the hash of the file. + :type hash_algorithm_name: HashAlgorithmName + """ + + _attribute_map = { + 'file_name': {'key': 'fileName', 'type': 'str'}, + 'hash': {'key': 'hash', 'type': 'str'}, + 'hash_algorithm_name': {'key': 'hashAlgorithmName', 'type': 'HashAlgorithmName'} + } + + def __init__(self, file_name=None, hash=None, hash_algorithm_name=None): + super(FileHash, self).__init__() + self.file_name = file_name + self.hash = hash + self.hash_algorithm_name = hash_algorithm_name + + +class ManifestInfo(Model): + """ + Defines a manifest name and version. + + :param name: The name of the manifest. + :type name: str + :param version: The version of the manifest. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, name=None, version=None): + super(ManifestInfo, self).__init__() + self.name = name + self.version = version + + +class SBOMFile(Model): + """ + Represents a SBOM file object and contains additional properties related to the file. + + :param file_size_in_bytes: The size of the SBOM file in bytes. + :type file_size_in_bytes: long + :param sbom_file_path: The path where the final generated SBOM is placed. + :type sbom_file_path: str + :param sbom_format_name: The name and version of the format of the generated SBOM. + :type sbom_format_name: :class:`ManifestInfo ` + """ + + _attribute_map = { + 'file_size_in_bytes': {'key': 'fileSizeInBytes', 'type': 'long'}, + 'sbom_file_path': {'key': 'sbomFilePath', 'type': 'str'}, + 'sbom_format_name': {'key': 'sbomFormatName', 'type': 'ManifestInfo'} + } + + def __init__(self, file_size_in_bytes=None, sbom_file_path=None, sbom_format_name=None): + super(SBOMFile, self).__init__() + self.file_size_in_bytes = file_size_in_bytes + self.sbom_file_path = sbom_file_path + self.sbom_format_name = sbom_format_name + + +class SBOMTelemetry(Model): + """ + The telemetry that is logged to a file/console for the given SBOM execution. + + :param bsi_data: All available bsi data from the task build execution which includes build and system environment variables like repository and build information. + :type bsi_data: dict + :param bsi_source: The source of the bsi data. + :type bsi_source: str + :param e2_eTask_result: The end to end results of the extension task. + :type e2_eTask_result: str + :param parameters: A list of ConfigurationSetting`1 representing each input parameter used in the validation. + :type parameters: :class:`Configuration ` + :param result: The result of the execution + :type result: str + :param sbom_formats_used: A list of the SBOM formats and related file properties that was used in the generation/validation of the SBOM. + :type sbom_formats_used: list of :class:`SBOMFile ` + :param switches: Any internal switches and their value that were used during the execution. A switch can be something that was provided through a configuraiton or an environment variable. + :type switches: dict + :param task_error_message: Error messages that came from the extension task. + :type task_error_message: str + :param tool_execution_result: The result of the tool as a numeric value. + :type tool_execution_result: int + """ + + _attribute_map = { + 'bsi_data': {'key': 'bsiData', 'type': '{str}'}, + 'bsi_source': {'key': 'bsiSource', 'type': 'str'}, + 'e2_eTask_result': {'key': 'e2ETaskResult', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'Configuration'}, + 'result': {'key': 'result', 'type': 'str'}, + 'sbom_formats_used': {'key': 'sbomFormatsUsed', 'type': '[SBOMFile]'}, + 'switches': {'key': 'switches', 'type': '{object}'}, + 'task_error_message': {'key': 'taskErrorMessage', 'type': 'str'}, + 'tool_execution_result': {'key': 'toolExecutionResult', 'type': 'int'} + } + + def __init__(self, bsi_data=None, bsi_source=None, e2_eTask_result=None, parameters=None, result=None, sbom_formats_used=None, switches=None, task_error_message=None, tool_execution_result=None): + super(SBOMTelemetry, self).__init__() + self.bsi_data = bsi_data + self.bsi_source = bsi_source + self.e2_eTask_result = e2_eTask_result + self.parameters = parameters + self.result = result + self.sbom_formats_used = sbom_formats_used + self.switches = switches + self.task_error_message = task_error_message + self.tool_execution_result = tool_execution_result + + +class SignResponseBase(Model): + """ + The base reponse object for all responses from the signing api. + + :param customer_correlation_id: The customer correlation id that is sent to ESRP for correlating the current request to ESRP. + :type customer_correlation_id: str + :param error_info: If this is an error response, it will have more information about the error. + :type error_info: str + :param result: The result of the response. + :type result: object + """ + + _attribute_map = { + 'customer_correlation_id': {'key': 'customerCorrelationId', 'type': 'str'}, + 'error_info': {'key': 'errorInfo', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'object'} + } + + def __init__(self, customer_correlation_id=None, error_info=None, result=None): + super(SignResponseBase, self).__init__() + self.customer_correlation_id = customer_correlation_id + self.error_info = error_info + self.result = result + + +class SignStatusResponse(SignResponseBase): + """ + The response returned by the sign status api. + + :param customer_correlation_id: The customer correlation id that is sent to ESRP for correlating the current request to ESRP. + :type customer_correlation_id: str + :param error_info: If this is an error response, it will have more information about the error. + :type error_info: str + :param result: The result of the response. + :type result: object + :param download_url: The pre-signed download url used to download the signed catalog file. + :type download_url: str + """ + + _attribute_map = { + 'customer_correlation_id': {'key': 'customerCorrelationId', 'type': 'str'}, + 'error_info': {'key': 'errorInfo', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'object'}, + 'download_url': {'key': 'downloadUrl', 'type': 'str'} + } + + def __init__(self, customer_correlation_id=None, error_info=None, result=None, download_url=None): + super(SignStatusResponse, self).__init__(customer_correlation_id=customer_correlation_id, error_info=error_info, result=result) + self.download_url = download_url + + +__all__ = [ + 'Configuration', + 'ConfigurationSetting', + 'FileHash', + 'ManifestInfo', + 'SBOMFile', + 'SBOMTelemetry', + 'SignResponseBase', + 'SignStatusResponse', +] diff --git a/azure-devops/azure/devops/v7_0/sbom/sbom_client.py b/azure-devops/azure/devops/v7_0/sbom/sbom_client.py new file mode 100644 index 00000000..98ed021b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/sbom/sbom_client.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------------- +# 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 SBOMClient(Client): + """SBOM + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(SBOMClient, 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 = '2e504d18-2c0c-46f8-af8f-322d2af0068a' + diff --git a/azure-devops/azure/devops/v7_0/search/__init__.py b/azure-devops/azure/devops/v7_0/search/__init__.py new file mode 100644 index 00000000..ca31a2b8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/search/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'BoardResult', + 'BoardSearchRequest', + 'BoardSearchResponse', + 'BranchInfo', + 'CodeResult', + 'CodeSearchRequest', + 'CodeSearchResponse', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequest', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchRequest', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchRequest', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchRequest', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchRequest', + 'WorkItemSearchResponse', + 'SearchClient' +] diff --git a/azure-devops/azure/devops/v7_0/search/models.py b/azure-devops/azure/devops/v7_0/search/models.py new file mode 100644 index 00000000..c8cbab42 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/search/models.py @@ -0,0 +1,1247 @@ +# -------------------------------------------------------------------------------------------- +# 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 BoardResult(Model): + """ + Defines the Board result that matched a Board search request. + + :param boardtype: Board Type of the board document. + :type boardtype: str + :param collection: Collection details of the baord document. + :type collection: :class:`Collection ` + :param project: Project details of the board document. + :type project: :class:`Project ` + :param team: Team details of the board document. + :type team: :class:`Team ` + """ + + _attribute_map = { + 'boardtype': {'key': 'boardtype', 'type': 'str'}, + 'collection': {'key': 'collection', 'type': 'Collection'}, + 'project': {'key': 'project', 'type': 'Project'}, + 'team': {'key': 'team', 'type': 'Team'} + } + + def __init__(self, boardtype=None, collection=None, project=None, team=None): + super(BoardResult, self).__init__() + self.boardtype = boardtype + self.collection = collection + self.project = project + self.team = team + + +class BranchInfo(Model): + """ + Information about the configured branch. + + :param last_indexed_change_id: The commit Id of the last Git commit indexed in this branch + :type last_indexed_change_id: str + :param last_processed_time: The last time this branch was processed by the Search service + :type last_processed_time: datetime + :param name: Name of the indexed branch + :type name: str + """ + + _attribute_map = { + 'last_indexed_change_id': {'key': 'lastIndexedChangeId', 'type': 'str'}, + 'last_processed_time': {'key': 'lastProcessedTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, last_indexed_change_id=None, last_processed_time=None, name=None): + super(BranchInfo, self).__init__() + self.last_indexed_change_id = last_indexed_change_id + self.last_processed_time = last_processed_time + self.name = name + + +class CodeResult(Model): + """ + Defines the code result containing information of the searched files and its metadata. + + :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:`Version ` + """ + + _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': '[Version]'} + } + + 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): + """ + Defines the details of the 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 CustomRepositoryBranchStatusResponse(Model): + """ + :param last_indexed_change_id: + :type last_indexed_change_id: long + :param last_indexed_change_id_change_time: + :type last_indexed_change_id_change_time: datetime + :param latest_change_id: + :type latest_change_id: long + :param latest_change_id_change_time: + :type latest_change_id_change_time: datetime + """ + + _attribute_map = { + 'last_indexed_change_id': {'key': 'lastIndexedChangeId', 'type': 'long'}, + 'last_indexed_change_id_change_time': {'key': 'lastIndexedChangeIdChangeTime', 'type': 'iso-8601'}, + 'latest_change_id': {'key': 'latestChangeId', 'type': 'long'}, + 'latest_change_id_change_time': {'key': 'latestChangeIdChangeTime', 'type': 'iso-8601'} + } + + def __init__(self, last_indexed_change_id=None, last_indexed_change_id_change_time=None, latest_change_id=None, latest_change_id_change_time=None): + super(CustomRepositoryBranchStatusResponse, self).__init__() + self.last_indexed_change_id = last_indexed_change_id + self.last_indexed_change_id_change_time = last_indexed_change_id_change_time + self.latest_change_id = latest_change_id + self.latest_change_id_change_time = latest_change_id_change_time + + +class CustomRepositoryStatusResponse(Model): + """ + Defines the custom repository status. + + :param id: Repository Id. + :type id: str + :param indexed_top_level_folders: List of indexed top level folders info. + :type indexed_top_level_folders: list of :class:`DepotInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexed_top_level_folders': {'key': 'indexedTopLevelFolders', 'type': '[DepotInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexed_top_level_folders=None, name=None): + super(CustomRepositoryStatusResponse, self).__init__() + self.id = id + self.indexed_top_level_folders = indexed_top_level_folders + self.name = name + + +class DepotInfo(Model): + """ + Information about the custom repository indexing freshness for configured branches and depots. + + :param indexed_branches: List of Indexed branches info. + :type indexed_branches: list of :class:`BranchInfo ` + :param name: Name of the indexed top level folder (depot). + :type name: str + """ + + _attribute_map = { + 'indexed_branches': {'key': 'indexedBranches', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, indexed_branches=None, name=None): + super(DepotInfo, self).__init__() + self.indexed_branches = indexed_branches + self.name = name + + +class EntitySearchRequestBase(Model): + """ + Base class for search request types. + + :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): + """ + Defines the base contract for search response. + + :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 FeedInfo(Model): + """ + Defines the details of a feed. + + :param collection_id: Id of the collection. + :type collection_id: str + :param collection_name: Name of the collection. + :type collection_name: str + :param feed_id: Id of the feed. + :type feed_id: str + :param feed_name: Name of the feed. + :type feed_name: str + :param latest_matched_version: Latest matched version of package in this Feed. + :type latest_matched_version: str + :param latest_version: Latest version of package in this Feed. + :type latest_version: str + :param package_url: Url of package in this Feed. + :type package_url: str + :param views: List of views which contain the matched package. + :type views: list of str + """ + + _attribute_map = { + 'collection_id': {'key': 'collectionId', 'type': 'str'}, + 'collection_name': {'key': 'collectionName', 'type': 'str'}, + 'feed_id': {'key': 'feedId', 'type': 'str'}, + 'feed_name': {'key': 'feedName', 'type': 'str'}, + 'latest_matched_version': {'key': 'latestMatchedVersion', 'type': 'str'}, + 'latest_version': {'key': 'latestVersion', 'type': 'str'}, + 'package_url': {'key': 'packageUrl', 'type': 'str'}, + 'views': {'key': 'views', 'type': '[str]'} + } + + def __init__(self, collection_id=None, collection_name=None, feed_id=None, feed_name=None, latest_matched_version=None, latest_version=None, package_url=None, views=None): + super(FeedInfo, self).__init__() + self.collection_id = collection_id + self.collection_name = collection_name + self.feed_id = feed_id + self.feed_name = feed_name + self.latest_matched_version = latest_matched_version + self.latest_version = latest_version + self.package_url = package_url + self.views = views + + +class Filter(Model): + """ + Describes a filter bucket item representing the total matches of search result, name and id. + + :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): + """ + Describes the position of a piece of text in a document. + + :param code_snippet: Gets or sets an extract of code where the match appears. Usually it is the line where there is the match. + :type code_snippet: str + :param column: Gets or sets the column number where the match appears in the line. + :type column: int + :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 + :param line: Gets or sets the line number where the match appears in the file. + :type line: int + :param type: Gets or sets the name of type of a piece of text. + :type type: str + """ + + _attribute_map = { + 'code_snippet': {'key': 'codeSnippet', 'type': 'str'}, + 'column': {'key': 'column', 'type': 'int'}, + 'char_offset': {'key': 'charOffset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'line': {'key': 'line', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, code_snippet=None, column=None, char_offset=None, length=None, line=None, type=None): + super(Hit, self).__init__() + self.code_snippet = code_snippet + self.column = column + self.char_offset = char_offset + self.length = length + self.line = line + self.type = type + + +class PackageHit(Model): + """ + Defines the matched terms in the field of the package result. + + :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(PackageHit, self).__init__() + self.field_reference_name = field_reference_name + self.highlights = highlights + + +class PackageResult(Model): + """ + Defines the package result that matched a package search request. + + :param description: Description of the package. + :type description: str + :param feeds: List of feeds which contain the matching package. + :type feeds: list of :class:`FeedInfo ` + :param hits: List of highlighted fields for the match. + :type hits: list of :class:`PackageHit ` + :param id: Id of the package. + :type id: str + :param name: Name of the package. + :type name: str + :param protocol_type: Type of the package. + :type protocol_type: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'feeds': {'key': 'feeds', 'type': '[FeedInfo]'}, + 'hits': {'key': 'hits', 'type': '[PackageHit]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'} + } + + def __init__(self, description=None, feeds=None, hits=None, id=None, name=None, protocol_type=None): + super(PackageResult, self).__init__() + self.description = description + self.feeds = feeds + self.hits = hits + self.id = id + self.name = name + self.protocol_type = protocol_type + + +class PackageSearchResponse(Model): + """ + :param activity_id: + :type activity_id: list of str + :param content: + :type content: :class:`PackageSearchResponseContent ` + """ + + _attribute_map = { + 'activity_id': {'key': 'activityId', 'type': '[str]'}, + 'content': {'key': 'content', 'type': 'PackageSearchResponseContent'} + } + + def __init__(self, activity_id=None, content=None): + super(PackageSearchResponse, self).__init__() + self.activity_id = activity_id + self.content = content + + +class PackageSearchResponseContent(EntitySearchResponse): + """ + Defines a response item that is returned for a package search request. + + :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 packages. + :type count: int + :param results: List of matched packages. + :type results: list of :class:`PackageResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[PackageResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(PackageSearchResponseContent, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class Project(Model): + """ + Defines the details of the 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): + """ + Defines the details of the project. + + :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): + """ + Defines the details of the 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 RepositoryStatusResponse(Model): + """ + Defines the repository status. + + :param id: Repository Id. + :type id: str + :param indexed_branches: List of Indexed branches info. + :type indexed_branches: list of :class:`BranchInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexed_branches': {'key': 'indexedBranches', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexed_branches=None, name=None): + super(RepositoryStatusResponse, self).__init__() + self.id = id + self.indexed_branches = indexed_branches + self.name = name + + +class ScrollSearchRequest(EntitySearchRequestBase): + """ + Defines a scroll code search request. + + :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 scroll_id: Scroll Id for scroll search query. + :type scroll_id: str + :param scroll_size: Size of data to return for scroll search query. Min value is 201. + :type scroll_size: int + """ + + _attribute_map = { + 'filters': {'key': 'filters', 'type': '{[str]}'}, + 'search_text': {'key': 'searchText', 'type': 'str'}, + 'scroll_id': {'key': '$scrollId', 'type': 'str'}, + 'scroll_size': {'key': '$scrollSize', 'type': 'int'} + } + + def __init__(self, filters=None, search_text=None, scroll_id=None, scroll_size=None): + super(ScrollSearchRequest, self).__init__(filters=filters, search_text=search_text) + self.scroll_id = scroll_id + self.scroll_size = scroll_size + + +class SettingResult(Model): + """ + Defines the setting result that matched a setting search request + + :param description: Description of the settings page + :type description: str + :param icon: Icon name of the settings page + :type icon: str + :param route_id: Contribution url route id of the corresponding settings page + :type route_id: str + :param route_parameter_mapping: Contribution url route parameter of the corresponding settings page + :type route_parameter_mapping: dict + :param scope: Scope of the settings page, either organization, project or user + :type scope: object + :param title: Title of the settings page + :type title: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'icon': {'key': 'icon', 'type': 'str'}, + 'route_id': {'key': 'routeId', 'type': 'str'}, + 'route_parameter_mapping': {'key': 'routeParameterMapping', 'type': '{str}'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'title': {'key': 'title', 'type': 'str'} + } + + def __init__(self, description=None, icon=None, route_id=None, route_parameter_mapping=None, scope=None, title=None): + super(SettingResult, self).__init__() + self.description = description + self.icon = icon + self.route_id = route_id + self.route_parameter_mapping = route_parameter_mapping + self.scope = scope + self.title = title + + +class SettingSearchResponse(EntitySearchResponse): + """ + Defines a setting search response item + + :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 setting documents. + :type count: int + :param results: List of top matched setting documents. + :type results: list of :class:`SettingResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[SettingResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(SettingSearchResponse, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class SortOption(Model): + """ + Defines how to sort the result. + + :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 Team(Model): + """ + Defines the details of the team. + + :param id: Id of the team. + :type id: str + :param name: Name of the Team. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(Team, self).__init__() + self.id = id + self.name = name + + +class TfvcRepositoryStatusResponse(Model): + """ + Defines the TFVC repository status. + + :param id: Repository Id. + :type id: str + :param indexing_information: List of Indexing Information for TFVC repository + :type indexing_information: list of :class:`BranchInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexing_information': {'key': 'indexingInformation', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexing_information=None, name=None): + super(TfvcRepositoryStatusResponse, self).__init__() + self.id = id + self.indexing_information = indexing_information + self.name = name + + +class Version(Model): + """ + Describes the details pertaining to a version of the result file. + + :param branch_name: Name of the branch. + :type branch_name: str + :param change_id: ChangeId in the given branch associated with this match. + :type change_id: str + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'change_id': {'key': 'changeId', 'type': 'str'} + } + + def __init__(self, branch_name=None, change_id=None): + super(Version, self).__init__() + self.branch_name = branch_name + self.change_id = change_id + + +class Wiki(Model): + """ + Defines the details of 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): + """ + Defines the matched terms in the field of the wiki result. + + :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): + """ + Defines the wiki result that matched a wiki search request. + + :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): + """ + Defines a wiki search response item. + + :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): + """ + Defines the matched terms in the field of the work item result. + + :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): + """ + Defines the work item result that matched a work item search request. + + :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): + """ + Defines a response item that is returned for a work item search request. + + :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 BoardSearchResponse(EntitySearchResponse): + """ + Defines a Board search response item. + + :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 Board documents. + :type count: int + :param results: List of top matched Board documents. + :type results: list of :class:`BoardResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[BoardResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(BoardSearchResponse, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class CodeSearchResponse(EntitySearchResponse): + """ + Defines a code search response item. + + :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): + """ + Base contract for search request types without scroll support. + + :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 PackageSearchRequest(EntitySearchRequest): + """ + Defines a package search request. + + :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(PackageSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class SettingSearchRequest(EntitySearchRequest): + """ + Defines a setting search request + + :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(SettingSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class WikiSearchRequest(EntitySearchRequest): + """ + Defines a wiki search request. + + :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): + """ + Defines a work item search request. + + :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 BoardSearchRequest(EntitySearchRequest): + """ + Defines a Board search request. + + :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(BoardSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class CodeSearchRequest(EntitySearchRequest): + """ + Defines a code search request. + + :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 + :param include_snippet: Flag to opt for including matched code snippet in the result. Default behavior is false. + :type include_snippet: 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'}, + 'include_snippet': {'key': 'includeSnippet', 'type': 'bool'} + } + + def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None, include_snippet=None): + super(CodeSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + self.include_snippet = include_snippet + + +__all__ = [ + 'BoardResult', + 'BranchInfo', + 'CodeResult', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchResponse', + 'BoardSearchResponse', + 'CodeSearchResponse', + 'EntitySearchRequest', + 'PackageSearchRequest', + 'SettingSearchRequest', + 'WikiSearchRequest', + 'WorkItemSearchRequest', + 'BoardSearchRequest', + 'CodeSearchRequest', +] diff --git a/azure-devops/azure/devops/v7_0/search/search_client.py b/azure-devops/azure/devops/v7_0/search/search_client.py new file mode 100644 index 00000000..9ae71cd8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/search/search_client.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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_scroll_code_search_results(self, request, project=None): + """FetchScrollCodeSearchResults. + 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, 'ScrollSearchRequest') + response = self._send(http_method='POST', + location_id='852dac94-e8f7-45a2-9910-927ae35766a2', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_code_search_results(self, request, project=None): + """FetchCodeSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_package_search_results(self, request): + """FetchPackageSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Package Search Request. + :rtype: :class:` ` + """ + content = self._serialize.body(request, 'PackageSearchRequest') + response = self._send(http_method='POST', + location_id='f62ada48-eedc-4c8e-93f0-de870e4ecce0', + version='7.0', + content=content) + response_object = models.PackageSearchResponse() + response_object.content = self._deserialize('PackageSearchResponseContent', response) + response_object.activity_id = response.headers.get('ActivityId') + return response_object + + def get_repository_status(self, project, repository): + """GetRepositoryStatus. + Provides status of Repository. + :param str project: Project ID or project name + :param str repository: Repository ID or repository name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository is not None: + route_values['repository'] = self._serialize.url('repository', repository, 'str') + response = self._send(http_method='GET', + location_id='1f60303c-7261-4387-80f1-742a2ecf2964', + version='7.0', + route_values=route_values) + return self._deserialize('RepositoryStatusResponse', response) + + def get_tfvc_repository_status(self, project): + """GetTfvcRepositoryStatus. + Provides status of TFVC 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') + response = self._send(http_method='GET', + location_id='d5bf4e52-e0af-4626-8c50-8a80b18fa69f', + version='7.0', + route_values=route_values) + return self._deserialize('TfvcRepositoryStatusResponse', response) + + def fetch_wiki_search_results(self, request, project=None): + """FetchWikiSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WikiSearchResponse', response) + + def fetch_work_item_search_results(self, request, project=None): + """FetchWorkItemSearchResults. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemSearchResponse', response) + diff --git a/azure-devops/azure/devops/v7_0/security/__init__.py b/azure-devops/azure/devops/v7_0/security/__init__.py new file mode 100644 index 00000000..6ddc7288 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/security/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/security/models.py b/azure-devops/azure/devops/v7_0/security/models.py new file mode 100644 index 00000000..f458386c --- /dev/null +++ b/azure-devops/azure/devops/v7_0/security/models.py @@ -0,0 +1,267 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Class for encapsulating the allowed and denied permissions for a given IdentityDescriptor. + + :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): + """ + The AccessControlList class is meant to associate a set of AccessControlEntries with a security token and its inheritance settings. + + :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): + """ + A list of AccessControlList. An AccessControlList is meant to associate a set of AccessControlEntries with a security token and its inheritance settings. + + """ + + _attribute_map = { + } + + def __init__(self): + super(AccessControlListsCollection, self).__init__() + + +class AceExtendedInformation(Model): + """ + Holds the inherited and effective permission information for a given AccessControlEntry. + + :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): + """ + :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): + """ + Represents an evaluated permission. + + :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): + """ + Represents a set of evaluated permissions. + + :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): + """ + Class for describing the details of a TeamFoundationSecurityNamespace. + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/security/security_client.py b/azure-devops/azure/devops/v7_0/security/security_client.py new file mode 100644 index 00000000..393e0b80 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/security/security_client.py @@ -0,0 +1,224 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/service_endpoint/__init__.py b/azure-devops/azure/devops/v7_0/service_endpoint/__init__.py new file mode 100644 index 00000000..24dc7c7a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_endpoint/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AadOauthTokenRequest', + 'AadOauthTokenResult', + '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', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'ServiceEndpointClient' +] diff --git a/azure-devops/azure/devops/v7_0/service_endpoint/models.py b/azure-devops/azure/devops/v7_0/service_endpoint/models.py new file mode 100644 index 00000000..a4a2b215 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_endpoint/models.py @@ -0,0 +1,1478 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + Specifies the authentication scheme to be used for authentication. + + :param inputs: Gets or sets the key and value of the fields used for authentication. + :type inputs: dict + :param type: Gets or sets the type of authentication scheme of an endpoint. + :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): + """ + Represents the header of the REST request. + + :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): + """ + Azure Management Group + + :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): + """ + Azure management group query result + + :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): + """ + :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): + """ + :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): + """ + Specifies the client certificate to be used for the endpoint request. + + :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): + """ + Specifies the data sources for this endpoint. + + :param authentication_scheme: Gets or sets the authentication scheme for the endpoint request. + :type authentication_scheme: :class:`AuthenticationSchemeReference ` + :param callback_context_template: Gets or sets the pagination format supported by this data source(ContinuationToken/SkipTop). + :type callback_context_template: str + :param callback_required_template: Gets or sets the template to check if subsequent call is needed. + :type callback_required_template: str + :param endpoint_url: Gets or sets the endpoint url of the data source. + :type endpoint_url: str + :param headers: Gets or sets the authorization headers of the request. + :type headers: list of :class:`AuthorizationHeader ` + :param initial_context_template: Gets or sets the initial value of the query params. + :type initial_context_template: str + :param name: Gets or sets the name of the data source. + :type name: str + :param request_content: Gets or sets the request content of the endpoint request. + :type request_content: str + :param request_verb: Gets or sets the request method of the endpoint request. + :type request_verb: str + :param resource_url: Gets or sets the resource url of the endpoint request. + :type resource_url: str + :param result_selector: Gets or sets the result selector to filter the response of the endpoint request. + :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): + """ + 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 DataSourceDetails(Model): + """ + Represents details of the service endpoint data source. + + :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): + """ + Represents the details of the input on which a given input is dependent. + + :param key: Gets or sets the value of the field on which url is dependent. + :type key: str + :param value: Gets or sets the corresponding value of url. + :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): + """ + Represents the dependency data for the endpoint inputs. + + :param input: Gets or sets the category of dependency data. + :type input: str + :param map: Gets or sets the key-value pair to specify properties and their values. + :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): + """ + Represents the inputs on which any given input is dependent. + + :param input: Gets or sets the ID of the field on which URL's value is dependent. + :type input: str + :param map: Gets or sets key-value pair containing other's field value and corresponding url value. + :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): + """ + Represents the authorization used for service endpoint. + + :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): + """ + Represents url of the service endpoint. + + :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 format: Gets or sets the format of the url. + :type format: 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'}, + 'format': {'key': 'format', '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, format=None, help_text=None, is_visible=None, value=None): + super(EndpointUrl, self).__init__() + self.depends_on = depends_on + self.display_name = display_name + self.format = format + self.help_text = help_text + self.is_visible = is_visible + self.value = value + + +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 HelpLink(Model): + """ + Specifies the public url of the help documentation. + + :param text: Gets or sets the help text. + :type text: str + :param url: Gets or sets the public url of the help documentation. + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 RefreshAuthenticationParameters(Model): + """ + Specify the properties for refreshing the endpoint authentication object being queried + + :param endpoint_id: EndpointId which needs new authentication params + :type endpoint_id: str + :param scope: Scope of the token requested. For GitHub marketplace apps, scope contains repository Ids + :type scope: list of int + :param token_validity_in_minutes: The requested endpoint authentication should be valid for _ minutes. Authentication params will not be refreshed if the token contained in endpoint already has active token. + :type token_validity_in_minutes: int + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': '[int]'}, + 'token_validity_in_minutes': {'key': 'tokenValidityInMinutes', 'type': 'int'} + } + + def __init__(self, endpoint_id=None, scope=None, token_validity_in_minutes=None): + super(RefreshAuthenticationParameters, self).__init__() + self.endpoint_id = endpoint_id + self.scope = scope + self.token_validity_in_minutes = token_validity_in_minutes + + +class ResultTransformationDetails(Model): + """ + Represents template to transform the result data. + + :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): + """ + Represents an endpoint which may be used by an orchestration job. + + :param administrators_group: This is a deprecated field. + :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: This is a deprecated field. + :type group_scope_id: str + :param id: Gets or sets the identifier of this endpoint. + :type id: str + :param is_ready: EndPoint state indicator + :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 service_endpoint_project_references: All other project references where the service endpoint is shared. + :type service_endpoint_project_references: list of :class:`ServiceEndpointProjectReference ` + :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'}, + 'service_endpoint_project_references': {'key': 'serviceEndpointProjectReferences', 'type': '[ServiceEndpointProjectReference]'}, + '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, service_endpoint_project_references=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.service_endpoint_project_references = service_endpoint_project_references + self.type = type + self.url = url + + +class ServiceEndpointAuthenticationScheme(Model): + """ + Represents the authentication scheme used to authenticate the endpoint. + + :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: Gets or sets the data source bindings of the endpoint. + :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 properties: Gets or sets the properties of service endpoint authentication scheme. + :type properties: dict + :param requires_oAuth2_configuration: Gets or sets whether this auth scheme requires OAuth2 configuration or not. + :type requires_oAuth2_configuration: bool + :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]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'requires_oAuth2_configuration': {'key': 'requiresOAuth2Configuration', 'type': 'bool'}, + '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, properties=None, requires_oAuth2_configuration=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.properties = properties + self.requires_oAuth2_configuration = requires_oAuth2_configuration + self.scheme = scheme + + +class ServiceEndpointDetails(Model): + """ + Represents details of the service endpoint. + + :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): + """ + Represents service endpoint execution data. + + :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): + """ + Represents execution owner of the service endpoint. + + :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): + """ + Represents the details of service endpoint execution. + + :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): + """ + :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 ServiceEndpointProjectReference(Model): + """ + :param description: Gets or sets description of the service endpoint. + :type description: str + :param name: Gets or sets name of the service endpoint. + :type name: str + :param project_reference: Gets or sets project reference of the service endpoint. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(ServiceEndpointProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class ServiceEndpointRequest(Model): + """ + :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): + """ + Represents result of the service endpoint request. + + :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): + """ + Represents type of the service endpoint. + + :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: Gets or sets the help text shown at the endpoint create dialog. + :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): + """ + Represents the data source binding of the endpoint. + + :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(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, request_content=request_content, request_verb=request_verb, result_selector=result_selector, result_template=result_template, target=target) + + +__all__ = [ + 'AadOauthTokenRequest', + 'AadOauthTokenResult', + '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', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'DataSourceBinding', +] diff --git a/azure-devops/azure/devops/v7_0/service_endpoint/service_endpoint_client.py b/azure-devops/azure/devops/v7_0/service_endpoint/service_endpoint_client.py new file mode 100644 index 00000000..be42be76 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_endpoint/service_endpoint_client.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpointRequestResult', response) + + def create_service_endpoint(self, endpoint): + """CreateServiceEndpoint. + Creates a new service endpoint + :param :class:` ` endpoint: Service endpoint to create + :rtype: :class:` ` + """ + content = self._serialize.body(endpoint, 'ServiceEndpoint') + response = self._send(http_method='POST', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('ServiceEndpoint', response) + + def delete_service_endpoint(self, endpoint_id, project_ids, deep=None): + """DeleteServiceEndpoint. + Delete a service endpoint + :param str endpoint_id: Endpoint Id of endpoint to delete + :param [str] project_ids: project Ids from which endpoint needs to be deleted + :param bool deep: delete the spn created by endpoint + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + if deep is not None: + query_parameters['deep'] = self._serialize.query('deep', deep, 'bool') + self._send(http_method='DELETE', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_service_endpoint(self, endpoint_project_references, endpoint_id): + """ShareServiceEndpoint. + Share service endpoint across projects + :param [ServiceEndpointProjectReference] endpoint_project_references: Project reference details of the target project + :param str endpoint_id: Endpoint Id of the endpoint to share + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + content = self._serialize.body(endpoint_project_references, '[ServiceEndpointProjectReference]') + self._send(http_method='PATCH', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + content=content) + + def update_service_endpoint(self, endpoint, endpoint_id, operation=None): + """UpdateServiceEndpoint. + Update the service endpoint + :param :class:` ` endpoint: Updated data for the endpoint + :param str endpoint_id: Endpoint Id of the endpoint to update + :param str operation: operation type + :rtype: :class:` ` + """ + route_values = {} + 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='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpoint', response) + + def update_service_endpoints(self, endpoints): + """UpdateServiceEndpoints. + Update the service endpoints. + :param [ServiceEndpoint] endpoints: Names of the service endpoints to update. + :rtype: [ServiceEndpoint] + """ + content = self._serialize.body(endpoints, '[ServiceEndpoint]') + response = self._send(http_method='PUT', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_details(self, project, endpoint_id, action_filter=None): + """GetServiceEndpointDetails. + Get the service endpoint details. + :param str project: Project ID or project name + :param str endpoint_id: Id of the service endpoint. + :param str action_filter: Action filter for the service connection. It specifies the action which can be performed on the service connection. + :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 action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ServiceEndpoint', response) + + def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, owner=None, include_failed=None, include_details=None): + """GetServiceEndpoints. + 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 str owner: Owner 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 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.0', + 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, owner=None, include_failed=None, include_details=None): + """GetServiceEndpointsByNames. + 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 str owner: Owner 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoints_with_refreshed_authentication(self, refresh_authentication_parameters, project, endpoint_ids): + """GetServiceEndpointsWithRefreshedAuthentication. + Gets the service endpoints and patch new authorization parameters + :param [RefreshAuthenticationParameters] refresh_authentication_parameters: Scope, Validity of Token requested. + :param str project: Project ID or project name + :param [str] endpoint_ids: Ids of the service endpoints. + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_ids is not None: + endpoint_ids = ",".join(endpoint_ids) + query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') + content = self._serialize.body(refresh_authentication_parameters, '[RefreshAuthenticationParameters]') + response = self._send(http_method='POST', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_execution_records(self, project, endpoint_id, top=None, continuation_token=None): + """GetServiceEndpointExecutionRecords. + 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. + :param long continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of records + :rtype: :class:`<[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') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') + response = self._send(http_method='GET', + location_id='10a16738-9299-4cd1-9a81-fd23ad6200d0', + version='7.0', + 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. + 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='7.0', + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpointType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/service_hooks/__init__.py b/azure-devops/azure/devops/v7_0/service_hooks/__init__.py new file mode 100644 index 00000000..ba25f866 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_hooks/__init__.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'SubscriptionInputValuesQuery', + 'SubscriptionsQuery', + 'SubscriptionTracing', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'VersionedResource', + 'ServiceHooksClient' +] diff --git a/azure-devops/azure/devops/v7_0/service_hooks/models.py b/azure-devops/azure/devops/v7_0/service_hooks/models.py new file mode 100644 index 00000000..32f833c5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_hooks/models.py @@ -0,0 +1,1357 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Defines the data contract of a 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): + """ + Defines the data contract of a consumer action. + + :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): + """ + Encapsulates the properties of an 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): + """ + Describes a type of event + + :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): + """ + Describes how to configure a subscription that is managed externally. + + :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): + """ + Provides different formats of an event message + + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Defines a filter for subscription inputs. The filter matches a set of inputs if any (one or more) of the groups evaluates to true. + + :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): + """ + An expression which can be applied to filter a list of subscription inputs + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + Defines the data contract of the result of processing an event for a subscription. + + :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): + """ + Defines the data contract of notification details. + + :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 response. + :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): + """ + Summary of a particular result and count. + + :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): + """ + Defines a query for service hook notifications. + + :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): + """ + Summary of the notifications for a subscription. + + :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): + """ + Defines the data contract of an event 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): + """ + Wrapper around an event which is being published + + :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 notification. + :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 matched 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): + """ + Defines a query for service hook publishers. + + :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): + """ + 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 ResourceContainer(Model): + """ + The base class for all resource containers, i.e. Account, Collection, Project + + :param base_url: Gets or sets the container's base URL, i.e. the URL of the host (collection, application, or deployment) 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): + """ + Represents a session token to be attached in Events for Consumer actions that need it. + + :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): + """ + Encapsulates an event 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 last_probation_retry_date: + :type last_probation_retry_date: datetime + :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'}, + 'last_probation_retry_date': {'key': 'lastProbationRetryDate', 'type': 'iso-8601'}, + '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, last_probation_retry_date=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.last_probation_retry_date = last_probation_retry_date + 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): + """ + Contains all the diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`SubscriptionTracing ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`SubscriptionTracing ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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 SubscriptionInputValuesQuery(Model): + """ + Query for obtaining information about the possible/allowed values for one or more subscription inputs + + :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 scope: The scope at which the properties to query belong + :type scope: object + :param subscription: Subscription containing information about the publisher/consumer and the current input values + :type subscription: :class:`Subscription ` + """ + + _attribute_map = { + 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'subscription': {'key': 'subscription', 'type': 'Subscription'} + } + + def __init__(self, input_values=None, scope=None, subscription=None): + super(SubscriptionInputValuesQuery, self).__init__() + self.input_values = input_values + self.scope = scope + self.subscription = subscription + + +class SubscriptionsQuery(Model): + """ + Defines a query for service hook subscriptions. + + :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): + """ + Data controlling a single diagnostic setting for a subscription. + + :param enabled: Indicates whether the diagnostic tracing is enabled or not. + :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): + """ + Parameters to update diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Parameters to update a specific diagnostic setting. + + :param enabled: Indicates whether to enable to disable the diagnostic tracing. + :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): + """ + Encapsulates the resource version and its data or reference to the compatible version. Only one of the two last fields should be not null. + + :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', + 'SubscriptionInputValuesQuery', + 'SubscriptionsQuery', + 'SubscriptionTracing', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'VersionedResource', +] diff --git a/azure-devops/azure/devops/v7_0/service_hooks/service_hooks_client.py b/azure-devops/azure/devops/v7_0/service_hooks/service_hooks_client.py new file mode 100644 index 00000000..3e80b1b4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/service_hooks/service_hooks_client.py @@ -0,0 +1,395 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters) + return self._deserialize('[Consumer]', self._unwrap_collection(response)) + + def get_subscription_diagnostics(self, subscription_id): + """GetSubscriptionDiagnostics. + :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='7.0', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + :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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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: 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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('Notification', response) + diff --git a/azure-devops/azure/devops/v7_0/settings/__init__.py b/azure-devops/azure/devops/v7_0/settings/__init__.py new file mode 100644 index 00000000..3798fc24 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/settings/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/settings/settings_client.py b/azure-devops/azure/devops/v7_0/settings/settings_client.py new file mode 100644 index 00000000..9833c950 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/settings/settings_client.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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='7.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='7.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='7.0-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/symbol/__init__.py b/azure-devops/azure/devops/v7_0/symbol/__init__.py new file mode 100644 index 00000000..98f9674b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/symbol/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'Request', + 'ResourceBase', + 'SymbolClient' +] diff --git a/azure-devops/azure/devops/v7_0/symbol/models.py b/azure-devops/azure/devops/v7_0/symbol/models.py new file mode 100644 index 00000000..d888f472 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/symbol/models.py @@ -0,0 +1,261 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + A batch of debug entry to create. + + :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 ` + :param proof_nodes: Serialized Proof nodes, used to verify uploads on server side for Chunk Dedup DebugEntry + :type proof_nodes: list of str + """ + + _attribute_map = { + 'create_behavior': {'key': 'createBehavior', 'type': 'object'}, + 'debug_entries': {'key': 'debugEntries', 'type': '[DebugEntry]'}, + 'proof_nodes': {'key': 'proofNodes', 'type': '[str]'} + } + + def __init__(self, create_behavior=None, debug_entries=None, proof_nodes=None): + super(DebugEntryCreateBatch, self).__init__() + self.create_behavior = create_behavior + self.debug_entries = debug_entries + self.proof_nodes = proof_nodes + + +class IDomainId(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(IDomainId, self).__init__() + + +class JsonBlobBlockHash(Model): + """ + BlobBlock hash formatted to be deserialized for symbol service. + + :param hash_bytes: Array of 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): + """ + :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): + """ + BlobIdentifier with block hashes formatted to be deserialzied for symbol service. + + :param block_hashes: List of blob block hashes. + :type block_hashes: list of :class:`JsonBlobBlockHash ` + :param identifier_value: Array of blobId bytes. + :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): + """ + :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): + """ + A dual-purpose data object, the debug entry is used by the client to publish the symbol file (with file's blob identifier, which can be calculated from VSTS hashing algorithm) or query the file (with a client key). Since the symbol server tries to return a matched symbol file with the richest information level, it may not always point to the same symbol file for different queries with same client key. + + :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: Details of the blob formatted to be deserialized for symbol service. + :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 domain_id: The Domain Id where this debugEntry lives. This property should not be null. + :type domain_id: :class:`IDomainId ` + :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 size: The size for the debug entry. + :type size: long + :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'}, + 'domain_id': {'key': 'domainId', 'type': 'IDomainId'}, + 'information_level': {'key': 'informationLevel', 'type': 'object'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + '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, domain_id=None, information_level=None, request_id=None, size=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.domain_id = domain_id + self.information_level = information_level + self.request_id = request_id + self.size = size + self.status = status + + +class Request(ResourceBase): + """ + Symbol 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 domain_id: The Domain Id where this request lives. This property should not be null. + :type domain_id: :class:`IDomainId ` + :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 is_chunked: Indicates if request should be chunk dedup + :type is_chunked: bool + :param name: A human-facing name for the request. Required on POST, ignored on PATCH. + :type name: str + :param size: The total Size for this request. + :type size: long + :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'}, + 'domain_id': {'key': 'domainId', 'type': 'IDomainId'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'is_chunked': {'key': 'isChunked', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, created_by=None, created_date=None, id=None, storage_eTag=None, url=None, description=None, domain_id=None, expiration_date=None, is_chunked=None, name=None, size=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.domain_id = domain_id + self.expiration_date = expiration_date + self.is_chunked = is_chunked + self.name = name + self.size = size + self.status = status + + +__all__ = [ + 'DebugEntryCreateBatch', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'ResourceBase', + 'DebugEntry', + 'Request', +] diff --git a/azure-devops/azure/devops/v7_0/symbol/symbol_client.py b/azure-devops/azure/devops/v7_0/symbol/symbol_client.py new file mode 100644 index 00000000..5ed632e9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/symbol/symbol_client.py @@ -0,0 +1,244 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0') + + def get_client(self, client_type): + """GetClient. + 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='7.0', + route_values=route_values) + return self._deserialize('object', response) + + def head_client(self): + """HeadClient. + Get client version information. + """ + self._send(http_method='HEAD', + location_id='79c83865-4de3-460c-8a16-01be238e0818', + version='7.0') + + def get_debug_entry_content(self, request_id, debug_entry_id): + """GetDebugEntryContent. + Get a stitched debug entry for a symbol request as specified by symbol request identifier and debug entry identifier. + :param str request_id: The symbol request identifier. + :param str debug_entry_id: The debug entry identifier. + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + if debug_entry_id is not None: + route_values['debugEntryId'] = self._serialize.url('debug_entry_id', debug_entry_id, 'str') + self._send(http_method='GET', + location_id='0f98d9f5-caf7-44fd-a5c9-55f3a9b34399', + version='7.0', + route_values=route_values) + + def create_requests(self, request_to_create): + """CreateRequests. + 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='7.0', + content=content) + return self._deserialize('Request', response) + + def create_requests_request_id_debug_entries(self, batch, request_id, collection): + """CreateRequestsRequestIdDebugEntries. + 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='7.0', + 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. + 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: The symbol 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def delete_requests_request_name(self, request_name, synchronous=None): + """DeleteRequestsRequestName. + Delete a symbol request by request name. + :param str request_name: The symbol 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='7.0', + query_parameters=query_parameters) + + def get_requests_request_id(self, request_id): + """GetRequestsRequestId. + 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='7.0', + route_values=route_values) + return self._deserialize('Request', response) + + def get_requests_request_name(self, request_name): + """GetRequestsRequestName. + Get a symbol request by request name. + :param str request_name: The symbol 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='7.0', + query_parameters=query_parameters) + return self._deserialize('Request', response) + + def update_requests_request_id(self, update_request, request_id): + """UpdateRequestsRequestId. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Request', response) + + def update_requests_request_name(self, update_request, request_name): + """UpdateRequestsRequestName. + Update a symbol request by request name. + :param :class:` ` update_request: The symbol request. + :param str request_name: The symbol 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='7.0', + 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. + 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='7.0', + route_values=route_values) + diff --git a/azure-devops/azure/devops/v7_0/task/__init__.py b/azure-devops/azure/devops/v7_0/task/__init__.py new file mode 100644 index 00000000..42230cd0 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'TaskAgentJob', + 'TaskAgentJobStep', + 'TaskAgentJobTask', + 'TaskAgentJobVariable', + 'TaskAttachment', + 'TaskLog', + 'TaskLogReference', + 'TaskOrchestrationContainer', + 'TaskOrchestrationItem', + 'TaskOrchestrationOwner', + 'TaskOrchestrationPlan', + 'TaskOrchestrationPlanGroupsQueueMetrics', + 'TaskOrchestrationPlanReference', + 'TaskOrchestrationQueuedPlan', + 'TaskOrchestrationQueuedPlanGroup', + 'TaskReference', + 'Timeline', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineRecordFeedLinesWrapper', + 'TimelineReference', + 'VariableValue', + 'TaskClient' +] diff --git a/azure-devops/azure/devops/v7_0/task/models.py b/azure-devops/azure/devops/v7_0/task/models.py new file mode 100644 index 00000000..95ebbc1a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task/models.py @@ -0,0 +1,1002 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + Represents an option that may affect the way an agent runs the job. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 TaskAgentJob(Model): + """ + :param container: + :type container: str + :param id: + :type id: str + :param name: + :type name: str + :param sidecar_containers: + :type sidecar_containers: dict + :param steps: + :type steps: list of :class:`TaskAgentJobStep ` + :param variables: + :type variables: list of :class:`TaskAgentJobVariable ` + """ + + _attribute_map = { + 'container': {'key': 'container', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sidecar_containers': {'key': 'sidecarContainers', 'type': '{str}'}, + 'steps': {'key': 'steps', 'type': '[TaskAgentJobStep]'}, + 'variables': {'key': 'variables', 'type': '[TaskAgentJobVariable]'} + } + + def __init__(self, container=None, id=None, name=None, sidecar_containers=None, steps=None, variables=None): + super(TaskAgentJob, self).__init__() + self.container = container + self.id = id + self.name = name + self.sidecar_containers = sidecar_containers + self.steps = steps + self.variables = variables + + +class TaskAgentJobStep(Model): + """ + :param condition: + :type condition: str + :param continue_on_error: + :type continue_on_error: bool + :param enabled: + :type enabled: bool + :param env: + :type env: dict + :param id: + :type id: str + :param inputs: + :type inputs: dict + :param name: + :type name: str + :param retry_count_on_task_failure: + :type retry_count_on_task_failure: int + :param task: + :type task: :class:`TaskAgentJobTask ` + :param timeout_in_minutes: + :type timeout_in_minutes: int + :param type: + :type type: object + """ + + _attribute_map = { + 'condition': {'key': 'condition', 'type': 'str'}, + 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'env': {'key': 'env', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + 'task': {'key': 'task', 'type': 'TaskAgentJobTask'}, + 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, condition=None, continue_on_error=None, enabled=None, env=None, id=None, inputs=None, name=None, retry_count_on_task_failure=None, task=None, timeout_in_minutes=None, type=None): + super(TaskAgentJobStep, self).__init__() + self.condition = condition + self.continue_on_error = continue_on_error + self.enabled = enabled + self.env = env + self.id = id + self.inputs = inputs + self.name = name + self.retry_count_on_task_failure = retry_count_on_task_failure + self.task = task + self.timeout_in_minutes = timeout_in_minutes + self.type = type + + +class TaskAgentJobTask(Model): + """ + :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(TaskAgentJobTask, self).__init__() + self.id = id + self.name = name + self.version = version + + +class TaskAgentJobVariable(Model): + """ + :param name: + :type name: str + :param secret: + :type secret: bool + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, name=None, secret=None, value=None): + super(TaskAgentJobVariable, self).__init__() + self.name = name + self.secret = secret + self.value = value + + +class TaskAttachment(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :param agent_specification: + :type agent_specification: :class:`object ` + :param attempt: + :type attempt: 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 change_id: + :type change_id: int + :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 queue_id: + :type queue_id: int + :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 = { + 'agent_specification': {'key': 'agentSpecification', 'type': 'object'}, + 'attempt': {'key': 'attempt', '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'}, + 'change_id': {'key': 'changeId', 'type': 'int'}, + '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]'}, + 'queue_id': {'key': 'queueId', 'type': 'int'}, + '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, agent_specification=None, attempt=None, current_operation=None, details=None, error_count=None, finish_time=None, change_id=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, queue_id=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.agent_specification = agent_specification + self.attempt = attempt + self.current_operation = current_operation + self.details = details + self.error_count = error_count + self.finish_time = finish_time + self.change_id = change_id + 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.queue_id = queue_id + 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): + """ + :param count: + :type count: int + :param end_line: + :type end_line: long + :param start_line: + :type start_line: long + :param step_id: + :type step_id: str + :param value: + :type value: list of str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'end_line': {'key': 'endLine', 'type': 'long'}, + 'start_line': {'key': 'startLine', 'type': 'long'}, + 'step_id': {'key': 'stepId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[str]'} + } + + def __init__(self, count=None, end_line=None, start_line=None, step_id=None, value=None): + super(TimelineRecordFeedLinesWrapper, self).__init__() + self.count = count + self.end_line = end_line + self.start_line = start_line + self.step_id = step_id + self.value = value + + +class TimelineReference(Model): + """ + :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): + """ + :param is_read_only: + :type is_read_only: bool + :param is_secret: + :type is_secret: bool + :param value: + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class TaskLog(TaskLogReference): + """ + :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): + """ + :param item_type: + :type item_type: object + :param continue_on_error: + :type continue_on_error: bool + :param data: + :type data: dict + :param children: + :type children: list of :class:`TaskOrchestrationItem ` + :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'}, + 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, + 'data': {'key': 'data', 'type': '{str}'}, + 'children': {'key': 'children', 'type': '[TaskOrchestrationItem]'}, + 'max_concurrency': {'key': 'maxConcurrency', 'type': 'int'}, + 'parallel': {'key': 'parallel', 'type': 'bool'}, + 'rollback': {'key': 'rollback', 'type': 'TaskOrchestrationContainer'} + } + + def __init__(self, item_type=None, continue_on_error=None, data=None, children=None, max_concurrency=None, parallel=None, rollback=None): + super(TaskOrchestrationContainer, self).__init__(item_type=item_type) + self.continue_on_error = continue_on_error + self.data = data + self.children = children + self.max_concurrency = max_concurrency + self.parallel = parallel + self.rollback = rollback + + +class TaskOrchestrationPlan(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 + :param environment: + :type environment: :class:`PlanEnvironment ` + :param expanded_yaml: + :type expanded_yaml: :class:`TaskLogReference ` + :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'}, + 'expanded_yaml': {'key': 'expandedYaml', 'type': 'TaskLogReference'}, + '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, expanded_yaml=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.expanded_yaml = expanded_yaml + 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): + """ + :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', + 'TaskAgentJob', + 'TaskAgentJobStep', + 'TaskAgentJobTask', + 'TaskAgentJobVariable', + 'TaskAttachment', + 'TaskLogReference', + 'TaskOrchestrationItem', + 'TaskOrchestrationOwner', + 'TaskOrchestrationPlanGroupsQueueMetrics', + 'TaskOrchestrationPlanReference', + 'TaskOrchestrationQueuedPlan', + 'TaskOrchestrationQueuedPlanGroup', + 'TaskReference', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineRecordFeedLinesWrapper', + 'TimelineReference', + 'VariableValue', + 'TaskLog', + 'TaskOrchestrationContainer', + 'TaskOrchestrationPlan', + 'Timeline', +] diff --git a/azure-devops/azure/devops/v7_0/task/task_client.py b/azure-devops/azure/devops/v7_0/task/task_client.py new file mode 100644 index 00000000..398c305a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task/task_client.py @@ -0,0 +1,513 @@ +# -------------------------------------------------------------------------------------------- +# 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. + :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='7.0', + 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. + :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='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskAttachment', response) + + def create_attachment_from_artifact(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, artifact_hash, length): + """CreateAttachmentFromArtifact. + :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: + :param str artifact_hash: + :param long length: + :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') + query_parameters = {} + if artifact_hash is not None: + query_parameters['artifactHash'] = self._serialize.query('artifact_hash', artifact_hash, 'str') + if length is not None: + query_parameters['length'] = self._serialize.query('length', length, 'long') + response = self._send(http_method='PUT', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAttachment', response) + + def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): + """GetAttachment. + :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='7.0', + 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. + :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='7.0', + 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. + :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='7.0', + 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='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskLog', response) + + def associate_log(self, scope_identifier, hub_name, plan_id, log_id, serialized_blob_id, line_count): + """AssociateLog. + :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 str serialized_blob_id: + :param int line_count: + :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') + query_parameters = {} + if serialized_blob_id is not None: + query_parameters['serializedBlobId'] = self._serialize.query('serialized_blob_id', serialized_blob_id, 'str') + if line_count is not None: + query_parameters['lineCount'] = self._serialize.query('line_count', line_count, 'int') + response = self._send(http_method='POST', + location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values) + return self._deserialize('[Timeline]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/task_agent/__init__.py b/azure-devops/azure/devops/v7_0/task_agent/__init__.py new file mode 100644 index 00000000..e6e230a6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task_agent/__init__.py @@ -0,0 +1,138 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'EnvironmentCreateParameter', + 'EnvironmentDeploymentExecutionRecord', + 'EnvironmentInstance', + 'EnvironmentReference', + 'EnvironmentResource', + 'EnvironmentResourceReference', + 'EnvironmentUpdateParameter', + 'GraphSubjectBase', + 'HelpLink', + 'IdentityRef', + 'InputDescriptor', + 'InputValidation', + 'InputValidationRequest', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'KubernetesResource', + 'KubernetesResourceCreateParameters', + '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', + 'TaskAgentJobRequest', + 'TaskAgentMessage', + 'TaskAgentPool', + 'TaskAgentPoolMaintenanceDefinition', + 'TaskAgentPoolMaintenanceJob', + 'TaskAgentPoolMaintenanceJobTargetAgent', + 'TaskAgentPoolMaintenanceOptions', + 'TaskAgentPoolMaintenanceRetentionPolicy', + 'TaskAgentPoolMaintenanceSchedule', + 'TaskAgentPoolReference', + 'TaskAgentPublicKey', + 'TaskAgentQueue', + 'TaskAgentReference', + 'TaskAgentSession', + 'TaskAgentSessionKey', + 'TaskAgentUpdate', + 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', + 'TaskDefinition', + 'TaskDefinitionEndpoint', + 'TaskDefinitionReference', + 'TaskExecution', + 'TaskGroup', + 'TaskGroupCreateParameter', + 'TaskGroupDefinition', + 'TaskGroupRevision', + 'TaskGroupStep', + 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', + 'TaskHubLicenseDetails', + 'TaskInputDefinition', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationOwner', + 'TaskOutputVariable', + 'TaskPackageMetadata', + 'TaskReference', + 'TaskRestrictions', + 'TaskSourceDefinition', + 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', + 'TaskVersion', + 'ValidationItem', + 'VariableGroup', + 'VariableGroupParameters', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'VirtualMachine', + 'VirtualMachineGroup', + 'VirtualMachineGroupCreateParameters', + 'TaskAgentClient' +] diff --git a/azure-devops/azure/devops/v7_0/task_agent/models.py b/azure-devops/azure/devops/v7_0/task_agent/models.py new file mode 100644 index 00000000..810e132e --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task_agent/models.py @@ -0,0 +1,4543 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Azure Management Group + + :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 belongs + :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): + """ + Azure management group query result + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 DataSourceDetails(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Properties to create Deployment group. + + :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): + """ + Properties of Deployment pool to create Deployment group. + + :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): + """ + Deployment group metrics. + + :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): + """ + Deployment group reference. This is useful for referring a deployment group in another object. + + :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): + """ + Deployment group update parameter. + + :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): + """ + Deployment target. + + :param agent: Deployment agent. + :type agent: :class:`TaskAgent ` + :param id: Deployment target Identifier. + :type id: int + :param properties: Properties of the deployment target. + :type properties: :class:`object ` + :param tags: Tags of the deployment target. + :type tags: list of str + """ + + _attribute_map = { + 'agent': {'key': 'agent', 'type': 'TaskAgent'}, + 'id': {'key': 'id', 'type': 'int'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, agent=None, id=None, properties=None, tags=None): + super(DeploymentMachine, self).__init__() + self.agent = agent + self.id = id + self.properties = properties + self.tags = tags + + +class DeploymentMachineGroupReference(Model): + """ + :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): + """ + Deployment pool summary. + + :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 ` + :param resource: Virtual machine Resource referring in pool. + :type resource: :class:`EnvironmentResourceReference ` + """ + + _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'}, + 'resource': {'key': 'resource', 'type': 'EnvironmentResourceReference'} + } + + def __init__(self, deployment_groups=None, offline_agents_count=None, online_agents_count=None, pool=None, resource=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 + self.resource = resource + + +class DeploymentTargetUpdateParameter(Model): + """ + Deployment target update parameter. + + :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): + """ + :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): + """ + Represents url of the service endpoint. + + :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 EnvironmentCreateParameter(Model): + """ + Properties to create Environment. + + :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 EnvironmentDeploymentExecutionRecord(Model): + """ + EnvironmentDeploymentExecutionRecord. + + :param definition: Definition of the environment deployment execution owner + :type definition: :class:`TaskOrchestrationOwner ` + :param environment_id: Id of the Environment + :type environment_id: int + :param finish_time: Finish time of the environment deployment execution + :type finish_time: datetime + :param id: Id of the Environment deployment execution history record + :type id: long + :param job_attempt: Job Attempt + :type job_attempt: int + :param job_name: Job name + :type job_name: str + :param owner: Owner of the environment deployment execution record + :type owner: :class:`TaskOrchestrationOwner ` + :param plan_id: Plan Id + :type plan_id: str + :param plan_type: Plan type of the environment deployment execution record + :type plan_type: str + :param queue_time: Queue time of the environment deployment execution + :type queue_time: datetime + :param request_identifier: Request identifier of the Environment deployment execution history record + :type request_identifier: str + :param resource_id: Resource Id + :type resource_id: int + :param result: Result of the environment deployment execution + :type result: object + :param scope_id: Project Id + :type scope_id: str + :param service_owner: Service owner Id + :type service_owner: str + :param stage_attempt: Stage Attempt + :type stage_attempt: int + :param stage_name: Stage name + :type stage_name: str + :param start_time: Start time of the environment deployment execution + :type start_time: datetime + """ + + _attribute_map = { + 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, + 'environment_id': {'key': 'environmentId', 'type': 'int'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'long'}, + 'job_attempt': {'key': 'jobAttempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'}, + 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, + 'plan_id': {'key': 'planId', 'type': 'str'}, + 'plan_type': {'key': 'planType', 'type': 'str'}, + 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, + 'request_identifier': {'key': 'requestIdentifier', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'int'}, + 'result': {'key': 'result', 'type': 'object'}, + 'scope_id': {'key': 'scopeId', 'type': 'str'}, + 'service_owner': {'key': 'serviceOwner', 'type': 'str'}, + 'stage_attempt': {'key': 'stageAttempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'} + } + + def __init__(self, definition=None, environment_id=None, finish_time=None, id=None, job_attempt=None, job_name=None, owner=None, plan_id=None, plan_type=None, queue_time=None, request_identifier=None, resource_id=None, result=None, scope_id=None, service_owner=None, stage_attempt=None, stage_name=None, start_time=None): + super(EnvironmentDeploymentExecutionRecord, self).__init__() + self.definition = definition + self.environment_id = environment_id + self.finish_time = finish_time + self.id = id + self.job_attempt = job_attempt + self.job_name = job_name + self.owner = owner + self.plan_id = plan_id + self.plan_type = plan_type + self.queue_time = queue_time + self.request_identifier = request_identifier + self.resource_id = resource_id + self.result = result + self.scope_id = scope_id + self.service_owner = service_owner + self.stage_attempt = stage_attempt + self.stage_name = stage_name + self.start_time = start_time + + +class EnvironmentInstance(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 project: Project information for environment. + :type project: :class:`ProjectReference ` + :param resources: + :type resources: list of :class:`EnvironmentResourceReference ` + """ + + _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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + 'resources': {'key': 'resources', 'type': '[EnvironmentResourceReference]'} + } + + def __init__(self, created_by=None, created_on=None, description=None, id=None, last_modified_by=None, last_modified_on=None, name=None, project=None, resources=None): + super(EnvironmentInstance, 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.project = project + self.resources = resources + + +class EnvironmentReference(Model): + """ + :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 EnvironmentResource(Model): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource 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'}, + 'tags': {'key': 'tags', '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, tags=None, type=None): + super(EnvironmentResource, 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.tags = tags + self.type = type + + +class EnvironmentResourceReference(Model): + """ + EnvironmentResourceReference. + + :param id: Id of the resource. + :type id: int + :param name: Name of the resource. + :type name: str + :param tags: Tags of the Environment Resource Reference. + :type tags: list of str + :param type: Type of the resource. + :type type: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, id=None, name=None, tags=None, type=None): + super(EnvironmentResourceReference, self).__init__() + self.id = id + self.name = name + self.tags = tags + self.type = type + + +class EnvironmentUpdateParameter(Model): + """ + Properties to update Environment. + + :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): + """ + :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): + """ + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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 KubernetesResource(EnvironmentResource): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource type + :type type: object + :param cluster_name: + :type cluster_name: str + :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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + '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, tags=None, type=None, cluster_name=None, namespace=None, service_endpoint_id=None): + super(KubernetesResource, 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, tags=tags, type=type) + self.cluster_name = cluster_name + self.namespace = namespace + self.service_endpoint_id = service_endpoint_id + + +class KubernetesResourceCreateParameters(Model): + """ + :param cluster_name: + :type cluster_name: str + :param name: + :type name: str + :param namespace: + :type namespace: str + :param tags: Tags of the kubernetes resource. + :type tags: list of str + """ + + _attribute_map = { + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, cluster_name=None, name=None, namespace=None, tags=None): + super(KubernetesResourceCreateParameters, self).__init__() + self.cluster_name = cluster_name + self.name = name + self.namespace = namespace + self.tags = tags + + +class MetricsColumnMetaData(Model): + """ + Meta data for a metrics column. + + :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): + """ + Metrics columns header + + :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): + """ + Metrics row. + + :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): + """ + Represents a downloadable package. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 ResourceLimit(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Represents an endpoint which may be used by an orchestration job. + + :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 indicator + :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: Gets or sets the owner of the endpoint. + :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): + """ + :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): + """ + :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): + """ + Represents service endpoint execution data. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Represents type of the service endpoint. + + :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 TaskAgentAuthorization(Model): + """ + Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows. + + :param authorization_url: Endpoint used to obtain access tokens from the configured token service. + :type authorization_url: str + :param client_id: Client identifier for this agent. + :type client_id: str + :param public_key: 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): + """ + :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 acquisition_timeout: + :type acquisition_timeout: int + :param agent_cloud_id: + :type agent_cloud_id: int + :param get_account_parallelism_endpoint: + :type get_account_parallelism_endpoint: str + :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 id: + :type id: str + :param internal: Signifies that this Agent Cloud is internal and should not be user-manageable + :type internal: bool + :param max_parallelism: + :type max_parallelism: int + :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'}, + 'acquisition_timeout': {'key': 'acquisitionTimeout', 'type': 'int'}, + 'agent_cloud_id': {'key': 'agentCloudId', 'type': 'int'}, + 'get_account_parallelism_endpoint': {'key': 'getAccountParallelismEndpoint', 'type': 'str'}, + 'get_agent_definition_endpoint': {'key': 'getAgentDefinitionEndpoint', 'type': 'str'}, + 'get_agent_request_status_endpoint': {'key': 'getAgentRequestStatusEndpoint', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'internal': {'key': 'internal', 'type': 'bool'}, + 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, + '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, acquisition_timeout=None, agent_cloud_id=None, get_account_parallelism_endpoint=None, get_agent_definition_endpoint=None, get_agent_request_status_endpoint=None, id=None, internal=None, max_parallelism=None, name=None, release_agent_endpoint=None, shared_secret=None, type=None): + super(TaskAgentCloud, self).__init__() + self.acquire_agent_endpoint = acquire_agent_endpoint + self.acquisition_timeout = acquisition_timeout + self.agent_cloud_id = agent_cloud_id + self.get_account_parallelism_endpoint = get_account_parallelism_endpoint + self.get_agent_definition_endpoint = get_agent_definition_endpoint + self.get_agent_request_status_endpoint = get_agent_request_status_endpoint + self.id = id + self.internal = internal + self.max_parallelism = max_parallelism + self.name = name + self.release_agent_endpoint = release_agent_endpoint + self.shared_secret = shared_secret + self.type = type + + +class TaskAgentCloudRequest(Model): + """ + :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): + """ + :param display_name: Gets or sets the display name of agent 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 TaskAgentJobRequest(Model): + """ + A job request for an agent. + + :param agent_specification: + :type agent_specification: :class:`object ` + :param assign_time: The date/time this request was assigned. + :type assign_time: datetime + :param data: Additional data about the request. + :type data: dict + :param definition: The pipeline definition associated with this request + :type definition: :class:`TaskOrchestrationOwner ` + :param demands: A list of demands required to fulfill this request. + :type demands: list of :class:`object ` + :param finish_time: The date/time this request was finished. + :type finish_time: datetime + :param host_id: The host which triggered this request. + :type host_id: str + :param job_id: ID of the job resulting from this request. + :type job_id: str + :param job_name: Name of the job resulting from this request. + :type job_name: str + :param locked_until: The deadline for the agent to renew the lock. + :type locked_until: datetime + :param matched_agents: + :type matched_agents: list of :class:`TaskAgentReference ` + :param matches_all_agents_in_pool: + :type matches_all_agents_in_pool: bool + :param orchestration_id: + :type orchestration_id: str + :param owner: The pipeline associated with this request + :type owner: :class:`TaskOrchestrationOwner ` + :param plan_group: + :type plan_group: str + :param plan_id: Internal ID for the orchestration plan connected with this request. + :type plan_id: str + :param plan_type: Internal detail representing the type of orchestration plan. + :type plan_type: str + :param pool_id: The ID of the pool this request targets + :type pool_id: int + :param priority: + :type priority: int + :param queue_id: The ID of the queue this request targets + :type queue_id: int + :param queue_time: The date/time this request was queued. + :type queue_time: datetime + :param receive_time: The date/time this request was receieved by an agent. + :type receive_time: datetime + :param request_id: ID of the request. + :type request_id: long + :param reserved_agent: The agent allocated for this request. + :type reserved_agent: :class:`TaskAgentReference ` + :param result: The result of this request. + :type result: object + :param scope_id: Scope of the pipeline; matches the project ID. + :type scope_id: str + :param service_owner: The service which owns this request. + :type service_owner: str + :param status_message: + :type status_message: str + :param user_delayed: + :type user_delayed: bool + """ + + _attribute_map = { + '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]'}, + '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]'}, + 'matches_all_agents_in_pool': {'key': 'matchesAllAgentsInPool', 'type': 'bool'}, + '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'}, + 'priority': {'key': 'priority', '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'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'user_delayed': {'key': 'userDelayed', 'type': 'bool'} + } + + def __init__(self, agent_specification=None, assign_time=None, data=None, definition=None, demands=None, finish_time=None, host_id=None, job_id=None, job_name=None, locked_until=None, matched_agents=None, matches_all_agents_in_pool=None, orchestration_id=None, owner=None, plan_group=None, plan_id=None, plan_type=None, pool_id=None, priority=None, queue_id=None, queue_time=None, receive_time=None, request_id=None, reserved_agent=None, result=None, scope_id=None, service_owner=None, status_message=None, user_delayed=None): + super(TaskAgentJobRequest, self).__init__() + self.agent_specification = agent_specification + self.assign_time = assign_time + self.data = data + self.definition = definition + self.demands = demands + 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.matches_all_agents_in_pool = matches_all_agents_in_pool + 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.priority = priority + 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 + self.status_message = status_message + self.user_delayed = user_delayed + + +class TaskAgentMessage(Model): + """ + Provides a contract for receiving messages from the task orchestrator. + + :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 initialization 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + 'pool_type': {'key': 'poolType', 'type': 'object'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None): + super(TaskAgentPoolReference, self).__init__() + self.id = id + self.is_hosted = is_hosted + self.is_legacy = is_legacy + self.name = name + self.options = options + self.pool_type = pool_type + self.scope = scope + self.size = size + + +class TaskAgentPublicKey(Model): + """ + Represents the public key portion of an RSA asymmetric key. + + :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): + """ + An agent queue. + + :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): + """ + A reference to an agent. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param access_point: This agent's access point. + :type access_point: str + :param enabled: Whether or not this agent should run jobs. + :type enabled: bool + :param id: Identifier of the agent. + :type id: int + :param name: Name of the agent. + :type name: str + :param os_description: Agent OS. + :type os_description: str + :param provisioning_state: Provisioning state of this agent. + :type provisioning_state: str + :param status: Whether or not the agent is online. + :type status: object + :param version: Agent version. + :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): + """ + Represents a session for performing message exchanges from an agent. + + :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): + """ + Represents a symmetric key used for message-level encryption for communication sent to an agent. + + :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): + """ + Details about an agent update. + + :param current_state: Current state of this agent update. + :type current_state: str + :param reason: Reason for this update. + :type reason: :class:`TaskAgentUpdateReason ` + :param requested_by: Identity which requested this update. + :type requested_by: :class:`IdentityRef ` + :param request_time: Date on which this update was requested. + :type request_time: datetime + :param source_version: Source agent version of the update. + :type source_version: :class:`PackageVersion ` + :param target_version: Target agent version of the 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): + """ + :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 TaskCommandRestrictions(Model): + """ + :param mode: + :type mode: object + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'object'} + } + + def __init__(self, mode=None): + super(TaskCommandRestrictions, self).__init__() + self.mode = mode + + +class TaskDefinition(Model): + """ + :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 ecosystem: + :type ecosystem: str + :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 help_url: + :type help_url: 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 restrictions: + :type restrictions: :class:`TaskRestrictions ` + :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'}, + 'ecosystem': {'key': 'ecosystem', 'type': 'str'}, + 'execution': {'key': 'execution', 'type': '{object}'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, + 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', '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'}, + 'restrictions': {'key': 'restrictions', 'type': 'TaskRestrictions'}, + '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, ecosystem=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, help_url=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, restrictions=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.ecosystem = ecosystem + self.execution = execution + self.friendly_name = friendly_name + self.groups = groups + self.help_mark_down = help_mark_down + self.help_url = help_url + 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.restrictions = restrictions + 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): + """ + :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. Essentially, 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): + """ + :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): + """ + :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): + """ + :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 ecosystem: + :type ecosystem: str + :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 help_url: + :type help_url: 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 restrictions: + :type restrictions: :class:`TaskRestrictions ` + :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'}, + 'ecosystem': {'key': 'ecosystem', 'type': 'str'}, + 'execution': {'key': 'execution', 'type': '{object}'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, + 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', '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'}, + 'restrictions': {'key': 'restrictions', 'type': 'TaskRestrictions'}, + '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, ecosystem=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, help_url=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, restrictions=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, ecosystem=ecosystem, execution=execution, friendly_name=friendly_name, groups=groups, help_mark_down=help_mark_down, help_url=help_url, 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, restrictions=restrictions, 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): + """ + :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): + """ + :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): + """ + :param comment: + :type comment: str + :param file_id: + :type file_id: int + :param changed_by: + :type changed_by: :class:`IdentityRef ` + :param changed_date: + :type changed_date: datetime + :param change_type: + :type change_type: object + :param major_version: + :type major_version: int + :param revision: + :type revision: int + :param task_group_id: + :type task_group_id: str + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'file_id': {'key': 'fileId', 'type': 'int'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'major_version': {'key': 'majorVersion', 'type': 'int'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'task_group_id': {'key': 'taskGroupId', 'type': 'str'} + } + + def __init__(self, comment=None, file_id=None, changed_by=None, changed_date=None, change_type=None, major_version=None, revision=None, task_group_id=None): + super(TaskGroupRevision, self).__init__() + self.comment = comment + self.file_id = file_id + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + self.major_version = major_version + self.revision = revision + self.task_group_id = task_group_id + + +class TaskGroupStep(Model): + """ + Represents tasks in the task group. + + :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 retry_count_on_task_failure: Gets or sets the maximum number of retries + :type retry_count_on_task_failure: int + :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}'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + self.task = task + self.timeout_in_minutes = timeout_in_minutes + + +class TaskGroupUpdateParameter(Model): + """ + :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 TaskGroupUpdatePropertiesBase(Model): + """ + :param comment: Comment for this update request + :type comment: str + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'} + } + + def __init__(self, comment=None): + super(TaskGroupUpdatePropertiesBase, self).__init__() + self.comment = comment + + +class TaskHubLicenseDetails(Model): + """ + :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 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'}, + '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, 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.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): + """ + :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 TaskOrchestrationOwner(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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 TaskRestrictions(Model): + """ + :param commands: + :type commands: :class:`TaskCommandRestrictions ` + :param settable_variables: + :type settable_variables: :class:`TaskVariableRestrictions ` + """ + + _attribute_map = { + 'commands': {'key': 'commands', 'type': 'TaskCommandRestrictions'}, + 'settable_variables': {'key': 'settableVariables', 'type': 'TaskVariableRestrictions'} + } + + def __init__(self, commands=None, settable_variables=None): + super(TaskRestrictions, self).__init__() + self.commands = commands + self.settable_variables = settable_variables + + +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 TaskVariableRestrictions(Model): + """ + :param allowed: + :type allowed: list of str + """ + + _attribute_map = { + 'allowed': {'key': 'allowed', 'type': '[str]'} + } + + def __init__(self, allowed=None): + super(TaskVariableRestrictions, self).__init__() + self.allowed = allowed + + +class TaskVersion(Model): + """ + :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): + """ + :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): + """ + A variable group is a collection of related variables. + + :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 variable_group_project_references: all project references where the variable group is shared with other projects. + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + '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, variable_group_project_references=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.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupParameters(Model): + """ + :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 variable_group_project_references: + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + 'variables': {'key': 'variables', 'type': '{VariableValue}'} + } + + def __init__(self, description=None, name=None, provider_data=None, type=None, variable_group_project_references=None, variables=None): + super(VariableGroupParameters, self).__init__() + self.description = description + self.name = name + self.provider_data = provider_data + self.type = type + self.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupProjectReference(Model): + """ + A variable group reference is a shallow reference to variable group. + + :param description: Gets or sets description of the variable group. + :type description: str + :param name: Gets or sets name of the variable group. + :type name: str + :param project_reference: Gets or sets project reference of the variable group. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(VariableGroupProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class VariableGroupProviderData(Model): + """ + Defines provider data of the variable group. + + """ + + _attribute_map = { + } + + def __init__(self): + super(VariableGroupProviderData, self).__init__() + + +class VariableValue(Model): + """ + :param is_read_only: + :type is_read_only: bool + :param is_secret: + :type is_secret: bool + :param value: + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class VirtualMachine(Model): + """ + :param agent: + :type agent: :class:`TaskAgent ` + :param id: + :type id: int + :param tags: + :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(VirtualMachine, self).__init__() + self.agent = agent + self.id = id + self.tags = tags + + +class VirtualMachineGroup(EnvironmentResource): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource type + :type type: object + :param pool_id: + :type pool_id: int + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'} + } + + def __init__(self, created_by=None, created_on=None, environment_reference=None, id=None, last_modified_by=None, last_modified_on=None, name=None, tags=None, type=None, pool_id=None): + super(VirtualMachineGroup, 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, tags=tags, type=type) + self.pool_id = pool_id + + +class VirtualMachineGroupCreateParameters(Model): + """ + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(VirtualMachineGroupCreateParameters, self).__init__() + self.name = name + + +class DataSourceBinding(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 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(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, request_content=request_content, request_verb=request_verb, result_selector=result_selector, result_template=result_template, target=target) + + +class DeploymentGroup(DeploymentGroupReference): + """ + Deployment group. + + :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): + """ + :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 TaskAgent(TaskAgentReference): + """ + A task agent. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param access_point: This agent's access point. + :type access_point: str + :param enabled: Whether or not this agent should run jobs. + :type enabled: bool + :param id: Identifier of the agent. + :type id: int + :param name: Name of the agent. + :type name: str + :param os_description: Agent OS. + :type os_description: str + :param provisioning_state: Provisioning state of this agent. + :type provisioning_state: str + :param status: Whether or not the agent is online. + :type status: object + :param version: Agent version. + :type version: str + :param assigned_agent_cloud_request: The agent cloud request that's currently associated with this agent. + :type assigned_agent_cloud_request: :class:`TaskAgentCloudRequest ` + :param assigned_request: The request which is currently assigned to this agent. + :type assigned_request: :class:`TaskAgentJobRequest ` + :param authorization: Authorization information for this agent. + :type authorization: :class:`TaskAgentAuthorization ` + :param created_on: Date on which this agent was created. + :type created_on: datetime + :param last_completed_request: The last request which was completed by this agent. + :type last_completed_request: :class:`TaskAgentJobRequest ` + :param max_parallelism: Maximum job parallelism allowed for this agent. + :type max_parallelism: int + :param pending_update: Pending update for this agent. + :type pending_update: :class:`TaskAgentUpdate ` + :param properties: + :type properties: :class:`object ` + :param status_changed_on: Date on which the last connectivity status change occurred. + :type status_changed_on: datetime + :param system_capabilities: System-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities. + :type system_capabilities: dict + :param user_capabilities: User-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing 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): + """ + An organization-level grouping of agents. + + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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: The ID of the associated agent cloud. + :type agent_cloud_id: int + :param auto_provision: Whether or not a queue should be automatically provisioned for each project collection. + :type auto_provision: bool + :param auto_size: Whether or not the pool should autosize itself based on the Agent Cloud Provider settings. + :type auto_size: bool + :param auto_update: Whether or not agents in this pool are allowed to automatically update + :type auto_update: bool + :param created_by: Creator of the 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: The date/time of the pool creation. + :type created_on: datetime + :param owner: Owner or administrator of the pool. + :type owner: :class:`IdentityRef ` + :param properties: + :type properties: :class:`object ` + :param target_size: Target parallelism. + :type target_size: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + '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'}, + 'auto_update': {'key': 'autoUpdate', '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'}, + 'target_size': {'key': 'targetSize', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None, agent_cloud_id=None, auto_provision=None, auto_size=None, auto_update=None, created_by=None, created_on=None, owner=None, properties=None, target_size=None): + super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, is_legacy=is_legacy, name=name, options=options, 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.auto_update = auto_update + self.created_by = created_by + self.created_on = created_on + self.owner = owner + self.properties = properties + self.target_size = target_size + + +class TaskInputDefinition(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(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): + """ + :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', + 'EnvironmentCreateParameter', + 'EnvironmentDeploymentExecutionRecord', + 'EnvironmentInstance', + 'EnvironmentReference', + 'EnvironmentResource', + 'EnvironmentResourceReference', + 'EnvironmentUpdateParameter', + 'GraphSubjectBase', + 'HelpLink', + 'IdentityRef', + 'InputDescriptor', + 'InputValidation', + 'InputValidationRequest', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'KubernetesResource', + 'KubernetesResourceCreateParameters', + 'MetricsColumnMetaData', + 'MetricsColumnsHeader', + 'MetricsRow', + 'PackageMetadata', + 'PackageVersion', + 'ProjectReference', + 'PublishTaskGroupMetadata', + 'ReferenceLinks', + 'ResourceLimit', + 'ResourceUsage', + 'ResultTransformationDetails', + 'SecureFile', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'TaskAgentAuthorization', + 'TaskAgentCloud', + 'TaskAgentCloudRequest', + 'TaskAgentCloudType', + 'TaskAgentJobRequest', + 'TaskAgentMessage', + 'TaskAgentPoolMaintenanceDefinition', + 'TaskAgentPoolMaintenanceJob', + 'TaskAgentPoolMaintenanceJobTargetAgent', + 'TaskAgentPoolMaintenanceOptions', + 'TaskAgentPoolMaintenanceRetentionPolicy', + 'TaskAgentPoolMaintenanceSchedule', + 'TaskAgentPoolReference', + 'TaskAgentPublicKey', + 'TaskAgentQueue', + 'TaskAgentReference', + 'TaskAgentSession', + 'TaskAgentSessionKey', + 'TaskAgentUpdate', + 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', + 'TaskDefinition', + 'TaskDefinitionEndpoint', + 'TaskDefinitionReference', + 'TaskExecution', + 'TaskGroup', + 'TaskGroupCreateParameter', + 'TaskGroupDefinition', + 'TaskGroupRevision', + 'TaskGroupStep', + 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', + 'TaskHubLicenseDetails', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationOwner', + 'TaskOutputVariable', + 'TaskPackageMetadata', + 'TaskReference', + 'TaskRestrictions', + 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', + 'TaskVersion', + 'ValidationItem', + 'VariableGroup', + 'VariableGroupParameters', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'VirtualMachine', + 'VirtualMachineGroup', + 'VirtualMachineGroupCreateParameters', + 'DataSourceBinding', + 'DeploymentGroup', + 'DeploymentMachineGroup', + 'TaskAgent', + 'TaskAgentPool', + 'TaskInputDefinition', + 'TaskSourceDefinition', +] diff --git a/azure-devops/azure/devops/v7_0/task_agent/task_agent_client.py b/azure-devops/azure/devops/v7_0/task_agent/task_agent_client.py new file mode 100644 index 00000000..72c55f8f --- /dev/null +++ b/azure-devops/azure/devops/v7_0/task_agent/task_agent_client.py @@ -0,0 +1,1205 @@ +# -------------------------------------------------------------------------------------------- +# 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. + :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='7.0', + content=content) + return self._deserialize('TaskAgentCloud', response) + + def delete_agent_cloud(self, agent_cloud_id): + """DeleteAgentCloud. + :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='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_cloud(self, agent_cloud_id): + """GetAgentCloud. + :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='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_clouds(self): + """GetAgentClouds. + :rtype: [TaskAgentCloud] + """ + response = self._send(http_method='GET', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0') + return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) + + def update_agent_cloud(self, updated_cloud, agent_cloud_id): + """UpdateAgentCloud. + :param :class:` ` updated_cloud: + :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') + content = self._serialize.body(updated_cloud, 'TaskAgentCloud') + response = self._send(http_method='PATCH', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentCloud', 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='7.0-preview.1') + return self._deserialize('[TaskAgentCloudType]', self._unwrap_collection(response)) + + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgent', response) + + def add_deployment_group(self, deployment_group, project): + """AddDeploymentGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def delete_deployment_group(self, project, deployment_group_id): + """DeleteDeploymentGroup. + 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='7.0', + route_values=route_values) + + def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): + """GetDeploymentGroup. + 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='7.0', + 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. + 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: :class:`<[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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def get_environment_deployment_execution_records(self, project, environment_id, continuation_token=None, top=None): + """GetEnvironmentDeploymentExecutionRecords. + Get environment deployment execution history + :param str project: Project ID or project name + :param int environment_id: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentDeploymentExecutionRecord]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_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') + response = self._send(http_method='GET', + location_id='51bb5d21-4305-4ea6-9dbb-b7488af73334', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentDeploymentExecutionRecord]', self._unwrap_collection(response)) + + def add_environment(self, environment_create_parameter, project): + """AddEnvironment. + Create an environment. + :param :class:` ` environment_create_parameter: Environment 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(environment_create_parameter, 'EnvironmentCreateParameter') + response = self._send(http_method='POST', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def delete_environment(self, project, environment_id): + """DeleteEnvironment. + Delete the specified environment. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + self._send(http_method='DELETE', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values) + + def get_environment_by_id(self, project, environment_id, expands=None): + """GetEnvironmentById. + Get an environment by its ID. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :param str expands: 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 environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if expands is not None: + query_parameters['expands'] = self._serialize.query('expands', expands, 'str') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('EnvironmentInstance', response) + + def get_environments(self, project, name=None, continuation_token=None, top=None): + """GetEnvironments. + Get all environments. + :param str project: Project ID or project name + :param str name: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentInstance]> ` + """ + 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 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') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentInstance]', self._unwrap_collection(response)) + + def update_environment(self, environment_update_parameter, project, environment_id): + """UpdateEnvironment. + Update the specified environment. + :param :class:` ` environment_update_parameter: Environment data to update. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(environment_update_parameter, 'EnvironmentUpdateParameter') + response = self._send(http_method='PATCH', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def add_kubernetes_resource(self, create_parameters, project, environment_id): + """AddKubernetesResource. + :param :class:` ` create_parameters: + :param str project: Project ID or project name + :param int environment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(create_parameters, 'KubernetesResourceCreateParameters') + response = self._send(http_method='POST', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('KubernetesResource', response) + + def delete_kubernetes_resource(self, project, environment_id, resource_id): + """DeleteKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + self._send(http_method='DELETE', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + + def get_kubernetes_resource(self, project, environment_id, resource_id): + """GetKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + response = self._send(http_method='GET', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + return self._deserialize('KubernetesResource', 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentPool', response) + + def add_agent_queue(self, queue, project=None, authorize_pipelines=None): + """AddAgentQueue. + Create a new agent queue to connect a project to an agent pool. + :param :class:` ` queue: Details about the queue to create + :param str project: Project ID or project name + :param bool authorize_pipelines: Automatically authorize this queue when using YAML + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if authorize_pipelines is not None: + query_parameters['authorizePipelines'] = self._serialize.query('authorize_pipelines', authorize_pipelines, 'bool') + content = self._serialize.body(queue, 'TaskAgentQueue') + response = self._send(http_method='POST', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TaskAgentQueue', response) + + def delete_agent_queue(self, queue_id, project=None): + """DeleteAgentQueue. + Removes an agent queue from a project. + :param int queue_id: The agent queue 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 queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + self._send(http_method='DELETE', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values) + + def get_agent_queue(self, queue_id, project=None, action_filter=None): + """GetAgentQueue. + Get information about an agent queue. + :param int queue_id: The agent queue to get information about + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + query_parameters = {} + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAgentQueue', response) + + def get_agent_queues(self, project=None, queue_name=None, action_filter=None): + """GetAgentQueues. + Get a list of agent queues. + :param str project: Project ID or project name + :param str queue_name: Filter on the agent queue name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_name is not None: + query_parameters['queueName'] = self._serialize.query('queue_name', queue_name, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_ids(self, queue_ids, project=None, action_filter=None): + """GetAgentQueuesByIds. + Get a list of agent queues by their IDs + :param [int] queue_ids: A comma-separated list of agent queue IDs to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_ids is not None: + queue_ids = ",".join(map(str, queue_ids)) + query_parameters['queueIds'] = self._serialize.query('queue_ids', queue_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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_names(self, queue_names, project=None, action_filter=None): + """GetAgentQueuesByNames. + Get a list of agent queues by their names + :param [str] queue_names: A comma-separated list of agent names to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_names is not None: + queue_names = ",".join(queue_names) + query_parameters['queueNames'] = self._serialize.query('queue_names', queue_names, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_for_pools(self, pool_ids, project=None, action_filter=None): + """GetAgentQueuesForPools. + Get a list of agent queues by pool ids + :param [int] pool_ids: A comma-separated list of pool ids to get the corresponding queues for + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_cloud_requests(self, agent_cloud_id): + """GetAgentCloudRequests. + :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='7.0', + route_values=route_values) + return self._deserialize('[TaskAgentCloudRequest]', self._unwrap_collection(response)) + + def delete_deployment_target(self, project, deployment_group_id, target_id): + """DeleteDeploymentTarget. + 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='7.0', + route_values=route_values) + + def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): + """GetDeploymentTarget. + 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='7.0', + 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, property_filters=None): + """GetDeploymentTargets. + 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. + :param [str] property_filters: + :rtype: :class:`<[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') + 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='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) + + def add_task_group(self, task_group, project): + """AddTaskGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def delete_task_group(self, project, task_group_id, comment=None): + """DeleteTaskGroup. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def add_variable_group(self, variable_group_parameters): + """AddVariableGroup. + Add a variable group. + :param :class:` ` variable_group_parameters: + :rtype: :class:` ` + """ + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='POST', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + content=content) + return self._deserialize('VariableGroup', response) + + def delete_variable_group(self, group_id, project_ids): + """DeleteVariableGroup. + Delete a variable group + :param int group_id: Id of the variable group. + :param [str] project_ids: + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + self._send(http_method='DELETE', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_variable_group(self, variable_group_project_references, variable_group_id): + """ShareVariableGroup. + Add a variable group. + :param [VariableGroupProjectReference] variable_group_project_references: + :param int variable_group_id: + """ + query_parameters = {} + if variable_group_id is not None: + query_parameters['variableGroupId'] = self._serialize.query('variable_group_id', variable_group_id, 'int') + content = self._serialize.body(variable_group_project_references, '[VariableGroupProjectReference]') + self._send(http_method='PATCH', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + query_parameters=query_parameters, + content=content) + + def update_variable_group(self, variable_group_parameters, group_id): + """UpdateVariableGroup. + Update a variable group. + :param :class:` ` variable_group_parameters: + :param int group_id: Id of the variable group to update. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='PUT', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('VariableGroup', response) + + def get_variable_group(self, project, group_id): + """GetVariableGroup. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) + + def get_yaml_schema(self, validate_task_names=None): + """GetYamlSchema. + GET the Yaml schema used for Yaml file validation. + :param bool validate_task_names: Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). + :rtype: object + """ + query_parameters = {} + if validate_task_names is not None: + query_parameters['validateTaskNames'] = self._serialize.query('validate_task_names', validate_task_names, 'bool') + response = self._send(http_method='GET', + location_id='1f9990b9-1dba-441f-9c2e-6485888c42b6', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('object', response) + diff --git a/azure-devops/azure/devops/v7_0/test/__init__.py b/azure-devops/azure/devops/v7_0/test/__init__.py new file mode 100644 index 00000000..b6456e75 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test/__init__.py @@ -0,0 +1,129 @@ +# -------------------------------------------------------------------------------------------- +# 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', + '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' +] diff --git a/azure-devops/azure/devops/v7_0/test/models.py b/azure-devops/azure/devops/v7_0/test/models.py new file mode 100644 index 00000000..f9573697 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test/models.py @@ -0,0 +1,4679 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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 BuildConfiguration(Model): + """ + BuildConfiguration Details. + + :param branch_name: Branch name for which build is generated. + :type branch_name: str + :param build_definition_id: BuildDefinitionId for build. + :type build_definition_id: int + :param build_system: Build system. + :type build_system: str + :param creation_date: Build Creation Date. + :type creation_date: datetime + :param flavor: Build flavor (eg Build/Release). + :type flavor: str + :param id: BuildConfiguration Id. + :type id: int + :param number: Build Number. + :type number: str + :param platform: BuildConfiguration Platform. + :type platform: str + :param project: Project associated with this BuildConfiguration. + :type project: :class:`ShallowReference ` + :param repository_guid: Repository Guid for the Build. + :type repository_guid: str + :param repository_id: Repository Id. + :type repository_id: int + :param repository_type: Repository Type (eg. TFSGit). + :type repository_type: str + :param source_version: Source Version(/first commit) for the build was triggered. + :type source_version: str + :param target_branch_name: Target BranchName. + :type target_branch_name: str + :param uri: Build 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'}, + 'target_branch_name': {'key': 'targetBranchName', '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, target_branch_name=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.target_branch_name = target_branch_name + self.uri = uri + + +class BuildCoverage(Model): + """ + Build Coverage Detail + + :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): + """ + Reference to a build. + + :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): + """ + Detail About Clone Operation. + + :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 Succeeded or Failed, the operation is complete + :type state: object + :param url: Url for getting 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): + """ + Clone options for cloning the test suite. + + :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 hierarchy + :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): + """ + Clone Statistics Details. + + :param cloned_requirements_count: Number of requirements 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): + """ + Represents the build configuration (platform, flavor) and coverage data for the build + + :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): + """ + Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) + + :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): + """ + Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build + + :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 ` + :param status: Uri of build against which difference in coverage is computed + :type status: object + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'ShallowReference'}, + 'coverage_data': {'key': 'coverageData', 'type': '[CodeCoverageData]'}, + 'delta_build': {'key': 'deltaBuild', 'type': 'ShallowReference'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, build=None, coverage_data=None, delta_build=None, status=None): + super(CodeCoverageSummary, self).__init__() + self.build = build + self.coverage_data = coverage_data + self.delta_build = delta_build + self.status = status + + +class CoverageStatistics(Model): + """ + :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): + """ + A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool) + + :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): + """ + :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): + """ + This is a temporary class to provide the details for the test run environment. + + :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): + """ + Failing since information of a test result. + + :param build: Build reference since failing. + :type build: :class:`BuildReference ` + :param date: Time since failing(UTC). + :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): + """ + :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): + """ + :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): + """ + :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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +class LastResultDetails(Model): + """ + Last result details of test point. + + :param date_completed: Completed date of last result. + :type date_completed: datetime + :param duration: Duration of the last result in milliseconds. + :type duration: long + :param run_by: The user who executed the last result. + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Name value pair + + :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 PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +class PlanUpdateModel(Model): + """ + A model class used for creating and updating test plans. + + :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): + """ + Adding test cases to a suite creates one of more test points based on the default configurations and testers assigned to the test suite. PointAssignment is the list of test points that were created for each of the test cases that were added to the test suite. + + :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): + """ + Filter class for test point. + + :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): + """ + Model to update test point. + + :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): + """ + The class to represent a Generic store for test session data. + + :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): + """ + :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): + """ + 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 ReleaseEnvironmentDefinitionReference(Model): + """ + Reference to release environment resource. + + :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): + """ + Reference to a release. + + :param attempt: Number of Release Attempt. + :type attempt: int + :param creation_date: Release Creation Date(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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): + """ + Test result retention settings + + :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): + """ + :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): + """ + Test run create details. + + :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: BuildReference of the test run. + :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: Additional properties of test Run. + :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: Filter used for discovering the Run. + :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 pipeline_reference: Reference of the pipeline to which this test run belongs. PipelineReference.PipelineId should be equal to RunCreateModel.Build.Id + :type pipeline_reference: :class:`PipelineReference ` + :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: Reference to release associated with test run. + :type release_reference: :class:`ReleaseReference ` + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param run_timeout: Timespan till the run times out. + :type run_timeout: object + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :type source_workflow: str + :param start_date: Start date time of the run. + :type start_date: str + :param state: The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting + :type state: str + :param tags: Tags to attach with the test run, maximum of 5 tags can be added to run. + :type tags: list of :class:`TestTag ` + :param test_configurations_mapping: TestConfigurationMapping of the test run. + :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 of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun) + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'run_timeout': {'key': 'runTimeout', 'type': 'object'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=None, plan=None, point_ids=None, release_environment_uri=None, release_reference=None, release_uri=None, run_summary=None, run_timeout=None, source_workflow=None, start_date=None, state=None, tags=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.pipeline_reference = pipeline_reference + 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_summary = run_summary + self.run_timeout = run_timeout + self.source_workflow = source_workflow + self.start_date = start_date + self.state = state + self.tags = tags + 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): + """ + This class is used to provide the filters used for discovery + + :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): + """ + Test run statistics per outcome. + + :param count: Test result count fo the given outcome. + :type count: int + :param outcome: Test result outcome + :type outcome: str + :param resolution_state: Test run Resolution State. + :type resolution_state: :class:`TestResolutionState ` + :param result_metadata: ResultMetadata for the given outcome/count. + :type result_metadata: object + :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'}, + 'result_metadata': {'key': 'resultMetadata', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, count=None, outcome=None, resolution_state=None, result_metadata=None, state=None): + super(RunStatistic, self).__init__() + self.count = count + self.outcome = outcome + self.resolution_state = resolution_state + self.result_metadata = result_metadata + self.state = state + + +class RunSummaryModel(Model): + """ + Run summary for each output type of test. + + :param duration: Total time taken in milliseconds. + :type duration: long + :param result_count: Number of results for Outcome TestOutcome + :type result_count: int + :param test_outcome: Summary is based on outcome + :type test_outcome: object + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'long'}, + 'result_count': {'key': 'resultCount', 'type': 'int'}, + 'test_outcome': {'key': 'testOutcome', 'type': 'object'} + } + + def __init__(self, duration=None, result_count=None, test_outcome=None): + super(RunSummaryModel, self).__init__() + self.duration = duration + self.result_count = result_count + self.test_outcome = test_outcome + + +class RunUpdateModel(Model): + """ + :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 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: true to delete inProgess Results , false otherwise. + :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: URI of release environment associated with the run. + :type release_environment_uri: str + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :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: The types of sub states for test run. + :type substate: object + :param tags: Tags to attach with the test run. + :type tags: list of :class:`TestTag ` + :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 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'}, + 'run_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'started_date': {'key': 'startedDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'substate': {'key': 'substate', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, run_summary=None, source_workflow=None, started_date=None, state=None, substate=None, tags=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.run_summary = run_summary + self.source_workflow = source_workflow + self.started_date = started_date + self.state = state + self.substate = substate + self.tags = tags + self.test_environment_id = test_environment_id + self.test_settings = test_settings + + +class ShallowReference(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :param automated_test_name: + :type automated_test_name: str + :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 tags: + :type tags: list of str + :param test_case_title: + :type test_case_title: str + """ + + _attribute_map = { + 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} + } + + def __init__(self, automated_test_name=None, 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, tags=None, test_case_title=None): + super(ShallowTestCaseResult, self).__init__() + self.automated_test_name = automated_test_name + 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.tags = tags + self.test_case_title = test_case_title + + +class SharedStepModel(Model): + """ + Reference to shared step workitem. + + :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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +class SuiteCreateModel(Model): + """ + Suite create model + + :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): + """ + A suite entry defines properties for a test suite. + + :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): + """ + A model to define sequence of test suite entries in a test suite. + + :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): + """ + Test case for the suite. + + :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): + """ + Test suite update model. + + :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): + """ + Test suite update model. + + :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): + """ + The Team Context for an operation. + + :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): + """ + 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 TestAttachment(Model): + """ + :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): + """ + Reference to test attachment. + + :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): + """ + Test attachment request model + + :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): + """ + Represents a test result. + + :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: TypeId of automated test. + :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 with maxSize= 1000 chars. + :type comment: str + :param completed_date: Time when test execution completed(UTC). Completed date should be greater than StartedDate. + :type completed_date: datetime + :param computer_name: Machine name where test executed. + :type computer_name: str + :param configuration: Reference to test configuration. Type ShallowReference. + :type configuration: :class:`ShallowReference ` + :param created_date: Timestamp when test result created(UTC). + :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. If not provided value will be set as CompletedDate - StartedDate + :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. Valid Value= (Known Issue, New Issue, Regression, Unknown, None) + :type failure_type: str + :param id: ID of a test result. + :type id: int + :param iteration_details: Test result details of test iterations used only for Manual Testing. + :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(UTC). + :type last_updated_date: datetime + :param outcome: Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted) + :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: ResetCount. + :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 with maxSize= 1000 chars. + :type stack_trace: str + :param started_date: Time when test execution started(UTC). + :type started_date: datetime + :param state: State of test result. Type TestRunState. + :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 TestResultMetaData + :type test_case_reference_id: int + :param test_case_revision: TestCaseRevision Number. + :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): + """ + Test attachment information in a test iteration. + + :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): + """ + Reference to a test result. + + :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): + """ + :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): + """ + Test configuration + + :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): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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): + """ + :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): + """ + :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 TestFlakyIdentifier(Model): + """ + Test Flaky Identifier + + :param branch_name: Branch Name where Flakiness has to be Marked/Unmarked + :type branch_name: str + :param is_flaky: State for Flakiness + :type is_flaky: bool + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'is_flaky': {'key': 'isFlaky', 'type': 'bool'} + } + + def __init__(self, branch_name=None, is_flaky=None): + super(TestFlakyIdentifier, self).__init__() + self.branch_name = branch_name + self.is_flaky = is_flaky + + +class TestHistoryQuery(Model): + """ + Filter to get TestCase result history. + + :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 BuildDefinitionId. 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 test_case_id: Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname + :type test_case_id: int + :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]'}, + 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, + '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, test_case_id=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.test_case_id = test_case_id + self.trend_days = trend_days + + +class TestIterationDetailsModel(Model): + """ + Represents a test iteration result. + + :param action_results: Test step results in an iteration. + :type action_results: list of :class:`TestActionResultModel ` + :param attachments: Reference 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(UTC). + :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(UTC). + :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): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :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): + """ + Class representing a reference to an operation. + + :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): + """ + Test outcome settings + + :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): + """ + The test plan resource. + + :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): + """ + :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): + """ + Test point. + + :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): + """ + Test point query class. + + :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): + """ + Test Resolution State Details. + + :param id: Test Resolution state Id. + :type id: int + :param name: Test Resolution State 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + List of test results filtered on the basis of GroupByValue + + :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): + """ + Represents a Meta Data of a test result. + + :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 flaky_identifiers: List of Flaky Identifier for TestCaseReferenceId + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + :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'}, + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'}, + '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, flaky_identifiers=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.flaky_identifiers = flaky_identifiers + 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): + """ + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :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): + """ + Test parameter information in a test iteration. + + :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. Deprecated in hosted environment. + :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): + """ + :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): + """ + :param build: + :type build: :class:`BuildReference ` + :param context_type: + :type context_type: object + :param pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + self.release = release + + +class TestResultsDetails(Model): + """ + :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): + """ + :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 + :param tags: + :type tags: list of str + """ + + _attribute_map = { + 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, + 'results': {'key': 'results', 'type': '[TestCaseResult]'}, + 'results_count_by_outcome': {'key': 'resultsCountByOutcome', 'type': '{AggregatedResultsByOutcome}'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, group_by_value=None, results=None, results_count_by_outcome=None, tags=None): + super(TestResultsDetailsForGroup, self).__init__() + self.group_by_value = group_by_value + self.results = results + self.results_count_by_outcome = results_count_by_outcome + self.tags = tags + + +class TestResultsGroupsForBuild(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :param aggregated_results_analysis: + :type aggregated_results_analysis: :class:`AggregatedResultsAnalysis ` + :param no_config_runs_count: + :type no_config_runs_count: int + :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 ` + :param total_runs_count: + :type total_runs_count: int + """ + + _attribute_map = { + 'aggregated_results_analysis': {'key': 'aggregatedResultsAnalysis', 'type': 'AggregatedResultsAnalysis'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'team_project': {'key': 'teamProject', 'type': 'TeamProjectReference'}, + 'test_failures': {'key': 'testFailures', 'type': 'TestFailuresAnalysis'}, + 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, aggregated_results_analysis=None, no_config_runs_count=None, team_project=None, test_failures=None, test_results_context=None, total_runs_count=None): + super(TestResultSummary, self).__init__() + self.aggregated_results_analysis = aggregated_results_analysis + self.no_config_runs_count = no_config_runs_count + self.team_project = team_project + self.test_failures = test_failures + self.test_results_context = test_results_context + self.total_runs_count = total_runs_count + + +class TestResultTrendFilter(Model): + """ + :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): + """ + Test run details. + + :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: Test Run Controller. + :type controller: str + :param created_date: Test Run CreatedDate. + :type created_date: datetime + :param custom_fields: List of Custom Fields for TestRun. + :type custom_fields: list of :class:`CustomTestField ` + :param drop_location: Drop Location for the test Run. + :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: Number of 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: Number of 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: Phase/State for the testRun. + :type phase: str + :param pipeline_reference: Reference of the pipeline to which this test run belongs. + :type pipeline_reference: :class:`PipelineReference ` + :param plan: Test plan associated with this test run. + :type plan: :class:`ShallowReference ` + :param post_process_state: Post Process State. + :type post_process_state: str + :param project: Project associated with this run. + :type project: :class:`ShallowReference ` + :param release: Release Reference for the Test Run. + :type release: :class:`ReleaseReference ` + :param release_environment_uri: Release Environment Uri for TestRun. + :type release_environment_uri: str + :param release_uri: Release Uri for TestRun. + :type release_uri: str + :param revision: + :type revision: int + :param run_statistics: RunSummary by outcome. + :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. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation + :type state: str + :param substate: TestRun Substate. + :type substate: object + :param tags: Tags attached with this test run. + :type tags: list of :class:`TestTag ` + :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: Number of failed tests in the run. + :type unanalyzed_tests: int + :param url: Url of the test run + :type url: str + :param web_access_url: Web Access Url for TestRun. + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=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, tags=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.pipeline_reference = pipeline_reference + 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.tags = tags + 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): + """ + Test Run Code Coverage Details + + :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): + """ + Test run statistics. + + :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): + """ + Test Session + + :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): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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): + """ + Represents a sub result of a test result. + + :param comment: Comment in sub result. + :type comment: str + :param completed_date: Time when test execution completed(UTC). + :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(UTC). + :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(UTC). + :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): + """ + Test suite + + :param area_uri: Area uri of the test suite. + :type area_uri: str + :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 children: Child test suites of current test suite. + :type children: list of :class:`TestSuite ` + :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'}, + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[ShallowReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[ShallowReference]'}, + 'children': {'key': 'children', 'type': '[TestSuite]'}, + '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, default_configurations=None, default_testers=None, children=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.default_configurations = default_configurations + self.default_testers = default_testers + self.children = children + 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): + """ + Test suite clone request + + :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): + """ + :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 TestTag(Model): + """ + Tag attached to a run or result. + + :param name: Name of the tag, alphanumeric value less than 30 chars + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(TestTag, self).__init__() + self.name = name + + +class TestToWorkItemLinks(Model): + """ + :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): + """ + :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): + """ + WorkItem reference Details. + + :param id: WorkItem Id. + :type id: str + :param name: WorkItem Name. + :type name: str + :param type: WorkItem Type. + :type type: str + :param url: WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case) + :type url: str + :param web_url: WorkItem WebUrl. + :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): + """ + :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): + """ + Represents a test step result. + + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :type started_date: datetime + :param action_path: Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step + :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. Deprecated in hosted environment. + :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', + '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', + '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', + 'TestActionResultModel', +] diff --git a/azure-devops/azure/devops/v7_0/test/test_client.py b/azure-devops/azure/devops/v7_0/test/test_client.py new file mode 100644 index 00000000..e4a299a3 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test/test_client.py @@ -0,0 +1,1181 @@ +# -------------------------------------------------------------------------------------------- +# 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 create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id): + """CreateTestResultAttachment. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): + """GetTestSubResultAttachmentContent. + 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='7.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_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id): + """GetTestSubResultAttachments. + 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='7.0', + 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. + 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='7.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_test_run_attachment(self, attachment_request_model, project, run_id): + """CreateTestRunAttachment. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.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_code_coverage(self, project, build_id, flags): + """GetBuildCodeCoverage. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestRunCoverage]', 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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestIterationDetailsModel]', 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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestPointsQuery', response) + + def get_result_retention_settings(self, project): + """GetResultRetentionSettings. + 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='7.0', + route_values=route_values) + return self._deserialize('ResultRetentionSettings', response) + + def update_result_retention_settings(self, retention_settings, project): + """UpdateResultRetentionSettings. + 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='7.0', + 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='7.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='7.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='7.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='7.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 , 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='7.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='7.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='7.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: Default value is true. It includes details like run statistics, release, build, test environment, 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='7.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='7.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 separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma separated 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 separated 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:`<[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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestRun', response) + + def create_test_session(self, test_session, team_context): + """CreateTestSession. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSession', 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) + + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + 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='7.0', + route_values=route_values) + + def query_test_history(self, filter, project): + """QueryTestHistory. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestHistoryQuery', response) + diff --git a/azure-devops/azure/devops/v7_0/test_plan/__init__.py b/azure-devops/azure/devops/v7_0/test_plan/__init__.py new file mode 100644 index 00000000..e37d1710 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_plan/__init__.py @@ -0,0 +1,78 @@ +# -------------------------------------------------------------------------------------------- +# 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_plan_client import TestPlanClient + +__all__ = [ + 'BuildDefinitionReference', + 'CloneOperationCommonResponse', + 'CloneOptions', + 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', + 'CloneTestPlanOperationInformation', + 'CloneTestPlanParams', + 'CloneTestSuiteOperationInformation', + 'CloneTestSuiteParams', + 'Configuration', + 'DestinationTestPlanCloneParams', + 'DestinationTestSuiteInfo', + 'GraphSubjectBase', + 'IdentityRef', + 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', + 'NameValuePair', + 'PointAssignment', + 'ReferenceLinks', + 'ReleaseEnvironmentDefinitionReference', + 'Results', + 'SourceTestPlanInfo', + 'SourceTestplanResponse', + 'SourceTestSuiteInfo', + 'SourceTestSuiteResponse', + 'SuiteEntry', + 'SuiteEntryUpdateParams', + 'SuiteTestCaseCreateUpdateParameters', + 'TeamProjectReference', + 'TestCase', + 'TestCaseAssociatedResult', + 'TestCaseReference', + 'TestCaseResultsData', + 'TestConfiguration', + 'TestConfigurationCreateUpdateParameters', + 'TestConfigurationReference', + 'TestEntityCount', + 'TestEnvironment', + 'TestOutcomeSettings', + 'TestPlan', + 'TestPlanCreateParams', + 'TestPlanDetailedReference', + 'TestPlanReference', + 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', + 'TestPlanUpdateParams', + 'TestPoint', + 'TestPointDetailedReference', + 'TestPointResults', + 'TestPointUpdateParams', + 'TestSettings', + 'TestSuite', + 'TestSuiteCreateParams', + 'TestSuiteCreateUpdateCommonParams', + 'TestSuiteReference', + 'TestSuiteReferenceWithProject', + 'TestSuiteUpdateParams', + 'TestVariable', + 'TestVariableCreateUpdateParameters', + 'WorkItem', + 'WorkItemDetails', + 'TestPlanClient' +] diff --git a/azure-devops/azure/devops/v7_0/test_plan/models.py b/azure-devops/azure/devops/v7_0/test_plan/models.py new file mode 100644 index 00000000..d2ebf44b --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_plan/models.py @@ -0,0 +1,2284 @@ +# -------------------------------------------------------------------------------------------- +# 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 BuildDefinitionReference(Model): + """ + The build definition reference resource + + :param id: ID of the build definition + :type id: int + :param name: Name of the build definition + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(BuildDefinitionReference, self).__init__() + self.id = id + self.name = name + + +class CloneOperationCommonResponse(Model): + """ + Common Response for clone operation + + :param clone_statistics: Various statistics related to the clone operation + :type clone_statistics: :class:`CloneStatistics ` + :param completion_date: Completion data of the operation + :type completion_date: datetime + :param creation_date: Creation data of the operation + :type creation_date: datetime + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param message: Message related to the job + :type message: str + :param op_id: Clone operation Id + :type op_id: int + :param state: Clone operation state + :type state: object + """ + + _attribute_map = { + 'clone_statistics': {'key': 'cloneStatistics', 'type': 'CloneStatistics'}, + 'completion_date': {'key': 'completionDate', 'type': 'iso-8601'}, + 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'message': {'key': 'message', 'type': 'str'}, + 'op_id': {'key': 'opId', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, clone_statistics=None, completion_date=None, creation_date=None, links=None, message=None, op_id=None, state=None): + super(CloneOperationCommonResponse, self).__init__() + self.clone_statistics = clone_statistics + self.completion_date = completion_date + self.creation_date = creation_date + self.links = links + self.message = message + self.op_id = op_id + self.state = state + + +class CloneOptions(Model): + """ + Clone options for cloning the test suite. + + :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 hierarchy + :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): + """ + Clone Statistics Details. + + :param cloned_requirements_count: Number of requirements 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 CloneTestCaseOperationInformation(Model): + """ + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneTestCaseOptions ` + :param destination_test_suite: Information of destination Test Suite + :type destination_test_suite: :class:`TestSuiteReferenceWithProject ` + :param source_test_suite: Information of source Test Suite + :type source_test_suite: :class:`SourceTestSuiteResponse ` + """ + + _attribute_map = { + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneTestCaseOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteResponse'} + } + + def __init__(self, clone_operation_response=None, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestCaseOperationInformation, self).__init__() + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class CloneTestCaseOptions(Model): + """ + :param include_attachments: If set to true, include the attachments + :type include_attachments: bool + :param include_links: If set to true, include the links + :type include_links: bool + :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 = { + 'include_attachments': {'key': 'includeAttachments', 'type': 'bool'}, + 'include_links': {'key': 'includeLinks', 'type': 'bool'}, + 'related_link_comment': {'key': 'relatedLinkComment', 'type': 'str'} + } + + def __init__(self, include_attachments=None, include_links=None, related_link_comment=None): + super(CloneTestCaseOptions, self).__init__() + self.include_attachments = include_attachments + self.include_links = include_links + self.related_link_comment = related_link_comment + + +class CloneTestCaseParams(Model): + """ + Parameters for Test Suite clone operation + + :param clone_options: Test Case Clone create parameters + :type clone_options: :class:`CloneTestCaseOptions ` + :param destination_test_plan: Information about destination Test Plan + :type destination_test_plan: :class:`TestPlanReference ` + :param destination_test_suite: Information about destination Test Suite + :type destination_test_suite: :class:`DestinationTestSuiteInfo ` + :param source_test_plan: Information about source Test Plan + :type source_test_plan: :class:`TestPlanReference ` + :param source_test_suite: Information about source Test Suite + :type source_test_suite: :class:`SourceTestSuiteInfo ` + :param test_case_ids: Test Case IDs + :type test_case_ids: list of int + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneTestCaseOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'TestPlanReference'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'DestinationTestSuiteInfo'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'TestPlanReference'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteInfo'}, + 'test_case_ids': {'key': 'testCaseIds', 'type': '[int]'} + } + + def __init__(self, clone_options=None, destination_test_plan=None, destination_test_suite=None, source_test_plan=None, source_test_suite=None, test_case_ids=None): + super(CloneTestCaseParams, self).__init__() + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.destination_test_suite = destination_test_suite + self.source_test_plan = source_test_plan + self.source_test_suite = source_test_suite + self.test_case_ids = test_case_ids + + +class CloneTestPlanOperationInformation(Model): + """ + Response for Test Plan clone operation + + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_plan: Information of destination Test Plan + :type destination_test_plan: :class:`TestPlan ` + :param source_test_plan: Information of source Test Plan + :type source_test_plan: :class:`SourceTestplanResponse ` + """ + + _attribute_map = { + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'TestPlan'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'SourceTestplanResponse'} + } + + def __init__(self, clone_operation_response=None, clone_options=None, destination_test_plan=None, source_test_plan=None): + super(CloneTestPlanOperationInformation, self).__init__() + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.source_test_plan = source_test_plan + + +class CloneTestPlanParams(Model): + """ + Parameters for Test Plan clone operation + + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_plan: Information about destination Test Plan + :type destination_test_plan: :class:`DestinationTestPlanCloneParams ` + :param source_test_plan: Information about source Test Plan + :type source_test_plan: :class:`SourceTestPlanInfo ` + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'DestinationTestPlanCloneParams'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'SourceTestPlanInfo'} + } + + def __init__(self, clone_options=None, destination_test_plan=None, source_test_plan=None): + super(CloneTestPlanParams, self).__init__() + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.source_test_plan = source_test_plan + + +class CloneTestSuiteOperationInformation(Model): + """ + Response for Test Suite clone operation + + :param cloned_test_suite: Information of newly cloned Test Suite + :type cloned_test_suite: :class:`TestSuiteReferenceWithProject ` + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_suite: Information of destination Test Suite + :type destination_test_suite: :class:`TestSuiteReferenceWithProject ` + :param source_test_suite: Information of source Test Suite + :type source_test_suite: :class:`TestSuiteReferenceWithProject ` + """ + + _attribute_map = { + 'cloned_test_suite': {'key': 'clonedTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'TestSuiteReferenceWithProject'} + } + + def __init__(self, cloned_test_suite=None, clone_operation_response=None, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestSuiteOperationInformation, self).__init__() + self.cloned_test_suite = cloned_test_suite + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class CloneTestSuiteParams(Model): + """ + Parameters for Test Suite clone operation + + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_suite: Information about destination Test Suite + :type destination_test_suite: :class:`DestinationTestSuiteInfo ` + :param source_test_suite: Information about source Test Suite + :type source_test_suite: :class:`SourceTestSuiteInfo ` + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'DestinationTestSuiteInfo'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteInfo'} + } + + def __init__(self, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestSuiteParams, self).__init__() + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class Configuration(Model): + """ + Configuration of the Test Point + + :param configuration_id: Id of the Configuration Assigned to the Test Point + :type configuration_id: int + """ + + _attribute_map = { + 'configuration_id': {'key': 'configurationId', 'type': 'int'} + } + + def __init__(self, configuration_id=None): + super(Configuration, self).__init__() + self.configuration_id = configuration_id + + +class DestinationTestSuiteInfo(Model): + """ + Destination Test Suite information for Test Suite clone operation + + :param id: Destination Suite Id + :type id: int + :param project: Destination Project Name + :type project: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'str'} + } + + def __init__(self, id=None, project=None): + super(DestinationTestSuiteInfo, self).__init__() + self.id = id + 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 LastResultDetails(Model): + """ + Last result details of test point. + + :param date_completed: Completed date of last result. + :type date_completed: datetime + :param duration: Duration of the last result in milliseconds. + :type duration: long + :param run_by: The user who executed the last result. + :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 LibraryWorkItemsData(Model): + """ + This data model is used in Work item-based tabs of Test Plans Library. + + :param column_options: Specifies the column option field names + :type column_options: list of str + :param continuation_token: Continuation token to fetch next set of elements. Present only when HasMoreElements is true. + :type continuation_token: str + :param exceeded_work_item_query_limit: Boolean indicating if the WIQL query has exceeded the limit of items returned. + :type exceeded_work_item_query_limit: bool + :param has_more_elements: Boolean indicating if there are more elements present than what are being sent. + :type has_more_elements: bool + :param return_code: Specifies if there was an error while execution of data provider. + :type return_code: object + :param work_item_ids: List of work items returned when OrderByField is sent something other than Id. + :type work_item_ids: list of int + :param work_items: List of work items to be returned. + :type work_items: list of :class:`WorkItemDetails ` + """ + + _attribute_map = { + 'column_options': {'key': 'columnOptions', 'type': '[str]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'exceeded_work_item_query_limit': {'key': 'exceededWorkItemQueryLimit', 'type': 'bool'}, + 'has_more_elements': {'key': 'hasMoreElements', 'type': 'bool'}, + 'return_code': {'key': 'returnCode', 'type': 'object'}, + 'work_item_ids': {'key': 'workItemIds', 'type': '[int]'}, + 'work_items': {'key': 'workItems', 'type': '[WorkItemDetails]'} + } + + def __init__(self, column_options=None, continuation_token=None, exceeded_work_item_query_limit=None, has_more_elements=None, return_code=None, work_item_ids=None, work_items=None): + super(LibraryWorkItemsData, self).__init__() + self.column_options = column_options + self.continuation_token = continuation_token + self.exceeded_work_item_query_limit = exceeded_work_item_query_limit + self.has_more_elements = has_more_elements + self.return_code = return_code + self.work_item_ids = work_item_ids + self.work_items = work_items + + +class LibraryWorkItemsDataProviderRequest(Model): + """ + This is the request data contract for LibraryTestCaseDataProvider. + + :param column_options: Specifies the list of column options to show in test cases table. + :type column_options: list of str + :param continuation_token: The continuation token required for paging of work items. This is required when getting subsequent sets of work items when OrderByField is Id. + :type continuation_token: str + :param filter_values: List of filter values to be supplied. Currently supported filters are Title, State, AssignedTo, Priority, AreaPath. + :type filter_values: list of :class:`TestPlansLibraryWorkItemFilter ` + :param is_ascending: Whether the data is to be sorted in ascending or descending order. When not supplied, defaults to descending. + :type is_ascending: bool + :param library_query_type: The type of query to run. + :type library_query_type: object + :param order_by_field: Work item field on which to order the results. When not supplied, defaults to work item IDs. + :type order_by_field: str + :param work_item_ids: List of work items to query for field details. This is required when getting subsequent sets of work item fields when OrderByField is other than Id. + :type work_item_ids: list of int + """ + + _attribute_map = { + 'column_options': {'key': 'columnOptions', 'type': '[str]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'filter_values': {'key': 'filterValues', 'type': '[TestPlansLibraryWorkItemFilter]'}, + 'is_ascending': {'key': 'isAscending', 'type': 'bool'}, + 'library_query_type': {'key': 'libraryQueryType', 'type': 'object'}, + 'order_by_field': {'key': 'orderByField', 'type': 'str'}, + 'work_item_ids': {'key': 'workItemIds', 'type': '[int]'} + } + + def __init__(self, column_options=None, continuation_token=None, filter_values=None, is_ascending=None, library_query_type=None, order_by_field=None, work_item_ids=None): + super(LibraryWorkItemsDataProviderRequest, self).__init__() + self.column_options = column_options + self.continuation_token = continuation_token + self.filter_values = filter_values + self.is_ascending = is_ascending + self.library_query_type = library_query_type + self.order_by_field = order_by_field + self.work_item_ids = work_item_ids + + +class NameValuePair(Model): + """ + Name value pair + + :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 PointAssignment(Configuration): + """ + Assignments for the Test Point + + :param configuration_id: Id of the Configuration Assigned to the Test Point + :type configuration_id: int + :param configuration_name: Name of the Configuration Assigned to the Test Point + :type configuration_name: str + :param id: Id of the Test Point + :type id: int + :param tester: Tester Assigned to the Test Point + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'configuration_id': {'key': 'configurationId', 'type': 'int'}, + 'configuration_name': {'key': 'configurationName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, configuration_id=None, configuration_name=None, id=None, tester=None): + super(PointAssignment, self).__init__(configuration_id=configuration_id) + self.configuration_name = configuration_name + self.id = id + self.tester = tester + + +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 ReleaseEnvironmentDefinitionReference(Model): + """ + Reference to release environment resource. + + :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 Results(Model): + """ + Results class for Test Point + + :param outcome: Outcome of the Test Point + :type outcome: object + """ + + _attribute_map = { + 'outcome': {'key': 'outcome', 'type': 'object'} + } + + def __init__(self, outcome=None): + super(Results, self).__init__() + self.outcome = outcome + + +class SourceTestPlanInfo(Model): + """ + Source Test Plan information for Test Plan clone operation + + :param id: ID of the source Test Plan + :type id: int + :param suite_ids: Id of suites to be cloned inside source Test Plan + :type suite_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'suite_ids': {'key': 'suiteIds', 'type': '[int]'} + } + + def __init__(self, id=None, suite_ids=None): + super(SourceTestPlanInfo, self).__init__() + self.id = id + self.suite_ids = suite_ids + + +class SourceTestSuiteInfo(Model): + """ + Source Test Suite information for Test Suite clone operation + + :param id: Id of the Source Test Suite + :type id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, id=None): + super(SourceTestSuiteInfo, self).__init__() + self.id = id + + +class SuiteEntryUpdateParams(Model): + """ + A suite entry defines properties for a test suite. + + :param id: Id of the suite entry in the test suite: either a test case id or child suite id. + :type id: int + :param sequence_number: Sequence number for the suite entry object in the test suite. + :type sequence_number: int + :param suite_entry_type: Defines whether the entry is of type test case or suite. + :type suite_entry_type: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'suite_entry_type': {'key': 'suiteEntryType', 'type': 'object'} + } + + def __init__(self, id=None, sequence_number=None, suite_entry_type=None): + super(SuiteEntryUpdateParams, self).__init__() + self.id = id + self.sequence_number = sequence_number + self.suite_entry_type = suite_entry_type + + +class SuiteTestCaseCreateUpdateParameters(Model): + """ + Create and Update Suite Test Case Parameters + + :param point_assignments: Configurations Ids + :type point_assignments: list of :class:`Configuration ` + :param work_item: Id of Test Case to be updated or created + :type work_item: :class:`WorkItem ` + """ + + _attribute_map = { + 'point_assignments': {'key': 'pointAssignments', 'type': '[Configuration]'}, + 'work_item': {'key': 'workItem', 'type': 'WorkItem'} + } + + def __init__(self, point_assignments=None, work_item=None): + super(SuiteTestCaseCreateUpdateParameters, self).__init__() + self.point_assignments = point_assignments + self.work_item = work_item + + +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 TestCase(Model): + """ + Test Case Class + + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param order: Order of the TestCase in the Suite + :type order: int + :param point_assignments: List of Points associated with the Test Case + :type point_assignments: list of :class:`PointAssignment ` + :param project: Project under which the Test Case is + :type project: :class:`TeamProjectReference ` + :param test_plan: Test Plan under which the Test Case is + :type test_plan: :class:`TestPlanReference ` + :param test_suite: Test Suite under which the Test Case is + :type test_suite: :class:`TestSuiteReference ` + :param work_item: Work Item details of the TestCase + :type work_item: :class:`WorkItemDetails ` + """ + + _attribute_map = { + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'order': {'key': 'order', 'type': 'int'}, + 'point_assignments': {'key': 'pointAssignments', 'type': '[PointAssignment]'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanReference'}, + 'test_suite': {'key': 'testSuite', 'type': 'TestSuiteReference'}, + 'work_item': {'key': 'workItem', 'type': 'WorkItemDetails'} + } + + def __init__(self, links=None, order=None, point_assignments=None, project=None, test_plan=None, test_suite=None, work_item=None): + super(TestCase, self).__init__() + self.links = links + self.order = order + self.point_assignments = point_assignments + self.project = project + self.test_plan = test_plan + self.test_suite = test_suite + self.work_item = work_item + + +class TestCaseAssociatedResult(Model): + """ + :param completed_date: + :type completed_date: datetime + :param configuration: + :type configuration: :class:`TestConfigurationReference ` + :param outcome: + :type outcome: object + :param plan: + :type plan: :class:`TestPlanReference ` + :param point_id: + :type point_id: int + :param result_id: + :type result_id: int + :param run_by: + :type run_by: :class:`IdentityRef ` + :param run_id: + :type run_id: int + :param suite: + :type suite: :class:`TestSuiteReference ` + :param tester: + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'point_id': {'key': 'pointId', 'type': 'int'}, + 'result_id': {'key': 'resultId', 'type': 'int'}, + 'run_by': {'key': 'runBy', 'type': 'IdentityRef'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'suite': {'key': 'suite', 'type': 'TestSuiteReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, completed_date=None, configuration=None, outcome=None, plan=None, point_id=None, result_id=None, run_by=None, run_id=None, suite=None, tester=None): + super(TestCaseAssociatedResult, self).__init__() + self.completed_date = completed_date + self.configuration = configuration + self.outcome = outcome + self.plan = plan + self.point_id = point_id + self.result_id = result_id + self.run_by = run_by + self.run_id = run_id + self.suite = suite + self.tester = tester + + +class TestCaseReference(Model): + """ + Test Case Reference + + :param assigned_to: Identity to whom the test case is assigned + :type assigned_to: :class:`IdentityRef ` + :param id: Test Case Id + :type id: int + :param name: Test Case Name + :type name: str + :param state: State of the test case work item + :type state: str + """ + + _attribute_map = { + 'assigned_to': {'key': 'assignedTo', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, assigned_to=None, id=None, name=None, state=None): + super(TestCaseReference, self).__init__() + self.assigned_to = assigned_to + self.id = id + self.name = name + self.state = state + + +class TestCaseResultsData(Model): + """ + This data model is used in TestCaseResultsDataProvider and populates the data required for initial page load + + :param context_point: Point information from where the execution history was viewed. Used to set initial filters. + :type context_point: :class:`TestPointDetailedReference ` + :param results: Use to store the results displayed in the table + :type results: list of :class:`TestCaseAssociatedResult ` + :param test_case_name: Test Case Name to be displayed in the table header + :type test_case_name: str + """ + + _attribute_map = { + 'context_point': {'key': 'contextPoint', 'type': 'TestPointDetailedReference'}, + 'results': {'key': 'results', 'type': '[TestCaseAssociatedResult]'}, + 'test_case_name': {'key': 'testCaseName', 'type': 'str'} + } + + def __init__(self, context_point=None, results=None, test_case_name=None): + super(TestCaseResultsData, self).__init__() + self.context_point = context_point + self.results = results + self.test_case_name = test_case_name + + +class TestConfigurationCreateUpdateParameters(Model): + """ + Test Configuration Create or Update Parameters + + :param description: Description of the configuration + :type description: str + :param is_default: Is the configuration a default for the test plans + :type is_default: bool + :param name: Name of the configuration + :type name: str + :param state: State of the configuration + :type state: object + :param values: Dictionary of Test Variable, Selected Value + :type values: list of :class:`NameValuePair ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'object'}, + 'values': {'key': 'values', 'type': '[NameValuePair]'} + } + + def __init__(self, description=None, is_default=None, name=None, state=None, values=None): + super(TestConfigurationCreateUpdateParameters, self).__init__() + self.description = description + self.is_default = is_default + self.name = name + self.state = state + self.values = values + + +class TestConfigurationReference(Model): + """ + Test Configuration Reference + + :param id: Id of the configuration + :type id: int + :param name: Name of the configuration + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestConfigurationReference, self).__init__() + self.id = id + self.name = name + + +class TestEntityCount(Model): + """ + Test Entity Count Used to store test cases count (define tab) and test point count (execute tab) Used to store test cases count (define tab) and test point count (execute tab) + + :param count: Test Entity Count + :type count: int + :param test_plan_id: Test Plan under which the Test Entities are + :type test_plan_id: int + :param test_suite_id: Test Suite under which the Test Entities are + :type test_suite_id: int + :param total_count: Total test entities in the suite without the applied filters + :type total_count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'test_plan_id': {'key': 'testPlanId', 'type': 'int'}, + 'test_suite_id': {'key': 'testSuiteId', 'type': 'int'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, count=None, test_plan_id=None, test_suite_id=None, total_count=None): + super(TestEntityCount, self).__init__() + self.count = count + self.test_plan_id = test_plan_id + self.test_suite_id = test_suite_id + self.total_count = total_count + + +class TestEnvironment(Model): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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 TestOutcomeSettings(Model): + """ + Test outcome settings + + :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 TestPlanCreateParams(Model): + """ + The test plan create parameters. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 ` + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None): + super(TestPlanCreateParams, self).__init__() + self.area_path = area_path + self.automated_test_environment = automated_test_environment + self.automated_test_settings = automated_test_settings + self.build_definition = build_definition + self.build_id = build_id + 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.test_outcome_settings = test_outcome_settings + + +class TestPlanReference(Model): + """ + The test plan reference resource. + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestPlanReference, self).__init__() + self.id = id + self.name = name + + +class TestPlansHubRefreshData(Model): + """ + This data model is used in TestPlansHubRefreshDataProvider and populates the data required for initial page load + + :param define_column_option_fields: + :type define_column_option_fields: list of str + :param define_tab_custom_column_field_map: + :type define_tab_custom_column_field_map: dict + :param error_message: + :type error_message: str + :param execute_column_option_fields: + :type execute_column_option_fields: list of str + :param execute_tab_custom_column_field_map: + :type execute_tab_custom_column_field_map: dict + :param is_advanced_extension_enabled: + :type is_advanced_extension_enabled: bool + :param selected_pivot_id: + :type selected_pivot_id: str + :param selected_suite_id: + :type selected_suite_id: int + :param test_case_page_size: + :type test_case_page_size: int + :param test_cases: + :type test_cases: list of :class:`TestCase ` + :param test_cases_continuation_token: + :type test_cases_continuation_token: str + :param test_plan: + :type test_plan: :class:`TestPlanDetailedReference ` + :param test_point_page_size: + :type test_point_page_size: int + :param test_points: + :type test_points: list of :class:`TestPoint ` + :param test_points_continuation_token: + :type test_points_continuation_token: str + :param test_suites: + :type test_suites: list of :class:`TestSuite ` + :param test_suites_continuation_token: + :type test_suites_continuation_token: str + """ + + _attribute_map = { + 'define_column_option_fields': {'key': 'defineColumnOptionFields', 'type': '[str]'}, + 'define_tab_custom_column_field_map': {'key': 'defineTabCustomColumnFieldMap', 'type': '{str}'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'execute_column_option_fields': {'key': 'executeColumnOptionFields', 'type': '[str]'}, + 'execute_tab_custom_column_field_map': {'key': 'executeTabCustomColumnFieldMap', 'type': '{str}'}, + 'is_advanced_extension_enabled': {'key': 'isAdvancedExtensionEnabled', 'type': 'bool'}, + 'selected_pivot_id': {'key': 'selectedPivotId', 'type': 'str'}, + 'selected_suite_id': {'key': 'selectedSuiteId', 'type': 'int'}, + 'test_case_page_size': {'key': 'testCasePageSize', 'type': 'int'}, + 'test_cases': {'key': 'testCases', 'type': '[TestCase]'}, + 'test_cases_continuation_token': {'key': 'testCasesContinuationToken', 'type': 'str'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanDetailedReference'}, + 'test_point_page_size': {'key': 'testPointPageSize', 'type': 'int'}, + 'test_points': {'key': 'testPoints', 'type': '[TestPoint]'}, + 'test_points_continuation_token': {'key': 'testPointsContinuationToken', 'type': 'str'}, + 'test_suites': {'key': 'testSuites', 'type': '[TestSuite]'}, + 'test_suites_continuation_token': {'key': 'testSuitesContinuationToken', 'type': 'str'} + } + + def __init__(self, define_column_option_fields=None, define_tab_custom_column_field_map=None, error_message=None, execute_column_option_fields=None, execute_tab_custom_column_field_map=None, is_advanced_extension_enabled=None, selected_pivot_id=None, selected_suite_id=None, test_case_page_size=None, test_cases=None, test_cases_continuation_token=None, test_plan=None, test_point_page_size=None, test_points=None, test_points_continuation_token=None, test_suites=None, test_suites_continuation_token=None): + super(TestPlansHubRefreshData, self).__init__() + self.define_column_option_fields = define_column_option_fields + self.define_tab_custom_column_field_map = define_tab_custom_column_field_map + self.error_message = error_message + self.execute_column_option_fields = execute_column_option_fields + self.execute_tab_custom_column_field_map = execute_tab_custom_column_field_map + self.is_advanced_extension_enabled = is_advanced_extension_enabled + self.selected_pivot_id = selected_pivot_id + self.selected_suite_id = selected_suite_id + self.test_case_page_size = test_case_page_size + self.test_cases = test_cases + self.test_cases_continuation_token = test_cases_continuation_token + self.test_plan = test_plan + self.test_point_page_size = test_point_page_size + self.test_points = test_points + self.test_points_continuation_token = test_points_continuation_token + self.test_suites = test_suites + self.test_suites_continuation_token = test_suites_continuation_token + + +class TestPlansLibraryWorkItemFilter(Model): + """ + Container to hold information about a filter being applied in Test Plans Library. + + :param field_name: Work item field name on which the items are to be filtered. + :type field_name: str + :param field_values: Work item field values corresponding to the field name. + :type field_values: list of str + :param filter_mode: Mode of the filter. + :type filter_mode: object + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'field_values': {'key': 'fieldValues', 'type': '[str]'}, + 'filter_mode': {'key': 'filterMode', 'type': 'object'} + } + + def __init__(self, field_name=None, field_values=None, filter_mode=None): + super(TestPlansLibraryWorkItemFilter, self).__init__() + self.field_name = field_name + self.field_values = field_values + self.filter_mode = filter_mode + + +class TestPlanUpdateParams(TestPlanCreateParams): + """ + The test plan update parameters. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 revision: Revision of the test plan. + :type revision: int + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, revision=None): + super(TestPlanUpdateParams, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings) + self.revision = revision + + +class TestPoint(Model): + """ + Test Point Class + + :param comment: Comment associated to the Test Point + :type comment: str + :param configuration: Configuration associated with the Test Point + :type configuration: :class:`TestConfigurationReference ` + :param id: Id of the Test Point + :type id: int + :param is_active: Variable to decide whether the test case is Active or not + :type is_active: bool + :param is_automated: Is the Test Point for Automated Test Case or Manual + :type is_automated: bool + :param last_reset_to_active: Last Reset to Active Time Stamp for the Test Point + :type last_reset_to_active: datetime + :param last_updated_by: Last Updated details for the Test Point + :type last_updated_by: :class:`IdentityRef ` + :param last_updated_date: Last Update Time Stamp for the Test Point + :type last_updated_date: datetime + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param project: Project under which the Test Point is + :type project: :class:`TeamProjectReference ` + :param results: Results associated to the Test Point + :type results: :class:`TestPointResults ` + :param test_case_reference: Test Case Reference + :type test_case_reference: :class:`TestCaseReference ` + :param tester: Tester associated with the Test Point + :type tester: :class:`IdentityRef ` + :param test_plan: Test Plan under which the Test Point is + :type test_plan: :class:`TestPlanReference ` + :param test_suite: Test Suite under which the Test Point is + :type test_suite: :class:`TestSuiteReference ` + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, + 'last_reset_to_active': {'key': 'lastResetToActive', 'type': 'iso-8601'}, + 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, + 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'results': {'key': 'results', 'type': 'TestPointResults'}, + 'test_case_reference': {'key': 'testCaseReference', 'type': 'TestCaseReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanReference'}, + 'test_suite': {'key': 'testSuite', 'type': 'TestSuiteReference'} + } + + def __init__(self, comment=None, configuration=None, id=None, is_active=None, is_automated=None, last_reset_to_active=None, last_updated_by=None, last_updated_date=None, links=None, project=None, results=None, test_case_reference=None, tester=None, test_plan=None, test_suite=None): + super(TestPoint, self).__init__() + self.comment = comment + self.configuration = configuration + self.id = id + self.is_active = is_active + self.is_automated = is_automated + self.last_reset_to_active = last_reset_to_active + self.last_updated_by = last_updated_by + self.last_updated_date = last_updated_date + self.links = links + self.project = project + self.results = results + self.test_case_reference = test_case_reference + self.tester = tester + self.test_plan = test_plan + self.test_suite = test_suite + + +class TestPointDetailedReference(Model): + """ + :param configuration: + :type configuration: :class:`TestConfigurationReference ` + :param plan: + :type plan: :class:`TestPlanReference ` + :param point_id: + :type point_id: int + :param suite: + :type suite: :class:`TestSuiteReference ` + :param tester: + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'point_id': {'key': 'pointId', 'type': 'int'}, + 'suite': {'key': 'suite', 'type': 'TestSuiteReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, configuration=None, plan=None, point_id=None, suite=None, tester=None): + super(TestPointDetailedReference, self).__init__() + self.configuration = configuration + self.plan = plan + self.point_id = point_id + self.suite = suite + self.tester = tester + + +class TestPointResults(Model): + """ + Test Point Results + + :param failure_type: Failure Type for the Test Point + :type failure_type: object + :param last_resolution_state: Last Resolution State Id for the Test Point + :type last_resolution_state: object + :param last_result_details: Last Result Details for the Test Point + :type last_result_details: :class:`LastResultDetails ` + :param last_result_id: Last Result Id + :type last_result_id: int + :param last_result_state: Last Result State of the Test Point + :type last_result_state: object + :param last_run_build_number: Last RUn Build Number for the Test Point + :type last_run_build_number: str + :param last_test_run_id: Last Test Run Id for the Test Point + :type last_test_run_id: int + :param outcome: Outcome of the Test Point + :type outcome: object + :param state: State of the Test Point + :type state: object + """ + + _attribute_map = { + 'failure_type': {'key': 'failureType', 'type': 'object'}, + 'last_resolution_state': {'key': 'lastResolutionState', 'type': 'object'}, + 'last_result_details': {'key': 'lastResultDetails', 'type': 'LastResultDetails'}, + 'last_result_id': {'key': 'lastResultId', 'type': 'int'}, + 'last_result_state': {'key': 'lastResultState', 'type': 'object'}, + 'last_run_build_number': {'key': 'lastRunBuildNumber', 'type': 'str'}, + 'last_test_run_id': {'key': 'lastTestRunId', 'type': 'int'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, failure_type=None, last_resolution_state=None, last_result_details=None, last_result_id=None, last_result_state=None, last_run_build_number=None, last_test_run_id=None, outcome=None, state=None): + super(TestPointResults, self).__init__() + self.failure_type = failure_type + self.last_resolution_state = last_resolution_state + self.last_result_details = last_result_details + self.last_result_id = last_result_id + self.last_result_state = last_result_state + self.last_run_build_number = last_run_build_number + self.last_test_run_id = last_test_run_id + self.outcome = outcome + self.state = state + + +class TestPointUpdateParams(Model): + """ + Test Point Update Parameters + + :param id: Id of Test Point to be updated + :type id: int + :param is_active: Reset the Test Point to Active + :type is_active: bool + :param results: Results of the test point + :type results: :class:`Results ` + :param tester: Tester of the Test Point + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'results': {'key': 'results', 'type': 'Results'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, id=None, is_active=None, results=None, tester=None): + super(TestPointUpdateParams, self).__init__() + self.id = id + self.is_active = is_active + self.results = results + self.tester = tester + + +class TestSettings(Model): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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 TestSuiteCreateUpdateCommonParams(Model): + """ + Test Suite Create/Update Common Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :param query_string: Test suite query string, for dynamic suites. + :type query_string: str + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None): + super(TestSuiteCreateUpdateCommonParams, self).__init__() + self.default_configurations = default_configurations + self.default_testers = default_testers + self.inherit_default_configurations = inherit_default_configurations + self.name = name + self.parent_suite = parent_suite + self.query_string = query_string + + +class TestSuiteReference(Model): + """ + The test suite reference resource. + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestSuiteReference, self).__init__() + self.id = id + self.name = name + + +class TestSuiteReferenceWithProject(TestSuiteReference): + """ + Test Suite Reference with Project + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + :param project: Reference of destination Project + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, id=None, name=None, project=None): + super(TestSuiteReferenceWithProject, self).__init__(id=id, name=name) + self.project = project + + +class TestSuiteUpdateParams(TestSuiteCreateUpdateCommonParams): + """ + Test Suite Update Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :param query_string: Test suite query string, for dynamic suites. + :type query_string: str + :param revision: Test suite revision. + :type revision: int + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, revision=None): + super(TestSuiteUpdateParams, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string) + self.revision = revision + + +class TestVariableCreateUpdateParameters(Model): + """ + Test Variable Create or Update Parameters + + :param description: Description of the test variable + :type description: str + :param name: Name of the test variable + :type name: str + :param values: List of allowed values + :type values: list of str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'} + } + + def __init__(self, description=None, name=None, values=None): + super(TestVariableCreateUpdateParameters, self).__init__() + self.description = description + self.name = name + self.values = values + + +class WorkItem(Model): + """ + Work Item + + :param id: Id of the Work Item + :type id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, id=None): + super(WorkItem, self).__init__() + self.id = id + + +class WorkItemDetails(Model): + """ + Work Item Class + + :param id: Work Item Id + :type id: int + :param name: Work Item Name + :type name: str + :param work_item_fields: Work Item Fields + :type work_item_fields: list of object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'work_item_fields': {'key': 'workItemFields', 'type': '[object]'} + } + + def __init__(self, id=None, name=None, work_item_fields=None): + super(WorkItemDetails, self).__init__() + self.id = id + self.name = name + self.work_item_fields = work_item_fields + + +class DestinationTestPlanCloneParams(TestPlanCreateParams): + """ + Destination Test Plan create parameters + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 project: Destination Project Name + :type project: str + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'project': {'key': 'project', 'type': 'str'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, project=None): + super(DestinationTestPlanCloneParams, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings) + self.project = project + + +class SourceTestplanResponse(TestPlanReference): + """ + Source Test Plan Response for Test Plan clone operation + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + :param project: project reference + :type project: :class:`TeamProjectReference ` + :param suite_ids: Id of suites to be cloned inside source Test Plan + :type suite_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'suite_ids': {'key': 'suiteIds', 'type': '[int]'} + } + + def __init__(self, id=None, name=None, project=None, suite_ids=None): + super(SourceTestplanResponse, self).__init__(id=id, name=name) + self.project = project + self.suite_ids = suite_ids + + +class SourceTestSuiteResponse(TestSuiteReference): + """ + Source Test Suite Response for Test Case clone operation + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + :param project: project reference + :type project: :class:`TeamProjectReference ` + :param test_case_ids: Id of suites to be cloned inside source Test Plan + :type test_case_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'test_case_ids': {'key': 'testCaseIds', 'type': '[int]'} + } + + def __init__(self, id=None, name=None, project=None, test_case_ids=None): + super(SourceTestSuiteResponse, self).__init__(id=id, name=name) + self.project = project + self.test_case_ids = test_case_ids + + +class SuiteEntry(SuiteEntryUpdateParams): + """ + A suite entry defines properties for a test suite. + + :param id: Id of the suite entry in the test suite: either a test case id or child suite id. + :type id: int + :param sequence_number: Sequence number for the suite entry object in the test suite. + :type sequence_number: int + :param suite_entry_type: Defines whether the entry is of type test case or suite. + :type suite_entry_type: object + :param suite_id: Id for the test suite. + :type suite_id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'suite_entry_type': {'key': 'suiteEntryType', 'type': 'object'}, + 'suite_id': {'key': 'suiteId', 'type': 'int'} + } + + def __init__(self, id=None, sequence_number=None, suite_entry_type=None, suite_id=None): + super(SuiteEntry, self).__init__(id=id, sequence_number=sequence_number, suite_entry_type=suite_entry_type) + self.suite_id = suite_id + + +class TestConfiguration(TestConfigurationCreateUpdateParameters): + """ + Test configuration + + :param description: Description of the configuration + :type description: str + :param is_default: Is the configuration a default for the test plans + :type is_default: bool + :param name: Name of the configuration + :type name: str + :param state: State of the configuration + :type state: object + :param values: Dictionary of Test Variable, Selected Value + :type values: list of :class:`NameValuePair ` + :param id: Id of the configuration + :type id: int + :param project: Id of the test configuration variable + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'object'}, + 'values': {'key': 'values', 'type': '[NameValuePair]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, description=None, is_default=None, name=None, state=None, values=None, id=None, project=None): + super(TestConfiguration, self).__init__(description=description, is_default=is_default, name=name, state=state, values=values) + self.id = id + self.project = project + + +class TestPlan(TestPlanUpdateParams): + """ + The test plan resource. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 revision: Revision of the test plan. + :type revision: int + :param _links: Relevant links + :type _links: :class:`ReferenceLinks ` + :param id: ID of the test plan. + :type id: int + :param previous_build_id: Previous build Id associated with the test plan + :type previous_build_id: int + :param project: Project which contains the test plan. + :type project: :class:`TeamProjectReference ` + :param root_suite: Root test suite of the test plan. + :type root_suite: :class:`TestSuiteReference ` + :param updated_by: Identity Reference for the last update of the test plan + :type updated_by: :class:`IdentityRef ` + :param updated_date: Updated date of the test plan + :type updated_date: datetime + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'revision': {'key': 'revision', 'type': 'int'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'id': {'key': 'id', 'type': 'int'}, + 'previous_build_id': {'key': 'previousBuildId', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'root_suite': {'key': 'rootSuite', 'type': 'TestSuiteReference'}, + 'updated_by': {'key': 'updatedBy', 'type': 'IdentityRef'}, + 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, revision=None, _links=None, id=None, previous_build_id=None, project=None, root_suite=None, updated_by=None, updated_date=None): + super(TestPlan, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings, revision=revision) + self._links = _links + self.id = id + self.previous_build_id = previous_build_id + self.project = project + self.root_suite = root_suite + self.updated_by = updated_by + self.updated_date = updated_date + + +class TestPlanDetailedReference(TestPlanReference): + """ + The test plan detailed reference resource. Contains additional workitem realted information + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + :param area_path: Area of the test plan. + :type area_path: str + :param end_date: End date for the test plan. + :type end_date: datetime + :param iteration: Iteration path of the test plan. + :type iteration: str + :param root_suite_id: Root Suite Id + :type root_suite_id: int + :param start_date: Start date for the test plan. + :type start_date: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'root_suite_id': {'key': 'rootSuiteId', 'type': 'int'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'} + } + + def __init__(self, id=None, name=None, area_path=None, end_date=None, iteration=None, root_suite_id=None, start_date=None): + super(TestPlanDetailedReference, self).__init__(id=id, name=name) + self.area_path = area_path + self.end_date = end_date + self.iteration = iteration + self.root_suite_id = root_suite_id + self.start_date = start_date + + +class TestSuiteCreateParams(TestSuiteCreateUpdateCommonParams): + """ + Test suite Create Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :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 suite_type: Test suite type. + :type suite_type: object + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'requirement_id': {'key': 'requirementId', 'type': 'int'}, + 'suite_type': {'key': 'suiteType', 'type': 'object'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, requirement_id=None, suite_type=None): + super(TestSuiteCreateParams, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string) + self.requirement_id = requirement_id + self.suite_type = suite_type + + +class TestVariable(TestVariableCreateUpdateParameters): + """ + Test Variable + + :param description: Description of the test variable + :type description: str + :param name: Name of the test variable + :type name: str + :param values: List of allowed values + :type values: list of str + :param id: Id of the test variable + :type id: int + :param project: Id of the test variable + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, description=None, name=None, values=None, id=None, project=None): + super(TestVariable, self).__init__(description=description, name=name, values=values) + self.id = id + self.project = project + + +class TestSuite(TestSuiteCreateParams): + """ + Test suite + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :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 suite_type: Test suite type. + :type suite_type: object + :param _links: Links: self, testPoints, testCases, parent + :type _links: :class:`ReferenceLinks ` + :param has_children: Boolean value dictating if Child test suites are present + :type has_children: bool + :param children: Child test suites of current test suite. + :type children: list of :class:`TestSuite ` + :param id: Id of test suite. + :type id: int + :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 plan: Test plan to which the test suite belongs. + :type plan: :class:`TestPlanReference ` + :param project: Test suite project shallow reference. + :type project: :class:`TeamProjectReference ` + :param revision: Test suite revision. + :type revision: int + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'requirement_id': {'key': 'requirementId', 'type': 'int'}, + 'suite_type': {'key': 'suiteType', 'type': 'object'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[TestSuite]'}, + 'id': {'key': 'id', 'type': 'int'}, + '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'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, requirement_id=None, suite_type=None, _links=None, has_children=None, children=None, id=None, last_error=None, last_populated_date=None, last_updated_by=None, last_updated_date=None, plan=None, project=None, revision=None): + super(TestSuite, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string, requirement_id=requirement_id, suite_type=suite_type) + self._links = _links + self.has_children = has_children + self.children = children + self.id = id + 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.plan = plan + self.project = project + self.revision = revision + + +__all__ = [ + 'BuildDefinitionReference', + 'CloneOperationCommonResponse', + 'CloneOptions', + 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', + 'CloneTestPlanOperationInformation', + 'CloneTestPlanParams', + 'CloneTestSuiteOperationInformation', + 'CloneTestSuiteParams', + 'Configuration', + 'DestinationTestSuiteInfo', + 'GraphSubjectBase', + 'IdentityRef', + 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', + 'NameValuePair', + 'PointAssignment', + 'ReferenceLinks', + 'ReleaseEnvironmentDefinitionReference', + 'Results', + 'SourceTestPlanInfo', + 'SourceTestSuiteInfo', + 'SuiteEntryUpdateParams', + 'SuiteTestCaseCreateUpdateParameters', + 'TeamProjectReference', + 'TestCase', + 'TestCaseAssociatedResult', + 'TestCaseReference', + 'TestCaseResultsData', + 'TestConfigurationCreateUpdateParameters', + 'TestConfigurationReference', + 'TestEntityCount', + 'TestEnvironment', + 'TestOutcomeSettings', + 'TestPlanCreateParams', + 'TestPlanReference', + 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', + 'TestPlanUpdateParams', + 'TestPoint', + 'TestPointDetailedReference', + 'TestPointResults', + 'TestPointUpdateParams', + 'TestSettings', + 'TestSuiteCreateUpdateCommonParams', + 'TestSuiteReference', + 'TestSuiteReferenceWithProject', + 'TestSuiteUpdateParams', + 'TestVariableCreateUpdateParameters', + 'WorkItem', + 'WorkItemDetails', + 'DestinationTestPlanCloneParams', + 'SourceTestplanResponse', + 'SourceTestSuiteResponse', + 'SuiteEntry', + 'TestConfiguration', + 'TestPlan', + 'TestPlanDetailedReference', + 'TestSuiteCreateParams', + 'TestVariable', + 'TestSuite', +] diff --git a/azure-devops/azure/devops/v7_0/test_plan/test_plan_client.py b/azure-devops/azure/devops/v7_0/test_plan/test_plan_client.py new file mode 100644 index 00000000..a5a059c1 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_plan/test_plan_client.py @@ -0,0 +1,910 @@ +# -------------------------------------------------------------------------------------------- +# 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 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 create_test_configuration(self, test_configuration_create_update_parameters, project): + """CreateTestConfiguration. + Create a test configuration. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :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_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestConfiguration', response) + + def delete_test_confguration(self, project, test_configuartion_id): + """DeleteTestConfguration. + Delete a test configuration by its ID. + :param str project: Project ID or project name + :param int test_configuartion_id: ID of the test configuration to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + self._send(http_method='DELETE', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_test_configuration_by_id(self, project, test_configuration_id): + """GetTestConfigurationById. + 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='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values) + return self._deserialize('TestConfiguration', response) + + def get_test_configurations(self, project, continuation_token=None): + """GetTestConfigurations. + Get a list of test configurations. + :param str project: Project ID or project name + :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. + :rtype: :class:`<[TestConfiguration]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestConfiguration]', self._unwrap_collection(response)) + + def update_test_configuration(self, test_configuration_create_update_parameters, project, test_configuartion_id): + """UpdateTestConfiguration. + Update a test configuration by its ID. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :param str project: Project ID or project name + :param int test_configuartion_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') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + content = self._serialize.body(test_configuration_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestConfiguration', response) + + def create_test_plan(self, test_plan_create_params, project): + """CreateTestPlan. + Create a test plan. + :param :class:` ` test_plan_create_params: A testPlanCreateParams object.TestPlanCreateParams + :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_create_params, 'TestPlanCreateParams') + response = self._send(http_method='POST', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + + def get_test_plan_by_id(self, project, plan_id): + """GetTestPlanById. + Get a test plan by Id. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan 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') + response = self._send(http_method='GET', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + return self._deserialize('TestPlan', response) + + def get_test_plans(self, project, owner=None, continuation_token=None, include_plan_details=None, filter_active_plans=None): + """GetTestPlans. + 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 str continuation_token: If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. + :param bool include_plan_details: Get all properties of the test plan + :param bool filter_active_plans: Get just the active plans + :rtype: :class:`<[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 continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + + def update_test_plan(self, test_plan_update_params, project, plan_id): + """UpdateTestPlan. + Update a test plan. + :param :class:` ` test_plan_update_params: A testPlanUpdateParams object.TestPlanUpdateParams + :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(test_plan_update_params, 'TestPlanUpdateParams') + response = self._send(http_method='PATCH', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def get_suite_entries(self, project, suite_id, suite_entry_type=None): + """GetSuiteEntries. + 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. + :param str suite_entry_type: + :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') + query_parameters = {} + if suite_entry_type is not None: + query_parameters['suiteEntryType'] = self._serialize.query('suite_entry_type', suite_entry_type, 'str') + response = self._send(http_method='GET', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def reorder_suite_entries(self, suite_entries, project, suite_id): + """ReorderSuiteEntries. + Reorder test suite entries in the test suite. + :param [SuiteEntryUpdateParams] suite_entries: List of SuiteEntry 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, '[SuiteEntryUpdateParams]') + response = self._send(http_method='PATCH', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def create_test_suite(self, test_suite_create_params, project, plan_id): + """CreateTestSuite. + Create test suite. + :param :class:` ` test_suite_create_params: Parameters for suite creation + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :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(test_suite_create_params, 'TestSuiteCreateParams') + response = self._send(http_method='POST', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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 str 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, 'str') + response = self._send(http_method='GET', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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, continuation_token=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 str expand: Include the children suites and testers details. + :param str continuation_token: If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + :param bool as_tree_view: If the suites returned should be in a tree structure. + :rtype: :class:`<[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, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def update_test_suite(self, test_suite_update_params, project, plan_id, suite_id): + """UpdateTestSuite. + Update test suite. + :param :class:` ` test_suite_update_params: Parameters for suite updation + :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 parent suite. + :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(test_suite_update_params, 'TestSuiteUpdateParams') + response = self._send(http_method='PATCH', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.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='a4080e84-f17b-4fad-84f1-7960b6525bf2', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def add_test_cases_to_suite(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """AddTestCasesToSuite. + Add test cases to a suite with specified configurations + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be added. + :param int suite_id: ID of the test suite to which test cases are to be added. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='POST', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case(self, project, plan_id, suite_id, test_case_id, wit_fields=None, return_identity_ref=None): + """GetTestCase. + Get a particular Test Case from a Suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_case_id: Test Case Id to be fetched. + :param str wit_fields: Get the list of witFields. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :rtype: [TestCase] + """ + 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_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'str') + query_parameters = {} + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case_list(self, project, plan_id, suite_id, test_ids=None, configuration_ids=None, wit_fields=None, continuation_token=None, return_identity_ref=None, expand=None, exclude_flags=None, is_recursive=None): + """GetTestCaseList. + Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_ids: Test Case Ids to be fetched. + :param str configuration_ids: Fetch Test Cases which contains all the configuration Ids specified. + :param str wit_fields: Get the list of witFields. + :param str continuation_token: If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :param bool expand: If set to false, will get a smaller payload containing only basic details about the suite test case object + :param str exclude_flags: Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2). + :param bool is_recursive: + :rtype: :class:`<[TestCase]> ` + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + if configuration_ids is not None: + query_parameters['configurationIds'] = self._serialize.query('configuration_ids', configuration_ids, 'str') + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'bool') + if exclude_flags is not None: + query_parameters['excludeFlags'] = self._serialize.query('exclude_flags', exclude_flags, 'str') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def remove_test_cases_from_suite(self, project, plan_id, suite_id, test_case_ids): + """RemoveTestCasesFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_case_ids: Test Case Ids to be removed. + """ + 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 test_case_ids is not None: + query_parameters['testCaseIds'] = self._serialize.query('test_case_ids', test_case_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def remove_test_cases_list_from_suite(self, project, plan_id, suite_id, test_ids): + """RemoveTestCasesListFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_ids: Comma separated string of Test Case Ids to be removed. + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def update_suite_test_cases(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """UpdateSuiteTestCases. + Update the configurations for test cases + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: A SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be updated. + :param int suite_id: ID of the test suite to which test cases are to be updated. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='PATCH', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def clone_test_case(self, clone_request_body, project): + """CloneTestCase. + :param :class:` ` clone_request_body: + :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(clone_request_body, 'CloneTestCaseParams') + response = self._send(http_method='POST', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def get_test_case_clone_information(self, project, clone_operation_id): + """GetTestCaseCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + Delete a test case. + :param str project: Project ID or project name + :param int test_case_id: Id of test case to be deleted. + """ + 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='29006fb5-816b-4ff7-a329-599943569229', + version='7.0', + route_values=route_values) + + def clone_test_plan(self, clone_request_body, project, deep_clone=None): + """CloneTestPlan. + Clone test plan + :param :class:` ` clone_request_body: Plan Clone Request Body detail TestPlanCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestPlanParams') + response = self._send(http_method='POST', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_clone_information(self, project, clone_operation_id): + """GetCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_points(self, project, plan_id, suite_id, point_id, return_identity_ref=None, include_point_details=None): + """GetPoints. + Get a particular Test Point from a suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param str point_id: ID of test point to be fetched. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :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 point_id is not None: + query_parameters['pointId'] = self._serialize.query('point_id', point_id, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def get_points_list(self, project, plan_id, suite_id, test_point_ids=None, test_case_id=None, continuation_token=None, return_identity_ref=None, include_point_details=None, is_recursive=None): + """GetPointsList. + Get all the points inside a suite based on some filters + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested + :param str test_point_ids: ID of test points to fetch. + :param str test_case_id: Get Test Points for specific test case Ids. + :param str continuation_token: If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool is_recursive: If set to true, will also fetch test points belonging to child suites recursively. + :rtype: :class:`<[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 test_point_ids is not None: + query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') + if test_case_id is not None: + query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def update_test_points(self, test_point_update_params, project, plan_id, suite_id, include_point_details=None, return_identity_ref=None): + """UpdateTestPoints. + Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point + :param [TestPointUpdateParams] test_point_update_params: A TestPointUpdateParams Object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :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 include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + content = self._serialize.body(test_point_update_params, '[TestPointUpdateParams]') + response = self._send(http_method='PATCH', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def clone_test_suite(self, clone_request_body, project, deep_clone=None): + """CloneTestSuite. + Clone test suite + :param :class:` ` clone_request_body: Suite Clone Request Body detail TestSuiteCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestSuiteParams') + response = self._send(http_method='POST', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def get_suite_clone_information(self, project, clone_operation_id): + """GetSuiteCloneInformation. + 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 + :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') + response = self._send(http_method='GET', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def create_test_variable(self, test_variable_create_update_parameters, project): + """CreateTestVariable. + Create a test variable. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + + def delete_test_variable(self, project, test_variable_id): + """DeleteTestVariable. + 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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + + def get_test_variable_by_id(self, project, test_variable_id): + """GetTestVariableById. + 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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + return self._deserialize('TestVariable', response) + + def get_test_variables(self, project, continuation_token=None): + """GetTestVariables. + Get a list of test variables. + :param str project: Project ID or project name + :param str continuation_token: If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables. + :rtype: :class:`<[TestVariable]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestVariable]', self._unwrap_collection(response)) + + def update_test_variable(self, test_variable_create_update_parameters, project, test_variable_id): + """UpdateTestVariable. + Update a test variable by its ID. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + diff --git a/azure-devops/azure/devops/v7_0/test_results/__init__.py b/azure-devops/azure/devops/v7_0/test_results/__init__.py new file mode 100644 index 00000000..d1b39657 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_results/__init__.py @@ -0,0 +1,113 @@ +# -------------------------------------------------------------------------------------------- +# 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_results_client import TestResultsClient + +__all__ = [ + 'AggregatedDataForResultTrend', + 'AggregatedResultDetailsByOutcome', + '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', + 'NewTestResultLoggingSettings', + 'PhaseReference', + 'PipelineReference', + 'PipelineTestMetrics', + 'QueryModel', + 'ReferenceLinks', + 'ReleaseReference', + 'ResultsAnalysis', + 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', + 'RunCreateModel', + 'RunFilter', + 'RunStatistic', + 'RunSummary', + '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', + 'TestResultFailuresAnalysis', + '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' +] diff --git a/azure-devops/azure/devops/v7_0/test_results/models.py b/azure-devops/azure/devops/v7_0/test_results/models.py new file mode 100644 index 00000000..9ededeb5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_results/models.py @@ -0,0 +1,3625 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 AggregatedResultDetailsByOutcome(Model): + """ + Result deatils for a particular test result outcome. + + :param count: Number of results for current outcome. + :type count: int + :param duration: Time taken by results. + :type duration: object + :param outcome: Test result outcome + :type outcome: object + :param rerun_result_count: Number of results on rerun + :type rerun_result_count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'duration': {'key': 'duration', 'type': 'object'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'rerun_result_count': {'key': 'rerunResultCount', 'type': 'int'} + } + + def __init__(self, count=None, duration=None, outcome=None, rerun_result_count=None): + super(AggregatedResultDetailsByOutcome, self).__init__() + self.count = count + self.duration = duration + self.outcome = outcome + self.rerun_result_count = rerun_result_count + + +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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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 BuildConfiguration(Model): + """ + BuildConfiguration Details. + + :param branch_name: Branch name for which build is generated. + :type branch_name: str + :param build_definition_id: BuildDefinitionId for build. + :type build_definition_id: int + :param build_system: Build system. + :type build_system: str + :param creation_date: Build Creation Date. + :type creation_date: datetime + :param flavor: Build flavor (eg Build/Release). + :type flavor: str + :param id: BuildConfiguration Id. + :type id: int + :param number: Build Number. + :type number: str + :param platform: BuildConfiguration Platform. + :type platform: str + :param project: Project associated with this BuildConfiguration. + :type project: :class:`ShallowReference ` + :param repository_guid: Repository Guid for the Build. + :type repository_guid: str + :param repository_id: Repository Id. + :type repository_id: int + :param repository_type: Repository Type (eg. TFSGit). + :type repository_type: str + :param source_version: Source Version(/first commit) for the build was triggered. + :type source_version: str + :param target_branch_name: Target BranchName. + :type target_branch_name: str + :param uri: Build 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'}, + 'target_branch_name': {'key': 'targetBranchName', '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, target_branch_name=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.target_branch_name = target_branch_name + self.uri = uri + + +class BuildCoverage(Model): + """ + Build Coverage Detail + + :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): + """ + Reference to a build. + + :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 CodeCoverageData(Model): + """ + Represents the build configuration (platform, flavor) and coverage data for the build + + :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): + """ + Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) + + :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): + """ + Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build + + :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 ` + :param status: Uri of build against which difference in coverage is computed + :type status: object + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'ShallowReference'}, + 'coverage_data': {'key': 'coverageData', 'type': '[CodeCoverageData]'}, + 'delta_build': {'key': 'deltaBuild', 'type': 'ShallowReference'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, build=None, coverage_data=None, delta_build=None, status=None): + super(CodeCoverageSummary, self).__init__() + self.build = build + self.coverage_data = coverage_data + self.delta_build = delta_build + self.status = status + + +class CoverageStatistics(Model): + """ + :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): + """ + A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool) + + :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 DtlEnvironmentDetails(Model): + """ + This is a temporary class to provide the details for the test run environment. + + :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): + """ + Failing since information of a test result. + + :param build: Build reference since failing. + :type build: :class:`BuildReference ` + :param date: Time since failing(UTC). + :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): + """ + :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 FileCoverageRequest(Model): + """ + :param file_path: + :type file_path: str + :param pull_request_base_iteration_id: + :type pull_request_base_iteration_id: int + :param pull_request_id: + :type pull_request_id: int + :param pull_request_iteration_id: + :type pull_request_iteration_id: int + :param repo_id: + :type repo_id: str + """ + + _attribute_map = { + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'pull_request_base_iteration_id': {'key': 'pullRequestBaseIterationId', 'type': 'int'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'}, + 'pull_request_iteration_id': {'key': 'pullRequestIterationId', 'type': 'int'}, + 'repo_id': {'key': 'repoId', 'type': 'str'} + } + + def __init__(self, file_path=None, pull_request_base_iteration_id=None, pull_request_id=None, pull_request_iteration_id=None, repo_id=None): + super(FileCoverageRequest, self).__init__() + self.file_path = file_path + self.pull_request_base_iteration_id = pull_request_base_iteration_id + self.pull_request_id = pull_request_id + self.pull_request_iteration_id = pull_request_iteration_id + self.repo_id = repo_id + + +class FlakyDetection(Model): + """ + :param flaky_detection_pipelines: FlakyDetectionPipelines defines Pipelines for Detection. + :type flaky_detection_pipelines: :class:`FlakyDetectionPipelines ` + :param flaky_detection_type: FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual. + :type flaky_detection_type: object + """ + + _attribute_map = { + 'flaky_detection_pipelines': {'key': 'flakyDetectionPipelines', 'type': 'FlakyDetectionPipelines'}, + 'flaky_detection_type': {'key': 'flakyDetectionType', 'type': 'object'} + } + + def __init__(self, flaky_detection_pipelines=None, flaky_detection_type=None): + super(FlakyDetection, self).__init__() + self.flaky_detection_pipelines = flaky_detection_pipelines + self.flaky_detection_type = flaky_detection_type + + +class FlakyDetectionPipelines(Model): + """ + :param allowed_pipelines: AllowedPipelines - List All Pipelines allowed for detection. + :type allowed_pipelines: list of int + :param is_all_pipelines_allowed: IsAllPipelinesAllowed if users configure all system's pipelines. + :type is_all_pipelines_allowed: bool + """ + + _attribute_map = { + 'allowed_pipelines': {'key': 'allowedPipelines', 'type': '[int]'}, + 'is_all_pipelines_allowed': {'key': 'isAllPipelinesAllowed', 'type': 'bool'} + } + + def __init__(self, allowed_pipelines=None, is_all_pipelines_allowed=None): + super(FlakyDetectionPipelines, self).__init__() + self.allowed_pipelines = allowed_pipelines + self.is_all_pipelines_allowed = is_all_pipelines_allowed + + +class FlakySettings(Model): + """ + :param flaky_detection: FlakyDetection defines types of detection. + :type flaky_detection: :class:`FlakyDetection ` + :param flaky_in_summary_report: FlakyInSummaryReport defines flaky data should show in summary report or not. + :type flaky_in_summary_report: bool + :param is_flaky_bug_created: IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult. + :type is_flaky_bug_created: bool + :param manual_mark_unmark_flaky: ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase. + :type manual_mark_unmark_flaky: bool + """ + + _attribute_map = { + 'flaky_detection': {'key': 'flakyDetection', 'type': 'FlakyDetection'}, + 'flaky_in_summary_report': {'key': 'flakyInSummaryReport', 'type': 'bool'}, + 'is_flaky_bug_created': {'key': 'isFlakyBugCreated', 'type': 'bool'}, + 'manual_mark_unmark_flaky': {'key': 'manualMarkUnmarkFlaky', 'type': 'bool'} + } + + def __init__(self, flaky_detection=None, flaky_in_summary_report=None, is_flaky_bug_created=None, manual_mark_unmark_flaky=None): + super(FlakySettings, self).__init__() + self.flaky_detection = flaky_detection + self.flaky_in_summary_report = flaky_in_summary_report + self.is_flaky_bug_created = is_flaky_bug_created + self.manual_mark_unmark_flaky = manual_mark_unmark_flaky + + +class FunctionCoverage(Model): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param descriptor: + :type descriptor: str + :param display_name: + :type display_name: str + :param url: + :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: + :type _links: :class:`ReferenceLinks ` + :param descriptor: + :type descriptor: str + :param display_name: + :type display_name: str + :param url: + :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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +class ModuleCoverage(Model): + """ + :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 NewTestResultLoggingSettings(Model): + """ + :param log_new_tests: LogNewTests defines whether or not we will record new test cases coming into the system + :type log_new_tests: bool + """ + + _attribute_map = { + 'log_new_tests': {'key': 'logNewTests', 'type': 'bool'} + } + + def __init__(self, log_new_tests=None): + super(NewTestResultLoggingSettings, self).__init__() + self.log_new_tests = log_new_tests + + +class PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +class PipelineTestMetrics(Model): + """ + Test summary of a pipeline instance. + + :param current_context: Reference of Pipeline instance for which test summary is calculated. + :type current_context: :class:`PipelineReference ` + :param results_analysis: This is the return value for metric ResultsAnalysis Results insights which include failure analysis, increase/decrease in results count analysis. + :type results_analysis: :class:`ResultsAnalysis ` + :param result_summary: This is the return value for metric ResultSummary Results summary based on results outcome. + :type result_summary: :class:`ResultSummary ` + :param run_summary: This is the return value for metric RunSummary Run summary. + :type run_summary: :class:`RunSummary ` + :param summary_at_child: Summary at child node. + :type summary_at_child: list of :class:`PipelineTestMetrics ` + """ + + _attribute_map = { + 'current_context': {'key': 'currentContext', 'type': 'PipelineReference'}, + 'results_analysis': {'key': 'resultsAnalysis', 'type': 'ResultsAnalysis'}, + 'result_summary': {'key': 'resultSummary', 'type': 'ResultSummary'}, + 'run_summary': {'key': 'runSummary', 'type': 'RunSummary'}, + 'summary_at_child': {'key': 'summaryAtChild', 'type': '[PipelineTestMetrics]'} + } + + def __init__(self, current_context=None, results_analysis=None, result_summary=None, run_summary=None, summary_at_child=None): + super(PipelineTestMetrics, self).__init__() + self.current_context = current_context + self.results_analysis = results_analysis + self.result_summary = result_summary + self.run_summary = run_summary + self.summary_at_child = summary_at_child + + +class QueryModel(Model): + """ + :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): + """ + :param links: + :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(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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 ResultsAnalysis(Model): + """ + Results insights for runs with state completed and NeedInvestigation. + + :param previous_context: Reference of pipeline instance from which to compare the results. + :type previous_context: :class:`PipelineReference ` + :param results_difference: Increase/Decrease in counts of results for a different outcome with respect to PreviousContext. + :type results_difference: :class:`AggregatedResultsDifference ` + :param test_failures_analysis: Failure analysis of results with respect to PreviousContext + :type test_failures_analysis: :class:`TestResultFailuresAnalysis ` + """ + + _attribute_map = { + 'previous_context': {'key': 'previousContext', 'type': 'PipelineReference'}, + 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, + 'test_failures_analysis': {'key': 'testFailuresAnalysis', 'type': 'TestResultFailuresAnalysis'} + } + + def __init__(self, previous_context=None, results_difference=None, test_failures_analysis=None): + super(ResultsAnalysis, self).__init__() + self.previous_context = previous_context + self.results_difference = results_difference + self.test_failures_analysis = test_failures_analysis + + +class ResultsFilter(Model): + """ + :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 ResultsSummaryByOutcome(Model): + """ + Result summary by the outcome of test results. + + :param aggregated_result_details_by_outcome: Aggregated result details for each test result outcome. + :type aggregated_result_details_by_outcome: dict + :param duration: Time taken by results. + :type duration: object + :param not_reported_test_count: Total number of not reported test results. + :type not_reported_test_count: int + :param total_test_count: Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage). + :type total_test_count: int + """ + + _attribute_map = { + 'aggregated_result_details_by_outcome': {'key': 'aggregatedResultDetailsByOutcome', 'type': '{AggregatedResultDetailsByOutcome}'}, + 'duration': {'key': 'duration', 'type': 'object'}, + 'not_reported_test_count': {'key': 'notReportedTestCount', 'type': 'int'}, + 'total_test_count': {'key': 'totalTestCount', 'type': 'int'} + } + + def __init__(self, aggregated_result_details_by_outcome=None, duration=None, not_reported_test_count=None, total_test_count=None): + super(ResultsSummaryByOutcome, self).__init__() + self.aggregated_result_details_by_outcome = aggregated_result_details_by_outcome + self.duration = duration + self.not_reported_test_count = not_reported_test_count + self.total_test_count = total_test_count + + +class ResultSummary(Model): + """ + Summary of results for a pipeline instance. + + :param result_summary_by_run_state: Result summary of pipeline, group by TestRun state. + :type result_summary_by_run_state: dict + """ + + _attribute_map = { + 'result_summary_by_run_state': {'key': 'resultSummaryByRunState', 'type': '{ResultsSummaryByOutcome}'} + } + + def __init__(self, result_summary_by_run_state=None): + super(ResultSummary, self).__init__() + self.result_summary_by_run_state = result_summary_by_run_state + + +class RunCreateModel(Model): + """ + Test run create details. + + :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: BuildReference of the test run. + :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: Additional properties of test Run. + :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: Filter used for discovering the Run. + :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 pipeline_reference: Reference of the pipeline to which this test run belongs. PipelineReference.PipelineId should be equal to RunCreateModel.Build.Id + :type pipeline_reference: :class:`PipelineReference ` + :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: Reference to release associated with test run. + :type release_reference: :class:`ReleaseReference ` + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param run_timeout: Timespan till the run times out. + :type run_timeout: object + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :type source_workflow: str + :param start_date: Start date time of the run. + :type start_date: str + :param state: The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting + :type state: str + :param tags: Tags to attach with the test run, maximum of 5 tags can be added to run. + :type tags: list of :class:`TestTag ` + :param test_configurations_mapping: TestConfigurationMapping of the test run. + :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 of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun) + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'run_timeout': {'key': 'runTimeout', 'type': 'object'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=None, plan=None, point_ids=None, release_environment_uri=None, release_reference=None, release_uri=None, run_summary=None, run_timeout=None, source_workflow=None, start_date=None, state=None, tags=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.pipeline_reference = pipeline_reference + 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_summary = run_summary + self.run_timeout = run_timeout + self.source_workflow = source_workflow + self.start_date = start_date + self.state = state + self.tags = tags + 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): + """ + This class is used to provide the filters used for discovery + + :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): + """ + Test run statistics per outcome. + + :param count: Test result count fo the given outcome. + :type count: int + :param outcome: Test result outcome + :type outcome: str + :param resolution_state: Test run Resolution State. + :type resolution_state: :class:`TestResolutionState ` + :param result_metadata: ResultMetadata for the given outcome/count. + :type result_metadata: object + :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'}, + 'result_metadata': {'key': 'resultMetadata', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, count=None, outcome=None, resolution_state=None, result_metadata=None, state=None): + super(RunStatistic, self).__init__() + self.count = count + self.outcome = outcome + self.resolution_state = resolution_state + self.result_metadata = result_metadata + self.state = state + + +class RunSummary(Model): + """ + Summary of runs for a pipeline instance. + + :param duration: Total time taken by runs with state completed and NeedInvestigation. + :type duration: object + :param no_config_runs_count: NoConfig runs count. + :type no_config_runs_count: int + :param run_summary_by_outcome: Runs count by outcome for runs with state completed and NeedInvestigation runs. + :type run_summary_by_outcome: dict + :param run_summary_by_state: Runs count by state. + :type run_summary_by_state: dict + :param total_runs_count: Total runs count. + :type total_runs_count: int + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'object'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'run_summary_by_outcome': {'key': 'runSummaryByOutcome', 'type': '{int}'}, + 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{int}'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, duration=None, no_config_runs_count=None, run_summary_by_outcome=None, run_summary_by_state=None, total_runs_count=None): + super(RunSummary, self).__init__() + self.duration = duration + self.no_config_runs_count = no_config_runs_count + self.run_summary_by_outcome = run_summary_by_outcome + self.run_summary_by_state = run_summary_by_state + self.total_runs_count = total_runs_count + + +class RunSummaryModel(Model): + """ + Run summary for each output type of test. + + :param duration: Total time taken in milliseconds. + :type duration: long + :param result_count: Number of results for Outcome TestOutcome + :type result_count: int + :param test_outcome: Summary is based on outcome + :type test_outcome: object + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'long'}, + 'result_count': {'key': 'resultCount', 'type': 'int'}, + 'test_outcome': {'key': 'testOutcome', 'type': 'object'} + } + + def __init__(self, duration=None, result_count=None, test_outcome=None): + super(RunSummaryModel, self).__init__() + self.duration = duration + self.result_count = result_count + self.test_outcome = test_outcome + + +class RunUpdateModel(Model): + """ + :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 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: true to delete inProgess Results , false otherwise. + :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: URI of release environment associated with the run. + :type release_environment_uri: str + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :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: The types of sub states for test run. + :type substate: object + :param tags: Tags to attach with the test run. + :type tags: list of :class:`TestTag ` + :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 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'}, + 'run_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'started_date': {'key': 'startedDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'substate': {'key': 'substate', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, run_summary=None, source_workflow=None, started_date=None, state=None, substate=None, tags=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.run_summary = run_summary + self.source_workflow = source_workflow + self.started_date = started_date + self.state = state + self.substate = substate + self.tags = tags + self.test_environment_id = test_environment_id + self.test_settings = test_settings + + +class ShallowReference(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :param automated_test_name: + :type automated_test_name: str + :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 tags: + :type tags: list of str + :param test_case_title: + :type test_case_title: str + """ + + _attribute_map = { + 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} + } + + def __init__(self, automated_test_name=None, 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, tags=None, test_case_title=None): + super(ShallowTestCaseResult, self).__init__() + self.automated_test_name = automated_test_name + 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.tags = tags + self.test_case_title = test_case_title + + +class SharedStepModel(Model): + """ + Reference to shared step workitem. + + :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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +class TeamProjectReference(Model): + """ + :param abbreviation: + :type abbreviation: str + :param default_team_image_url: + :type default_team_image_url: 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 revision: + :type revision: long + :param state: + :type state: object + :param url: + :type url: str + :param 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 TestAttachment(Model): + """ + :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): + """ + Reference to test attachment. + + :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): + """ + Test attachment request model + + :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): + """ + Represents a test result. + + :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: TypeId of automated test. + :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 with maxSize= 1000 chars. + :type comment: str + :param completed_date: Time when test execution completed(UTC). Completed date should be greater than StartedDate. + :type completed_date: datetime + :param computer_name: Machine name where test executed. + :type computer_name: str + :param configuration: Reference to test configuration. Type ShallowReference. + :type configuration: :class:`ShallowReference ` + :param created_date: Timestamp when test result created(UTC). + :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. If not provided value will be set as CompletedDate - StartedDate + :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. Valid Value= (Known Issue, New Issue, Regression, Unknown, None) + :type failure_type: str + :param id: ID of a test result. + :type id: int + :param iteration_details: Test result details of test iterations used only for Manual Testing. + :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(UTC). + :type last_updated_date: datetime + :param outcome: Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted) + :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: ResetCount. + :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 with maxSize= 1000 chars. + :type stack_trace: str + :param started_date: Time when test execution started(UTC). + :type started_date: datetime + :param state: State of test result. Type TestRunState. + :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 TestResultMetaData + :type test_case_reference_id: int + :param test_case_revision: TestCaseRevision Number. + :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): + """ + Test attachment information in a test iteration. + + :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): + """ + Reference to a test result. + + :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 TestEnvironment(Model): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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): + """ + :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): + """ + :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 TestFlakyIdentifier(Model): + """ + Test Flaky Identifier + + :param branch_name: Branch Name where Flakiness has to be Marked/Unmarked + :type branch_name: str + :param is_flaky: State for Flakiness + :type is_flaky: bool + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'is_flaky': {'key': 'isFlaky', 'type': 'bool'} + } + + def __init__(self, branch_name=None, is_flaky=None): + super(TestFlakyIdentifier, self).__init__() + self.branch_name = branch_name + self.is_flaky = is_flaky + + +class TestHistoryQuery(Model): + """ + Filter to get TestCase result history. + + :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 BuildDefinitionId. 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 test_case_id: Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname + :type test_case_id: int + :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]'}, + 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, + '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, test_case_id=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.test_case_id = test_case_id + self.trend_days = trend_days + + +class TestIterationDetailsModel(Model): + """ + Represents a test iteration result. + + :param action_results: Test step results in an iteration. + :type action_results: list of :class:`TestActionResultModel ` + :param attachments: Reference 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(UTC). + :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(UTC). + :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 TestLog(Model): + """ + Represents Test Log Result object. + + :param log_reference: Test Log Context run, build + :type log_reference: :class:`TestLogReference ` + :param meta_data: Meta data for Log file + :type meta_data: dict + :param modified_on: LastUpdatedDate for Log file + :type modified_on: datetime + :param size: Size in Bytes for Log file + :type size: long + """ + + _attribute_map = { + 'log_reference': {'key': 'logReference', 'type': 'TestLogReference'}, + 'meta_data': {'key': 'metaData', 'type': '{str}'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'size': {'key': 'size', 'type': 'long'} + } + + def __init__(self, log_reference=None, meta_data=None, modified_on=None, size=None): + super(TestLog, self).__init__() + self.log_reference = log_reference + self.meta_data = meta_data + self.modified_on = modified_on + self.size = size + + +class TestLogReference(Model): + """ + Test Log Reference object + + :param build_id: BuildId for test log, if context is build + :type build_id: int + :param file_path: FileName for log file + :type file_path: str + :param release_env_id: ReleaseEnvId for test log, if context is Release + :type release_env_id: int + :param release_id: ReleaseId for test log, if context is Release + :type release_id: int + :param result_id: Resultid for test log, if context is run and log is related to result + :type result_id: int + :param run_id: runid for test log, if context is run + :type run_id: int + :param scope: Test Log Scope + :type scope: object + :param sub_result_id: SubResultid for test log, if context is run and log is related to subresult + :type sub_result_id: int + :param type: Log Type + :type type: object + """ + + _attribute_map = { + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'release_env_id': {'key': 'releaseEnvId', 'type': 'int'}, + 'release_id': {'key': 'releaseId', 'type': 'int'}, + 'result_id': {'key': 'resultId', 'type': 'int'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'sub_result_id': {'key': 'subResultId', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, build_id=None, file_path=None, release_env_id=None, release_id=None, result_id=None, run_id=None, scope=None, sub_result_id=None, type=None): + super(TestLogReference, self).__init__() + self.build_id = build_id + self.file_path = file_path + self.release_env_id = release_env_id + self.release_id = release_id + self.result_id = result_id + self.run_id = run_id + self.scope = scope + self.sub_result_id = sub_result_id + self.type = type + + +class TestLogStoreEndpointDetails(Model): + """ + Represents Test Log store endpoint details. + + :param endpoint_sASUri: Test log store connection Uri. + :type endpoint_sASUri: str + :param endpoint_type: Test log store endpoint type. + :type endpoint_type: object + :param status: Test log store status code + :type status: object + """ + + _attribute_map = { + 'endpoint_sASUri': {'key': 'endpointSASUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'object'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, endpoint_sASUri=None, endpoint_type=None, status=None): + super(TestLogStoreEndpointDetails, self).__init__() + self.endpoint_sASUri = endpoint_sASUri + self.endpoint_type = endpoint_type + self.status = status + + +class TestMessageLogDetails(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :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): + """ + Class representing a reference to an operation. + + :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 TestResolutionState(Model): + """ + Test Resolution State Details. + + :param id: Test Resolution state Id. + :type id: int + :param name: Test Resolution State 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 TestResultDocument(Model): + """ + :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 TestResultFailuresAnalysis(Model): + """ + :param existing_failures: + :type existing_failures: :class:`TestFailureDetails ` + :param fixed_tests: + :type fixed_tests: :class:`TestFailureDetails ` + :param new_failures: + :type new_failures: :class:`TestFailureDetails ` + """ + + _attribute_map = { + 'existing_failures': {'key': 'existingFailures', 'type': 'TestFailureDetails'}, + 'fixed_tests': {'key': 'fixedTests', 'type': 'TestFailureDetails'}, + 'new_failures': {'key': 'newFailures', 'type': 'TestFailureDetails'} + } + + def __init__(self, existing_failures=None, fixed_tests=None, new_failures=None): + super(TestResultFailuresAnalysis, self).__init__() + self.existing_failures = existing_failures + self.fixed_tests = fixed_tests + self.new_failures = new_failures + + +class TestResultHistory(Model): + """ + :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): + """ + :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): + """ + List of test results filtered on the basis of GroupByValue + + :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): + """ + Represents a Meta Data of a test result. + + :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 flaky_identifiers: List of Flaky Identifier for TestCaseReferenceId + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + :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'}, + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'}, + '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, flaky_identifiers=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.flaky_identifiers = flaky_identifiers + self.owner = owner + self.priority = priority + self.test_case_reference_id = test_case_reference_id + self.test_case_title = test_case_title + + +class TestResultMetaDataUpdateInput(Model): + """ + Represents a TestResultMetaData Input + + :param flaky_identifiers: List of Flaky Identifiers + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + """ + + _attribute_map = { + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'} + } + + def __init__(self, flaky_identifiers=None): + super(TestResultMetaDataUpdateInput, self).__init__() + self.flaky_identifiers = flaky_identifiers + + +class TestResultModelBase(Model): + """ + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :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): + """ + Test parameter information in a test iteration. + + :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. Deprecated in hosted environment. + :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): + """ + :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): + """ + :param build: + :type build: :class:`BuildReference ` + :param context_type: + :type context_type: object + :param pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + self.release = release + + +class TestResultsDetails(Model): + """ + :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): + """ + :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 + :param tags: + :type tags: list of str + """ + + _attribute_map = { + 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, + 'results': {'key': 'results', 'type': '[TestCaseResult]'}, + 'results_count_by_outcome': {'key': 'resultsCountByOutcome', 'type': '{AggregatedResultsByOutcome}'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, group_by_value=None, results=None, results_count_by_outcome=None, tags=None): + super(TestResultsDetailsForGroup, self).__init__() + self.group_by_value = group_by_value + self.results = results + self.results_count_by_outcome = results_count_by_outcome + self.tags = tags + + +class TestResultsQuery(Model): + """ + :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 TestResultsSettings(Model): + """ + :param flaky_settings: IsRequired and EmitDefaultValue are passed as false as if users doesn't pass anything, should not come for serialisation and deserialisation. + :type flaky_settings: :class:`FlakySettings ` + :param new_test_result_logging_settings: + :type new_test_result_logging_settings: :class:`NewTestResultLoggingSettings ` + """ + + _attribute_map = { + 'flaky_settings': {'key': 'flakySettings', 'type': 'FlakySettings'}, + 'new_test_result_logging_settings': {'key': 'newTestResultLoggingSettings', 'type': 'NewTestResultLoggingSettings'} + } + + def __init__(self, flaky_settings=None, new_test_result_logging_settings=None): + super(TestResultsSettings, self).__init__() + self.flaky_settings = flaky_settings + self.new_test_result_logging_settings = new_test_result_logging_settings + + +class TestResultSummary(Model): + """ + :param aggregated_results_analysis: + :type aggregated_results_analysis: :class:`AggregatedResultsAnalysis ` + :param no_config_runs_count: + :type no_config_runs_count: int + :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 ` + :param total_runs_count: + :type total_runs_count: int + """ + + _attribute_map = { + 'aggregated_results_analysis': {'key': 'aggregatedResultsAnalysis', 'type': 'AggregatedResultsAnalysis'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'team_project': {'key': 'teamProject', 'type': 'TeamProjectReference'}, + 'test_failures': {'key': 'testFailures', 'type': 'TestFailuresAnalysis'}, + 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, aggregated_results_analysis=None, no_config_runs_count=None, team_project=None, test_failures=None, test_results_context=None, total_runs_count=None): + super(TestResultSummary, self).__init__() + self.aggregated_results_analysis = aggregated_results_analysis + self.no_config_runs_count = no_config_runs_count + self.team_project = team_project + self.test_failures = test_failures + self.test_results_context = test_results_context + self.total_runs_count = total_runs_count + + +class TestResultsUpdateSettings(Model): + """ + :param flaky_settings: FlakySettings defines Flaky Settings Data. + :type flaky_settings: :class:`FlakySettings ` + :param new_test_result_logging_settings: NewTestResultLoggingSettings defines the setting for logging new test results + :type new_test_result_logging_settings: :class:`NewTestResultLoggingSettings ` + """ + + _attribute_map = { + 'flaky_settings': {'key': 'flakySettings', 'type': 'FlakySettings'}, + 'new_test_result_logging_settings': {'key': 'newTestResultLoggingSettings', 'type': 'NewTestResultLoggingSettings'} + } + + def __init__(self, flaky_settings=None, new_test_result_logging_settings=None): + super(TestResultsUpdateSettings, self).__init__() + self.flaky_settings = flaky_settings + self.new_test_result_logging_settings = new_test_result_logging_settings + + +class TestResultTrendFilter(Model): + """ + :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): + """ + Test run details. + + :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: Test Run Controller. + :type controller: str + :param created_date: Test Run CreatedDate. + :type created_date: datetime + :param custom_fields: List of Custom Fields for TestRun. + :type custom_fields: list of :class:`CustomTestField ` + :param drop_location: Drop Location for the test Run. + :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: Number of 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: Number of 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: Phase/State for the testRun. + :type phase: str + :param pipeline_reference: Reference of the pipeline to which this test run belongs. + :type pipeline_reference: :class:`PipelineReference ` + :param plan: Test plan associated with this test run. + :type plan: :class:`ShallowReference ` + :param post_process_state: Post Process State. + :type post_process_state: str + :param project: Project associated with this run. + :type project: :class:`ShallowReference ` + :param release: Release Reference for the Test Run. + :type release: :class:`ReleaseReference ` + :param release_environment_uri: Release Environment Uri for TestRun. + :type release_environment_uri: str + :param release_uri: Release Uri for TestRun. + :type release_uri: str + :param revision: + :type revision: int + :param run_statistics: RunSummary by outcome. + :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. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation + :type state: str + :param substate: TestRun Substate. + :type substate: object + :param tags: Tags attached with this test run. + :type tags: list of :class:`TestTag ` + :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: Number of failed tests in the run. + :type unanalyzed_tests: int + :param url: Url of the test run + :type url: str + :param web_access_url: Web Access Url for TestRun. + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=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, tags=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.pipeline_reference = pipeline_reference + 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.tags = tags + 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): + """ + Test Run Code Coverage Details + + :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): + """ + Test run statistics. + + :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 TestSettings(Model): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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): + """ + Represents a sub result of a test result. + + :param comment: Comment in sub result. + :type comment: str + :param completed_date: Time when test execution completed(UTC). + :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(UTC). + :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(UTC). + :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 TestSummaryForWorkItem(Model): + """ + :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 TestTag(Model): + """ + Tag attached to a run or result. + + :param name: Name of the tag, alphanumeric value less than 30 chars + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(TestTag, self).__init__() + self.name = name + + +class TestTagSummary(Model): + """ + Test tag summary for build or release grouped by test run. + + :param tags_group_by_test_artifact: Dictionary which contains tags associated with a test run. + :type tags_group_by_test_artifact: dict + """ + + _attribute_map = { + 'tags_group_by_test_artifact': {'key': 'tagsGroupByTestArtifact', 'type': '{[TestTag]}'} + } + + def __init__(self, tags_group_by_test_artifact=None): + super(TestTagSummary, self).__init__() + self.tags_group_by_test_artifact = tags_group_by_test_artifact + + +class TestTagsUpdateModel(Model): + """ + Tags to update to a run or result. + + :param tags: + :type tags: list of { key: OperationType; value: [TestTag] } + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[{ key: OperationType; value: [TestTag] }]'} + } + + def __init__(self, tags=None): + super(TestTagsUpdateModel, self).__init__() + self.tags = tags + + +class TestToWorkItemLinks(Model): + """ + :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 WorkItemReference(Model): + """ + WorkItem reference Details. + + :param id: WorkItem Id. + :type id: str + :param name: WorkItem Name. + :type name: str + :param type: WorkItem Type. + :type type: str + :param url: WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case) + :type url: str + :param web_url: WorkItem WebUrl. + :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): + """ + :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): + """ + Represents a test step result. + + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :type started_date: datetime + :param action_path: Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step + :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. Deprecated in hosted environment. + :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', + 'AggregatedResultDetailsByOutcome', + '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', + 'NewTestResultLoggingSettings', + 'PhaseReference', + 'PipelineReference', + 'PipelineTestMetrics', + 'QueryModel', + 'ReferenceLinks', + 'ReleaseReference', + 'ResultsAnalysis', + 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', + 'RunCreateModel', + 'RunFilter', + 'RunStatistic', + 'RunSummary', + 'RunSummaryModel', + 'RunUpdateModel', + 'ShallowReference', + 'ShallowTestCaseResult', + 'SharedStepModel', + 'StageReference', + 'TeamProjectReference', + 'TestAttachment', + 'TestAttachmentReference', + 'TestAttachmentRequestModel', + 'TestCaseResult', + 'TestCaseResultAttachmentModel', + 'TestCaseResultIdentifier', + 'TestEnvironment', + 'TestFailureDetails', + 'TestFailuresAnalysis', + 'TestFlakyIdentifier', + 'TestHistoryQuery', + 'TestIterationDetailsModel', + 'TestLog', + 'TestLogReference', + 'TestLogStoreEndpointDetails', + 'TestMessageLogDetails', + 'TestMethod', + 'TestOperationReference', + 'TestResolutionState', + 'TestResultDocument', + 'TestResultFailuresAnalysis', + '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', + 'TestActionResultModel', +] diff --git a/azure-devops/azure/devops/v7_0/test_results/test_results_client.py b/azure-devops/azure/devops/v7_0/test_results/test_results_client.py new file mode 100644 index 00000000..75dcbc0a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/test_results/test_results_client.py @@ -0,0 +1,348 @@ +# -------------------------------------------------------------------------------------------- +# 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 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 = 'c83eaf52-edf3-4034-ae11-17d38f25404c' + + def query_test_results_meta_data(self, test_case_reference_ids, project, details_to_include=None): + """QueryTestResultsMetaData. + [Preview API] Get list of test Result meta data details for corresponding testcasereferenceId + :param [str] test_case_reference_ids: TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200). + :param str project: Project ID or project name + :param str details_to_include: Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers. + :rtype: [TestResultMetaData] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if details_to_include is not None: + query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') + content = self._serialize.body(test_case_reference_ids, '[str]') + response = self._send(http_method='POST', + location_id='b72ff4c0-4341-4213-ba27-f517cf341c95', + version='7.0-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestResultMetaData]', self._unwrap_collection(response)) + + def update_test_results_meta_data(self, test_result_meta_data_update_input, project, test_case_reference_id): + """UpdateTestResultsMetaData. + [Preview API] Update properties of test result meta data + :param :class:` ` test_result_meta_data_update_input: TestResultMetaData update input TestResultMetaDataUpdateInput + :param str project: Project ID or project name + :param int test_case_reference_id: TestCaseReference Id of Test Result to be updated. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_case_reference_id is not None: + route_values['testCaseReferenceId'] = self._serialize.url('test_case_reference_id', test_case_reference_id, 'int') + content = self._serialize.body(test_result_meta_data_update_input, 'TestResultMetaDataUpdateInput') + response = self._send(http_method='PATCH', + location_id='b72ff4c0-4341-4213-ba27-f517cf341c95', + version='7.0-preview.4', + route_values=route_values, + content=content) + return self._deserialize('TestResultMetaData', response) + + def get_test_result_logs(self, project, run_id, result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestResultLogs. + [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 result_id: Id of the test result + :param str type: type of attachments to get + :param str directory_path: directory path of attachments to get + :param str file_name_prefix: file name prefix to filter the list of attachment + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Numbe of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_sub_result_logs(self, project, run_id, result_id, sub_result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestSubResultLogs. + [Preview API] Get list of test subresult attachments reference + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains the results + :param int result_id: Id of the test result that contains subresult + :param int sub_result_id: Id of the test subresult + :param str type: type of the attachments to get + :param str directory_path: directory path of the attachment to get + :param str file_name_prefix: file name prefix to filter the list of attachments + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Number of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_run_logs(self, project, run_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestRunLogs. + [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 + :param str type: type of the attachments to get + :param str directory_path: directory path for which attachments are needed + :param str file_name_prefix: file name prefix to filter the list of attachment + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Number of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='5b47b946-e875-4c9a-acdc-2a20996caebe', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_log_store_endpoint_details_for_result_log(self, project, run_id, result_id, type, file_path): + """GetTestLogStoreEndpointDetailsForResultLog. + [Preview API] Get SAS Uri of a test results attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains result + :param int result_id: Id of the test result whose files need to be downloaded + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def get_test_log_store_endpoint_details_for_sub_result_log(self, project, run_id, result_id, sub_result_id, type, file_path): + """GetTestLogStoreEndpointDetailsForSubResultLog. + [Preview API] Get SAS Uri of a test subresults attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains result + :param int result_id: Id of the test result that contains subresult + :param int sub_result_id: Id of the test subresult whose file sas uri is needed + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def test_log_store_endpoint_details_for_result(self, project, run_id, result_id, sub_result_id, file_path, type): + """TestLogStoreEndpointDetailsForResult. + [Preview API] Create empty file for a result and Get Sas uri for the file + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains the result + :param int result_id: Id of the test results that contains sub result + :param int sub_result_id: Id of the test sub result whose file sas uri is needed + :param str file_path: file path inside the sub result for which sas uri is needed + :param str type: Type of the file for download + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='POST', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def get_test_log_store_endpoint_details_for_run_log(self, project, run_id, type, file_path): + """GetTestLogStoreEndpointDetailsForRunLog. + [Preview API] Get SAS Uri of a test run attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run whose file has to be downloaded + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def test_log_store_endpoint_details_for_run(self, project, run_id, test_log_store_operation_type, file_path=None, type=None): + """TestLogStoreEndpointDetailsForRun. + [Preview API] Create empty file for a run and Get Sas uri for the file + :param str project: Project ID or project name + :param int run_id: Id of the run to get endpoint details + :param str test_log_store_operation_type: Type of operation to perform using sas uri + :param str file_path: file path to create an empty file + :param str type: Default is GeneralAttachment, type of empty file to be created + :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 test_log_store_operation_type is not None: + query_parameters['testLogStoreOperationType'] = self._serialize.query('test_log_store_operation_type', test_log_store_operation_type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='POST', + location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + diff --git a/azure-devops/azure/devops/v7_0/tfvc/__init__.py b/azure-devops/azure/devops/v7_0/tfvc/__init__.py new file mode 100644 index 00000000..84b77dc9 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/tfvc/__init__.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'FileContentMetadata', + 'GitRepository', + 'GitRepositoryRef', + 'GraphSubjectBase', + 'Change', + 'CheckinNote', + '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' +] diff --git a/azure-devops/azure/devops/v7_0/tfvc/models.py b/azure-devops/azure/devops/v7_0/tfvc/models.py new file mode 100644 index 00000000..2e3cb955 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/tfvc/models.py @@ -0,0 +1,1436 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 FileContentMetadata(Model): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=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, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + 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 + self.web_url = web_url + + +class GitRepositoryRef(Model): + """ + :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): + """ + :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 Change(Model): + """ + :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): + """ + :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 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 ItemContent(Model): + """ + :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): + """ + :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): + """ + 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 TeamProjectCollectionReference(Model): + """ + Reference object for a TeamProjectCollection. + + :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): + """ + 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 TfvcBranchMapping(Model): + """ + A branch mapping. + + :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): + """ + A change. + + :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): + """ + Metadata for a changeset. + + :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 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 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 url: URL to retrieve the item. + :type url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'author': {'key': 'author', 'type': 'IdentityRef'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'}, + 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, _links=None, author=None, comment=None, comment_truncated=None, created_date=None, changeset_id=None, checked_in_by=None, url=None): + super(TfvcChangesetRef, self).__init__() + self._links = _links + self.author = author + self.comment = comment + self.comment_truncated = comment_truncated + self.created_date = created_date + self.changeset_id = changeset_id + self.checked_in_by = checked_in_by + self.url = url + + +class TfvcChangesetSearchCriteria(Model): + """ + Criteria used in a search for change lists. + + :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): + """ + Request body for Get batched changesets. + + :param comment_length: Max length of the comment. + :type comment_length: int + :param changeset_ids: List of changeset Ids. + :type changeset_ids: list of int + :param include_links: Whether to include the _links field on the shallow references + :type include_links: bool + """ + + _attribute_map = { + 'comment_length': {'key': 'commentLength', 'type': 'int'}, + 'changeset_ids': {'key': 'changesetIds', 'type': '[int]'}, + 'include_links': {'key': 'includeLinks', 'type': 'bool'} + } + + def __init__(self, comment_length=None, changeset_ids=None, include_links=None): + super(TfvcChangesetsRequestData, self).__init__() + self.comment_length = comment_length + self.changeset_ids = changeset_ids + self.include_links = include_links + + +class TfvcItem(ItemModel): + """ + Metadata for an item. + + :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 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 change_date: Item changed datetime. + :type change_date: datetime + :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'}, + 'deletion_id': {'key': 'deletionId', 'type': 'int'}, + 'encoding': {'key': 'encoding', 'type': 'int'}, + 'hash_value': {'key': 'hashValue', 'type': 'str'}, + 'change_date': {'key': 'changeDate', 'type': 'iso-8601'}, + '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, deletion_id=None, encoding=None, hash_value=None, change_date=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.deletion_id = deletion_id + self.encoding = encoding + self.hash_value = hash_value + self.change_date = change_date + self.is_branch = is_branch + self.is_pending_change = is_pending_change + self.size = size + self.version = version + + +class TfvcItemDescriptor(Model): + """ + Item path and Version descriptor properties + + :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): + """ + Request body used by Get Items Batch + + :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): + """ + Metadata for a Label. + + :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): + """ + :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): + """ + MappingFilter can be used to include or exclude specific paths. + + :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): + """ + :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): + """ + Policy failure information. + + :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): + """ + Information on the policy override. + + :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): + """ + This is the shallow branchref class. + + :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): + """ + Metadata for a shallow shelveset. + + :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): + """ + :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_comment_length: Max length of comment + :type max_comment_length: int + :param max_change_count: Max number of changes to include + :type max_change_count: 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_comment_length': {'key': 'maxCommentLength', 'type': 'int'}, + 'max_change_count': {'key': 'maxChangeCount', '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_comment_length=None, max_change_count=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_comment_length = max_comment_length + self.max_change_count = max_change_count + self.name = name + self.owner = owner + + +class TfvcStatistics(Model): + """ + :param file_count_total: Count of files at the requested scope. + :type file_count_total: long + :param changeset_id: Id of the last changeset the stats are based on. + :type changeset_id: int + """ + + _attribute_map = { + 'file_count_total': {'key': 'fileCountTotal', 'type': 'long'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'} + } + + def __init__(self, file_count_total=None, changeset_id=None): + super(TfvcStatistics, self).__init__() + self.file_count_total = file_count_total + self.changeset_id = changeset_id + + +class TfvcVersionDescriptor(Model): + """ + Version descriptor properties. + + :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): + """ + :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): + """ + :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): + """ + Metadata for a branchref. + + :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): + """ + A collection of changes. + + :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 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 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 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 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 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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'}, + 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, + 'url': {'key': 'url', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'collection_id': {'key': 'collectionId', 'type': 'str'}, + 'has_more_changes': {'key': 'hasMoreChanges', 'type': 'bool'}, + 'changes': {'key': 'changes', 'type': '[TfvcChange]'}, + 'checkin_notes': {'key': 'checkinNotes', 'type': '[CheckinNote]'}, + '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, comment=None, comment_truncated=None, created_date=None, changeset_id=None, checked_in_by=None, url=None, account_id=None, collection_id=None, has_more_changes=None, changes=None, checkin_notes=None, policy_override=None, team_project_ids=None, work_items=None): + super(TfvcChangeset, self).__init__(_links=_links, author=author, comment=comment, comment_truncated=comment_truncated, created_date=created_date, changeset_id=changeset_id, checked_in_by=checked_in_by, url=url) + self.account_id = account_id + self.collection_id = collection_id + self.has_more_changes = has_more_changes + self.changes = changes + self.checkin_notes = checkin_notes + self.policy_override = policy_override + self.team_project_ids = team_project_ids + self.work_items = work_items + + +class TfvcLabel(TfvcLabelRef): + """ + Metadata for a label. + + :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): + """ + Metadata for a shelveset. + + :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): + """ + Class representing a branch object. + + :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', + 'FileContentMetadata', + 'GitRepository', + 'GitRepositoryRef', + 'GraphSubjectBase', + 'Change', + 'CheckinNote', + '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', +] diff --git a/azure-devops/azure/devops/v7_0/tfvc/tfvc_client.py b/azure-devops/azure/devops/v7_0/tfvc/tfvc_client.py new file mode 100644 index 00000000..e5b5447a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/tfvc/tfvc_client.py @@ -0,0 +1,750 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.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, 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:`<[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') + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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, defaults to 100 when undefined + :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='7.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='7.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='7.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='7.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='7.0', + query_parameters=query_parameters) + return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/token_admin/__init__.py b/azure-devops/azure/devops/v7_0/token_admin/__init__.py new file mode 100644 index 00000000..69575947 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/token_admin/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'SessionTokenResult', + 'TokenAdminPagedSessionTokens', + 'TokenAdminRevocation', + 'TokenAdminRevocationRule', + 'TokenAdminClient' +] diff --git a/azure-devops/azure/devops/v7_0/token_admin/models.py b/azure-devops/azure/devops/v7_0/token_admin/models.py new file mode 100644 index 00000000..0b081584 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/token_admin/models.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Represents a session token used to access Azure DevOps resources + + :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 claims: + :type claims: dict + :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'}, + 'claims': {'key': 'claims', '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, claims=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.claims = claims + 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 SessionTokenResult(Model): + """ + :param has_error: + :type has_error: bool + :param session_token: + :type session_token: :class:`SessionToken ` + :param session_token_error: + :type session_token_error: object + """ + + _attribute_map = { + 'has_error': {'key': 'hasError', 'type': 'bool'}, + 'session_token': {'key': 'sessionToken', 'type': 'SessionToken'}, + 'session_token_error': {'key': 'sessionTokenError', 'type': 'object'} + } + + def __init__(self, has_error=None, session_token=None, session_token_error=None): + super(SessionTokenResult, self).__init__() + self.has_error = has_error + self.session_token = session_token + self.session_token_error = session_token_error + + +class TokenAdminPagedSessionTokens(Model): + """ + A paginated list of session tokens. Session tokens correspond to OAuth credentials such as personal access tokens (PATs) and other OAuth authorizations. + + :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): + """ + A request to revoke a particular delegated authorization. + + :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): + """ + A rule which is applied to disable any incoming delegated authorization which matches the given properties. + + :param created_before: A datetime cutoff. Tokens created before this time will be rejected. This is an optional parameter. 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 Azure DevOps, see: https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#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', + 'SessionTokenResult', + 'TokenAdminPagedSessionTokens', + 'TokenAdminRevocation', + 'TokenAdminRevocationRule', +] diff --git a/azure-devops/azure/devops/v7_0/token_admin/token_admin_client.py b/azure-devops/azure/devops/v7_0/token_admin/token_admin_client.py new file mode 100644 index 00000000..40ec43b5 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/token_admin/token_admin_client.py @@ -0,0 +1,80 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TokenAdminPagedSessionTokens', response) + + def create_revocation_rule(self, revocation_rule): + """CreateRevocationRule. + 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='7.0', + content=content) + + def revoke_authorizations(self, revocations, is_public=None): + """RevokeAuthorizations. + 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='7.0', + query_parameters=query_parameters, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/upack_api/__init__.py b/azure-devops/azure/devops/v7_0/upack_api/__init__.py new file mode 100644 index 00000000..5a9801e6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_api/__init__.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/upack_api/models.py b/azure-devops/azure/devops/v7_0/upack_api/models.py new file mode 100644 index 00000000..4fa9c504 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_api/models.py @@ -0,0 +1,219 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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 version metadata for a Universal 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): + """ + :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): + """ + 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 UPackPackagesBatchRequest(Model): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a Universal package. + + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/upack_api/upack_api_client.py b/azure-devops/azure/devops/v7_0/upack_api/upack_api_client.py new file mode 100644 index 00000000..43bd0f4a --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_api/upack_api_client.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# 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 update_package_versions(self, batch_request, feed_id, project=None): + """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. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'UPackPackagesBatchRequest') + self._send(http_method='POST', + location_id='c17e81ae-4caa-4d8b-a431-6b329e890281', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'UPackPackagesBatchRequest') + self._send(http_method='POST', + location_id='12f73313-0937-4114-bb9f-4e9e720fdc78', + version='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted versions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.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, project=None): + """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. + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_0/upack_packaging/__init__.py b/azure-devops/azure/devops/v7_0/upack_packaging/__init__.py new file mode 100644 index 00000000..b1e72abc --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_packaging/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/upack_packaging/models.py b/azure-devops/azure/devops/v7_0/upack_packaging/models.py new file mode 100644 index 00000000..fd448fd6 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_packaging/models.py @@ -0,0 +1,141 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param description: + :type description: str + :param version: + :type version: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, description=None, version=None): + super(UPackLimitedPackageMetadata, self).__init__() + self.description = description + self.version = version + + +class UPackLimitedPackageMetadataListResponse(Model): + """ + :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): + """ + :param description: + :type description: str + :param manifest_id: + :type manifest_id: str + :param package_size: + :type package_size: long + :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'}, + 'package_size': {'key': 'packageSize', 'type': 'long'}, + 'super_root_id': {'key': 'superRootId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, description=None, manifest_id=None, package_size=None, super_root_id=None, version=None): + super(UPackPackageMetadata, self).__init__() + self.description = description + self.manifest_id = manifest_id + self.package_size = package_size + self.super_root_id = super_root_id + self.version = version + + +class UPackPackagePushMetadata(Model): + """ + Contains the parameters for adding a new Universal Package to the feed, except for name and version which are transmitted in the URL + + :param description: + :type description: str + :param manifest_id: + :type manifest_id: str + :param proof_nodes: + :type proof_nodes: list of str + :param super_root_id: + :type super_root_id: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'manifest_id': {'key': 'manifestId', 'type': 'str'}, + 'proof_nodes': {'key': 'proofNodes', 'type': '[str]'}, + 'super_root_id': {'key': 'superRootId', 'type': 'str'} + } + + def __init__(self, description=None, manifest_id=None, proof_nodes=None, super_root_id=None): + super(UPackPackagePushMetadata, self).__init__() + self.description = description + self.manifest_id = manifest_id + self.proof_nodes = proof_nodes + self.super_root_id = super_root_id + + +class UPackPackageVersionDeletionState(Model): + """ + Deletion state of a Universal package. + + :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', +] diff --git a/azure-devops/azure/devops/v7_0/upack_packaging/upack_packaging_client.py b/azure-devops/azure/devops/v7_0/upack_packaging/upack_packaging_client.py new file mode 100644 index 00000000..6c8fa426 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/upack_packaging/upack_packaging_client.py @@ -0,0 +1,102 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None): + """AddPackage. + [Preview API] + :param :class:` ` metadata: + :param str feed_id: + :param str package_name: + :param str package_version: + :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 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='7.0-preview.1', + route_values=route_values, + content=content) + + def get_package_metadata(self, feed_id, package_name, package_version, project=None, intent=None): + """GetPackageMetadata. + [Preview API] + :param str feed_id: + :param str package_name: + :param str package_version: + :param str project: Project ID or project name + :param str intent: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.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, project=None): + """GetPackageVersionsMetadata. + [Preview API] + :param str feed_id: + :param str package_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 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='7.0-preview.1', + route_values=route_values) + return self._deserialize('UPackLimitedPackageMetadataListResponse', response) + diff --git a/azure-devops/azure/devops/v7_0/wiki/__init__.py b/azure-devops/azure/devops/v7_0/wiki/__init__.py new file mode 100644 index 00000000..fa52900d --- /dev/null +++ b/azure-devops/azure/devops/v7_0/wiki/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'Comment', + 'CommentAttachment', + 'CommentCreateParameters', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentResourceReference', + 'CommentUpdateParameters', + 'GitRepository', + 'GitRepositoryRef', + 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WikiAttachment', + 'WikiAttachmentResponse', + 'WikiCreateBaseParameters', + 'WikiCreateParametersV2', + 'WikiPage', + 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', + 'WikiPageMove', + 'WikiPageMoveParameters', + 'WikiPageMoveResponse', + 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', + 'WikiPageViewStats', + 'WikiUpdateParameters', + 'WikiV2', + 'WikiClient' +] diff --git a/azure-devops/azure/devops/v7_0/wiki/models.py b/azure-devops/azure/devops/v7_0/wiki/models.py new file mode 100644 index 00000000..02dc62ca --- /dev/null +++ b/azure-devops/azure/devops/v7_0/wiki/models.py @@ -0,0 +1,1056 @@ +# -------------------------------------------------------------------------------------------- +# 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 CommentCreateParameters(Model): + """ + Represents a request to create a work item comment. + + :param parent_id: Optional CommentId of the parent in order to add a reply for an existing comment + :type parent_id: int + :param text: + :type text: str + """ + + _attribute_map = { + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, parent_id=None, text=None): + super(CommentCreateParameters, self).__init__() + self.parent_id = parent_id + self.text = text + + +class CommentResourceReference(Model): + """ + Base class for comment resource references + + :param url: + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, url=None): + super(CommentResourceReference, self).__init__() + self.url = url + + +class CommentUpdateParameters(Model): + """ + Represents a request to update a comment. + + :param state: Set the current state of the comment + :type state: object + :param text: The updated text of the comment + :type text: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'object'}, + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, state=None, text=None): + super(CommentUpdateParameters, self).__init__() + self.state = state + self.text = text + + +class GitRepository(Model): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=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, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + 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 + self.web_url = web_url + + +class GitRepositoryRef(Model): + """ + :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 GitVersionDescriptor(Model): + """ + :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 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 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 TeamProjectCollectionReference(Model): + """ + :param id: + :type id: str + :param name: + :type name: str + :param 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): + """ + :param abbreviation: + :type abbreviation: str + :param default_team_image_url: + :type default_team_image_url: 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 revision: + :type revision: long + :param state: + :type state: object + :param url: + :type url: str + :param 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 WikiAttachment(Model): + """ + Defines properties for wiki attachment file. + + :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): + """ + Response contract for the Wiki Attachments API + + :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): + """ + Base wiki creation parameters. + + :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): + """ + Wiki creation parameters. + + :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): + """ + Contract encapsulating parameters for the page create or update operations. + + :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 WikiPageDetail(Model): + """ + Defines a page with its metedata in a wiki. + + :param id: When present, permanent identifier for the wiki page + :type id: int + :param path: Path of the wiki page. + :type path: str + :param view_stats: Path of the wiki page. + :type view_stats: list of :class:`WikiPageStat ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + 'view_stats': {'key': 'viewStats', 'type': '[WikiPageStat]'} + } + + def __init__(self, id=None, path=None, view_stats=None): + super(WikiPageDetail, self).__init__() + self.id = id + self.path = path + self.view_stats = view_stats + + +class WikiPageMoveParameters(Model): + """ + Contract encapsulating parameters for the page move operation. + + :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): + """ + Response contract for the Wiki Page Move API. + + :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): + """ + Response contract for the Wiki Pages PUT, PATCH and DELETE APIs. + + :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 WikiPagesBatchRequest(Model): + """ + Contract encapsulating parameters for the pages batch. + + :param continuation_token: If the list of page data returned is not complete, a continuation token to query next batch of pages is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of Wiki Page Data. + :type continuation_token: str + :param page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :type page_views_for_days: int + :param top: Total count of pages on a wiki to return. + :type top: int + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'page_views_for_days': {'key': 'pageViewsForDays', 'type': 'int'}, + 'top': {'key': 'top', 'type': 'int'} + } + + def __init__(self, continuation_token=None, page_views_for_days=None, top=None): + super(WikiPagesBatchRequest, self).__init__() + self.continuation_token = continuation_token + self.page_views_for_days = page_views_for_days + self.top = top + + +class WikiPageStat(Model): + """ + Defines properties for wiki page stat. + + :param count: the count of the stat for the Day + :type count: int + :param day: Day of the stat + :type day: datetime + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'iso-8601'} + } + + def __init__(self, count=None, day=None): + super(WikiPageStat, self).__init__() + self.count = count + self.day = day + + +class WikiPageViewStats(Model): + """ + Defines properties for wiki page view stats. + + :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): + """ + Wiki update parameters. + + :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): + """ + Defines a wiki resource. + + :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 is_disabled: Is wiki repository disabled + :type is_disabled: bool + :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'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + '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, is_disabled=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.is_disabled = is_disabled + self.properties = properties + self.remote_url = remote_url + self.url = url + self.versions = versions + + +class Comment(CommentResourceReference): + """ + Comment on an artifact like Work Item or Wiki, etc. + + :param url: + :type url: str + :param artifact_id: The id of the artifact this comment belongs to + :type artifact_id: str + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted. + :type is_deleted: bool + :param mentions: The mentions of the comment. + :type mentions: list of :class:`CommentMention ` + :param modified_by: IdentityRef of the user who last modified the comment. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The last modification date of the comment. + :type modified_date: datetime + :param parent_id: The comment id of the parent comment, if any + :type parent_id: int + :param reactions: The reactions on the comment. + :type reactions: list of :class:`CommentReaction ` + :param rendered_text: The rendered text of the comment + :type rendered_text: str + :param replies: Replies for this comment + :type replies: :class:`CommentList ` + :param state: Indicates the current state of the comment + :type state: object + :param text: The plaintext/markdown version of the comment + :type text: str + :param version: The current version of the comment + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'mentions': {'key': 'mentions', 'type': '[CommentMention]'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'reactions': {'key': 'reactions', 'type': '[CommentReaction]'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + 'replies': {'key': 'replies', 'type': 'CommentList'}, + 'state': {'key': 'state', 'type': 'object'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, artifact_id=None, created_by=None, created_date=None, id=None, is_deleted=None, mentions=None, modified_by=None, modified_date=None, parent_id=None, reactions=None, rendered_text=None, replies=None, state=None, text=None, version=None): + super(Comment, self).__init__(url=url) + self.artifact_id = artifact_id + self.created_by = created_by + self.created_date = created_date + self.id = id + self.is_deleted = is_deleted + self.mentions = mentions + self.modified_by = modified_by + self.modified_date = modified_date + self.parent_id = parent_id + self.reactions = reactions + self.rendered_text = rendered_text + self.replies = replies + self.state = state + self.text = text + self.version = version + + +class CommentAttachment(CommentResourceReference): + """ + Represents an attachment to a comment. + + :param url: + :type url: str + :param created_by: IdentityRef of the creator of the attachment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the attachment. + :type created_date: datetime + :param id: Unique Id of the attachment. + :type id: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, url=None, created_by=None, created_date=None, id=None): + super(CommentAttachment, self).__init__(url=url) + self.created_by = created_by + self.created_date = created_date + self.id = id + + +class CommentList(CommentResourceReference): + """ + Represents a list of comments. + + :param url: + :type url: str + :param comments: List of comments in the current batch. + :type comments: list of :class:`Comment ` + :param continuation_token: A string token that can be used to retrieving next page of comments if available. Otherwise null. + :type continuation_token: str + :param count: The count of comments in the current batch. + :type count: int + :param next_page: Uri to the next page of comments if it is available. Otherwise null. + :type next_page: str + :param total_count: Total count of comments on a work item. + :type total_count: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comments': {'key': 'comments', 'type': '[Comment]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'next_page': {'key': 'nextPage', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, url=None, comments=None, continuation_token=None, count=None, next_page=None, total_count=None): + super(CommentList, self).__init__(url=url) + self.comments = comments + self.continuation_token = continuation_token + self.count = count + self.next_page = next_page + self.total_count = total_count + + +class CommentMention(CommentResourceReference): + """ + Contains information about various artifacts mentioned in the comment + + :param url: + :type url: str + :param artifact_id: Id of the artifact this mention belongs to + :type artifact_id: str + :param comment_id: Id of the comment associated with this mention. Nullable to support legacy mentions which can potentially have null commentId + :type comment_id: int + :param mentioned_artifact: Value of the mentioned artifact. Expected Value varies by CommentMentionType: Person: VSID associated with the identity Work Item: ID of the work item Pull Request: ID of the Pull Request + :type mentioned_artifact: str + :param type: The context which represent where this mentioned was parsed from + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'mentioned_artifact': {'key': 'mentionedArtifact', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, artifact_id=None, comment_id=None, mentioned_artifact=None, type=None): + super(CommentMention, self).__init__(url=url) + self.artifact_id = artifact_id + self.comment_id = comment_id + self.mentioned_artifact = mentioned_artifact + self.type = type + + +class CommentReaction(CommentResourceReference): + """ + Contains information about comment reaction for a particular reaction type. + + :param url: + :type url: str + :param comment_id: The id of the comment this reaction belongs to. + :type comment_id: int + :param count: Total number of reactions for the CommentReactionType. + :type count: int + :param is_current_user_engaged: Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment). + :type is_current_user_engaged: bool + :param type: Type of the reaction. + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'is_current_user_engaged': {'key': 'isCurrentUserEngaged', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, comment_id=None, count=None, is_current_user_engaged=None, type=None): + super(CommentReaction, self).__init__(url=url) + self.comment_id = comment_id + self.count = count + self.is_current_user_engaged = is_current_user_engaged + self.type = type + + +class WikiPage(WikiPageCreateOrUpdateParameters): + """ + Defines a page in a wiki. + + :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 id: When present, permanent identifier for the wiki page + :type id: int + :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'}, + 'id': {'key': 'id', 'type': 'int'}, + '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, id=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.id = id + 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): + """ + Request contract for Wiki Page Move. + + :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__ = [ + 'CommentCreateParameters', + 'CommentResourceReference', + 'CommentUpdateParameters', + 'GitRepository', + 'GitRepositoryRef', + 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WikiAttachment', + 'WikiAttachmentResponse', + 'WikiCreateBaseParameters', + 'WikiCreateParametersV2', + 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', + 'WikiPageMoveParameters', + 'WikiPageMoveResponse', + 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', + 'WikiPageViewStats', + 'WikiUpdateParameters', + 'WikiV2', + 'Comment', + 'CommentAttachment', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'WikiPage', + 'WikiPageMove', +] diff --git a/azure-devops/azure/devops/v7_0/wiki/wiki_client.py b/azure-devops/azure/devops/v7_0/wiki/wiki_client.py new file mode 100644 index 00000000..5899095c --- /dev/null +++ b/azure-devops/azure/devops/v7_0/wiki/wiki_client.py @@ -0,0 +1,625 @@ +# -------------------------------------------------------------------------------------------- +# 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, 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 wiki 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='7.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, 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 wiki 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='7.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, 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 wiki 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='7.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, version_descriptor=None): + """DeletePage. + Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki 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='7.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 wiki 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='7.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 wiki 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='7.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 wiki 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='7.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 delete_page_by_id(self, project, wiki_identifier, id, comment=None): + """DeletePageById. + Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + response = self._send(http_method='DELETE', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id(self, project, wiki_identifier, id, recursion_level=None, include_content=None): + """GetPageById. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id_text(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdText. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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_by_id_zip(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdZip. + Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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 update_page_by_id(self, parameters, project, wiki_identifier, id, version, comment=None): + """UpdatePageById. + Edits a wiki page. + :param :class:` ` parameters: Wiki update operation parameters. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + 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='PATCH', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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 get_pages_batch(self, pages_batch_request, project, wiki_identifier, version_descriptor=None): + """GetPagesBatch. + Returns pageable list of Wiki Pages + :param :class:` ` pages_batch_request: Wiki batch page request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:`<[WikiPageDetail]> ` + """ + 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 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(pages_batch_request, 'WikiPagesBatchRequest') + response = self._send(http_method='POST', + location_id='71323c46-2592-4398-8771-ced73dd87207', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[WikiPageDetail]', self._unwrap_collection(response)) + + def get_page_data(self, project, wiki_identifier, page_id, page_views_for_days=None): + """GetPageData. + Returns page detail corresponding to Page ID. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int page_id: Wiki page ID. + :param int page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :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') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'int') + query_parameters = {} + if page_views_for_days is not None: + query_parameters['pageViewsForDays'] = self._serialize.query('page_views_for_days', page_views_for_days, 'int') + response = self._send(http_method='GET', + location_id='81c4e0fe-7663-4d62-ad46-6ab78459f274', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WikiPageDetail', response) + + 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='7.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 ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.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='7.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 ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.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 wiki name provided using the update parameters. + :param :class:` ` update_parameters: Update parameters. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WikiV2', response) + diff --git a/azure-devops/azure/devops/v7_0/work/__init__.py b/azure-devops/azure/devops/v7_0/work/__init__.py new file mode 100644 index 00000000..38efd362 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work/__init__.py @@ -0,0 +1,95 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'BoardBadge', + 'BoardCardRuleSettings', + 'BoardCardSettings', + 'BoardColumn', + 'BoardFields', + 'BoardChart', + 'BoardChartReference', + 'BoardReference', + 'BoardRow', + 'BoardSuggestedValue', + 'BoardUserSettings', + 'CapacityContractBase', + 'CapacityPatch', + 'CategoryConfiguration', + 'CreatePlan', + 'DateRange', + 'DeliveryViewData', + 'FieldReference', + 'FilterClause', + 'GraphSubjectBase', + 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', + 'IterationWorkItems', + 'Link', + 'Member', + 'ParentChildWIMap', + 'Plan', + 'PlanViewData', + 'PredefinedQuery', + 'ProcessConfiguration', + 'ReferenceLinks', + 'ReorderOperation', + 'ReorderResult', + 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', + 'TeamContext', + 'TeamFieldValue', + 'TeamFieldValues', + 'TeamFieldValuesPatch', + 'TeamIterationAttributes', + 'TeamMemberCapacity', + 'TeamMemberCapacityIdentityRef', + 'TeamSetting', + 'TeamSettingsDataContractBase', + 'TeamSettingsDaysOff', + 'TeamSettingsDaysOffPatch', + 'TeamSettingsIteration', + 'TeamSettingsPatch', + 'TimelineCriteriaStatus', + 'TimelineIterationStatus', + 'TimelineTeamData', + 'TimelineTeamIteration', + 'TimelineTeamStatus', + 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', + 'WorkItem', + 'WorkItemColor', + 'WorkItemCommentVersionRef', + 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeReference', + 'WorkItemTypeStateInfo', + 'WorkClient' +] diff --git a/azure-devops/azure/devops/v7_0/work/models.py b/azure-devops/azure/devops/v7_0/work/models.py new file mode 100644 index 00000000..9e8c8f20 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work/models.py @@ -0,0 +1,2332 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param capacity_per_day: + :type capacity_per_day: float + :param name: + :type name: str + """ + + _attribute_map = { + 'capacity_per_day': {'key': 'capacityPerDay', 'type': 'float'}, + '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): + """ + :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): + """ + :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 is_bugs_behavior_configured: Is BugsBehavior Configured in the process + :type is_bugs_behavior_configured: bool + :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]'}, + 'is_bugs_behavior_configured': {'key': 'isBugsBehaviorConfigured', 'type': 'bool'}, + '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, is_bugs_behavior_configured=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.is_bugs_behavior_configured = is_bugs_behavior_configured + 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): + """ + :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): + """ + Contract representing a backlog level + + :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): + """ + :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: Default 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): + """ + Represents work items in a backlog level + + :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 BoardBadge(Model): + """ + Represents a board badge. + + :param board_id: The ID of the board represented by this badge. + :type board_id: str + :param image_url: A link to the SVG resource. + :type image_url: str + """ + + _attribute_map = { + 'board_id': {'key': 'boardId', 'type': 'str'}, + 'image_url': {'key': 'imageUrl', 'type': 'str'} + } + + def __init__(self, board_id=None, image_url=None): + super(BoardBadge, self).__init__() + self.board_id = board_id + self.image_url = image_url + + +class BoardCardRuleSettings(Model): + """ + :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): + """ + :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 BoardColumn(Model): + """ + :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): + """ + :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 BoardChartReference(Model): + """ + :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 BoardReference(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Expected data from PATCH + + :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): + """ + Details about a given backlog category + + :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): + """ + :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): + """ + :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): + """ + An abstracted reference to a field + + :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): + """ + :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): + """ + :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 ITaskboardColumnMapping(Model): + """ + :param state: + :type state: str + :param work_item_type: + :type work_item_type: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_type': {'key': 'workItemType', 'type': 'str'} + } + + def __init__(self, state=None, work_item_type=None): + super(ITaskboardColumnMapping, self).__init__() + self.state = state + self.work_item_type = work_item_type + + +class IterationCapacity(Model): + """ + Capacity and teams for all teams in an iteration + + :param teams: + :type teams: list of :class:`TeamCapacityTotals ` + :param total_iteration_capacity_per_day: + :type total_iteration_capacity_per_day: float + :param total_iteration_days_off: + :type total_iteration_days_off: int + """ + + _attribute_map = { + 'teams': {'key': 'teams', 'type': '[TeamCapacityTotals]'}, + 'total_iteration_capacity_per_day': {'key': 'totalIterationCapacityPerDay', 'type': 'float'}, + 'total_iteration_days_off': {'key': 'totalIterationDaysOff', 'type': 'int'} + } + + def __init__(self, teams=None, total_iteration_capacity_per_day=None, total_iteration_days_off=None): + super(IterationCapacity, self).__init__() + self.teams = teams + self.total_iteration_capacity_per_day = total_iteration_capacity_per_day + self.total_iteration_days_off = total_iteration_days_off + + +class Link(Model): + """ + Link description. + + :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): + """ + :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): + """ + :param child_work_item_ids: + :type child_work_item_ids: list of int + :param id: + :type id: int + :param title: + :type title: str + :param work_item_type_name: + :type work_item_type_name: str + """ + + _attribute_map = { + 'child_work_item_ids': {'key': 'childWorkItemIds', 'type': '[int]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} + } + + def __init__(self, child_work_item_ids=None, id=None, title=None, work_item_type_name=None): + super(ParentChildWIMap, self).__init__() + self.child_work_item_ids = child_work_item_ids + self.id = id + self.title = title + self.work_item_type_name = work_item_type_name + + +class Plan(Model): + """ + Data contract for the plan definition + + :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): + """ + Base class for plan view data contracts. Anything common goes here. + + :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): + """ + Represents a single pre-defined query. + + :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): + """ + Process Configurations for the project + + :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): + """ + 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 ReorderOperation(Model): + """ + Represents a reorder request for one or more work items. + + :param ids: IDs of the work items to be reordered. Must be valid WorkItem Ids. + :type ids: list of int + :param iteration_path: IterationPath for reorder operation. This is only used when we reorder from the Iteration Backlog + :type iteration_path: str + :param next_id: ID of the work item that should be after the reordered items. Can use 0 to specify the end of the list. + :type next_id: int + :param parent_id: Parent ID for all of the work items involved in this operation. Can use 0 to indicate the items don't have a parent. + :type parent_id: int + :param previous_id: ID of the work item that should be before the reordered items. Can use 0 to specify the beginning of the list. + :type previous_id: int + """ + + _attribute_map = { + 'ids': {'key': 'ids', 'type': '[int]'}, + 'iteration_path': {'key': 'iterationPath', 'type': 'str'}, + 'next_id': {'key': 'nextId', 'type': 'int'}, + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'previous_id': {'key': 'previousId', 'type': 'int'} + } + + def __init__(self, ids=None, iteration_path=None, next_id=None, parent_id=None, previous_id=None): + super(ReorderOperation, self).__init__() + self.ids = ids + self.iteration_path = iteration_path + self.next_id = next_id + self.parent_id = parent_id + self.previous_id = previous_id + + +class ReorderResult(Model): + """ + Represents a reorder result for a work item. + + :param id: The ID of the work item that was reordered. + :type id: int + :param order: The updated order value of the work item that was reordered. + :type order: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'order': {'key': 'order', 'type': 'float'} + } + + def __init__(self, id=None, order=None): + super(ReorderResult, self).__init__() + self.id = id + self.order = order + + +class Rule(Model): + """ + :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 TaskboardColumn(Model): + """ + Represents the taskbord column + + :param id: Column ID + :type id: str + :param mappings: Work item type states mapped to this column to support auto state update when column is updated. + :type mappings: list of :class:`ITaskboardColumnMapping ` + :param name: Column name + :type name: str + :param order: Column position relative to other columns in the same board + :type order: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mappings': {'key': 'mappings', 'type': '[ITaskboardColumnMapping]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'} + } + + def __init__(self, id=None, mappings=None, name=None, order=None): + super(TaskboardColumn, self).__init__() + self.id = id + self.mappings = mappings + self.name = name + self.order = order + + +class TaskboardColumnMapping(Model): + """ + Represents the state to column mapping per work item type This allows auto state update when the column changes + + :param state: State of the work item type mapped to the column + :type state: str + :param work_item_type: Work Item Type name who's state is mapped to the column + :type work_item_type: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_type': {'key': 'workItemType', 'type': 'str'} + } + + def __init__(self, state=None, work_item_type=None): + super(TaskboardColumnMapping, self).__init__() + self.state = state + self.work_item_type = work_item_type + + +class TaskboardColumns(Model): + """ + :param columns: + :type columns: list of :class:`TaskboardColumn ` + :param is_customized: Are the columns cutomized for this team + :type is_customized: bool + :param is_valid: Specifies if the referenced WIT and State is valid + :type is_valid: bool + :param validation_messsage: Details of validation failure if the state to column mapping is invalid + :type validation_messsage: str + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[TaskboardColumn]'}, + 'is_customized': {'key': 'isCustomized', 'type': 'bool'}, + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'validation_messsage': {'key': 'validationMesssage', 'type': 'str'} + } + + def __init__(self, columns=None, is_customized=None, is_valid=None, validation_messsage=None): + super(TaskboardColumns, self).__init__() + self.columns = columns + self.is_customized = is_customized + self.is_valid = is_valid + self.validation_messsage = validation_messsage + + +class TaskboardWorkItemColumn(Model): + """ + Column value of a work item in the taskboard + + :param column: Work item column value in the taskboard + :type column: str + :param column_id: Work item column id in the taskboard + :type column_id: str + :param state: Work Item state value + :type state: str + :param work_item_id: Work item id + :type work_item_id: int + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'column_id': {'key': 'columnId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_id': {'key': 'workItemId', 'type': 'int'} + } + + def __init__(self, column=None, column_id=None, state=None, work_item_id=None): + super(TaskboardWorkItemColumn, self).__init__() + self.column = column + self.column_id = column_id + self.state = state + self.work_item_id = work_item_id + + +class TeamCapacity(Model): + """ + Represents team member capacity with totals aggregated + + :param team_members: + :type team_members: list of :class:`TeamMemberCapacityIdentityRef ` + :param total_capacity_per_day: + :type total_capacity_per_day: float + :param total_days_off: + :type total_days_off: int + """ + + _attribute_map = { + 'team_members': {'key': 'teamMembers', 'type': '[TeamMemberCapacityIdentityRef]'}, + 'total_capacity_per_day': {'key': 'totalCapacityPerDay', 'type': 'float'}, + 'total_days_off': {'key': 'totalDaysOff', 'type': 'int'} + } + + def __init__(self, team_members=None, total_capacity_per_day=None, total_days_off=None): + super(TeamCapacity, self).__init__() + self.team_members = team_members + self.total_capacity_per_day = total_capacity_per_day + self.total_days_off = total_days_off + + +class TeamCapacityTotals(Model): + """ + Team information with total capacity and days off + + :param team_capacity_per_day: + :type team_capacity_per_day: float + :param team_id: + :type team_id: str + :param team_total_days_off: + :type team_total_days_off: int + """ + + _attribute_map = { + 'team_capacity_per_day': {'key': 'teamCapacityPerDay', 'type': 'float'}, + 'team_id': {'key': 'teamId', 'type': 'str'}, + 'team_total_days_off': {'key': 'teamTotalDaysOff', 'type': 'int'} + } + + def __init__(self, team_capacity_per_day=None, team_id=None, team_total_days_off=None): + super(TeamCapacityTotals, self).__init__() + self.team_capacity_per_day = team_capacity_per_day + self.team_id = team_id + self.team_total_days_off = team_total_days_off + + +class TeamContext(Model): + """ + The Team Context for an operation. + + :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): + """ + Represents a single 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): + """ + Expected data from PATCH + + :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): + """ + :param finish_date: Finish date of the iteration. Date-only, correct unadjusted at midnight in UTC. + :type finish_date: datetime + :param start_date: Start date of the iteration. Date-only, correct unadjusted at midnight in UTC. + :type start_date: datetime + :param time_frame: Time frame of the iteration, such as past, current or future. + :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): + """ + Base class for TeamSettings data contracts. Anything common goes here. + + :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): + """ + :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): + """ + :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): + """ + Represents a shallow ref for a single iteration. + + :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 of the iteration such as start and end date. + :type attributes: :class:`TeamIterationAttributes ` + :param id: Id of the iteration. + :type id: str + :param name: Name of the iteration. + :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): + """ + Data contract for what we expect to receive when PATCH + + :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): + """ + :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): + """ + :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): + """ + :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 partially_paged_work_items: + :type partially_paged_work_items: list of [object] + :param project_id: The project id the team belongs team + :type project_id: str + :param rollup_work_item_types: Work item types for which we will collect roll up data on the client side + :type rollup_work_item_types: list of 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_items: Work items associated with the team that are not under any of the team's iterations + :type work_items: list of [object] + :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]'}, + 'partially_paged_work_items': {'key': 'partiallyPagedWorkItems', 'type': '[[object]]'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'rollup_work_item_types': {'key': 'rollupWorkItemTypes', '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_items': {'key': 'workItems', 'type': '[[object]]'}, + '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, partially_paged_work_items=None, project_id=None, rollup_work_item_types=None, status=None, team_field_default_value=None, team_field_name=None, team_field_values=None, work_items=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.partially_paged_work_items = partially_paged_work_items + self.project_id = project_id + self.rollup_work_item_types = rollup_work_item_types + 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_items = work_items + self.work_item_type_colors = work_item_type_colors + + +class TimelineTeamIteration(Model): + """ + :param css_node_id: The iteration CSS Node Id + :type css_node_id: str + :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 = { + 'css_node_id': {'key': 'cssNodeId', 'type': 'str'}, + '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, css_node_id=None, 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.css_node_id = css_node_id + 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): + """ + :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): + """ + :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 UpdateTaskboardColumn(Model): + """ + :param id: Column ID, keep it null for new column + :type id: str + :param mappings: Work item type states mapped to this column to support auto state update when column is updated. + :type mappings: list of :class:`TaskboardColumnMapping ` + :param name: Column name is required + :type name: str + :param order: Column position relative to other columns in the same board + :type order: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mappings': {'key': 'mappings', 'type': '[TaskboardColumnMapping]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'} + } + + def __init__(self, id=None, mappings=None, name=None, order=None): + super(UpdateTaskboardColumn, self).__init__() + self.id = id + self.mappings = mappings + self.name = name + self.order = order + + +class UpdateTaskboardWorkItemColumn(Model): + """ + :param new_column: + :type new_column: str + """ + + _attribute_map = { + 'new_column': {'key': 'newColumn', 'type': 'str'} + } + + def __init__(self, new_column=None): + super(UpdateTaskboardWorkItemColumn, self).__init__() + self.new_column = new_column + + +class WorkItemColor(Model): + """ + Work item color and icon. + + :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): + """ + Reference to a field in a work item + + :param name: The friendly 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): + """ + A link between two work items. + + :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): + """ + Contains reference to a work item. + + :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): + """ + :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): + """ + Base class for work item tracking resource references. + + :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): + """ + Reference to a work item type. + + :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): + """ + :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): + """ + :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): + """ + :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 CapacityContractBase(TeamSettingsDataContractBase): + """ + :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 ` + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'url': {'key': 'url', 'type': 'str'}, + 'activities': {'key': 'activities', 'type': '[Activity]'}, + 'days_off': {'key': 'daysOff', 'type': '[DateRange]'} + } + + def __init__(self, _links=None, url=None, activities=None, days_off=None): + super(CapacityContractBase, self).__init__(_links=_links, url=url) + self.activities = activities + self.days_off = days_off + + +class DeliveryViewData(PlanViewData): + """ + Data contract for Data of Delivery View + + :param id: + :type id: str + :param revision: + :type revision: int + :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 child_id_to_parent_id_map: Work item child id to parent id map + :type child_id_to_parent_id_map: dict + :param max_expanded_teams: Max number of teams that can be configured for a delivery plan + :type max_expanded_teams: int + :param parent_item_maps: Mapping between parent id, title and all the child work item ids + :type parent_item_maps: list of :class:`ParentChildWIMap ` + :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 ` + :param work_item_dependencies: List of all work item ids that have a dependency but not a violation + :type work_item_dependencies: list of int + :param work_item_violations: List of all work item ids that have a violation + :type work_item_violations: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'criteria_status': {'key': 'criteriaStatus', 'type': 'TimelineCriteriaStatus'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'child_id_to_parent_id_map': {'key': 'childIdToParentIdMap', 'type': '{int}'}, + 'max_expanded_teams': {'key': 'maxExpandedTeams', 'type': 'int'}, + 'parent_item_maps': {'key': 'parentItemMaps', 'type': '[ParentChildWIMap]'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'teams': {'key': 'teams', 'type': '[TimelineTeamData]'}, + 'work_item_dependencies': {'key': 'workItemDependencies', 'type': '[int]'}, + 'work_item_violations': {'key': 'workItemViolations', 'type': '[int]'} + } + + def __init__(self, id=None, revision=None, criteria_status=None, end_date=None, child_id_to_parent_id_map=None, max_expanded_teams=None, parent_item_maps=None, start_date=None, teams=None, work_item_dependencies=None, work_item_violations=None): + super(DeliveryViewData, self).__init__(id=id, revision=revision) + self.criteria_status = criteria_status + self.end_date = end_date + self.child_id_to_parent_id_map = child_id_to_parent_id_map + self.max_expanded_teams = max_expanded_teams + self.parent_item_maps = parent_item_maps + self.start_date = start_date + self.teams = teams + self.work_item_dependencies = work_item_dependencies + self.work_item_violations = work_item_violations + + +class IterationWorkItems(TeamSettingsDataContractBase): + """ + Represents work items in an iteration backlog + + :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): + """ + Essentially a collection of team field values + + :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(CapacityContractBase): + """ + Represents capacity for a specific team member + + :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, activities=activities, days_off=days_off) + self.team_member = team_member + + +class TeamMemberCapacityIdentityRef(CapacityContractBase): + """ + Represents capacity for a specific team member + + :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: Identity ref of the associated team member + :type team_member: :class:`IdentityRef ` + """ + + _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': 'IdentityRef'} + } + + def __init__(self, _links=None, url=None, activities=None, days_off=None, team_member=None): + super(TeamMemberCapacityIdentityRef, self).__init__(_links=_links, url=url, activities=activities, days_off=days_off) + self.team_member = team_member + + +class TeamSetting(TeamSettingsDataContractBase): + """ + Data contract for TeamSettings + + :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 WorkItemCommentVersionRef(WorkItemTrackingResourceReference): + """ + Represents the reference to a specific version of a comment on a Work Item. + + :param url: + :type url: str + :param comment_id: The id assigned to the comment. + :type comment_id: int + :param created_in_revision: [Internal] The work item revision where this comment was originally added. + :type created_in_revision: int + :param is_deleted: [Internal] Specifies whether comment was deleted. + :type is_deleted: bool + :param text: [Internal] The text of the comment. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'created_in_revision': {'key': 'createdInRevision', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, comment_id=None, created_in_revision=None, is_deleted=None, text=None, version=None): + super(WorkItemCommentVersionRef, self).__init__(url=url) + self.comment_id = comment_id + self.created_in_revision = created_in_revision + self.is_deleted = is_deleted + self.text = text + self.version = version + + +class WorkItemTrackingResource(WorkItemTrackingResourceReference): + """ + Base class for WIT REST resources. + + :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): + """ + Describes a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_version_ref: Reference to a specific version of the comment added/edited/deleted in this revision. + :type comment_version_ref: :class:`WorkItemCommentVersionRef ` + :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'}, + 'comment_version_ref': {'key': 'commentVersionRef', 'type': 'WorkItemCommentVersionRef'}, + '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, comment_version_ref=None, fields=None, id=None, relations=None, rev=None): + super(WorkItem, self).__init__(url=url, _links=_links) + self.comment_version_ref = comment_version_ref + self.fields = fields + self.id = id + self.relations = relations + self.rev = rev + + +__all__ = [ + 'Activity', + 'BacklogColumn', + 'BacklogConfiguration', + 'BacklogFields', + 'BacklogLevel', + 'BacklogLevelConfiguration', + 'BacklogLevelWorkItems', + 'BoardBadge', + 'BoardCardRuleSettings', + 'BoardCardSettings', + 'BoardColumn', + 'BoardFields', + 'BoardChartReference', + 'BoardReference', + 'BoardRow', + 'BoardSuggestedValue', + 'BoardUserSettings', + 'CapacityPatch', + 'CategoryConfiguration', + 'CreatePlan', + 'DateRange', + 'FieldReference', + 'FilterClause', + 'GraphSubjectBase', + 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', + 'Link', + 'Member', + 'ParentChildWIMap', + 'Plan', + 'PlanViewData', + 'PredefinedQuery', + 'ProcessConfiguration', + 'ReferenceLinks', + 'ReorderOperation', + 'ReorderResult', + 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', + 'TeamContext', + 'TeamFieldValue', + 'TeamFieldValuesPatch', + 'TeamIterationAttributes', + 'TeamSettingsDataContractBase', + 'TeamSettingsDaysOff', + 'TeamSettingsDaysOffPatch', + 'TeamSettingsIteration', + 'TeamSettingsPatch', + 'TimelineCriteriaStatus', + 'TimelineIterationStatus', + 'TimelineTeamData', + 'TimelineTeamIteration', + 'TimelineTeamStatus', + 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', + 'WorkItemColor', + 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeReference', + 'WorkItemTypeStateInfo', + 'Board', + 'BoardChart', + 'CapacityContractBase', + 'DeliveryViewData', + 'IterationWorkItems', + 'TeamFieldValues', + 'TeamMemberCapacity', + 'TeamMemberCapacityIdentityRef', + 'TeamSetting', + 'WorkItemCommentVersionRef', + 'WorkItemTrackingResource', + 'WorkItem', +] diff --git a/azure-devops/azure/devops/v7_0/work/work_client.py b/azure-devops/azure/devops/v7_0/work/work_client.py new file mode 100644 index 00000000..0ba0e6f8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work/work_client.py @@ -0,0 +1,1644 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.0', + route_values=route_values) + return self._deserialize('BacklogConfiguration', response) + + def get_backlog_level_work_items(self, team_context, backlog_id): + """GetBacklogLevelWorkItems. + 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='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelWorkItems', response) + + def get_backlog(self, team_context, id): + """GetBacklog. + 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='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelConfiguration', response) + + def get_backlogs(self, team_context): + """GetBacklogs. + 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='7.0', + 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='7.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. + 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='7.0', + 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='7.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='7.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='7.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='7.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. + 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='7.0', + route_values=route_values) + return self._deserialize('BoardUserSettings', response) + + def update_board_user_settings(self, board_user_settings, team_context, board): + """UpdateBoardUserSettings. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardUserSettings', response) + + def get_capacities_with_identity_ref_and_totals(self, team_context, iteration_id): + """GetCapacitiesWithIdentityRefAndTotals. + Get a team's capacity including total capacity and days off + :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='74412d15-8c1a-4352-a48d-ef1ed5587d57', + version='7.0', + route_values=route_values) + return self._deserialize('TeamCapacity', 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='7.0', + 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='7.0', + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardCardRuleSettings', response) + + def update_taskboard_card_rule_settings(self, board_card_rule_settings, team_context): + """UpdateTaskboardCardRuleSettings. + Update taskboard card Rule settings + :param :class:` ` board_card_rule_settings: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_rule_settings, 'BoardCardRuleSettings') + self._send(http_method='PATCH', + location_id='3f84a8d1-1aab-423e-a94b-6dcbdcca511f', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardCardSettings', response) + + def update_taskboard_card_settings(self, board_card_settings_to_save, team_context): + """UpdateTaskboardCardSettings. + Update taskboard card settings + :param :class:` ` board_card_settings_to_save: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_settings_to_save, 'BoardCardSettings') + self._send(http_method='PUT', + location_id='0d63745f-31f3-4cf3-9056-2a064e567637', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeliveryViewData', 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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardChart', response) + + def get_total_iteration_capacities(self, project, iteration_id): + """GetTotalIterationCapacities. + Get an iteration's capacity for all teams in iteration + :param str project: Project ID or project name + :param str iteration_id: ID of the iteration + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='1e385ce0-396b-4273-8171-d64562c18d37', + version='7.0', + route_values=route_values) + return self._deserialize('IterationCapacity', 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Plan', response) + + def get_process_configuration(self, project): + """GetProcessConfiguration. + 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='7.0', + 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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('[BoardRow]', self._unwrap_collection(response)) + + def get_columns(self, team_context): + """GetColumns. + :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='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values) + return self._deserialize('TaskboardColumns', response) + + def update_columns(self, update_columns, team_context): + """UpdateColumns. + :param [UpdateTaskboardColumn] update_columns: + :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(update_columns, '[UpdateTaskboardColumn]') + response = self._send(http_method='PUT', + location_id='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskboardColumns', response) + + def get_work_item_columns(self, team_context, iteration_id): + """GetWorkItemColumns. + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :rtype: [TaskboardWorkItemColumn] + """ + 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='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskboardWorkItemColumn]', self._unwrap_collection(response)) + + def update_work_item_column(self, update_column, team_context, iteration_id, work_item_id): + """UpdateWorkItemColumn. + :param :class:` ` update_column: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :param int work_item_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 iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(update_column, 'UpdateTaskboardWorkItemColumn') + self._send(http_method='PATCH', + location_id='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values, + content=content) + + 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='7.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 containing 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('TeamSetting', response) + + def get_iteration_work_items(self, team_context, iteration_id): + """GetIterationWorkItems. + 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='7.0', + route_values=route_values) + return self._deserialize('IterationWorkItems', response) + + def reorder_backlog_work_items(self, operation, team_context): + """ReorderBacklogWorkItems. + Reorder Product Backlog/Boards Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='1c22b714-e7e4-41b9-85e0-56ee13ef55ed', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + + def reorder_iteration_work_items(self, operation, team_context, iteration_id): + """ReorderIterationWorkItems. + Reorder Sprint Backlog/Taskboard Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: The id of the iteration + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='47755db2-d7eb-405a-8c25-675401525fc9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking/__init__.py b/azure-devops/azure/devops/v7_0/work_item_tracking/__init__.py new file mode 100644 index 00000000..6ed6dec4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking/__init__.py @@ -0,0 +1,103 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'AccountRecentActivityWorkItemModel2', + 'AccountRecentActivityWorkItemModelBase', + 'AccountRecentMentionWorkItemModel', + 'AccountWorkWorkItemModel', + 'ArtifactUriQuery', + 'ArtifactUriQueryResult', + 'AttachmentReference', + 'Comment', + 'CommentCreate', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentUpdate', + 'CommentVersion', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', + 'FieldDependentRule', + 'GraphSubjectBase', + 'IdentityRef', + 'IdentityReference', + 'JsonPatchOperation', + 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', + 'ProjectWorkItemStateColors', + 'ProvisioningResult', + 'QueryBatchGetRequest', + 'QueryHierarchyItem', + 'QueryHierarchyItemsResult', + 'ReferenceLinks', + 'ReportingWorkItemLinksBatch', + 'ReportingWorkItemRevisionsBatch', + 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', + 'StreamedBatch', + 'TeamContext', + 'UpdateWorkItemField', + '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', + 'WorkItemTagDefinition', + 'WorkItemTemplate', + 'WorkItemTemplateReference', + 'WorkItemTrackingReference', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemType', + 'WorkItemTypeCategory', + 'WorkItemTypeColor', + 'WorkItemTypeColorAndIcon', + 'WorkItemTypeFieldInstance', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', + 'WorkItemTypeReference', + 'WorkItemTypeStateColors', + 'WorkItemTypeTemplate', + 'WorkItemTypeTemplateUpdateModel', + 'WorkItemUpdate', + 'WorkItemTrackingClient' +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking/models.py b/azure-devops/azure/devops/v7_0/work_item_tracking/models.py new file mode 100644 index 00000000..51b646d7 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking/models.py @@ -0,0 +1,2939 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 AccountRecentActivityWorkItemModelBase(Model): + """ + Represents Work Item Recent Activity + + :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 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'}, + '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, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None): + super(AccountRecentActivityWorkItemModelBase, self).__init__() + self.activity_date = activity_date + self.activity_type = activity_type + 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): + """ + Represents Recent Mention Work Item + + :param assigned_to: Assigned To + :type assigned_to: str + :param id: Work Item Id + :type id: int + :param mentioned_date_field: Latest 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): + """ + :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): + """ + Contains criteria for querying work items based on artifact URI. + + :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): + """ + Defines result of artifact URI query on work items. Contains mapping of work item IDs to artifact URI. + + :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): + """ + :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 CommentCreate(Model): + """ + Represents a request to create a work item comment. + + :param text: The text of the comment. + :type text: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, text=None): + super(CommentCreate, self).__init__() + self.text = text + + +class CommentUpdate(Model): + """ + Represents a request to update a work item comment. + + :param text: The updated text of the comment. + :type text: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, text=None): + super(CommentUpdate, self).__init__() + self.text = text + + +class EmailRecipients(Model): + """ + :param email_addresses: Plaintext email addresses. + :type email_addresses: list of str + :param tf_ids: TfIds + :type tf_ids: list of str + :param unresolved_entity_ids: Unresolved entity ids + :type unresolved_entity_ids: list of str + """ + + _attribute_map = { + 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, + 'tf_ids': {'key': 'tfIds', 'type': '[str]'}, + 'unresolved_entity_ids': {'key': 'unresolvedEntityIds', 'type': '[str]'} + } + + def __init__(self, email_addresses=None, tf_ids=None, unresolved_entity_ids=None): + super(EmailRecipients, self).__init__() + self.email_addresses = email_addresses + self.tf_ids = tf_ids + self.unresolved_entity_ids = unresolved_entity_ids + + +class ExternalDeployment(Model): + """ + :param artifact_id: + :type artifact_id: str + :param created_by: + :type created_by: str + :param description: + :type description: str + :param display_name: + :type display_name: str + :param environment: + :type environment: :class:`ExternalEnvironment ` + :param group: + :type group: str + :param pipeline: + :type pipeline: :class:`ExternalPipeline ` + :param related_work_item_ids: + :type related_work_item_ids: list of int + :param run_id: + :type run_id: int + :param sequence_number: + :type sequence_number: int + :param status: + :type status: str + :param status_date: + :type status_date: datetime + :param url: + :type url: str + """ + + _attribute_map = { + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'environment': {'key': 'environment', 'type': 'ExternalEnvironment'}, + 'group': {'key': 'group', 'type': 'str'}, + 'pipeline': {'key': 'pipeline', 'type': 'ExternalPipeline'}, + 'related_work_item_ids': {'key': 'relatedWorkItemIds', 'type': '[int]'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, artifact_id=None, created_by=None, description=None, display_name=None, environment=None, group=None, pipeline=None, related_work_item_ids=None, run_id=None, sequence_number=None, status=None, status_date=None, url=None): + super(ExternalDeployment, self).__init__() + self.artifact_id = artifact_id + self.created_by = created_by + self.description = description + self.display_name = display_name + self.environment = environment + self.group = group + self.pipeline = pipeline + self.related_work_item_ids = related_work_item_ids + self.run_id = run_id + self.sequence_number = sequence_number + self.status = status + self.status_date = status_date + self.url = url + + +class ExternalEnvironment(Model): + """ + :param display_name: + :type display_name: str + :param id: + :type id: int + :param type: + :type type: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, display_name=None, id=None, type=None): + super(ExternalEnvironment, self).__init__() + self.display_name = display_name + self.id = id + self.type = type + + +class ExternalPipeline(Model): + """ + :param display_name: + :type display_name: str + :param id: + :type id: int + :param url: + :type url: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, display_name=None, id=None, url=None): + super(ExternalPipeline, self).__init__() + self.display_name = display_name + self.id = id + self.url = url + + +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 IdentityReference(IdentityRef): + """ + Describes a reference to an identity. + + :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 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 + :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): + """ + 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 Link(Model): + """ + Link description. + + :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 MailMessage(Model): + """ + :param body: The mail body in HTML format. + :type body: str + :param cc: CC recipients. + :type cc: :class:`EmailRecipients ` + :param in_reply_to: The in-reply-to header value + :type in_reply_to: str + :param message_id: The Message Id value + :type message_id: str + :param reply_to: Reply To recipients. + :type reply_to: :class:`EmailRecipients ` + :param subject: The mail subject. + :type subject: str + :param to: To recipients + :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_to': {'key': 'replyTo', 'type': 'EmailRecipients'}, + '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_to=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_to = reply_to + self.subject = subject + self.to = to + + +class ProcessIdModel(Model): + """ + Stores process ID. + + :param type_id: The ID of the process. + :type type_id: str + """ + + _attribute_map = { + 'type_id': {'key': 'typeId', 'type': 'str'} + } + + def __init__(self, type_id=None): + super(ProcessIdModel, self).__init__() + self.type_id = type_id + + +class ProcessMigrationResultModel(Model): + """ + Stores project ID and its process ID. + + :param process_id: The ID of the process. + :type process_id: str + :param project_id: The ID of the project. + :type project_id: str + """ + + _attribute_map = { + 'process_id': {'key': 'processId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'} + } + + def __init__(self, process_id=None, project_id=None): + super(ProcessMigrationResultModel, self).__init__() + self.process_id = process_id + self.project_id = project_id + + +class ProjectWorkItemStateColors(Model): + """ + Project work item type state colors + + :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): + """ + Result of an update work item type XML update operation. + + :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): + """ + Describes a request to get a list of queries + + :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): + """ + :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): + """ + 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 ReportingWorkItemRevisionsFilter(Model): + """ + The class represents the reporting work item revision filer. + + :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 SendMailBody(Model): + """ + :param fields: + :type fields: list of str + :param ids: + :type ids: list of int + :param message: + :type message: :class:`MailMessage ` + :param persistence_id: + :type persistence_id: str + :param project_id: + :type project_id: str + :param sort_fields: + :type sort_fields: list of str + :param temp_query_id: + :type temp_query_id: str + :param wiql: + :type wiql: str + """ + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[str]'}, + 'ids': {'key': 'ids', 'type': '[int]'}, + 'message': {'key': 'message', 'type': 'MailMessage'}, + 'persistence_id': {'key': 'persistenceId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'sort_fields': {'key': 'sortFields', 'type': '[str]'}, + 'temp_query_id': {'key': 'tempQueryId', 'type': 'str'}, + 'wiql': {'key': 'wiql', 'type': 'str'} + } + + def __init__(self, fields=None, ids=None, message=None, persistence_id=None, project_id=None, sort_fields=None, temp_query_id=None, wiql=None): + super(SendMailBody, self).__init__() + self.fields = fields + self.ids = ids + self.message = message + self.persistence_id = persistence_id + self.project_id = project_id + self.sort_fields = sort_fields + self.temp_query_id = temp_query_id + self.wiql = wiql + + +class StreamedBatch(Model): + """ + The class describes reporting work item revision batch. + + :param continuation_token: ContinuationToken acts as a waterMark. Used while querying large results. + :type continuation_token: str + :param is_last_batch: Returns 'true' if it's last batch, 'false' otherwise. + :type is_last_batch: bool + :param next_link: The next link for the work item. + :type next_link: str + :param values: Values such as rel, sourceId, TargetId, ChangedDate, isActive. + :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): + """ + The Team Context for an operation. + + :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 UpdateWorkItemField(Model): + """ + Describes an update request for a work item field. + + :param is_deleted: Indicates whether the user wants to restore the field. + :type is_deleted: bool + """ + + _attribute_map = { + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'} + } + + def __init__(self, is_deleted=None): + super(UpdateWorkItemField, self).__init__() + self.is_deleted = is_deleted + + +class Wiql(Model): + """ + A WIQL query + + :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): + """ + A work artifact link describes an outbound artifact link type. + + :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): + """ + Describes a request to get a set of work items + + :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): + """ + Reference to a deleted work item. + + :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): + """ + Shallow Reference to a deleted work item. + + :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): + """ + Describes an update request for a deleted work item. + + :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): + """ + Describes a work item field operation. + + :param name: Friendly 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): + """ + Reference to a field in a work item + + :param name: The friendly 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): + """ + Describes an update to a work item field. + + :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): + """ + Reference to a work item icon. + + :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): + """ + A link between two work items. + + :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): + """ + Describes the next state for a work item. + + :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): + """ + Represents a clause in a work item query. This shows the structure of a work item query. + + :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): + """ + The result of a work item query. + + :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): + """ + A sort column. + + :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): + """ + Contains reference to a work item. + + :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): + """ + :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): + """ + Describes updates to a work item's relations. + + :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): + """ + Work item type state name, color and state category + + :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): + """ + Describes a state transition in a work item. + + :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 WorkItemTagDefinition(Model): + """ + :param id: + :type id: str + :param name: + :type name: str + :param 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(WorkItemTagDefinition, self).__init__() + self.id = id + self.name = name + self.url = url + + +class WorkItemTrackingResourceReference(Model): + """ + Base class for work item tracking resource references. + + :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): + """ + Describes a work item type's colors. + + :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): + """ + Describes work item type nam, its icon and color. + + :param color: The color of the work item type in hex format. + :type color: str + :param icon: The 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): + """ + Base field instance for workItemType fields. + + :param name: The friendly 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): + """ + Field Instance of a workItemype with detailed references. + + :param name: The friendly 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): + """ + Reference to a work item type. + + :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): + """ + State colors for a work item type + + :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): + """ + Describes a work item type template. + + :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): + """ + Describes a update work item type template request body. + + :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 AccountRecentActivityWorkItemModel(AccountRecentActivityWorkItemModelBase): + """ + Represents Work Item Recent Activity + + :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 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 + :param assigned_to: Assigned To + :type assigned_to: str + """ + + _attribute_map = { + 'activity_date': {'key': 'activityDate', 'type': 'iso-8601'}, + 'activity_type': {'key': 'activityType', 'type': 'object'}, + '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'}, + 'assigned_to': {'key': 'assignedTo', 'type': 'str'} + } + + def __init__(self, activity_date=None, activity_type=None, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None, assigned_to=None): + super(AccountRecentActivityWorkItemModel, self).__init__(activity_date=activity_date, activity_type=activity_type, changed_date=changed_date, id=id, identity_id=identity_id, state=state, team_project=team_project, title=title, work_item_type=work_item_type) + self.assigned_to = assigned_to + + +class AccountRecentActivityWorkItemModel2(AccountRecentActivityWorkItemModelBase): + """ + Represents Work Item Recent Activity + + :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 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 + :param assigned_to: Assigned To + :type assigned_to: :class:`IdentityRef ` + """ + + _attribute_map = { + 'activity_date': {'key': 'activityDate', 'type': 'iso-8601'}, + 'activity_type': {'key': 'activityType', 'type': 'object'}, + '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'}, + 'assigned_to': {'key': 'assignedTo', 'type': 'IdentityRef'} + } + + def __init__(self, activity_date=None, activity_type=None, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None, assigned_to=None): + super(AccountRecentActivityWorkItemModel2, self).__init__(activity_date=activity_date, activity_type=activity_type, changed_date=changed_date, id=id, identity_id=identity_id, state=state, team_project=team_project, title=title, work_item_type=work_item_type) + self.assigned_to = assigned_to + + +class ReportingWorkItemLinksBatch(StreamedBatch): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(ReportingWorkItemLinksBatch, self).__init__() + + +class ReportingWorkItemRevisionsBatch(StreamedBatch): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(ReportingWorkItemRevisionsBatch, self).__init__() + + +class WorkItemCommentVersionRef(WorkItemTrackingResourceReference): + """ + Represents the reference to a specific version of a comment on a Work Item. + + :param url: + :type url: str + :param comment_id: The id assigned to the comment. + :type comment_id: int + :param created_in_revision: [Internal] The work item revision where this comment was originally added. + :type created_in_revision: int + :param is_deleted: [Internal] Specifies whether comment was deleted. + :type is_deleted: bool + :param text: [Internal] The text of the comment. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'created_in_revision': {'key': 'createdInRevision', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, comment_id=None, created_in_revision=None, is_deleted=None, text=None, version=None): + super(WorkItemCommentVersionRef, self).__init__(url=url) + self.comment_id = comment_id + self.created_in_revision = created_in_revision + self.is_deleted = is_deleted + self.text = text + self.version = version + + +class WorkItemDelete(WorkItemDeleteReference): + """ + Full deleted work item object. Includes the work item itself. + + :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): + """ + Base class for WIT REST resources. + + :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): + """ + Describes a work item type. + + :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): + """ + Describes a work item type category. + + :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 belong 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): + """ + Field instance of a work item type. + + :param name: The friendly 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): + """ + Describes an update to a work item. + + :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 Comment(WorkItemTrackingResource): + """ + Comment on a Work Item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param created_on_behalf_date: Effective Date/time value for adding the comment. Can be optionally different from CreatedDate. + :type created_on_behalf_date: datetime + :param created_on_behalf_of: Identity on whose behalf this comment has been added. Can be optionally different from CreatedBy. + :type created_on_behalf_of: :class:`IdentityRef ` + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted. + :type is_deleted: bool + :param mentions: The mentions of the comment. + :type mentions: list of :class:`CommentMention ` + :param modified_by: IdentityRef of the user who last modified the comment. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The last modification date of the comment. + :type modified_date: datetime + :param reactions: The reactions of the comment. + :type reactions: list of :class:`CommentReaction ` + :param text: The text of the comment. + :type text: str + :param version: The current version of the comment. + :type version: int + :param work_item_id: The id of the work item this comment belongs to. + :type work_item_id: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'created_on_behalf_date': {'key': 'createdOnBehalfDate', 'type': 'iso-8601'}, + 'created_on_behalf_of': {'key': 'createdOnBehalfOf', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'mentions': {'key': 'mentions', 'type': '[CommentMention]'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'reactions': {'key': 'reactions', 'type': '[CommentReaction]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + 'work_item_id': {'key': 'workItemId', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, created_by=None, created_date=None, created_on_behalf_date=None, created_on_behalf_of=None, id=None, is_deleted=None, mentions=None, modified_by=None, modified_date=None, reactions=None, text=None, version=None, work_item_id=None): + super(Comment, self).__init__(url=url, _links=_links) + self.created_by = created_by + self.created_date = created_date + self.created_on_behalf_date = created_on_behalf_date + self.created_on_behalf_of = created_on_behalf_of + self.id = id + self.is_deleted = is_deleted + self.mentions = mentions + self.modified_by = modified_by + self.modified_date = modified_date + self.reactions = reactions + self.text = text + self.version = version + self.work_item_id = work_item_id + + +class CommentList(WorkItemTrackingResource): + """ + Represents a list of work item comments. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comments: List of comments in the current batch. + :type comments: list of :class:`Comment ` + :param continuation_token: A string token that can be used to retrieving next page of comments if available. Otherwise null. + :type continuation_token: str + :param count: The count of comments in the current batch. + :type count: int + :param next_page: Uri to the next page of comments if it is available. Otherwise null. + :type next_page: str + :param total_count: Total count of comments on a work item. + :type total_count: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'comments': {'key': 'comments', 'type': '[Comment]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'next_page': {'key': 'nextPage', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, comments=None, continuation_token=None, count=None, next_page=None, total_count=None): + super(CommentList, self).__init__(url=url, _links=_links) + self.comments = comments + self.continuation_token = continuation_token + self.count = count + self.next_page = next_page + self.total_count = total_count + + +class CommentMention(WorkItemTrackingResource): + """ + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param artifact_id: The artifact portion of the parsed text. (i.e. the work item's id) + :type artifact_id: str + :param artifact_type: The type the parser assigned to the mention. (i.e. person, work item, etc) + :type artifact_type: str + :param comment_id: The comment id of the mention. + :type comment_id: int + :param target_id: The resolved target of the mention. An example of this could be a user's tfid + :type target_id: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'target_id': {'key': 'targetId', 'type': 'str'} + } + + def __init__(self, url=None, _links=None, artifact_id=None, artifact_type=None, comment_id=None, target_id=None): + super(CommentMention, self).__init__(url=url, _links=_links) + self.artifact_id = artifact_id + self.artifact_type = artifact_type + self.comment_id = comment_id + self.target_id = target_id + + +class CommentReaction(WorkItemTrackingResource): + """ + Contains information about work item comment reaction for a particular reaction type. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_id: The id of the comment this reaction belongs to. + :type comment_id: int + :param count: Total number of reactions for the CommentReactionType. + :type count: int + :param is_current_user_engaged: Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment). + :type is_current_user_engaged: bool + :param type: Type of the reaction. + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'is_current_user_engaged': {'key': 'isCurrentUserEngaged', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, _links=None, comment_id=None, count=None, is_current_user_engaged=None, type=None): + super(CommentReaction, self).__init__(url=url, _links=_links) + self.comment_id = comment_id + self.count = count + self.is_current_user_engaged = is_current_user_engaged + self.type = type + + +class CommentVersion(WorkItemTrackingResource): + """ + Represents a specific version of a comment on a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param created_on_behalf_date: Effective Date/time value for adding the comment. Can be optionally different from CreatedDate. + :type created_on_behalf_date: datetime + :param created_on_behalf_of: Identity on whose behalf this comment has been added. Can be optionally different from CreatedBy. + :type created_on_behalf_of: :class:`IdentityRef ` + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted at this version. + :type is_deleted: bool + :param modified_by: IdentityRef of the user who modified the comment at this version. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The modification date of the comment for this version. + :type modified_date: datetime + :param rendered_text: The rendered content of the comment at this version. + :type rendered_text: str + :param text: The text of the comment at this version. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'created_on_behalf_date': {'key': 'createdOnBehalfDate', 'type': 'iso-8601'}, + 'created_on_behalf_of': {'key': 'createdOnBehalfOf', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, created_by=None, created_date=None, created_on_behalf_date=None, created_on_behalf_of=None, id=None, is_deleted=None, modified_by=None, modified_date=None, rendered_text=None, text=None, version=None): + super(CommentVersion, self).__init__(url=url, _links=_links) + self.created_by = created_by + self.created_date = created_date + self.created_on_behalf_date = created_on_behalf_date + self.created_on_behalf_of = created_on_behalf_of + self.id = id + self.is_deleted = is_deleted + self.modified_by = modified_by + self.modified_date = modified_date + self.rendered_text = rendered_text + self.text = text + self.version = version + + +class FieldDependentRule(WorkItemTrackingResource): + """ + Describes a list of dependent fields for a rule. + + :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): + """ + Represents an item in the work item query hierarchy. This can be either a query or a folder. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :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 children: The child query items inside a query folder. + :type children: list of :class:`QueryHierarchyItem ` + :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'}, + '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'}, + 'children': {'key': 'children', 'type': '[QueryHierarchyItem]'}, + '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, clauses=None, columns=None, created_by=None, created_date=None, filter_options=None, has_children=None, 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.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.children = 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): + """ + Describes a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_version_ref: Reference to a specific version of the comment added/edited/deleted in this revision. + :type comment_version_ref: :class:`WorkItemCommentVersionRef ` + :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'}, + 'comment_version_ref': {'key': 'commentVersionRef', 'type': 'WorkItemCommentVersionRef'}, + '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, comment_version_ref=None, fields=None, id=None, relations=None, rev=None): + super(WorkItem, self).__init__(url=url, _links=_links) + self.comment_version_ref = comment_version_ref + self.fields = fields + self.id = id + self.relations = relations + self.rev = rev + + +class WorkItemClassificationNode(WorkItemTrackingResource): + """ + Defines a classification node for work item tracking. + + :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 has_children: Flag that indicates if the classification node has any child nodes. + :type has_children: bool + :param children: List of child nodes fetched. + :type children: list of :class:`WorkItemClassificationNode ` + :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 path: Path of the classification node. + :type path: 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}'}, + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[WorkItemClassificationNode]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'identifier': {'key': 'identifier', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'structure_type': {'key': 'structureType', 'type': 'object'} + } + + def __init__(self, url=None, _links=None, attributes=None, has_children=None, children=None, id=None, identifier=None, name=None, path=None, structure_type=None): + super(WorkItemClassificationNode, self).__init__(url=url, _links=_links) + self.attributes = attributes + self.has_children = has_children + self.children = children + self.id = id + self.identifier = identifier + self.name = name + self.path = path + self.structure_type = structure_type + + +class WorkItemComment(WorkItemTrackingResource): + """ + Comment on Work Item + + :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): + """ + Collection of comments. + + :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): + """ + Describes a field on a work item and it's properties specific to that work item type. + + :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_deleted: Indicates whether this field is deleted. + :type is_deleted: bool + :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_deleted': {'key': 'isDeleted', 'type': 'bool'}, + '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_deleted=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_deleted = is_deleted + 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): + """ + :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): + """ + Describes a shallow reference to a work item template. + + :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): + """ + :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): + """ + Represents the work item type relation type. + + :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): + """ + Describes a work item template. + + :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', + 'AccountRecentActivityWorkItemModelBase', + 'AccountRecentMentionWorkItemModel', + 'AccountWorkWorkItemModel', + 'ArtifactUriQuery', + 'ArtifactUriQueryResult', + 'AttachmentReference', + 'CommentCreate', + 'CommentUpdate', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', + 'GraphSubjectBase', + 'IdentityRef', + 'IdentityReference', + 'JsonPatchOperation', + 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', + 'ProjectWorkItemStateColors', + 'ProvisioningResult', + 'QueryBatchGetRequest', + 'QueryHierarchyItemsResult', + 'ReferenceLinks', + 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', + 'StreamedBatch', + 'TeamContext', + 'UpdateWorkItemField', + 'Wiql', + 'WorkArtifactLink', + 'WorkItemBatchGetRequest', + 'WorkItemDeleteReference', + 'WorkItemDeleteShallowReference', + 'WorkItemDeleteUpdate', + 'WorkItemFieldOperation', + 'WorkItemFieldReference', + 'WorkItemFieldUpdate', + 'WorkItemIcon', + 'WorkItemLink', + 'WorkItemNextStateOnTransition', + 'WorkItemQueryClause', + 'WorkItemQueryResult', + 'WorkItemQuerySortColumn', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemRelationUpdates', + 'WorkItemStateColor', + 'WorkItemStateTransition', + 'WorkItemTagDefinition', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeColor', + 'WorkItemTypeColorAndIcon', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', + 'WorkItemTypeReference', + 'WorkItemTypeStateColors', + 'WorkItemTypeTemplate', + 'WorkItemTypeTemplateUpdateModel', + 'AccountRecentActivityWorkItemModel', + 'AccountRecentActivityWorkItemModel2', + 'ReportingWorkItemLinksBatch', + 'ReportingWorkItemRevisionsBatch', + 'WorkItemCommentVersionRef', + 'WorkItemDelete', + 'WorkItemTrackingResource', + 'WorkItemType', + 'WorkItemTypeCategory', + 'WorkItemTypeFieldInstance', + 'WorkItemUpdate', + 'Comment', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentVersion', + 'FieldDependentRule', + 'QueryHierarchyItem', + 'WorkItem', + 'WorkItemClassificationNode', + 'WorkItemComment', + 'WorkItemComments', + 'WorkItemField', + 'WorkItemHistory', + 'WorkItemTemplateReference', + 'WorkItemTrackingReference', + 'WorkItemRelationType', + 'WorkItemTemplate', +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking/work_item_tracking_client.py b/azure-devops/azure/devops/v7_0/work_item_tracking/work_item_tracking_client.py new file mode 100644 index 00000000..50ae3280 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking/work_item_tracking_client.py @@ -0,0 +1,2058 @@ +# -------------------------------------------------------------------------------------------- +# 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_recent_activity_data(self): + """GetRecentActivityData. + Gets recent work item activities + :rtype: [AccountRecentActivityWorkItemModel2] + """ + response = self._send(http_method='GET', + location_id='1bc988f4-c15f-4072-ad35-497c87e3a909', + version='7.0') + return self._deserialize('[AccountRecentActivityWorkItemModel2]', self._unwrap_collection(response)) + + def get_work_artifact_link_types(self): + """GetWorkArtifactLinkTypes. + 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='7.0') + return self._deserialize('[WorkArtifactLink]', self._unwrap_collection(response)) + + def query_work_items_for_artifact_uris(self, artifact_uri_query, project=None): + """QueryWorkItemsForArtifactUris. + 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='7.0', + 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='7.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='7.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='7.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 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemClassificationNode', response) + + def get_engaged_users(self, project, work_item_id, comment_id, reaction_type, top=None, skip=None): + """GetEngagedUsers. + [Preview API] Get users who reacted on the comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID. + :param int comment_id: Comment ID. + :param CommentReactionType reaction_type: Type of the reaction. + :param int top: + :param int skip: + :rtype: [IdentityRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + 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='e33ca5e0-2349-4285-af3d-d72d86781c35', + version='7.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[IdentityRef]', self._unwrap_collection(response)) + + def add_comment(self, request, project, work_item_id): + """AddComment. + [Preview API] Add a comment on a work item. + :param :class:` ` request: Comment create request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(request, 'CommentCreate') + response = self._send(http_method='POST', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values, + content=content) + return self._deserialize('Comment', response) + + def delete_comment(self, project, work_item_id, comment_id): + """DeleteComment. + [Preview API] Delete a comment on a work item. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param int comment_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values) + + def get_comment(self, project, work_item_id, comment_id, include_deleted=None, expand=None): + """GetComment. + [Preview API] Returns a work item comment. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get the comment. + :param int comment_id: Id of the comment to return. + :param bool include_deleted: Specify if the deleted comment should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + query_parameters = {} + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Comment', response) + + def get_comments(self, project, work_item_id, top=None, continuation_token=None, include_deleted=None, expand=None, order=None): + """GetComments. + [Preview API] Returns a list of work item comments, pageable. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get comments for. + :param int top: Max number of comments to return. + :param str continuation_token: Used to query for the next page of comments. + :param bool include_deleted: Specify if the deleted comments should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :param str order: Order in which the comments should be returned. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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') + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + if order is not None: + query_parameters['order'] = self._serialize.query('order', order, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CommentList', response) + + def get_comments_batch(self, project, work_item_id, ids, include_deleted=None, expand=None): + """GetCommentsBatch. + [Preview API] Returns a list of work item comments by ids. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get comments for. + :param [int] ids: Comma-separated list of comment ids to return. + :param bool include_deleted: Specify if the deleted comments should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + query_parameters = {} + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CommentList', response) + + def update_comment(self, request, project, work_item_id, comment_id): + """UpdateComment. + [Preview API] Update a comment on a work item. + :param :class:` ` request: Comment update request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param int comment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + content = self._serialize.body(request, 'CommentUpdate') + response = self._send(http_method='PATCH', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.0-preview.3', + route_values=route_values, + content=content) + return self._deserialize('Comment', response) + + def create_comment_reaction(self, project, work_item_id, comment_id, reaction_type): + """CreateCommentReaction. + [Preview API] Adds a new reaction to a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :param CommentReactionType reaction_type: Type of the reaction + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + response = self._send(http_method='PUT', + location_id='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('CommentReaction', response) + + def delete_comment_reaction(self, project, work_item_id, comment_id, reaction_type): + """DeleteCommentReaction. + [Preview API] Deletes an existing reaction on a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :param CommentReactionType reaction_type: Type of the reaction + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + response = self._send(http_method='DELETE', + location_id='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('CommentReaction', response) + + def get_comment_reactions(self, project, work_item_id, comment_id): + """GetCommentReactions. + [Preview API] Gets reactions of a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :rtype: [CommentReaction] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('[CommentReaction]', self._unwrap_collection(response)) + + def get_comment_version(self, project, work_item_id, comment_id, version): + """GetCommentVersion. + [Preview API] + :param str project: Project ID or project name + :param int work_item_id: + :param int comment_id: + :param int version: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if version is not None: + route_values['version'] = self._serialize.url('version', version, 'int') + response = self._send(http_method='GET', + location_id='49e03b34-3be0-42e3-8a5d-e8dfb88ac954', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('CommentVersion', response) + + def get_comment_versions(self, project, work_item_id, comment_id): + """GetCommentVersions. + [Preview API] + :param str project: Project ID or project name + :param int work_item_id: + :param int comment_id: + :rtype: [CommentVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='49e03b34-3be0-42e3-8a5d-e8dfb88ac954', + version='7.0-preview.1', + route_values=route_values) + return self._deserialize('[CommentVersion]', self._unwrap_collection(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='7.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. To undelete a filed, see "Update Field" API. + :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='7.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='7.0', + route_values=route_values) + return self._deserialize('WorkItemField', response) + + def get_fields(self, project=None, expand=None): + """GetFields. + Returns information for all fields. The project ID/name parameter is optional. + :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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItemField]', self._unwrap_collection(response)) + + def update_field(self, payload, field_name_or_ref_name, project=None): + """UpdateField. + Update a field. + :param :class:` ` payload: Payload contains desired value of the field's properties + :param str field_name_or_ref_name: Name/reference name of the field 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') + 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') + content = self._serialize.body(payload, 'UpdateWorkItemField') + response = self._send(http_method='PATCH', + location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemField', response) + + def migrate_projects_process(self, new_process, project): + """MigrateProjectsProcess. + Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + :param :class:` ` new_process: + :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(new_process, 'ProcessIdModel') + response = self._send(http_method='POST', + location_id='19801631-d4e5-47e9-8166-0330de0ff1e6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessMigrationResultModel', 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='7.0', + 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='7.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='7.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, use_iso_date_format=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 + :param bool use_iso_date_format: DateTime query clauses will be formatted using a ISO 8601 compliant format + :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') + if use_iso_date_format is not None: + query_parameters['$useIsoDateFormat'] = self._serialize.query('use_iso_date_format', use_iso_date_format, 'bool') + response = self._send(http_method='GET', + location_id='a67d190c-c41f-424b-814d-0e906f659301', + version='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + + def send_mail(self, body, project=None): + """SendMail. + RESTful method to send mail for selected/queried work items. + :param :class:` ` body: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(body, 'SendMailBody') + self._send(http_method='POST', + location_id='12438500-2f84-4fa7-9f1a-c31871b4959d', + version='7.0', + route_values=route_values, + content=content) + + def delete_tag(self, project, tag_id_or_name): + """DeleteTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + self._send(http_method='DELETE', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + + def get_tag(self, project, tag_id_or_name): + """GetTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemTagDefinition', response) + + def get_tags(self, project): + """GetTags. + :param str project: Project ID or project name + :rtype: [WorkItemTagDefinition] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemTagDefinition]', self._unwrap_collection(response)) + + def update_tag(self, tag_data, project, tag_id_or_name): + """UpdateTag. + :param :class:` ` tag_data: + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + content = self._serialize.body(tag_data, 'WorkItemTagDefinition') + response = self._send(http_method='PATCH', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTagDefinition', response) + + def create_template(self, template, team_context): + """CreateTemplate. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTemplate', response) + + def get_templates(self, team_context, workitemtypename=None): + """GetTemplates. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_template(self, team_context, template_id): + """GetTemplate. + 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='7.0', + route_values=route_values) + return self._deserialize('WorkItemTemplate', response) + + def replace_template(self, template_content, team_context, template_id): + """ReplaceTemplate. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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. + 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='7.0', + 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='7.0') + 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='7.0', + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ReportingWorkItemRevisionsBatch', response) + + def read_reporting_discussions(self, project=None, continuation_token=None, max_page_size=None): + """ReadReportingDiscussions. + :param str project: Project ID or project name + :param str continuation_token: + :param int max_page_size: + :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 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='4a644469-90c5-4fcc-9a9f-be0827d369ec', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + 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='7.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='7.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. 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='7.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='7.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='7.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, 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='7.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='7.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. + 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='7.0', + 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='7.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='7.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='7.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='7.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='7.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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WorkItemTypeFieldWithReferences', response) + + def get_work_item_type_states(self, project, type): + """GetWorkItemTypeStates. + 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='7.0', + route_values=route_values) + return self._deserialize('[WorkItemStateColor]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process/__init__.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process/__init__.py new file mode 100644 index 00000000..a9e87fd4 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process/models.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process/models.py new file mode 100644 index 00000000..9d59d436 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process/models.py @@ -0,0 +1,1532 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Class that describes a request to add a field in a work item type. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + '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, allowed_values=None, allow_groups=None, default_value=None, read_only=None, reference_name=None, required=None): + super(AddProcessWorkItemTypeFieldRequest, self).__init__() + self.allowed_values = allowed_values + 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): + """ + Represent a control in the form. + + :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): + """ + Describes a process being created. + + :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 process being created. If not specified, server will assign a unique reference name + :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): + """ + Request object/class for creating a rule on a work item type. + + :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): + """ + Class for create work item type request + + :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): + """ + Represents the extensions part of the layout + + :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): + """ + :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): + """ + :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): + """ + Describes the layout of a work item type + + :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): + """ + Represent a group in the form that holds controls in it. + + :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): + """ + Class that describes the work item state is hidden. + + :param hidden: Returns 'true', if workitem state is hidden, 'false' otherwise. + :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): + """ + Describes a page in the work item form layout + + :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): + """ + Metadata for 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 + """ + + _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): + """ + Process Behavior Model. + + :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): + """ + Process Behavior Create Payload. + + :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): + """ + Process Behavior Field. + + :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): + """ + Process behavior Reference. + + :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): + """ + Process Behavior Replace Payload. + + :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): + """ + Process. + + :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): + """ + :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): + """ + Properties of the process. + + :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): + """ + Process Rule Response. + + :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): + """ + Class that describes a work item type object + + :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): + """ + Class that describes a field in a work item type and its properties. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of object + :param allow_groups: Allow setting field value to a group identity. Only applies to identity fields. + :type allow_groups: bool + :param customization: Indicates the type of customization on this work item. + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[object]'}, + '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, allowed_values=None, 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.allowed_values = allowed_values + 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): + """ + Defines the project reference class. + + :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): + """ + Action to take when the rule is triggered. + + :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): + """ + Action to take when the rule is triggered. + + :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): + """ + Defines a condition on a field when the rule should be triggered. + + :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): + """ + :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): + """ + Defines a section of the work item form layout + + :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): + """ + Describes a request to update a process + + :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): + """ + Request class/object to update the rule. + + :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): + """ + Class to describe a request that updates a field's properties in a work item type. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + '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, allowed_values=None, allow_groups=None, default_value=None, read_only=None, required=None): + super(UpdateProcessWorkItemTypeFieldRequest, self).__init__() + self.allowed_values = allowed_values + self.allow_groups = allow_groups + self.default_value = default_value + self.read_only = read_only + self.required = required + + +class UpdateProcessWorkItemTypeRequest(Model): + """ + Class for update request on a work item type + + :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): + """ + Properties of a work item form contribution + + :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): + """ + :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): + """ + :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): + """ + Reference to the behavior of a work item type. + + :param id: The ID of the reference behavior. + :type id: str + :param url: The url of the reference behavior. + :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): + """ + Class That represents a work item state input. + + :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): + """ + Class that represents a work item state result. + + :param color: Work item state color. + :type color: str + :param customization_type: Work item state customization type. + :type customization_type: object + :param hidden: If the Work item state is hidden. + :type hidden: bool + :param id: Id of the Workitemstate. + :type id: str + :param name: Work item state name. + :type name: str + :param order: Work item state order. + :type order: int + :param state_category: Work item state statecategory. + :type state_category: str + :param url: Work item state 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): + """ + Association between a work item type and it's behavior + + :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 is_legacy_default: If true the work item type is the default work item type in the parent behavior + :type is_legacy_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'}, + 'is_legacy_default': {'key': 'isLegacyDefault', 'type': 'bool'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, behavior=None, is_default=None, is_legacy_default=None, url=None): + super(WorkItemTypeBehavior, self).__init__() + self.behavior = behavior + self.is_default = is_default + self.is_legacy_default = is_legacy_default + self.url = url + + +class WorkItemTypeModel(Model): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process/work_item_tracking_process_client.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process/work_item_tracking_process_client.py new file mode 100644 index 00000000..853879e0 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process/work_item_tracking_process_client.py @@ -0,0 +1,1211 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessBehavior', response) + + def delete_process_behavior(self, process_id, behavior_ref_name): + """DeleteProcessBehavior. + 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='7.0', + route_values=route_values) + + def get_process_behavior(self, process_id, behavior_ref_name, expand=None): + """GetProcessBehavior. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessBehavior', response) + + def get_process_behaviors(self, process_id, expand=None): + """GetProcessBehaviors. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_control(self, control, process_id, wit_ref_name, group_id, control_id): + """UpdateControl. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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, expand=None): + """GetWorkItemTypeField. + 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. + :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 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessWorkItemTypeField', response) + + def remove_work_item_type_field(self, process_id, wit_ref_name, field_ref_name): + """RemoveWorkItemTypeField. + 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='7.0', + route_values=route_values) + + def update_work_item_type_field(self, field, process_id, wit_ref_name, field_ref_name): + """UpdateWorkItemTypeField. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_group(self, group, process_id, wit_ref_name, page_id, section_id, group_id): + """UpdateGroup. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Group', response) + + def get_form_layout(self, process_id, wit_ref_name): + """GetFormLayout. + 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='7.0', + route_values=route_values) + return self._deserialize('FormLayout', response) + + def create_list(self, picklist): + """CreateList. + 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='7.0', + content=content) + return self._deserialize('PickList', response) + + def delete_list(self, list_id): + """DeleteList. + 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='7.0', + route_values=route_values) + + def get_list(self, list_id): + """GetList. + 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='7.0', + route_values=route_values) + return self._deserialize('PickList', response) + + def get_lists_metadata(self): + """GetListsMetadata. + Returns meta data of the picklist. + :rtype: [PickListMetadata] + """ + response = self._send(http_method='GET', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0') + return self._deserialize('[PickListMetadata]', self._unwrap_collection(response)) + + def update_list(self, picklist, list_id): + """UpdateList. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('PickList', response) + + def add_page(self, page, process_id, wit_ref_name): + """AddPage. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def remove_page(self, process_id, wit_ref_name, page_id): + """RemovePage. + 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='7.0', + route_values=route_values) + + def update_page(self, page, process_id, wit_ref_name): + """UpdatePage. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def create_new_process(self, create_request): + """CreateNewProcess. + 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='7.0', + content=content) + return self._deserialize('ProcessInfo', response) + + def delete_process_by_id(self, process_type_id): + """DeleteProcessById. + 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='7.0', + route_values=route_values) + + def edit_process(self, update_request, process_type_id): + """EditProcess. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessInfo', response) + + def get_list_of_processes(self, expand=None): + """GetListOfProcesses. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def get_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): + """GetProcessWorkItemTypeRule. + 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='7.0', + route_values=route_values) + return self._deserialize('ProcessRule', response) + + def get_process_work_item_type_rules(self, process_id, wit_ref_name): + """GetProcessWorkItemTypeRules. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessRule', response) + + def create_state_definition(self, state_model, process_id, wit_ref_name): + """CreateStateDefinition. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_state_definition(self, process_id, wit_ref_name, state_id): + """DeleteStateDefinition. + 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='7.0', + route_values=route_values) + + def get_state_definition(self, process_id, wit_ref_name, state_id): + """GetStateDefinition. + 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='7.0', + route_values=route_values) + return self._deserialize('WorkItemStateResultModel', response) + + def get_state_definitions(self, process_id, wit_ref_name): + """GetStateDefinitions. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_system_control(self, process_id, wit_ref_name, control_id): + """DeleteSystemControl. + Deletes a system control modification on 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 control_id: The ID of the control. + :rtype: [Control] + """ + 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 control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + response = self._send(http_method='DELETE', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def get_system_controls(self, process_id, wit_ref_name): + """GetSystemControls. + Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: [Control] + """ + 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def update_system_control(self, control, process_id, wit_ref_name, control_id): + """UpdateSystemControl. + Updates/adds a system control on the work item form. + :param :class:` ` 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 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 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Control', response) + + def create_process_work_item_type(self, work_item_type, process_id): + """CreateProcessWorkItemType. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemType', response) + + def delete_process_work_item_type(self, process_id, wit_ref_name): + """DeleteProcessWorkItemType. + 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='7.0', + route_values=route_values) + + def get_process_work_item_type(self, process_id, wit_ref_name, expand=None): + """GetProcessWorkItemType. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + 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. + 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='7.0', + route_values=route_values) + + def update_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): + """UpdateBehaviorToWorkItemType. + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTypeBehavior', response) + diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/__init__.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/__init__.py new file mode 100644 index 00000000..5d045cd8 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/__init__.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/models.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/models.py new file mode 100644 index 00000000..4d2edd0d --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/models.py @@ -0,0 +1,231 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Describes an admin behavior for a process. + + :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): + """ + Describes an admin behavior field. + + :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): + """ + Describes result of a check template existence request. + + :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): + """ + Describes the result of a Process Import request. + + :param help_url: Help URL. + :type help_url: str + :param check_existence_result: Check template existence result. + :type check_existence_result: :class:`CheckTemplateExistenceResult ` + :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'}, + 'check_existence_result': {'key': 'checkExistenceResult', 'type': 'CheckTemplateExistenceResult'}, + '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, check_existence_result=None, id=None, is_new=None, promote_job_id=None, validation_results=None): + super(ProcessImportResult, self).__init__() + self.help_url = help_url + self.check_existence_result = check_existence_result + self.id = id + self.is_new = is_new + self.promote_job_id = promote_job_id + self.validation_results = validation_results + + +class ProcessPromoteStatus(Model): + """ + Describes result of process operation promote. + + :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 associated 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 in progress 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/work_item_tracking_process_template_client.py b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/work_item_tracking_process_template_client.py new file mode 100644 index 00000000..c482fc29 --- /dev/null +++ b/azure-devops/azure/devops/v7_0/work_item_tracking_process_template/work_item_tracking_process_template_client.py @@ -0,0 +1,128 @@ +# -------------------------------------------------------------------------------------------- +# 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('AdminBehavior', response) + + def get_behaviors(self, process_id): + """GetBehaviors. + 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='7.0', + route_values=route_values) + return self._deserialize('[AdminBehavior]', self._unwrap_collection(response)) + + def export_process_template(self, id, **kwargs): + """ExportProcessTemplate. + 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='7.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 import_process_template(self, upload_stream, ignore_warnings=None, replace_existing_template=None, **kwargs): + """ImportProcessTemplate. + Imports a process from zip file. + :param object upload_stream: Stream to upload + :param bool ignore_warnings: Ignores validation warnings. Default value is false. + :param bool replace_existing_template: Replaces the existing template. Default value is true. + :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 replace_existing_template is not None: + query_parameters['replaceExistingTemplate'] = self._serialize.query('replace_existing_template', replace_existing_template, '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='7.0', + 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. + 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='7.0', + route_values=route_values) + return self._deserialize('ProcessPromoteStatus', response) + diff --git a/azure-devops/azure/devops/v7_1/__init__.py b/azure-devops/azure/devops/v7_1/__init__.py new file mode 100644 index 00000000..f885a96e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------------------------- diff --git a/azure-devops/azure/devops/v7_1/accounts/__init__.py b/azure-devops/azure/devops/v7_1/accounts/__init__.py new file mode 100644 index 00000000..7b1322e4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/accounts/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/accounts/accounts_client.py b/azure-devops/azure/devops/v7_1/accounts/accounts_client.py new file mode 100644 index 00000000..024e5b23 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/accounts/accounts_client.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId. + :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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[Account]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/accounts/models.py b/azure-devops/azure/devops/v7_1/accounts/models.py new file mode 100644 index 00000000..1703acc7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/accounts/models.py @@ -0,0 +1,149 @@ +# -------------------------------------------------------------------------------------------- +# 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', +] diff --git a/azure-devops/azure/devops/v7_1/audit/__init__.py b/azure-devops/azure/devops/v7_1/audit/__init__.py new file mode 100644 index 00000000..419e92ab --- /dev/null +++ b/azure-devops/azure/devops/v7_1/audit/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AuditActionInfo', + 'AuditLogEntry', + 'AuditLogQueryResult', + 'AuditStream', + 'DecoratedAuditLogEntry', + 'AuditClient' +] diff --git a/azure-devops/azure/devops/v7_1/audit/audit_client.py b/azure-devops/azure/devops/v7_1/audit/audit_client.py new file mode 100644 index 00000000..b8bd1ae3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/audit/audit_client.py @@ -0,0 +1,184 @@ +# -------------------------------------------------------------------------------------------- +# 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 get_actions(self, area_name=None): + """GetActions. + [Preview API] Get all auditable actions filterable by area. + :param str area_name: Optional. Get actions scoped to area + :rtype: [AuditActionInfo] + """ + query_parameters = {} + if area_name is not None: + query_parameters['areaName'] = self._serialize.query('area_name', area_name, 'str') + response = self._send(http_method='GET', + location_id='6fa30b9a-9558-4e3b-a95f-a12572caa6e6', + version='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[AuditActionInfo]', self._unwrap_collection(response)) + + 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='7.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='7.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) + + def create_stream(self, stream, days_to_backfill): + """CreateStream. + [Preview API] Create new Audit Stream + :param :class:` ` stream: Stream entry + :param int days_to_backfill: The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed. + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_backfill is not None: + query_parameters['daysToBackfill'] = self._serialize.query('days_to_backfill', days_to_backfill, 'int') + content = self._serialize.body(stream, 'AuditStream') + response = self._send(http_method='POST', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('AuditStream', response) + + def delete_stream(self, stream_id): + """DeleteStream. + [Preview API] Delete Audit Stream + :param int stream_id: Id of stream entry to delete + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + self._send(http_method='DELETE', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1', + route_values=route_values) + + def query_all_streams(self): + """QueryAllStreams. + [Preview API] Return all Audit Streams scoped to an organization + :rtype: [AuditStream] + """ + response = self._send(http_method='GET', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1') + return self._deserialize('[AuditStream]', self._unwrap_collection(response)) + + def query_stream_by_id(self, stream_id): + """QueryStreamById. + [Preview API] Return Audit Stream with id of streamId if one exists otherwise throw + :param int stream_id: Id of stream entry to retrieve + :rtype: :class:` ` + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + response = self._send(http_method='GET', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('AuditStream', response) + + def update_status(self, stream_id, status): + """UpdateStatus. + [Preview API] Update existing Audit Stream status + :param int stream_id: Id of stream entry to be updated + :param str status: Status of the stream + :rtype: :class:` ` + """ + route_values = {} + if stream_id is not None: + route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') + query_parameters = {} + if status is not None: + query_parameters['status'] = self._serialize.query('status', status, 'str') + response = self._send(http_method='PUT', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('AuditStream', response) + + def update_stream(self, stream): + """UpdateStream. + [Preview API] Update existing Audit Stream + :param :class:` ` stream: Stream entry + :rtype: :class:` ` + """ + content = self._serialize.body(stream, 'AuditStream') + response = self._send(http_method='PUT', + location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', + version='7.1-preview.1', + content=content) + return self._deserialize('AuditStream', response) + diff --git a/azure-devops/azure/devops/v7_1/audit/models.py b/azure-devops/azure/devops/v7_1/audit/models.py new file mode 100644 index 00000000..564ff97e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/audit/models.py @@ -0,0 +1,293 @@ +# -------------------------------------------------------------------------------------------- +# 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 AuditActionInfo(Model): + """ + :param action_id: The action id for the event, i.e Git.CreateRepo, Project.RenameProject + :type action_id: str + :param area: Area of Azure DevOps the action occurred + :type area: str + :param category: Type of action executed + :type category: object + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'area': {'key': 'area', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'object'} + } + + def __init__(self, action_id=None, area=None, category=None): + super(AuditActionInfo, self).__init__() + self.action_id = action_id + self.area = area + self.category = category + + +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_client_id: The Actor's Client Id (if actor is a service principal) + :type actor_client_id: str + :param actor_cUID: The Actor's CUID + :type actor_cUID: str + :param actor_uPN: The Actor's UPN + :type actor_uPN: str + :param actor_user_id: The Actor's User Id (if actor is a user) + :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 project_id: When specified, the id of the project this event is associated to + :type project_id: str + :param scope_id: The organization Id (Organization is the only scope currently supported) + :type scope_id: str + :param scope_type: The type of the scope (Organization is only scope currently supported) + :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_client_id': {'key': 'actorClientId', 'type': 'str'}, + 'actor_cUID': {'key': 'actorCUID', 'type': 'str'}, + 'actor_uPN': {'key': 'actorUPN', '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'}, + 'project_id': {'key': 'projectId', '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_client_id=None, actor_cUID=None, actor_uPN=None, actor_user_id=None, authentication_mechanism=None, correlation_id=None, data=None, id=None, ip_address=None, project_id=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_client_id = actor_client_id + self.actor_cUID = actor_cUID + self.actor_uPN = actor_uPN + 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.project_id = project_id + 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 AuditStream(Model): + """ + This class represents an audit stream + + :param consumer_inputs: Inputs used to communicate with external service. Inputs could be url, a connection string, a token, etc. + :type consumer_inputs: dict + :param consumer_type: Type of the consumer, i.e. splunk, azureEventHub, etc. + :type consumer_type: str + :param created_time: The time when the stream was created + :type created_time: datetime + :param display_name: Used to identify individual streams + :type display_name: str + :param id: Unique stream identifier + :type id: int + :param status: Status of the stream, Enabled, Disabled + :type status: object + :param status_reason: Reason for the current stream status, i.e. Disabled by the system, Invalid credentials, etc. + :type status_reason: str + :param updated_time: The time when the stream was last updated + :type updated_time: datetime + """ + + _attribute_map = { + 'consumer_inputs': {'key': 'consumerInputs', 'type': '{str}'}, + 'consumer_type': {'key': 'consumerType', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_reason': {'key': 'statusReason', 'type': 'str'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'} + } + + def __init__(self, consumer_inputs=None, consumer_type=None, created_time=None, display_name=None, id=None, status=None, status_reason=None, updated_time=None): + super(AuditStream, self).__init__() + self.consumer_inputs = consumer_inputs + self.consumer_type = consumer_type + self.created_time = created_time + self.display_name = display_name + self.id = id + self.status = status + self.status_reason = status_reason + self.updated_time = updated_time + + +class DecoratedAuditLogEntry(Model): + """ + :param action_id: The action id for the event, i.e Git.CreateRepo, Project.RenameProject + :type action_id: str + :param activity_id: ActivityId + :type activity_id: str + :param actor_client_id: The Actor's Client Id (if actor is a service principal) + :type actor_client_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_uPN: The Actor's UPN + :type actor_uPN: str + :param actor_user_id: The Actor's User Id (if actor is a user) + :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 project_id: When specified, the id of the project this event is associated to + :type project_id: str + :param project_name: When specified, the name of the project this event is associated to + :type project_name: str + :param scope_display_name: DisplayName of the scope + :type scope_display_name: str + :param scope_id: The organization Id (Organization is the only scope currently supported) + :type scope_id: str + :param scope_type: The type of the scope (Organization is only scope currently supported) + :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_client_id': {'key': 'actorClientId', 'type': 'str'}, + 'actor_cUID': {'key': 'actorCUID', 'type': 'str'}, + 'actor_display_name': {'key': 'actorDisplayName', 'type': 'str'}, + 'actor_image_url': {'key': 'actorImageUrl', 'type': 'str'}, + 'actor_uPN': {'key': 'actorUPN', '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'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'project_name': {'key': 'projectName', '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_client_id=None, actor_cUID=None, actor_display_name=None, actor_image_url=None, actor_uPN=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, project_id=None, project_name=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_client_id = actor_client_id + self.actor_cUID = actor_cUID + self.actor_display_name = actor_display_name + self.actor_image_url = actor_image_url + self.actor_uPN = actor_uPN + 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.project_id = project_id + self.project_name = project_name + 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__ = [ + 'AuditActionInfo', + 'AuditLogEntry', + 'AuditLogQueryResult', + 'AuditStream', + 'DecoratedAuditLogEntry', +] diff --git a/azure-devops/azure/devops/v7_1/build/__init__.py b/azure-devops/azure/devops/v7_1/build/__init__.py new file mode 100644 index 00000000..c0d17df7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/build/__init__.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'BuildRetentionHistory', + 'BuildRetentionSample', + 'BuildSettings', + 'DataSourceBindingBase', + 'DefinitionReference', + 'DefinitionResourceReference', + 'Deployment', + 'Folder', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'Issue', + 'JobReference', + 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', + 'ProcessParameters', + 'ProjectRetentionSetting', + 'PullRequest', + 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', + 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', + 'RetentionPolicy', + 'RetentionSetting', + 'SourceProviderAttributes', + 'SourceRepositories', + 'SourceRepository', + 'SourceRepositoryItem', + 'StageReference', + 'SupportedTrigger', + 'TaskAgentPoolReference', + 'TaskDefinitionReference', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationPlanReference', + 'TaskReference', + 'TaskSourceDefinitionBase', + 'TeamProjectReference', + 'TestResultsContext', + 'Timeline', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', + 'VariableGroup', + 'VariableGroupReference', + 'WebApiConnectedServiceRef', + 'XamlBuildControllerReference', + 'YamlBuild', + 'BuildClient' +] diff --git a/azure-devops/azure/devops/v7_1/build/build_client.py b/azure-devops/azure/devops/v7_1/build/build_client.py new file mode 100644 index 00000000..e940d42d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/build/build_client.py @@ -0,0 +1,2311 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.5', + route_values=route_values, + content=content) + return self._deserialize('BuildArtifact', response) + + def get_artifact(self, project, build_id, artifact_name): + """GetArtifact. + [Preview API] 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='7.1-preview.5', + 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. + [Preview API] 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='7.1-preview.5', + 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. + [Preview API] 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='7.1-preview.5', + 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. + [Preview API] 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='7.1-preview.5', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('str', response) + + def get_retention_leases_for_build(self, project, build_id): + """GetRetentionLeasesForBuild. + [Preview API] Gets all retention leases that apply to a specific build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [RetentionLease] + """ + 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='3da19a6a-f088-45c4-83ce-2ad3a87be6c4', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_build(self, project, build_id): + """DeleteBuild. + [Preview API] 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='7.1-preview.7', + route_values=route_values) + + def get_build(self, project, build_id, property_filters=None): + """GetBuild. + [Preview API] 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='7.1-preview.7', + 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. + [Preview API] 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:`<[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='7.1-preview.7', + 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, definition_id=None): + """QueueBuild. + [Preview API] 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: + :param int definition_id: Optional definition id to queue a build without a body. Ignored if there's a valid body + :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') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + content = self._serialize.body(build, 'Build') + response = self._send(http_method='POST', + location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', + version='7.1-preview.7', + 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. + [Preview API] 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='7.1-preview.7', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Build', response) + + def update_builds(self, builds, project): + """UpdateBuilds. + [Preview API] 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='7.1-preview.7', + route_values=route_values, + content=content) + return self._deserialize('[Build]', self._unwrap_collection(response)) + + def get_build_controller(self, controller_id): + """GetBuildController. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('BuildController', response) + + def get_build_controllers(self, name=None): + """GetBuildControllers. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.7', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('BuildDefinition', response) + + def delete_definition(self, project, definition_id): + """DeleteDefinition. + [Preview API] 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='7.1-preview.7', + 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. + [Preview API] 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='7.1-preview.7', + 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. + [Preview API] 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. To use this filter includeAllProperties should be set to true + :rtype: :class:`<[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='7.1-preview.7', + 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. + [Preview API] 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='7.1-preview.7', + 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. + [Preview API] Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT. + :param :class:` ` definition: The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted. + :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='7.1-preview.7', + 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='7.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='7.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='7.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='7.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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Folder', response) + + def get_build_general_settings(self, project): + """GetBuildGeneralSettings. + [Preview API] Gets pipeline general 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='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('PipelineGeneralSettings', response) + + def update_build_general_settings(self, new_settings, project): + """UpdateBuildGeneralSettings. + [Preview API] Updates pipeline general settings. + :param :class:` ` 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(new_settings, 'PipelineGeneralSettings') + response = self._send(http_method='PATCH', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('PipelineGeneralSettings', response) + + def get_retention_history(self, days_to_lookback=None): + """GetRetentionHistory. + [Preview API] Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline. + :param int days_to_lookback: + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_lookback is not None: + query_parameters['daysToLookback'] = self._serialize.query('days_to_lookback', days_to_lookback, 'int') + response = self._send(http_method='GET', + location_id='1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf', + version='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('BuildRetentionHistory', response) + + def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): + """GetBuildChanges. + [Preview API] 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:`<[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='7.1-preview.2', + 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(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. If not specified, the default branch is used. + :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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Build', response) + + def add_retention_leases(self, new_leases, project): + """AddRetentionLeases. + [Preview API] Adds new leases for pipeline runs. + :param [NewRetentionLease] new_leases: + :param str project: Project ID or project name + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_leases, '[NewRetentionLease]') + response = self._send(http_method='POST', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_retention_leases_by_id(self, project, ids): + """DeleteRetentionLeasesById. + [Preview API] Removes specific retention leases. + :param str project: Project ID or project name + :param [int] ids: + """ + 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') + self._send(http_method='DELETE', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + + def get_retention_lease(self, project, lease_id): + """GetRetentionLease. + [Preview API] Returns the details of the retention lease given a lease id. + :param str project: Project ID or project name + :param int lease_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values) + return self._deserialize('RetentionLease', response) + + def get_retention_leases_by_minimal_retention_leases(self, project, leases_to_fetch): + """GetRetentionLeasesByMinimalRetentionLeases. + [Preview API] Returns any leases matching the specified MinimalRetentionLeases + :param str project: Project ID or project name + :param [MinimalRetentionLease] leases_to_fetch: List of JSON-serialized MinimalRetentionLeases separated by '|' + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if leases_to_fetch is not None: + leases_to_fetch = "|".join(map(str, leases_to_fetch)) + query_parameters['leasesToFetch'] = self._serialize.query('leases_to_fetch', leases_to_fetch, 'str') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_owner_id(self, project, owner_id=None, definition_id=None, run_id=None): + """GetRetentionLeasesByOwnerId. + [Preview API] Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str owner_id: + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner_id is not None: + query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_user_id(self, project, user_owner_id, definition_id=None, run_id=None): + """GetRetentionLeasesByUserId. + [Preview API] Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str user_owner_id: The user id to search for. + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if user_owner_id is not None: + query_parameters['userOwnerId'] = self._serialize.query('user_owner_id', user_owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def update_retention_lease(self, lease_update, project, lease_id): + """UpdateRetentionLease. + [Preview API] Updates the duration or pipeline protection status of a retention lease. + :param :class:` ` lease_update: The new data for the retention lease. + :param str project: Project ID or project name + :param int lease_id: The ID of the lease to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + content = self._serialize.body(lease_update, 'RetentionLeaseUpdate') + response = self._send(http_method='PATCH', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('RetentionLease', response) + + def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): + """GetBuildLog. + [Preview API] 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='7.1-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_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): + """GetBuildLogLines. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('[BuildLog]', self._unwrap_collection(response)) + + def get_build_logs_zip(self, project, build_id, **kwargs): + """GetBuildLogsZip. + [Preview API] 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='7.1-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_build_log_zip(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): + """GetBuildLogZip. + [Preview API] 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='7.1-preview.2', + 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='7.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='7.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. + [Preview API] 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='7.1-preview.2', + 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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.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='7.1-preview.2') + return self._deserialize('BuildResourceUsage', response) + + def get_retention_settings(self, project): + """GetRetentionSettings. + [Preview API] Gets the project's 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='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('ProjectRetentionSetting', response) + + def update_retention_settings(self, update_model, project): + """UpdateRetentionSettings. + [Preview API] Updates the project's retention settings. + :param :class:` ` update_model: + :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(update_model, 'UpdateProjectRetentionSettingModel') + response = self._send(http_method='PATCH', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ProjectRetentionSetting', response) + + def get_definition_revisions(self, project, definition_id): + """GetDefinitionRevisions. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) + + def get_build_settings(self, project=None): + """GetBuildSettings. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('BuildSettings', response) + + def update_build_settings(self, settings, project=None): + """UpdateBuildSettings. + [Preview API] 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='7.1-preview.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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) + + def update_stage(self, update_parameters, build_id, stage_ref_name, project=None): + """UpdateStage. + [Preview API] Update a build stage + :param :class:` ` update_parameters: + :param int build_id: + :param str stage_ref_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 build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if stage_ref_name is not None: + route_values['stageRefName'] = self._serialize.url('stage_ref_name', stage_ref_name, 'str') + content = self._serialize.body(update_parameters, 'UpdateStageParameters') + self._send(http_method='PATCH', + location_id='b8aac6c9-744b-46e1-88fc-3550969f9313', + version='7.1-preview.1', + route_values=route_values, + content=content) + + 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. If not specified, the default branch is used. + :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='7.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. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_build_tags(self, tags, project, build_id): + """AddBuildTags. + [Preview API] Adds tags to a build. + :param [str] tags: The tags to add. Request body is composed directly from listed tags. + :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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_build_tag(self, project, build_id, tag): + """DeleteBuildTag. + [Preview API] Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_build_tags(self, project, build_id): + """GetBuildTags. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_build_tags(self, update_parameters, project, build_id): + """UpdateBuildTags. + [Preview API] Adds/Removes tags from a build. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', + version='7.1-preview.3', + route_values=route_values, + content=content) + 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='7.1-preview.3', + 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='7.1-preview.3', + 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. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :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='7.1-preview.3', + 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_definition_tags(self, update_parameters, project, definition_id): + """UpdateDefinitionTags. + [Preview API] Adds/Removes tags from a definition. + :param :class:` ` update_parameters: The tags to add/remove. + :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(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_tag(self, project, tag): + """DeleteTag. + [Preview API] Removes a tag from builds, definitions, and from the tag store + :param str project: Project ID or project name + :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 tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.1-preview.3', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_tags(self, project): + """GetTags. + [Preview API] Gets a list of all build 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_template(self, project, template_id): + """DeleteTemplate. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + + def get_template(self, project, template_id): + """GetTemplate. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('BuildDefinitionTemplate', response) + + def get_templates(self, project): + """GetTemplates. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) + + def save_template(self, template, project, template_id): + """SaveTemplate. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.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='7.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. + [Preview API] Gets the work items associated with a build. Only work items in the same project are returned. + :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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + + def get_definition_yaml(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): + """GetDefinitionYaml. + [Preview API] Converts a definition to YAML, 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='7c3df3a1-7e51-4150-8cf7-540347f8697f', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('YamlBuild', response) + diff --git a/azure-devops/azure/devops/v7_1/build/models.py b/azure-devops/azure/devops/v7_1/build/models.py new file mode 100644 index 00000000..061c8d6d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/build/models.py @@ -0,0 +1,3595 @@ +# -------------------------------------------------------------------------------------------- +# 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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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 append_commit_message_to_run_name: Append Commit Message To BuildNumber in UI. + :type append_commit_message_to_run_name: bool + :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. WARNING: this field is deprecated and does not corresponds to the jobs queues. + :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 template_parameters: Parameters to template expression evaluation + :type template_parameters: dict + :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'}, + 'append_commit_message_to_run_name': {'key': 'appendCommitMessageToRunName', 'type': 'bool'}, + '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]'}, + 'template_parameters': {'key': 'templateParameters', '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, append_commit_message_to_run_name=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, template_parameters=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.append_commit_message_to_run_name = append_commit_message_to_run_name + 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.template_parameters = template_parameters + 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. If an artifact is associated with multiple sources, this points to the first source. + :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 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 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 name: The name of the definition. + :type name: str + :param revision: The revision number. + :type revision: int + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, comment=None, definition_url=None, changed_by=None, changed_date=None, change_type=None, name=None, revision=None): + super(BuildDefinitionRevision, self).__init__() + self.comment = comment + self.definition_url = definition_url + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + 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 retry_count_on_task_failure: Number of retries. + :type retry_count_on_task_failure: int + :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'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + 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 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 checkout_submodules: Indicates whether to checkout submodules. + :type checkout_submodules: bool + :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 = { + 'clean': {'key': 'clean', 'type': 'str'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, + '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, clean=None, default_branch=None, checkout_submodules=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): + super(BuildRepository, self).__init__() + self.clean = clean + self.default_branch = default_branch + self.checkout_submodules = checkout_submodules + 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 BuildRetentionHistory(Model): + """ + A historical overview of build retention information. This includes a list of snapshots taken about build retention usage, and a list of builds that have exceeded the default 30 day retention policy. + + :param build_retention_samples: A list of builds that are older than the default retention policy, but are not marked as retained. Something is causing these builds to not get cleaned up. + :type build_retention_samples: list of :class:`BuildRetentionSample ` + """ + + _attribute_map = { + 'build_retention_samples': {'key': 'buildRetentionSamples', 'type': '[BuildRetentionSample]'} + } + + def __init__(self, build_retention_samples=None): + super(BuildRetentionHistory, self).__init__() + self.build_retention_samples = build_retention_samples + + +class BuildRetentionSample(Model): + """ + A snapshot of build retention information. This class takes a sample at the given time. It provides information about retained builds, files associated with those retained builds, and number of files being retained. + + :param builds: Summary of retention by build + :type builds: str + :param definitions: List of build definitions + :type definitions: str + :param files: Summary of files consumed by retained builds + :type files: str + :param sample_time: The date and time when the sample was taken + :type sample_time: datetime + """ + + _attribute_map = { + 'builds': {'key': 'builds', 'type': 'str'}, + 'definitions': {'key': 'definitions', 'type': 'str'}, + 'files': {'key': 'files', 'type': 'str'}, + 'sample_time': {'key': 'sampleTime', 'type': 'iso-8601'} + } + + def __init__(self, builds=None, definitions=None, files=None, sample_time=None): + super(BuildRetentionSample, self).__init__() + self.builds = builds + self.definitions = definitions + self.files = files + self.sample_time = sample_time + + +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 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 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 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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +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 MinimalRetentionLease(Model): + """ + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param owner_id: User-provided string that identifies the owner of a retention lease. + :type owner_id: str + :param run_id: The pipeline run to protect. + :type run_id: int + """ + + _attribute_map = { + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'int'} + } + + def __init__(self, definition_id=None, owner_id=None, run_id=None): + super(MinimalRetentionLease, self).__init__() + self.definition_id = definition_id + self.owner_id = owner_id + self.run_id = run_id + + +class NewRetentionLease(Model): + """ + Required information to create a new retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". + :type days_valid: int + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param owner_id: User-provided string that identifies the owner of a retention lease. + :type owner_id: str + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + :param run_id: The pipeline run to protect. + :type run_id: int + """ + + _attribute_map = { + 'days_valid': {'key': 'daysValid', 'type': 'int'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'}, + 'run_id': {'key': 'runId', 'type': 'int'} + } + + def __init__(self, days_valid=None, definition_id=None, owner_id=None, protect_pipeline=None, run_id=None): + super(NewRetentionLease, self).__init__() + self.days_valid = days_valid + self.definition_id = definition_id + self.owner_id = owner_id + self.protect_pipeline = protect_pipeline + self.run_id = run_id + + +class PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineGeneralSettings(Model): + """ + Contains pipeline general settings. + + :param audit_enforce_settable_var: If enabled, audit logs will be generated whenever someone queues a pipeline run and defines variables that are not marked as "Settable at queue time". + :type audit_enforce_settable_var: bool + :param disable_classic_pipeline_creation: Disable classic pipelines creation. + :type disable_classic_pipeline_creation: bool + :param enforce_job_auth_scope: If enabled, scope of access for all non-release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + :param enforce_job_auth_scope_for_releases: If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope_for_releases: bool + :param enforce_referenced_repo_scoped_token: Restricts the scope of access for all pipelines to only repositories explicitly referenced by the pipeline. + :type enforce_referenced_repo_scoped_token: bool + :param enforce_settable_var: If enabled, only those variables that are explicitly marked as "Settable at queue time" can be set at queue time. + :type enforce_settable_var: bool + :param publish_pipeline_metadata: Allows pipelines to record metadata. + :type publish_pipeline_metadata: bool + :param status_badges_are_private: Anonymous users can access the status badge API for all pipelines unless this option is enabled. + :type status_badges_are_private: bool + """ + + _attribute_map = { + 'audit_enforce_settable_var': {'key': 'auditEnforceSettableVar', 'type': 'bool'}, + 'disable_classic_pipeline_creation': {'key': 'disableClassicPipelineCreation', 'type': 'bool'}, + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, + 'enforce_job_auth_scope_for_releases': {'key': 'enforceJobAuthScopeForReleases', 'type': 'bool'}, + 'enforce_referenced_repo_scoped_token': {'key': 'enforceReferencedRepoScopedToken', 'type': 'bool'}, + 'enforce_settable_var': {'key': 'enforceSettableVar', 'type': 'bool'}, + 'publish_pipeline_metadata': {'key': 'publishPipelineMetadata', 'type': 'bool'}, + 'status_badges_are_private': {'key': 'statusBadgesArePrivate', 'type': 'bool'} + } + + def __init__(self, audit_enforce_settable_var=None, disable_classic_pipeline_creation=None, enforce_job_auth_scope=None, enforce_job_auth_scope_for_releases=None, enforce_referenced_repo_scoped_token=None, enforce_settable_var=None, publish_pipeline_metadata=None, status_badges_are_private=None): + super(PipelineGeneralSettings, self).__init__() + self.audit_enforce_settable_var = audit_enforce_settable_var + self.disable_classic_pipeline_creation = disable_classic_pipeline_creation + self.enforce_job_auth_scope = enforce_job_auth_scope + self.enforce_job_auth_scope_for_releases = enforce_job_auth_scope_for_releases + self.enforce_referenced_repo_scoped_token = enforce_referenced_repo_scoped_token + self.enforce_settable_var = enforce_settable_var + self.publish_pipeline_metadata = publish_pipeline_metadata + self.status_badges_are_private = status_badges_are_private + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +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 ProjectRetentionSetting(Model): + """ + Contains the settings for the retention rules. + + :param purge_artifacts: The rules for artifact retention. Artifacts can not live longer than a run, so will be overridden by a shorter run purge setting. + :type purge_artifacts: :class:`RetentionSetting ` + :param purge_pull_request_runs: The rules for pull request pipeline run retention. + :type purge_pull_request_runs: :class:`RetentionSetting ` + :param purge_runs: The rules for pipeline run retention. + :type purge_runs: :class:`RetentionSetting ` + :param retain_runs_per_protected_branch: The rules for retaining runs per protected branch. + :type retain_runs_per_protected_branch: :class:`RetentionSetting ` + """ + + _attribute_map = { + 'purge_artifacts': {'key': 'purgeArtifacts', 'type': 'RetentionSetting'}, + 'purge_pull_request_runs': {'key': 'purgePullRequestRuns', 'type': 'RetentionSetting'}, + 'purge_runs': {'key': 'purgeRuns', 'type': 'RetentionSetting'}, + 'retain_runs_per_protected_branch': {'key': 'retainRunsPerProtectedBranch', 'type': 'RetentionSetting'} + } + + def __init__(self, purge_artifacts=None, purge_pull_request_runs=None, purge_runs=None, retain_runs_per_protected_branch=None): + super(ProjectRetentionSetting, self).__init__() + self.purge_artifacts = purge_artifacts + self.purge_pull_request_runs = purge_pull_request_runs + self.purge_runs = purge_runs + self.retain_runs_per_protected_branch = retain_runs_per_protected_branch + + +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 draft: Returns if pull request is draft + :type draft: bool + :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'}, + 'draft': {'key': 'draft', 'type': 'bool'}, + '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, draft=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.draft = draft + 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(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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 RetentionLease(Model): + """ + A valid retention lease prevents automated systems from deleting a pipeline run. + + :param created_on: When the lease was created. + :type created_on: datetime + :param definition_id: The pipeline definition of the run. + :type definition_id: int + :param lease_id: The unique identifier for this lease. + :type lease_id: int + :param owner_id: Non-unique string that identifies the owner of a retention lease. + :type owner_id: str + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + :param run_id: The pipeline run protected by this lease. + :type run_id: int + :param valid_until: The last day the lease is considered valid. + :type valid_until: datetime + """ + + _attribute_map = { + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'lease_id': {'key': 'leaseId', 'type': 'int'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'valid_until': {'key': 'validUntil', 'type': 'iso-8601'} + } + + def __init__(self, created_on=None, definition_id=None, lease_id=None, owner_id=None, protect_pipeline=None, run_id=None, valid_until=None): + super(RetentionLease, self).__init__() + self.created_on = created_on + self.definition_id = definition_id + self.lease_id = lease_id + self.owner_id = owner_id + self.protect_pipeline = protect_pipeline + self.run_id = run_id + self.valid_until = valid_until + + +class RetentionLeaseUpdate(Model): + """ + An update to the retention parameters of a retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". + :type days_valid: int + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + """ + + _attribute_map = { + 'days_valid': {'key': 'daysValid', 'type': 'int'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'} + } + + def __init__(self, days_valid=None, protect_pipeline=None): + super(RetentionLeaseUpdate, self).__init__() + self.days_valid = days_valid + self.protect_pipeline = protect_pipeline + + +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 RetentionSetting(Model): + """ + Contains the minimum, maximum, and current value for a retention setting. + + :param max: + :type max: int + :param min: + :type min: int + :param value: + :type value: int + """ + + _attribute_map = { + 'max': {'key': 'max', 'type': 'int'}, + 'min': {'key': 'min', 'type': 'int'}, + 'value': {'key': 'value', 'type': 'int'} + } + + def __init__(self, max=None, min=None, value=None): + super(RetentionSetting, self).__init__() + self.max = max + self.min = min + self.value = value + + +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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +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 pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + 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 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 change_id: The change ID. + :type change_id: int + :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 queue_id: The queue ID of the queue that the operation ran on. + :type queue_id: int + :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'}, + 'current_operation': {'key': 'currentOperation', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TimelineReference'}, + 'error_count': {'key': 'errorCount', 'type': 'int'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'change_id': {'key': 'changeId', 'type': 'int'}, + '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]'}, + 'queue_id': {'key': 'queueId', 'type': 'int'}, + '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, current_operation=None, details=None, error_count=None, finish_time=None, change_id=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, queue_id=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.current_operation = current_operation + self.details = details + self.error_count = error_count + self.finish_time = finish_time + self.change_id = change_id + 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.queue_id = queue_id + 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 UpdateProjectRetentionSettingModel(Model): + """ + Contains members for updating the retention settings values. All fields are optional. + + :param artifacts_retention: + :type artifacts_retention: :class:`UpdateRetentionSettingModel ` + :param pull_request_run_retention: + :type pull_request_run_retention: :class:`UpdateRetentionSettingModel ` + :param retain_runs_per_protected_branch: + :type retain_runs_per_protected_branch: :class:`UpdateRetentionSettingModel ` + :param run_retention: + :type run_retention: :class:`UpdateRetentionSettingModel ` + """ + + _attribute_map = { + 'artifacts_retention': {'key': 'artifactsRetention', 'type': 'UpdateRetentionSettingModel'}, + 'pull_request_run_retention': {'key': 'pullRequestRunRetention', 'type': 'UpdateRetentionSettingModel'}, + 'retain_runs_per_protected_branch': {'key': 'retainRunsPerProtectedBranch', 'type': 'UpdateRetentionSettingModel'}, + 'run_retention': {'key': 'runRetention', 'type': 'UpdateRetentionSettingModel'} + } + + def __init__(self, artifacts_retention=None, pull_request_run_retention=None, retain_runs_per_protected_branch=None, run_retention=None): + super(UpdateProjectRetentionSettingModel, self).__init__() + self.artifacts_retention = artifacts_retention + self.pull_request_run_retention = pull_request_run_retention + self.retain_runs_per_protected_branch = retain_runs_per_protected_branch + self.run_retention = run_retention + + +class UpdateRetentionSettingModel(Model): + """ + :param value: + :type value: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'} + } + + def __init__(self, value=None): + super(UpdateRetentionSettingModel, self).__init__() + self.value = value + + +class UpdateStageParameters(Model): + """ + :param force_retry_all_jobs: + :type force_retry_all_jobs: bool + :param state: + :type state: object + """ + + _attribute_map = { + 'force_retry_all_jobs': {'key': 'forceRetryAllJobs', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, force_retry_all_jobs=None, state=None): + super(UpdateStageParameters, self).__init__() + self.force_retry_all_jobs = force_retry_all_jobs + self.state = state + + +class UpdateTagParameters(Model): + """ + :param tags_to_add: + :type tags_to_add: list of str + :param tags_to_remove: + :type tags_to_remove: list of str + """ + + _attribute_map = { + 'tags_to_add': {'key': 'tagsToAdd', 'type': '[str]'}, + 'tags_to_remove': {'key': 'tagsToRemove', 'type': '[str]'} + } + + def __init__(self, tags_to_add=None, tags_to_remove=None): + super(UpdateTagParameters, self).__init__() + self.tags_to_add = tags_to_add + self.tags_to_remove = tags_to_remove + + +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 YamlBuild(Model): + """ + Represents a yaml build. + + :param yaml: The yaml used to define the build + :type yaml: str + """ + + _attribute_map = { + 'yaml': {'key': 'yaml', 'type': 'str'} + } + + def __init__(self, yaml=None): + super(YamlBuild, self).__init__() + self.yaml = yaml + + +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', + 'BuildRetentionHistory', + 'BuildRetentionSample', + 'BuildSettings', + 'DataSourceBindingBase', + 'DefinitionReference', + 'DefinitionResourceReference', + 'Deployment', + 'Folder', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'Issue', + 'JobReference', + 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', + 'ProcessParameters', + 'ProjectRetentionSetting', + 'PullRequest', + 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', + 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', + 'RetentionPolicy', + 'RetentionSetting', + 'SourceProviderAttributes', + 'SourceRepositories', + 'SourceRepository', + 'SourceRepositoryItem', + 'StageReference', + 'SupportedTrigger', + 'TaskAgentPoolReference', + 'TaskDefinitionReference', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationPlanReference', + 'TaskReference', + 'TaskSourceDefinitionBase', + 'TeamProjectReference', + 'TestResultsContext', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', + 'VariableGroupReference', + 'WebApiConnectedServiceRef', + 'XamlBuildControllerReference', + 'YamlBuild', + 'BuildController', + 'BuildDefinitionReference', + 'BuildDefinitionReference3_2', + 'BuildLog', + 'BuildOptionDefinition', + 'Timeline', + 'VariableGroup', + 'BuildDefinition', + 'BuildDefinition3_2', +] diff --git a/azure-devops/azure/devops/v7_1/cix/__init__.py b/azure-devops/azure/devops/v7_1/cix/__init__.py new file mode 100644 index 00000000..28165779 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/cix/__init__.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'WebApiTeamRef', + 'CixClient' +] diff --git a/azure-devops/azure/devops/v7_1/cix/cix_client.py b/azure-devops/azure/devops/v7_1/cix/cix_client.py new file mode 100644 index 00000000..be18257b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/cix/cix_client.py @@ -0,0 +1,124 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.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='7.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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CreatedResources', response) + diff --git a/azure-devops/azure/devops/v7_1/cix/models.py b/azure-devops/azure/devops/v7_1/cix/models.py new file mode 100644 index 00000000..90a986a0 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/cix/models.py @@ -0,0 +1,431 @@ +# -------------------------------------------------------------------------------------------- +# 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 ConfigurationFile(Model): + """ + :param content: The content of the file. + :type content: str + :param is_base64_encoded: Indicates if the content is base64 encoded. + :type is_base64_encoded: bool + :param path: The full path of the file, relative to the root of the repository. + :type path: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'is_base64_encoded': {'key': 'isBase64Encoded', 'type': 'bool'}, + 'path': {'key': 'path', 'type': 'str'} + } + + def __init__(self, content=None, is_base64_encoded=None, path=None): + super(ConfigurationFile, self).__init__() + self.content = content + self.is_base64_encoded = is_base64_encoded + self.path = path + + +class CreatedResources(Model): + """ + :param resources: + :type resources: dict + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '{object}'} + } + + def __init__(self, resources=None): + super(CreatedResources, self).__init__() + self.resources = resources + + +class CreatePipelineConnectionInputs(Model): + """ + This class is used to create a pipeline connection within the team project provided. If the team project does not exist, it will be created. + + :param project: The team project settings for an existing team project or for a new team project. + :type project: :class:`TeamProject ` + :param provider_data: This dictionary contains information that is specific to the provider. This data is opaque to the rest of the Pipelines infrastructure and does NOT contribute to the resources Token. The format of the string and its contents depend on the implementation of the provider. + :type provider_data: dict + :param provider_id: The external source provider id for which the connection is being made. + :type provider_id: str + :param redirect_url: If provided, this will be the URL returned with the PipelineConnection. This will override any other redirect URL that would have been generated for the connection. + :type redirect_url: str + :param request_source: Where the request to create the pipeline originated (such as 'GitHub Marketplace' or 'Azure DevOps') + :type request_source: str + """ + + _attribute_map = { + 'project': {'key': 'project', 'type': 'TeamProject'}, + 'provider_data': {'key': 'providerData', 'type': '{str}'}, + 'provider_id': {'key': 'providerId', 'type': 'str'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'request_source': {'key': 'requestSource', 'type': 'str'} + } + + def __init__(self, project=None, provider_data=None, provider_id=None, redirect_url=None, request_source=None): + super(CreatePipelineConnectionInputs, self).__init__() + self.project = project + self.provider_data = provider_data + self.provider_id = provider_id + self.redirect_url = redirect_url + self.request_source = request_source + + +class DetectedBuildFramework(Model): + """ + :param build_targets: List of build targets discovered for the framework to act upon. + :type build_targets: list of :class:`DetectedBuildTarget ` + :param id: The unique identifier of the build framework. + :type id: str + :param settings: Additional detected settings for the build framework. + :type settings: dict + :param version: The version of the framework if it can be determined from the sources. + :type version: str + """ + + _attribute_map = { + 'build_targets': {'key': 'buildTargets', 'type': '[DetectedBuildTarget]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': '{str}'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, build_targets=None, id=None, settings=None, version=None): + super(DetectedBuildFramework, self).__init__() + self.build_targets = build_targets + self.id = id + self.settings = settings + self.version = version + + +class DetectedBuildTarget(Model): + """ + :param path: + :type path: str + :param settings: + :type settings: dict + :param type: + :type type: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, path=None, settings=None, type=None): + super(DetectedBuildTarget, self).__init__() + self.path = path + self.settings = settings + self.type = type + + +class OperationReference(Model): + """ + Reference for an async 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 + """ + + _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): + """ + :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 PipelineConnection(Model): + """ + :param account_id: The account id that contains the team project for the connection. + :type account_id: str + :param definition_id: The definition id that was created for the connection. + :type definition_id: int + :param redirect_url: This is the URL that the user should be taken to in order to continue setup. + :type redirect_url: str + :param service_endpoint_id: The service endpoint that was created for the connection. + :type service_endpoint_id: str + :param team_project_id: The team project that contains the definition for the connection. + :type team_project_id: str + """ + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'team_project_id': {'key': 'teamProjectId', 'type': 'str'} + } + + def __init__(self, account_id=None, definition_id=None, redirect_url=None, service_endpoint_id=None, team_project_id=None): + super(PipelineConnection, self).__init__() + self.account_id = account_id + self.definition_id = definition_id + self.redirect_url = redirect_url + self.service_endpoint_id = service_endpoint_id + self.team_project_id = team_project_id + + +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 ResourceCreationParameter(Model): + """ + :param resource_to_create: + :type resource_to_create: :class:`object ` + :param type: + :type type: str + """ + + _attribute_map = { + 'resource_to_create': {'key': 'resourceToCreate', 'type': 'object'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, resource_to_create=None, type=None): + super(ResourceCreationParameter, self).__init__() + self.resource_to_create = resource_to_create + self.type = type + + +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 WebApiTeamRef(Model): + """ + :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 Operation(OperationReference): + """ + Contains information about the progress or result of an async 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 + + +class TeamProject(TeamProjectReference): + """ + Represents a Team Project object. + + :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 + :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'}, + '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'}, + '_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, last_update_time=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, last_update_time=last_update_time, name=name, revision=revision, state=state, url=url, visibility=visibility) + self._links = _links + self.capabilities = capabilities + self.default_team = default_team + + +__all__ = [ + 'ConfigurationFile', + 'CreatedResources', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', + 'ReferenceLinks', + 'ResourceCreationParameter', + 'TeamProjectReference', + 'WebApiTeamRef', + 'Operation', + 'TeamProject', +] diff --git a/azure-devops/azure/devops/v7_1/client_factory.py b/azure-devops/azure/devops/v7_1/client_factory.py new file mode 100644 index 00000000..60ebccaf --- /dev/null +++ b/azure-devops/azure/devops/v7_1/client_factory.py @@ -0,0 +1,416 @@ +# -------------------------------------------------------------------------------------------- +# 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 ClientFactoryV7_1(object): + """ClientFactoryV7_1. + A factory class to get the 7.1 preview clients. + """ + + def __init__(self, connection): + self._connection = connection + + def get_accounts_client(self): + """get_accounts_client. + Gets the 7.1 version of the AccountsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.accounts.accounts_client.AccountsClient') + + def get_audit_client(self): + """get_audit_client. + Gets the 7.1 version of the AuditClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.audit.audit_client.AuditClient') + + def get_build_client(self): + """get_build_client. + Gets the 7.1 version of the BuildClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.build.build_client.BuildClient') + + def get_cix_client(self): + """get_cix_client. + Gets the 7.1 version of the CixClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.cix.cix_client.CixClient') + + def get_client_trace_client(self): + """get_client_trace_client. + Gets the 7.1 version of the ClientTraceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.client_trace.client_trace_client.ClientTraceClient') + + def get_contributions_client(self): + """get_contributions_client. + Gets the 7.1 version of the ContributionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.contributions.contributions_client.ContributionsClient') + + def get_core_client(self): + """get_core_client. + Gets the 7.1 version of the CoreClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.core.core_client.CoreClient') + + def get_customer_intelligence_client(self): + """get_customer_intelligence_client. + Gets the 7.1 version of the CustomerIntelligenceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') + + def get_dashboard_client(self): + """get_dashboard_client. + Gets the 7.1 version of the DashboardClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.dashboard.dashboard_client.DashboardClient') + + def get_elastic_client(self): + """get_elastic_client. + Gets the 7.1 version of the ElasticClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.elastic.elastic_client.ElasticClient') + + def get_extension_management_client(self): + """get_extension_management_client. + Gets the 7.1 version of the ExtensionManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.extension_management.extension_management_client.ExtensionManagementClient') + + def get_feature_availability_client(self): + """get_feature_availability_client. + Gets the 7.1 version of the FeatureAvailabilityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.feature_availability.feature_availability_client.FeatureAvailabilityClient') + + def get_feature_management_client(self): + """get_feature_management_client. + Gets the 7.1 version of the FeatureManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.feature_management.feature_management_client.FeatureManagementClient') + + def get_feed_client(self): + """get_feed_client. + Gets the 7.1 version of the FeedClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.feed.feed_client.FeedClient') + + def get_file_container_client(self): + """get_file_container_client. + Gets the 7.1 version of the FileContainerClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.file_container.file_container_client.FileContainerClient') + + def get_gallery_client(self): + """get_gallery_client. + Gets the 7.1 version of the GalleryClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.gallery.gallery_client.GalleryClient') + + def get_git_client(self): + """get_git_client. + Gets the 7.1 version of the GitClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.git.git_client.GitClient') + + def get_graph_client(self): + """get_graph_client. + Gets the 7.1 version of the GraphClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.graph.graph_client.GraphClient') + + def get_identity_client(self): + """get_identity_client. + Gets the 7.1 version of the IdentityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.identity.identity_client.IdentityClient') + + def get_location_client(self): + """get_location_client. + Gets the 7.1 version of the LocationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.location.location_client.LocationClient') + + def get_maven_client(self): + """get_maven_client. + Gets the 7.1 version of the MavenClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.maven.maven_client.MavenClient') + + def get_member_entitlement_management_client(self): + """get_member_entitlement_management_client. + Gets the 7.1 version of the MemberEntitlementManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') + + def get_notification_client(self): + """get_notification_client. + Gets the 7.1 version of the NotificationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.notification.notification_client.NotificationClient') + + def get_npm_client(self): + """get_npm_client. + Gets the 7.1 version of the NpmClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.npm.npm_client.NpmClient') + + def get_nuget_client(self): + """get_nuget_client. + Gets the 7.1 version of the NuGetClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.nuget.nuget_client.NuGetClient') + + def get_operations_client(self): + """get_operations_client. + Gets the 7.1 version of the OperationsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.operations.operations_client.OperationsClient') + + def get_pipeline_permissions_client(self): + """get_pipeline_permissions_client. + Gets the 7.1 version of the PipelinePermissionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient') + + def get_pipelines_client(self): + """get_pipelines_client. + Gets the 7.1 version of the PipelinesClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.pipelines.pipelines_client.PipelinesClient') + + def get_pipelines_checks_client(self): + """get_pipelines_checks_client. + Gets the 7.1 version of the PipelinesChecksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.pipelines_checks.pipelines_checks_client.PipelinesChecksClient') + + def get_policy_client(self): + """get_policy_client. + Gets the 7.1 version of the PolicyClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.policy.policy_client.PolicyClient') + + def get_profile_client(self): + """get_profile_client. + Gets the 7.1 version of the ProfileClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.profile.profile_client.ProfileClient') + + def get_profile_regions_client(self): + """get_profile_regions_client. + Gets the 7.1 version of the ProfileRegionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.profile_regions.profile_regions_client.ProfileRegionsClient') + + def get_project_analysis_client(self): + """get_project_analysis_client. + Gets the 7.1 version of the ProjectAnalysisClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.project_analysis.project_analysis_client.ProjectAnalysisClient') + + def get_provenance_client(self): + """get_provenance_client. + Gets the 7.1 version of the ProvenanceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.provenance.provenance_client.ProvenanceClient') + + def get_py_pi_api_client(self): + """get_py_pi_api_client. + Gets the 7.1 version of the PyPiApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.py_pi_api.py_pi_api_client.PyPiApiClient') + + def get_release_client(self): + """get_release_client. + Gets the 7.1 version of the ReleaseClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.release.release_client.ReleaseClient') + + def get_sbom_client(self): + """get_sbom_client. + Gets the 7.1 version of the SBOMClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.sbom.sbom_client.SBOMClient') + + def get_search_client(self): + """get_search_client. + Gets the 7.1 version of the SearchClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.search.search_client.SearchClient') + + def get_security_client(self): + """get_security_client. + Gets the 7.1 version of the SecurityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.security.security_client.SecurityClient') + + def get_service_endpoint_client(self): + """get_service_endpoint_client. + Gets the 7.1 version of the ServiceEndpointClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.service_endpoint.service_endpoint_client.ServiceEndpointClient') + + def get_service_hooks_client(self): + """get_service_hooks_client. + Gets the 7.1 version of the ServiceHooksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.service_hooks.service_hooks_client.ServiceHooksClient') + + def get_settings_client(self): + """get_settings_client. + Gets the 7.1 version of the SettingsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.settings.settings_client.SettingsClient') + + def get_symbol_client(self): + """get_symbol_client. + Gets the 7.1 version of the SymbolClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.symbol.symbol_client.SymbolClient') + + def get_task_client(self): + """get_task_client. + Gets the 7.1 version of the TaskClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.task.task_client.TaskClient') + + def get_task_agent_client(self): + """get_task_agent_client. + Gets the 7.1 version of the TaskAgentClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.task_agent.task_agent_client.TaskAgentClient') + + def get_test_client(self): + """get_test_client. + Gets the 7.1 version of the TestClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.test.test_client.TestClient') + + def get_test_plan_client(self): + """get_test_plan_client. + Gets the 7.1 version of the TestPlanClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.test_plan.test_plan_client.TestPlanClient') + + def get_test_results_client(self): + """get_test_results_client. + Gets the 7.1 version of the TestResultsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.test_results.test_results_client.TestResultsClient') + + def get_tfvc_client(self): + """get_tfvc_client. + Gets the 7.1 version of the TfvcClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.tfvc.tfvc_client.TfvcClient') + + def get_token_admin_client(self): + """get_token_admin_client. + Gets the 7.1 version of the TokenAdminClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.token_admin.token_admin_client.TokenAdminClient') + + def get_upack_api_client(self): + """get_upack_api_client. + Gets the 7.1 version of the UPackApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.upack_api.upack_api_client.UPackApiClient') + + def get_upack_packaging_client(self): + """get_upack_packaging_client. + Gets the 7.1 version of the UPackPackagingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.upack_packaging.upack_packaging_client.UPackPackagingClient') + + def get_wiki_client(self): + """get_wiki_client. + Gets the 7.1 version of the WikiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.wiki.wiki_client.WikiClient') + + def get_work_client(self): + """get_work_client. + Gets the 7.1 version of the WorkClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.work.work_client.WorkClient') + + def get_work_item_tracking_client(self): + """get_work_item_tracking_client. + Gets the 7.1 version of the WorkItemTrackingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') + + def get_work_item_tracking_process_client(self): + """get_work_item_tracking_process_client. + Gets the 7.1 version of the WorkItemTrackingProcessClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.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 7.1 version of the WorkItemTrackingProcessTemplateClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_1.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') + diff --git a/azure-devops/azure/devops/v7_1/client_trace/__init__.py b/azure-devops/azure/devops/v7_1/client_trace/__init__.py new file mode 100644 index 00000000..c1bc03a3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/client_trace/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/client_trace/client_trace_client.py b/azure-devops/azure/devops/v7_1/client_trace/client_trace_client.py new file mode 100644 index 00000000..7cece21e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/client_trace/client_trace_client.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_1/client_trace/models.py b/azure-devops/azure/devops/v7_1/client_trace/models.py new file mode 100644 index 00000000..32e0dec5 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/client_trace/models.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/contributions/__init__.py b/azure-devops/azure/devops/v7_1/contributions/__init__.py new file mode 100644 index 00000000..e8b6c6c3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/contributions/__init__.py @@ -0,0 +1,39 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/contributions/contributions_client.py b/azure-devops/azure/devops/v7_1/contributions/contributions_client.py new file mode 100644 index 00000000..f94d1d9b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/contributions/contributions_client.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('InstalledExtension', response) + diff --git a/azure-devops/azure/devops/v7_1/contributions/models.py b/azure-devops/azure/devops/v7_1/contributions/models.py new file mode 100644 index 00000000..c390cac7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/contributions/models.py @@ -0,0 +1,824 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Representation of a ContributionNode that can be used for serialized to clients. + + :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): + """ + Representation of a ContributionNode that can be used for serialized to clients. + + :param contribution: Contribution associated with this node. + :type contribution: :class:`ClientContribution ` + :param children: List of ids for contributions which are children to the current contribution. + :type children: list of str + :param parents: List of ids for contributions which are parents to the current contribution. + :type parents: list of str + """ + + _attribute_map = { + 'contribution': {'key': 'contribution', 'type': 'ClientContribution'}, + 'children': {'key': 'children', 'type': '[str]'}, + 'parents': {'key': 'parents', 'type': '[str]'} + } + + def __init__(self, contribution=None, children=None, parents=None): + super(ClientContributionNode, self).__init__() + self.contribution = contribution + self.children = children + self.parents = parents + + +class ClientContributionProviderDetails(Model): + """ + :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 associated 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): + """ + Base class shared by contributions and contribution types + + :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): + """ + Specifies a constraint that can be used to dynamically include/exclude a given contribution + + :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 eliminate 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): + """ + A query that can be issued for contribution nodes + + :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): + """ + Result of a contribution node query. Wraps the resulting contribution nodes and provider details. + + :param nodes: Map of contribution ids to corresponding node. + :type nodes: dict + :param provider_details: Map of provider 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): + """ + Description about a property of a contribution type + + :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): + """ + A contribution type, given by a json schema + + :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): + """ + Contextual information that data providers can examine when populating their data + + :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): + """ + :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): + """ + A query that can be issued for data provider data + + :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): + """ + Result structure from calls to GetDataProviderData + + :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): + """ + Base class for an event callback for an extension + + :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): + """ + Collection of event callbacks - endpoints called when particular extension events occur. + + :param post_disable: Optional. Defines an endpoint that gets called via a POST request 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 request 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 request 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 request 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 request 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 request 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): + """ + :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): + """ + How an extension should handle including contributions based on licensing + + :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): + """ + Base class for extension properties which are shared by the extension manifest and the extension model + + :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 specified 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): + """ + Represents a VSTS extension along with its installation state + + :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 specified 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): + """ + The state of an installed extension + + :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): + """ + Represents an installation issue + + :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): + """ + Maps a contribution to a licensing behavior + + :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): + """ + Entry for a specific data provider's resulting data + + :param duration: The total time the data provider took to resolve its data (in milliseconds) + :type duration: float + :param error: + :type error: str + :param id: + :type id: str + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'float'}, + '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): + """ + A client data provider are the details needed to make the data provider request from the client. + + :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): + """ + An individual contribution made by an extension + + :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', +] diff --git a/azure-devops/azure/devops/v7_1/core/__init__.py b/azure-devops/azure/devops/v7_1/core/__init__.py new file mode 100644 index 00000000..cb87e9b4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/core/__init__.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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', + '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' +] diff --git a/azure-devops/azure/devops/v7_1/core/core_client.py b/azure-devops/azure/devops/v7_1/core/core_client.py new file mode 100644 index 00000000..d960dfdd --- /dev/null +++ b/azure-devops/azure/devops/v7_1/core/core_client.py @@ -0,0 +1,505 @@ +# -------------------------------------------------------------------------------------------- +# 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 remove_project_avatar(self, project_id): + """RemoveProjectAvatar. + [Preview API] Removes the avatar for the project. + :param str project_id: The ID or name of the project. + """ + route_values = {} + if project_id is not None: + route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') + self._send(http_method='DELETE', + location_id='54b2a2a0-859b-4d05-827c-ec4c862f641a', + version='7.1-preview.1', + route_values=route_values) + + def set_project_avatar(self, avatar_blob, project_id): + """SetProjectAvatar. + [Preview API] Sets the avatar for the project. + :param :class:` ` avatar_blob: The avatar blob data object to upload. + :param str project_id: The ID or name of the project. + """ + route_values = {} + if project_id is not None: + route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') + content = self._serialize.body(avatar_blob, 'ProjectAvatar') + self._send(http_method='PUT', + location_id='54b2a2a0-859b-4d05-827c-ec4c862f641a', + version='7.1-preview.1', + route_values=route_values, + content=content) + + 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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Process', response) + + def get_processes(self): + """GetProcesses. + [Preview API] Get a list of processes. + :rtype: [Process] + """ + response = self._send(http_method='GET', + location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', + version='7.1-preview.1') + return self._deserialize('[Process]', self._unwrap_collection(response)) + + def get_project_collection(self, collection_id): + """GetProjectCollection. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('TeamProjectCollection', response) + + def get_project_collections(self, top=None, skip=None): + """GetProjectCollections. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.4', + 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. + [Preview API] 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 int continuation_token: Pointer that shows how many projects already been fetched. + :param bool get_default_team_image_url: + :rtype: :class:`<[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, 'int') + 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='7.1-preview.4', + query_parameters=query_parameters) + return self._deserialize('[TeamProjectReference]', self._unwrap_collection(response)) + + def queue_create_project(self, project_to_create): + """QueueCreateProject. + [Preview API] 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='7.1-preview.4', + content=content) + return self._deserialize('OperationReference', response) + + def queue_delete_project(self, project_id): + """QueueDeleteProject. + [Preview API] 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='7.1-preview.4', + route_values=route_values) + return self._deserialize('OperationReference', response) + + def update_project(self, project_update, project_id): + """UpdateProject. + [Preview API] 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='7.1-preview.4', + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.2', + query_parameters=query_parameters) + return self._deserialize('[Proxy]', self._unwrap_collection(response)) + + def get_all_teams(self, mine=None, top=None, skip=None, expand_identity=None): + """GetAllTeams. + [Preview API] Get a list of all teams. + :param bool mine: If true, then return all teams requesting user is member. Otherwise return all 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] + """ + 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='7a4d9ee9-3433-4347-b47a-7a80f1cf307e', + version='7.1-preview.3', + query_parameters=query_parameters) + return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) + + def create_team(self, team, project_id): + """CreateTeam. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('WebApiTeam', response) + + def delete_team(self, project_id, team_id): + """DeleteTeam. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + + def get_team(self, project_id, team_id, expand_identity=None): + """GetTeam. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('WebApiTeam', response) + diff --git a/azure-devops/azure/devops/v7_1/core/models.py b/azure-devops/azure/devops/v7_1/core/models.py new file mode 100644 index 00000000..ca93fc48 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/core/models.py @@ -0,0 +1,959 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 IdentityBase(Model): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class IdentityData(Model): + """ + :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): + """ + :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 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 OperationReference(Model): + """ + Reference for an async 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 + """ + + _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): + """ + :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 ProjectAvatar(Model): + """ + Contains the image data for project avatar. + + :param image: The avatar image represented as a byte array. + :type image: str + """ + + _attribute_map = { + 'image': {'key': 'image', 'type': 'str'} + } + + def __init__(self, image=None): + super(ProjectAvatar, self).__init__() + self.image = image + + +class ProjectInfo(Model): + """ + Contains information describing a project. + + :param abbreviation: The abbreviated name of the project. + :type abbreviation: str + :param description: The description of the project. + :type description: str + :param id: The id of the project. + :type id: str + :param last_update_time: The time that this project was last updated. + :type last_update_time: datetime + :param name: The name of the project. + :type name: str + :param properties: A set of name-value pairs storing additional property data related to the project. + :type properties: list of :class:`ProjectProperty ` + :param revision: The current revision of the project. + :type revision: long + :param state: The current state of the project. + :type state: object + :param uri: A Uri that can be used to refer to this project. + :type uri: str + :param version: The version number of the project. + :type version: long + :param visibility: Indicates whom the project is visible to. + :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 ProjectProperties(Model): + """ + :param project_id: The team project Id + :type project_id: str + :param properties: The collection of team project properties + :type properties: list of :class:`ProjectProperty ` + """ + + _attribute_map = { + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '[ProjectProperty]'} + } + + def __init__(self, project_id=None, properties=None): + super(ProjectProperties, self).__init__() + self.project_id = project_id + self.properties = properties + + +class ProjectProperty(Model): + """ + A named value associated with a project. + + :param name: The name of the property. + :type name: str + :param value: The value of the property. + :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): + """ + :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): + """ + :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): + """ + Represents the public key portion of an RSA asymmetric key. + + :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): + """ + 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 TeamMember(Model): + """ + :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): + """ + Reference object for a TeamProjectCollection. + + :param avatar_url: Collection avatar Url. + :type avatar_url: str + :param id: Collection Id. + :type id: str + :param name: Collection Name. + :type name: str + :param url: Collection REST Url. + :type url: str + """ + + _attribute_map = { + 'avatar_url': {'key': 'avatarUrl', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, avatar_url=None, id=None, name=None, url=None): + super(TeamProjectCollectionReference, self).__init__() + self.avatar_url = avatar_url + self.id = id + self.name = name + self.url = url + + +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 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 WebApiTeamRef(Model): + """ + :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 Identity(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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +class Process(ProcessReference): + """ + :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): + """ + Represents a Team Project object. + + :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 + :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'}, + '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'}, + '_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, last_update_time=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, last_update_time=last_update_time, name=name, revision=revision, state=state, url=url, visibility=visibility) + self._links = _links + self.capabilities = capabilities + self.default_team = default_team + + +class TeamProjectCollection(TeamProjectCollectionReference): + """ + Data contract for a TeamProjectCollection. + + :param avatar_url: Collection avatar Url. + :type avatar_url: str + :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 customization 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 = { + 'avatar_url': {'key': 'avatarUrl', 'type': 'str'}, + '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, avatar_url=None, id=None, name=None, url=None, _links=None, description=None, process_customization_type=None, state=None): + super(TeamProjectCollection, self).__init__(avatar_url=avatar_url, 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): + """ + :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): + """ + :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): + """ + :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: Team identity. + :type identity: :class:`Identity ` + :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': {'key': 'identity', 'type': 'Identity'}, + '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=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 = identity + self.identity_url = identity_url + self.project_id = project_id + self.project_name = project_name + + +__all__ = [ + 'GraphSubjectBase', + 'IdentityBase', + 'IdentityData', + 'IdentityRef', + 'JsonPatchOperation', + 'OperationReference', + 'ProcessReference', + 'ProjectAvatar', + 'ProjectInfo', + 'ProjectProperties', + 'ProjectProperty', + 'Proxy', + 'ProxyAuthorization', + 'PublicKey', + 'ReferenceLinks', + 'TeamMember', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WebApiConnectedServiceRef', + 'WebApiTeamRef', + 'Identity', + 'Process', + 'TeamProject', + 'TeamProjectCollection', + 'WebApiConnectedService', + 'WebApiConnectedServiceDetails', + 'WebApiTeam', +] diff --git a/azure-devops/azure/devops/v7_1/customer_intelligence/__init__.py b/azure-devops/azure/devops/v7_1/customer_intelligence/__init__.py new file mode 100644 index 00000000..f08358c6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/customer_intelligence/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/customer_intelligence/customer_intelligence_client.py b/azure-devops/azure/devops/v7_1/customer_intelligence/customer_intelligence_client.py new file mode 100644 index 00000000..52332bdd --- /dev/null +++ b/azure-devops/azure/devops/v7_1/customer_intelligence/customer_intelligence_client.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_1/customer_intelligence/models.py b/azure-devops/azure/devops/v7_1/customer_intelligence/models.py new file mode 100644 index 00000000..c61ab811 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/customer_intelligence/models.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/dashboard/__init__.py b/azure-devops/azure/devops/v7_1/dashboard/__init__.py new file mode 100644 index 00000000..1accd678 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/dashboard/__init__.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'CopyDashboardOptions', + 'CopyDashboardResponse', + 'Dashboard', + 'DashboardGroup', + 'DashboardGroupEntry', + 'DashboardGroupEntryResponse', + 'DashboardResponse', + 'LightboxOptions', + 'ReferenceLinks', + 'SemanticVersion', + 'TeamContext', + 'Widget', + 'WidgetMetadata', + 'WidgetMetadataResponse', + 'WidgetPosition', + 'WidgetResponse', + 'WidgetSize', + 'WidgetsVersionedList', + 'WidgetTypesResponse', + 'DashboardClient' +] diff --git a/azure-devops/azure/devops/v7_1/dashboard/dashboard_client.py b/azure-devops/azure/devops/v7_1/dashboard/dashboard_client.py new file mode 100644 index 00000000..34864019 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/dashboard/dashboard_client.py @@ -0,0 +1,562 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-preview.3', + 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='7.1-preview.3', + 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('Dashboard', response) + + def get_dashboards_by_project(self, team_context): + """GetDashboardsByProject. + [Preview API] Get a list of dashboards under a project. + :param :class:` ` team_context: The team context for the operation + :rtype: [Dashboard] + """ + 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('[Dashboard]', self._unwrap_collection(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='7.1-preview.3', + 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='7.1-preview.3', + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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, including widgets marked with isVisibleFromCatalog == false. + :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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WidgetTypesResponse', response) + diff --git a/azure-devops/azure/devops/v7_1/dashboard/models.py b/azure-devops/azure/devops/v7_1/dashboard/models.py new file mode 100644 index 00000000..3a40762d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/dashboard/models.py @@ -0,0 +1,856 @@ +# -------------------------------------------------------------------------------------------- +# 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 CopyDashboardOptions(Model): + """ + Copy options of a Dashboard. + + :param copy_dashboard_scope: Dashboard Scope. Can be either Project or Project_Team + :type copy_dashboard_scope: object + :param copy_queries_flag: When this flag is set to true,option to select the folder to copy Queries of copy dashboard will appear. + :type copy_queries_flag: bool + :param description: Description of the dashboard + :type description: str + :param name: Name of the dashboard + :type name: str + :param project_id: ID of the project. Provided by service at creation time. + :type project_id: str + :param query_folder_path: Path to which the queries should be copied of copy dashboard + :type query_folder_path: str + :param refresh_interval: Refresh interval of dashboard + :type refresh_interval: int + :param team_id: ID of the team. Provided by service at creation time + :type team_id: str + """ + + _attribute_map = { + 'copy_dashboard_scope': {'key': 'copyDashboardScope', 'type': 'object'}, + 'copy_queries_flag': {'key': 'copyQueriesFlag', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'query_folder_path': {'key': 'queryFolderPath', 'type': 'str'}, + 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, + 'team_id': {'key': 'teamId', 'type': 'str'} + } + + def __init__(self, copy_dashboard_scope=None, copy_queries_flag=None, description=None, name=None, project_id=None, query_folder_path=None, refresh_interval=None, team_id=None): + super(CopyDashboardOptions, self).__init__() + self.copy_dashboard_scope = copy_dashboard_scope + self.copy_queries_flag = copy_queries_flag + self.description = description + self.name = name + self.project_id = project_id + self.query_folder_path = query_folder_path + self.refresh_interval = refresh_interval + self.team_id = team_id + + +class CopyDashboardResponse(Model): + """ + :param copied_dashboard: Copied Dashboard + :type copied_dashboard: :class:`Dashboard ` + :param copy_dashboard_options: Copy Dashboard options + :type copy_dashboard_options: :class:`CopyDashboardOptions ` + """ + + _attribute_map = { + 'copied_dashboard': {'key': 'copiedDashboard', 'type': 'Dashboard'}, + 'copy_dashboard_options': {'key': 'copyDashboardOptions', 'type': 'CopyDashboardOptions'} + } + + def __init__(self, copied_dashboard=None, copy_dashboard_options=None): + super(CopyDashboardResponse, self).__init__() + self.copied_dashboard = copied_dashboard + self.copy_dashboard_options = copy_dashboard_options + + +class Dashboard(Model): + """ + Model of a Dashboard. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: str + :param id: ID of the Dashboard. Provided by service at creation time. + :type id: str + :param last_accessed_date: Dashboard Last Accessed Date. + :type last_accessed_date: datetime + :param modified_by: Id of the person who modified Dashboard. + :type modified_by: str + :param modified_date: Dashboard's last modified date. + :type modified_date: datetime + :param name: Name of the Dashboard. + :type name: str + :param owner_id: ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'str'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, last_accessed_date=None, modified_by=None, modified_date=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(Dashboard, self).__init__() + self._links = _links + self.dashboard_scope = dashboard_scope + self.description = description + self.eTag = eTag + self.group_id = group_id + self.id = id + self.last_accessed_date = last_accessed_date + self.modified_by = modified_by + self.modified_date = modified_date + 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): + """ + Describes a list of dashboards associated to an owner. Currently, teams own dashboard groups. + + :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): + """ + Dashboard group entry, wrapping around Dashboard (needed?) + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: str + :param id: ID of the Dashboard. Provided by service at creation time. + :type id: str + :param last_accessed_date: Dashboard Last Accessed Date. + :type last_accessed_date: datetime + :param modified_by: Id of the person who modified Dashboard. + :type modified_by: str + :param modified_date: Dashboard's last modified date. + :type modified_date: datetime + :param name: Name of the Dashboard. + :type name: str + :param owner_id: ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'str'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, last_accessed_date=None, modified_by=None, modified_date=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardGroupEntry, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, last_accessed_date=last_accessed_date, modified_by=modified_by, modified_date=modified_date, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class DashboardGroupEntryResponse(DashboardGroupEntry): + """ + Response from RestAPI when saving and editing DashboardGroupEntry + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: str + :param id: ID of the Dashboard. Provided by service at creation time. + :type id: str + :param last_accessed_date: Dashboard Last Accessed Date. + :type last_accessed_date: datetime + :param modified_by: Id of the person who modified Dashboard. + :type modified_by: str + :param modified_date: Dashboard's last modified date. + :type modified_date: datetime + :param name: Name of the Dashboard. + :type name: str + :param owner_id: ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'str'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, last_accessed_date=None, modified_by=None, modified_date=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardGroupEntryResponse, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, last_accessed_date=last_accessed_date, modified_by=modified_by, modified_date=modified_date, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class DashboardResponse(DashboardGroupEntry): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param dashboard_scope: Entity to which the dashboard is scoped. + :type dashboard_scope: object + :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 group_id: ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty. + :type group_id: str + :param id: ID of the Dashboard. Provided by service at creation time. + :type id: str + :param last_accessed_date: Dashboard Last Accessed Date. + :type last_accessed_date: datetime + :param modified_by: Id of the person who modified Dashboard. + :type modified_by: str + :param modified_date: Dashboard's last modified date. + :type modified_date: datetime + :param name: Name of the Dashboard. + :type name: str + :param owner_id: ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity 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'}, + 'dashboard_scope': {'key': 'dashboardScope', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'eTag': {'key': 'eTag', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'str'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + '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, dashboard_scope=None, description=None, eTag=None, group_id=None, id=None, last_accessed_date=None, modified_by=None, modified_date=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): + super(DashboardResponse, self).__init__(_links=_links, dashboard_scope=dashboard_scope, description=description, eTag=eTag, group_id=group_id, id=id, last_accessed_date=last_accessed_date, modified_by=modified_by, modified_date=modified_date, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) + + +class LightboxOptions(Model): + """ + Lightbox configuration + + :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): + """ + 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 SemanticVersion(Model): + """ + versioning for an artifact as described at: http://semver.org/, of the form major.minor.patch. + + :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): + """ + The Team Context for an operation. + + :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 data + + :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): + """ + Contribution based information describing Dashboard Widgets. + + :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 keywords: Keywords associated with this widget, non-filterable and invisible + :type keywords: list of str + :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 tags: Tags associated with this widget, visible on each widget and filterable. + :type tags: list of str + :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'}, + 'keywords': {'key': 'keywords', 'type': '[str]'}, + '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]'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + '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, keywords=None, lightbox_options=None, loading_image_url=None, name=None, publisher_name=None, supported_scopes=None, tags=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.keywords = keywords + 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.tags = tags + self.targets = targets + self.type_id = type_id + + +class WidgetMetadataResponse(Model): + """ + :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): + """ + :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): + """ + Response from RestAPI when saving and editing 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(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): + """ + :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): + """ + Wrapper class to support HTTP header generation using CreateResponse, ClientHeaderParameter and ClientResponseType in WidgetV2Controller + + :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): + """ + :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__ = [ + 'CopyDashboardOptions', + 'CopyDashboardResponse', + 'Dashboard', + 'DashboardGroup', + 'DashboardGroupEntry', + 'DashboardGroupEntryResponse', + 'DashboardResponse', + 'LightboxOptions', + 'ReferenceLinks', + 'SemanticVersion', + 'TeamContext', + 'Widget', + 'WidgetMetadata', + 'WidgetMetadataResponse', + 'WidgetPosition', + 'WidgetResponse', + 'WidgetSize', + 'WidgetsVersionedList', + 'WidgetTypesResponse', +] diff --git a/azure-devops/azure/devops/v7_1/elastic/__init__.py b/azure-devops/azure/devops/v7_1/elastic/__init__.py new file mode 100644 index 00000000..a93388a9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/elastic/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 .elastic_client import ElasticClient + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPool', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'ElasticClient' +] diff --git a/azure-devops/azure/devops/v7_1/elastic/elastic_client.py b/azure-devops/azure/devops/v7_1/elastic/elastic_client.py new file mode 100644 index 00000000..06a0d7a0 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/elastic/elastic_client.py @@ -0,0 +1,158 @@ +# -------------------------------------------------------------------------------------------- +# 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 ElasticClient(Client): + """Elastic + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ElasticClient, 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_elastic_pool_logs(self, pool_id, top=None): + """GetElasticPoolLogs. + [Preview API] Get elastic pool diagnostics logs for a specified Elastic Pool. + :param int pool_id: Pool Id of the Elastic Pool + :param int top: Number of elastic pool logs to retrieve + :rtype: [ElasticPoolLog] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_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='595b1769-61d5-4076-a72a-98a02105ca9a', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticPoolLog]', self._unwrap_collection(response)) + + def create_elastic_pool(self, elastic_pool, pool_name, authorize_all_pipelines=None, auto_provision_project_pools=None, project_id=None): + """CreateElasticPool. + [Preview API] Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project. + :param :class:` ` elastic_pool: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool. + :param str pool_name: Name to use for the new TaskAgentPool + :param bool authorize_all_pipelines: Setting to determine if all pipelines are authorized to use this TaskAgentPool by default. + :param bool auto_provision_project_pools: Setting to automatically provision TaskAgentQueues in every project for the new pool. + :param str project_id: Optional: If provided, a new TaskAgentQueue will be created in the specified project. + :rtype: :class:` ` + """ + query_parameters = {} + if pool_name is not None: + query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') + if authorize_all_pipelines is not None: + query_parameters['authorizeAllPipelines'] = self._serialize.query('authorize_all_pipelines', authorize_all_pipelines, 'bool') + if auto_provision_project_pools is not None: + query_parameters['autoProvisionProjectPools'] = self._serialize.query('auto_provision_project_pools', auto_provision_project_pools, 'bool') + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + content = self._serialize.body(elastic_pool, 'ElasticPool') + response = self._send(http_method='POST', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('ElasticPoolCreationResult', response) + + def get_elastic_pool(self, pool_id): + """GetElasticPool. + [Preview API] Returns the Elastic Pool with the specified Pool Id. + :param int pool_id: Pool Id of the associated TaskAgentPool + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('ElasticPool', response) + + def get_elastic_pools(self): + """GetElasticPools. + [Preview API] Get a list of all Elastic Pools. + :rtype: [ElasticPool] + """ + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.1-preview.1') + return self._deserialize('[ElasticPool]', self._unwrap_collection(response)) + + def update_elastic_pool(self, elastic_pool_settings, pool_id): + """UpdateElasticPool. + [Preview API] Update settings on a specified Elastic Pool. + :param :class:` ` elastic_pool_settings: New Elastic Pool settings data + :param int pool_id: + :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(elastic_pool_settings, 'ElasticPoolSettings') + response = self._send(http_method='PATCH', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ElasticPool', response) + + def get_elastic_nodes(self, pool_id, state=None): + """GetElasticNodes. + [Preview API] Get a list of ElasticNodes currently in the ElasticPool + :param int pool_id: Pool id of the ElasticPool + :param str state: Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState + :rtype: [ElasticNode] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + query_parameters = {} + if state is not None: + query_parameters['$state'] = self._serialize.query('state', state, 'str') + response = self._send(http_method='GET', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticNode]', self._unwrap_collection(response)) + + def update_elastic_node(self, elastic_node_settings, pool_id, elastic_node_id): + """UpdateElasticNode. + [Preview API] Update properties on a specified ElasticNode + :param :class:` ` elastic_node_settings: + :param int pool_id: + :param int elastic_node_id: + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + if elastic_node_id is not None: + route_values['elasticNodeId'] = self._serialize.url('elastic_node_id', elastic_node_id, 'int') + content = self._serialize.body(elastic_node_settings, 'ElasticNodeSettings') + response = self._send(http_method='PATCH', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ElasticNode', response) + diff --git a/azure-devops/azure/devops/v7_1/elastic/models.py b/azure-devops/azure/devops/v7_1/elastic/models.py new file mode 100644 index 00000000..b6446091 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/elastic/models.py @@ -0,0 +1,543 @@ +# -------------------------------------------------------------------------------------------- +# 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 ElasticNode(Model): + """ + Data and settings for an elastic node + + :param agent_id: Distributed Task's Agent Id + :type agent_id: int + :param agent_state: Summary of the state of the agent + :type agent_state: object + :param compute_id: Compute Id. VMSS's InstanceId + :type compute_id: str + :param compute_state: State of the compute host + :type compute_state: object + :param desired_state: Users can force state changes to specific states (ToReimage, ToDelete, Save) + :type desired_state: object + :param id: Unique identifier since the agent and/or VM may be null + :type id: int + :param name: Computer name. Used to match a scaleset VM with an agent + :type name: str + :param pool_id: Pool Id that this node belongs to + :type pool_id: int + :param request_id: Last job RequestId assigned to this agent + :type request_id: long + :param state: State of the ElasticNode + :type state: object + :param state_changed_on: Last state change. Only updated by SQL. + :type state_changed_on: datetime + """ + + _attribute_map = { + 'agent_id': {'key': 'agentId', 'type': 'int'}, + 'agent_state': {'key': 'agentState', 'type': 'object'}, + 'compute_id': {'key': 'computeId', 'type': 'str'}, + 'compute_state': {'key': 'computeState', 'type': 'object'}, + 'desired_state': {'key': 'desiredState', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'request_id': {'key': 'requestId', 'type': 'long'}, + 'state': {'key': 'state', 'type': 'object'}, + 'state_changed_on': {'key': 'stateChangedOn', 'type': 'iso-8601'} + } + + def __init__(self, agent_id=None, agent_state=None, compute_id=None, compute_state=None, desired_state=None, id=None, name=None, pool_id=None, request_id=None, state=None, state_changed_on=None): + super(ElasticNode, self).__init__() + self.agent_id = agent_id + self.agent_state = agent_state + self.compute_id = compute_id + self.compute_state = compute_state + self.desired_state = desired_state + self.id = id + self.name = name + self.pool_id = pool_id + self.request_id = request_id + self.state = state + self.state_changed_on = state_changed_on + + +class ElasticNodeSettings(Model): + """ + Class used for updating an elastic node where only certain members are populated + + :param state: State of the ElasticNode + :type state: object + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, state=None): + super(ElasticNodeSettings, self).__init__() + self.state = state + + +class ElasticPool(Model): + """ + Data and settings for an elastic pool + + :param agent_interactive_uI: Set whether agents should be configured to run with interactive UI + :type agent_interactive_uI: bool + :param azure_id: Azure string representing to location of the resource + :type azure_id: str + :param desired_idle: Number of agents to have ready waiting for jobs + :type desired_idle: int + :param desired_size: The desired size of the pool + :type desired_size: int + :param max_capacity: Maximum number of nodes that will exist in the elastic pool + :type max_capacity: int + :param max_saved_node_count: Keep nodes in the pool on failure for investigation + :type max_saved_node_count: int + :param offline_since: Timestamp the pool was first detected to be offline + :type offline_since: datetime + :param orchestration_type: Operating system type of the nodes in the pool + :type orchestration_type: object + :param os_type: Operating system type of the nodes in the pool + :type os_type: object + :param pool_id: Id of the associated TaskAgentPool + :type pool_id: int + :param recycle_after_each_use: Discard node after each job completes + :type recycle_after_each_use: bool + :param service_endpoint_id: Id of the Service Endpoint used to connect to Azure + :type service_endpoint_id: str + :param service_endpoint_scope: Scope the Service Endpoint belongs to + :type service_endpoint_scope: str + :param sizing_attempts: The number of sizing attempts executed while trying to achieve a desired size + :type sizing_attempts: int + :param state: State of the pool + :type state: object + :param time_to_live_minutes: The minimum time in minutes to keep idle agents alive + :type time_to_live_minutes: int + """ + + _attribute_map = { + 'agent_interactive_uI': {'key': 'agentInteractiveUI', 'type': 'bool'}, + 'azure_id': {'key': 'azureId', 'type': 'str'}, + 'desired_idle': {'key': 'desiredIdle', 'type': 'int'}, + 'desired_size': {'key': 'desiredSize', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + 'max_saved_node_count': {'key': 'maxSavedNodeCount', 'type': 'int'}, + 'offline_since': {'key': 'offlineSince', 'type': 'iso-8601'}, + 'orchestration_type': {'key': 'orchestrationType', 'type': 'object'}, + 'os_type': {'key': 'osType', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'recycle_after_each_use': {'key': 'recycleAfterEachUse', 'type': 'bool'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_scope': {'key': 'serviceEndpointScope', 'type': 'str'}, + 'sizing_attempts': {'key': 'sizingAttempts', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'object'}, + 'time_to_live_minutes': {'key': 'timeToLiveMinutes', 'type': 'int'} + } + + def __init__(self, agent_interactive_uI=None, azure_id=None, desired_idle=None, desired_size=None, max_capacity=None, max_saved_node_count=None, offline_since=None, orchestration_type=None, os_type=None, pool_id=None, recycle_after_each_use=None, service_endpoint_id=None, service_endpoint_scope=None, sizing_attempts=None, state=None, time_to_live_minutes=None): + super(ElasticPool, self).__init__() + self.agent_interactive_uI = agent_interactive_uI + self.azure_id = azure_id + self.desired_idle = desired_idle + self.desired_size = desired_size + self.max_capacity = max_capacity + self.max_saved_node_count = max_saved_node_count + self.offline_since = offline_since + self.orchestration_type = orchestration_type + self.os_type = os_type + self.pool_id = pool_id + self.recycle_after_each_use = recycle_after_each_use + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_scope = service_endpoint_scope + self.sizing_attempts = sizing_attempts + self.state = state + self.time_to_live_minutes = time_to_live_minutes + + +class ElasticPoolCreationResult(Model): + """ + Returned result from creating a new elastic pool + + :param agent_pool: Created agent pool + :type agent_pool: :class:`TaskAgentPool ` + :param agent_queue: Created agent queue + :type agent_queue: :class:`TaskAgentQueue ` + :param elastic_pool: Created elastic pool + :type elastic_pool: :class:`ElasticPool ` + """ + + _attribute_map = { + 'agent_pool': {'key': 'agentPool', 'type': 'TaskAgentPool'}, + 'agent_queue': {'key': 'agentQueue', 'type': 'TaskAgentQueue'}, + 'elastic_pool': {'key': 'elasticPool', 'type': 'ElasticPool'} + } + + def __init__(self, agent_pool=None, agent_queue=None, elastic_pool=None): + super(ElasticPoolCreationResult, self).__init__() + self.agent_pool = agent_pool + self.agent_queue = agent_queue + self.elastic_pool = elastic_pool + + +class ElasticPoolLog(Model): + """ + Log data for an Elastic Pool + + :param id: Log Id + :type id: long + :param level: E.g. error, warning, info + :type level: object + :param message: Log contents + :type message: str + :param operation: Operation that triggered the message being logged + :type operation: object + :param pool_id: Id of the associated TaskAgentPool + :type pool_id: int + :param timestamp: Datetime that the log occurred + :type timestamp: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'long'}, + 'level': {'key': 'level', 'type': 'object'}, + 'message': {'key': 'message', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'} + } + + def __init__(self, id=None, level=None, message=None, operation=None, pool_id=None, timestamp=None): + super(ElasticPoolLog, self).__init__() + self.id = id + self.level = level + self.message = message + self.operation = operation + self.pool_id = pool_id + self.timestamp = timestamp + + +class ElasticPoolSettings(Model): + """ + Class used for updating an elastic pool where only certain members are populated + + :param agent_interactive_uI: Set whether agents should be configured to run with interactive UI + :type agent_interactive_uI: bool + :param azure_id: Azure string representing to location of the resource + :type azure_id: str + :param desired_idle: Number of machines to have ready waiting for jobs + :type desired_idle: int + :param max_capacity: Maximum number of machines that will exist in the elastic pool + :type max_capacity: int + :param max_saved_node_count: Keep machines in the pool on failure for investigation + :type max_saved_node_count: int + :param orchestration_type: Operating system type of the machines in the pool + :type orchestration_type: object + :param os_type: Operating system type of the machines in the pool + :type os_type: object + :param recycle_after_each_use: Discard machines after each job completes + :type recycle_after_each_use: bool + :param service_endpoint_id: Id of the Service Endpoint used to connect to Azure + :type service_endpoint_id: str + :param service_endpoint_scope: Scope the Service Endpoint belongs to + :type service_endpoint_scope: str + :param time_to_live_minutes: The minimum time in minutes to keep idle agents alive + :type time_to_live_minutes: int + """ + + _attribute_map = { + 'agent_interactive_uI': {'key': 'agentInteractiveUI', 'type': 'bool'}, + 'azure_id': {'key': 'azureId', 'type': 'str'}, + 'desired_idle': {'key': 'desiredIdle', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + 'max_saved_node_count': {'key': 'maxSavedNodeCount', 'type': 'int'}, + 'orchestration_type': {'key': 'orchestrationType', 'type': 'object'}, + 'os_type': {'key': 'osType', 'type': 'object'}, + 'recycle_after_each_use': {'key': 'recycleAfterEachUse', 'type': 'bool'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_scope': {'key': 'serviceEndpointScope', 'type': 'str'}, + 'time_to_live_minutes': {'key': 'timeToLiveMinutes', 'type': 'int'} + } + + def __init__(self, agent_interactive_uI=None, azure_id=None, desired_idle=None, max_capacity=None, max_saved_node_count=None, orchestration_type=None, os_type=None, recycle_after_each_use=None, service_endpoint_id=None, service_endpoint_scope=None, time_to_live_minutes=None): + super(ElasticPoolSettings, self).__init__() + self.agent_interactive_uI = agent_interactive_uI + self.azure_id = azure_id + self.desired_idle = desired_idle + self.max_capacity = max_capacity + self.max_saved_node_count = max_saved_node_count + self.orchestration_type = orchestration_type + self.os_type = os_type + self.recycle_after_each_use = recycle_after_each_use + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_scope = service_endpoint_scope + self.time_to_live_minutes = time_to_live_minutes + + +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 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 TaskAgentPoolReference(Model): + """ + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + 'pool_type': {'key': 'poolType', 'type': 'object'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None): + super(TaskAgentPoolReference, self).__init__() + self.id = id + self.is_hosted = is_hosted + self.is_legacy = is_legacy + self.name = name + self.options = options + self.pool_type = pool_type + self.scope = scope + self.size = size + + +class TaskAgentQueue(Model): + """ + An agent queue. + + :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 TaskAgentPool(TaskAgentPoolReference): + """ + An organization-level grouping of agents. + + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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: The ID of the associated agent cloud. + :type agent_cloud_id: int + :param auto_provision: Whether or not a queue should be automatically provisioned for each project collection. + :type auto_provision: bool + :param auto_size: Whether or not the pool should autosize itself based on the Agent Cloud Provider settings. + :type auto_size: bool + :param auto_update: Whether or not agents in this pool are allowed to automatically update + :type auto_update: bool + :param created_by: Creator of the 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: The date/time of the pool creation. + :type created_on: datetime + :param owner: Owner or administrator of the pool. + :type owner: :class:`IdentityRef ` + :param properties: + :type properties: :class:`object ` + :param target_size: Target parallelism - Only applies to agent pools that are backed by pool providers. It will be null for regular pools. + :type target_size: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + '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'}, + 'auto_update': {'key': 'autoUpdate', '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'}, + 'target_size': {'key': 'targetSize', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None, agent_cloud_id=None, auto_provision=None, auto_size=None, auto_update=None, created_by=None, created_on=None, owner=None, properties=None, target_size=None): + super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, is_legacy=is_legacy, name=name, options=options, 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.auto_update = auto_update + self.created_by = created_by + self.created_on = created_on + self.owner = owner + self.properties = properties + self.target_size = target_size + + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'TaskAgentPool', +] diff --git a/azure-devops/azure/devops/v7_1/extension_management/__init__.py b/azure-devops/azure/devops/v7_1/extension_management/__init__.py new file mode 100644 index 00000000..47e66434 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/extension_management/__init__.py @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ExtensionAuditLog', + 'ExtensionAuditLogEntry', + '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' +] diff --git a/azure-devops/azure/devops/v7_1/extension_management/extension_management_client.py b/azure-devops/azure/devops/v7_1/extension_management/extension_management_client.py new file mode 100644 index 00000000..b7511e6e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/extension_management/extension_management_client.py @@ -0,0 +1,134 @@ +# -------------------------------------------------------------------------------------------- +# 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: Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific 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='7.1-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='7.1-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: Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific 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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + diff --git a/azure-devops/azure/devops/v7_1/extension_management/models.py b/azure-devops/azure/devops/v7_1/extension_management/models.py new file mode 100644 index 00000000..28af01a2 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/extension_management/models.py @@ -0,0 +1,1361 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param operation_state: State of 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): + """ + :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): + """ + Market item acquisition options (install, buy, etc) for an installation target. + + :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): + """ + Base class shared by contributions and contribution types + + :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): + """ + Specifies a constraint that can be used to dynamically include/exclude a given contribution + + :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 eliminate 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): + """ + Description about a property of a contribution type + + :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): + """ + A contribution type, given by a json schema + + :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): + """ + Contract for handling the extension acquisition process + + :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 ExtensionAuditLog(Model): + """ + Audit log for an extension + + :param entries: Collection of audit log entries + :type entries: list of :class:`ExtensionAuditLogEntry ` + :param extension_name: Extension that the change was made for + :type extension_name: str + :param publisher_name: Publisher that the extension is part of + :type publisher_name: str + """ + + _attribute_map = { + 'entries': {'key': 'entries', 'type': '[ExtensionAuditLogEntry]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, entries=None, extension_name=None, publisher_name=None): + super(ExtensionAuditLog, self).__init__() + self.entries = entries + self.extension_name = extension_name + self.publisher_name = publisher_name + + +class ExtensionAuditLogEntry(Model): + """ + An audit log entry for an extension + + :param audit_action: Change that was made to extension + :type audit_action: str + :param audit_date: Date at which the change was made + :type audit_date: datetime + :param comment: Extra information about the change + :type comment: str + :param updated_by: Represents the user who made the change + :type updated_by: :class:`IdentityRef ` + """ + + _attribute_map = { + 'audit_action': {'key': 'auditAction', 'type': 'str'}, + 'audit_date': {'key': 'auditDate', 'type': 'iso-8601'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'updated_by': {'key': 'updatedBy', 'type': 'IdentityRef'} + } + + def __init__(self, audit_action=None, audit_date=None, comment=None, updated_by=None): + super(ExtensionAuditLogEntry, self).__init__() + self.audit_action = audit_action + self.audit_date = audit_date + self.comment = comment + self.updated_by = updated_by + + +class ExtensionAuthorization(Model): + """ + :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): + """ + :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): + """ + Represents a single collection for extension data documents + + :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): + """ + Represents a query to receive a set of extension data collections + + :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): + """ + Base class for an event callback for an extension + + :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): + """ + Collection of event callbacks - endpoints called when particular extension events occur. + + :param post_disable: Optional. Defines an endpoint that gets called via a POST request 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 request 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 request 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 request 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 request 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 request 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): + """ + :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): + """ + Represents the component pieces of an extensions fully qualified name, along with the fully qualified name. + + :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): + """ + How an extension should handle including contributions based on licensing + + :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): + """ + Base class for extension properties which are shared by the extension manifest and the extension model + + :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 specified 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): + """ + Policy with a set of permissions on extension operations + + :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): + """ + A request for an extension (to be installed or have a license assigned) + + :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): + """ + :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): + """ + :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): + """ + :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 target_platform: + :type target_platform: 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 }]'}, + 'target_platform': {'key': 'targetPlatform', 'type': '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, target_platform=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.target_platform = target_platform + self.validation_result_message = validation_result_message + self.version = version + self.version_description = version_description + + +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 InstallationTarget(Model): + """ + :param extension_version: + :type extension_version: str + :param product_architecture: + :type product_architecture: str + :param target: + :type target: str + :param target_platform: + :type target_platform: str + :param target_version: + :type target_version: str + """ + + _attribute_map = { + 'extension_version': {'key': 'extensionVersion', 'type': 'str'}, + 'product_architecture': {'key': 'productArchitecture', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'target_platform': {'key': 'targetPlatform', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'} + } + + def __init__(self, extension_version=None, product_architecture=None, target=None, target_platform=None, target_version=None): + super(InstallationTarget, self).__init__() + self.extension_version = extension_version + self.product_architecture = product_architecture + self.target = target + self.target_platform = target_platform + self.target_version = target_version + + +class InstalledExtension(ExtensionManifest): + """ + Represents a VSTS extension along with its installation state + + :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 specified 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): + """ + :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): + """ + The state of an installed extension + + :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): + """ + Represents an installation issue + + :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): + """ + Maps a contribution to a licensing behavior + + :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): + """ + :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 present_in_conflict_list: Check if Extension is in conflict list or not. Taking as String and not as boolean because we don't want end customer to see this flag and by making it Boolean it is coming as false for all the cases. + :type present_in_conflict_list: 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'}, + 'present_in_conflict_list': {'key': 'presentInConflictList', '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, present_in_conflict_list=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.present_in_conflict_list = present_in_conflict_list + 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): + """ + High-level information about the publisher, like id's and names + + :param display_name: + :type display_name: str + :param domain: + :type domain: str + :param flags: + :type flags: object + :param is_domain_verified: + :type is_domain_verified: bool + :param publisher_id: + :type publisher_id: str + :param publisher_name: + :type publisher_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'flags': {'key': 'flags', 'type': 'object'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 'publisher_id': {'key': 'publisherId', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, display_name=None, domain=None, flags=None, is_domain_verified=None, publisher_id=None, publisher_name=None): + super(PublisherFacts, self).__init__() + self.display_name = display_name + self.domain = domain + self.flags = flags + self.is_domain_verified = is_domain_verified + self.publisher_id = publisher_id + self.publisher_name = publisher_name + + +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 RequestedExtension(Model): + """ + A request for an extension (to be installed or have a license assigned) + + :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): + """ + Represents the extension policy applied to a given user + + :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): + """ + An individual contribution made by an extension + + :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): + """ + The state of an extension + + :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', + 'ExtensionAuditLog', + 'ExtensionAuditLogEntry', + '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', +] diff --git a/azure-devops/azure/devops/v7_1/feature_availability/__init__.py b/azure-devops/azure/devops/v7_1/feature_availability/__init__.py new file mode 100644 index 00000000..d2d7dbd7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_availability/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/feature_availability/feature_availability_client.py b/azure-devops/azure/devops/v7_1/feature_availability/feature_availability_client.py new file mode 100644 index 00000000..2ca9f0ee --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_availability/feature_availability_client.py @@ -0,0 +1,137 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('FeatureFlag', response) + diff --git a/azure-devops/azure/devops/v7_1/feature_availability/models.py b/azure-devops/azure/devops/v7_1/feature_availability/models.py new file mode 100644 index 00000000..335a11e6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_availability/models.py @@ -0,0 +1,63 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + This is passed to the FeatureFlagController to edit the status of a feature flag + + :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', +] diff --git a/azure-devops/azure/devops/v7_1/feature_management/__init__.py b/azure-devops/azure/devops/v7_1/feature_management/__init__.py new file mode 100644 index 00000000..43a3bcca --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_management/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/feature_management/feature_management_client.py b/azure-devops/azure/devops/v7_1/feature_management/feature_management_client.py new file mode 100644 index 00000000..7f692d0e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_management/feature_management_client.py @@ -0,0 +1,218 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ContributedFeatureStateQuery', response) + diff --git a/azure-devops/azure/devops/v7_1/feature_management/models.py b/azure-devops/azure/devops/v7_1/feature_management/models.py new file mode 100644 index 00000000..d4ca2ae3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feature_management/models.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + A feature that can be enabled or disabled + + :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 occurred + :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): + """ + :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): + """ + An identifier and properties used to pass into a handler for a listener or plugin + + :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): + """ + The scope to which a feature setting applies + + :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): + """ + A contributed feature/state pair + + :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): + """ + A query for the effective contributed feature states for a list of feature ids + + :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): + """ + A rule for dynamically getting the enabled/disabled state of a feature + + :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): + """ + 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 + + +__all__ = [ + 'ContributedFeature', + 'ContributedFeatureHandlerSettings', + 'ContributedFeatureListener', + 'ContributedFeatureSettingScope', + 'ContributedFeatureState', + 'ContributedFeatureStateQuery', + 'ContributedFeatureValueRule', + 'ReferenceLinks', +] diff --git a/azure-devops/azure/devops/v7_1/feed/__init__.py b/azure-devops/azure/devops/v7_1/feed/__init__.py new file mode 100644 index 00000000..5a512119 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feed/__init__.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedIdsResult', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'FeedClient' +] diff --git a/azure-devops/azure/devops/v7_1/feed/feed_client.py b/azure-devops/azure/devops/v7_1/feed/feed_client.py new file mode 100644 index 00000000..1ac3b878 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feed/feed_client.py @@ -0,0 +1,893 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """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). + :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 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='7.1-preview.1', + route_values=route_values, + 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_feed_change(self, feed_id, project=None): + """GetFeedChange. + [Preview API] Query a feed to determine its current state. + :param str feed_id: Name or ID of the feed. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('FeedChange', response) + + def get_feed_changes(self, project=None, 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 str project: Project ID or project name + :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:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('FeedChangesResponse', response) + + def get_feeds_from_recycle_bin(self, project=None): + """GetFeedsFromRecycleBin. + [Preview API] Query for feeds within the recycle bin. + :param str project: Project ID or project name + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def permanent_delete_feed(self, feed_id, project=None): + """PermanentDeleteFeed. + [Preview API] + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + self._send(http_method='DELETE', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.1-preview.1', + route_values=route_values) + + def restore_deleted_feed(self, patch_json, feed_id, project=None): + """RestoreDeletedFeed. + [Preview API] + :param :class:`<[JsonPatchOperation]> ` patch_json: + :param str feed_id: + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(patch_json, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.1-preview.1', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + + def create_feed(self, feed, project=None): + """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. + :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(feed, 'Feed') + response = self._send(http_method='POST', + location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def delete_feed(self, feed_id, project=None): + """DeleteFeed. + [Preview API] Remove a feed and all its packages. The feed moves to the recycle bin and is reversible. + :param str feed_id: Name or Id of the feed. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_feed(self, feed_id, project=None, 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 str project: Project ID or project name + :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Feed', response) + + def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None, include_urls=None): + """GetFeeds. + [Preview API] Get all feeds in an account where you have the provided role access. + :param str project: Project ID or project name + :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. + :param bool include_urls: Resolve names if true + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + 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='c65009a7-474a-4ad1-8b42-7d852107ef8c', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def update_feed(self, feed, feed_id, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Feed', response) + + def get_global_permissions(self, include_ids=None): + """GetGlobalPermissions. + [Preview API] Get all service-wide feed creation and administration permissions. + :param bool include_ids: Set to true to add IdentityIds to the permission objects. + :rtype: [GlobalPermission] + """ + query_parameters = {} + if include_ids is not None: + query_parameters['includeIds'] = self._serialize.query('include_ids', include_ids, 'bool') + response = self._send(http_method='GET', + location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', + version='7.1-preview.1', + query_parameters=query_parameters) + 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 and administration. + :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='7.1-preview.1', + content=content) + return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) + + def get_package_changes(self, feed_id, project=None, 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 str project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageChangesResponse', response) + + def query_package_metrics(self, package_id_query, feed_id, project=None): + """QueryPackageMetrics. + [Preview API] + :param :class:` ` package_id_query: + :param str feed_id: + :param str project: Project ID or project name + :rtype: [PackageMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(package_id_query, 'PackageMetricsQuery') + response = self._send(http_method='POST', + location_id='bddc9b3c-8a59-4a9f-9b40-ee1dcaa2cc0d', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[PackageMetrics]', self._unwrap_collection(response)) + + def get_package(self, feed_id, package_id, project=None, 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 str project: Project ID or project 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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_packages(self, feed_id, project=None, 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 project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None, include_deleted_feeds=None): + """GetFeedPermissions. + [Preview API] Get the permissions for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :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. + :param bool include_deleted_feeds: If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid. + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + if include_deleted_feeds is not None: + query_parameters['includeDeletedFeeds'] = self._serialize.query('include_deleted_feeds', include_deleted_feeds, 'bool') + response = self._send(http_method='GET', + location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', + version='7.1-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, project=None): + """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. + :param str project: Project ID or project name + :rtype: [FeedPermission] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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). + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('PackageVersionProvenance', response) + + def empty_recycle_bin(self, feed_id, project=None): + """EmptyRecycleBin. + [Preview API] Queues a job to remove all package versions from a feed's recycle bin + :param str feed_id: Name or Id of the feed + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + response = self._send(http_method='DELETE', + location_id='2704e72c-f541-4141-99be-2004b50b05fa', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('OperationReference', response) + + def get_recycle_bin_package(self, feed_id, package_id, project=None, 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Package', response) + + def get_recycle_bin_packages(self, feed_id, project=None, 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 project: Project ID or project name + :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 project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None, 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None, 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 str project: Project ID or project name + :param bool include_urls: True to return REST Urls with the response. Default is True. + :rtype: [RecycleBinPackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """DeleteFeedRetentionPolicies. + [Preview API] Delete the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_feed_retention_policies(self, feed_id, project=None): + """GetFeedRetentionPolicies. + [Preview API] Get the retention policy for a feed. + :param str feed_id: Name or ID of the feed. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('FeedRetentionPolicy', response) + + def set_feed_retention_policies(self, policy, feed_id, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('FeedRetentionPolicy', response) + + def query_package_version_metrics(self, package_version_id_query, feed_id, package_id, project=None): + """QueryPackageVersionMetrics. + [Preview API] + :param :class:` ` package_version_id_query: + :param str feed_id: + :param str package_id: + :param str project: Project ID or project name + :rtype: [PackageVersionMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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') + content = self._serialize.body(package_version_id_query, 'PackageVersionMetricsQuery') + response = self._send(http_method='POST', + location_id='e6ae8caa-b6a8-4809-b840-91b2a42c19ad', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[PackageVersionMetrics]', self._unwrap_collection(response)) + + def get_package_version(self, feed_id, package_id, package_version_id, project=None, 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 str project: Project ID or project 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: This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PackageVersion', response) + + def get_package_versions(self, feed_id, package_id, project=None, 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 str project: Project ID or project 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: If set specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). + :rtype: [PackageVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + + def delete_feed_view(self, feed_id, view_id, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_feed_view(self, feed_id, view_id, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('FeedView', response) + + def get_feed_views(self, feed_id, project=None): + """GetFeedViews. + [Preview API] Get all views for a feed. + :param str feed_id: Name or Id of the feed. + :param str project: Project ID or project name + :rtype: [FeedView] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[FeedView]', self._unwrap_collection(response)) + + def update_feed_view(self, view, feed_id, view_id, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('FeedView', response) + diff --git a/azure-devops/azure/devops/v7_1/feed/models.py b/azure-devops/azure/devops/v7_1/feed/models.py new file mode 100644 index 00000000..66654445 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/feed/models.py @@ -0,0 +1,1274 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(FeedBatchOperationData, self).__init__() + + +class FeedCore(Model): + """ + An object that contains all of the settings for a specific 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 project: The project that this feed is associated with. + :type project: :class:`ProjectReference ` + :param upstream_enabled: 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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + '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, project=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.project = project + self.upstream_enabled = upstream_enabled + self.upstream_sources = upstream_sources + self.view = view + self.view_id = view_id + self.view_name = view_name + + +class FeedChange(Model): + """ + A container that encapsulates the state of the feed after a create, update, or delete. + + :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 change_type: The type of operation. + :type change_type: object + :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 = { + 'feed': {'key': 'feed', 'type': 'Feed'}, + 'feed_continuation_token': {'key': 'feedContinuationToken', 'type': 'long'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'latest_package_continuation_token': {'key': 'latestPackageContinuationToken', 'type': 'long'} + } + + def __init__(self, feed=None, feed_continuation_token=None, change_type=None, latest_package_continuation_token=None): + super(FeedChange, self).__init__() + self.feed = feed + self.feed_continuation_token = feed_continuation_token + self.change_type = change_type + self.latest_package_continuation_token = latest_package_continuation_token + + +class FeedChangesResponse(Model): + """ + A result set containing the feed changes for the range that was requested. + + :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 FeedIdsResult(Model): + """ + :param id: + :type id: str + :param name: + :type name: 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'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'} + } + + def __init__(self, id=None, name=None, project_id=None, project_name=None): + super(FeedIdsResult, self).__init__() + self.id = id + self.name = name + self.project_id = project_id + self.project_name = project_name + + +class FeedPermission(Model): + """ + Permissions for a feed. + + :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 is_inherited_role: Boolean indicating whether the role is inherited or set directly. + :type is_inherited_role: bool + :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'}, + 'is_inherited_role': {'key': 'isInheritedRole', 'type': 'bool'}, + 'role': {'key': 'role', 'type': 'object'} + } + + def __init__(self, display_name=None, identity_descriptor=None, identity_id=None, is_inherited_role=None, role=None): + super(FeedPermission, self).__init__() + self.display_name = display_name + self.identity_descriptor = identity_descriptor + self.identity_id = identity_id + self.is_inherited_role = is_inherited_role + self.role = role + + +class FeedRetentionPolicy(Model): + """ + Retention policy settings. + + :param age_limit_in_days: This attribute is deprecated and is not honoured by retention + :type age_limit_in_days: int + :param count_limit: Maximum versions to preserve per package and package type. + :type count_limit: int + :param days_to_keep_recently_downloaded_packages: Number of days to preserve a package version after its latest download. + :type days_to_keep_recently_downloaded_packages: int + """ + + _attribute_map = { + 'age_limit_in_days': {'key': 'ageLimitInDays', 'type': 'int'}, + 'count_limit': {'key': 'countLimit', 'type': 'int'}, + 'days_to_keep_recently_downloaded_packages': {'key': 'daysToKeepRecentlyDownloadedPackages', 'type': 'int'} + } + + def __init__(self, age_limit_in_days=None, count_limit=None, days_to_keep_recently_downloaded_packages=None): + super(FeedRetentionPolicy, self).__init__() + self.age_limit_in_days = age_limit_in_days + self.count_limit = count_limit + self.days_to_keep_recently_downloaded_packages = days_to_keep_recently_downloaded_packages + + +class FeedUpdate(Model): + """ + Update a feed definition with these new values. + + :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: 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): + """ + A view on top of a feed. + + :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): + """ + Permissions for feed service-wide operations such as the creation of new feeds. + + :param identity_descriptor: Identity of the user with the provided Role. + :type identity_descriptor: :class:`str ` + :param identity_id: IdentityId corresponding to the IdentityDescriptor + :type identity_id: str + :param role: Role associated with the Identity. + :type role: object + """ + + _attribute_map = { + 'identity_descriptor': {'key': 'identityDescriptor', 'type': 'str'}, + 'identity_id': {'key': 'identityId', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'object'} + } + + def __init__(self, identity_descriptor=None, identity_id=None, role=None): + super(GlobalPermission, self).__init__() + self.identity_descriptor = identity_descriptor + self.identity_id = identity_id + self.role = role + + +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 MinimalPackageVersion(Model): + """ + Core data about any package, including its id and version information and basic state. + + :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 and Cargo 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 OperationReference(Model): + """ + Reference for an async 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 + """ + + _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 Package(Model): + """ + A package, which is a container for one or more package versions. + + :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 PackageDependency(Model): + """ + A dependency on another package version. + + :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 PackageFile(Model): + """ + A package file for a specific package version, only relevant to package types that contain multiple files per version. + + :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 PackageChange(Model): + """ + A single change to a feed's packages. + + :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): + """ + A set of change operations to a feed's packages. + + :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 PackageMetrics(Model): + """ + All metrics for a certain package id + + :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(PackageMetrics, 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 PackageMetricsQuery(Model): + """ + Query to get package metrics + + :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(PackageMetricsQuery, self).__init__() + self.package_ids = package_ids + + +class PackageVersion(MinimalPackageVersion): + """ + A specific version of a package. + + :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 and Cargo 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): + """ + A change to a single package version. + + :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 change_type: The type of change that was performed. + :type change_type: object + :param package_version: Package version that was changed. + :type package_version: :class:`PackageVersion ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'long'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'package_version': {'key': 'packageVersion', 'type': 'PackageVersion'} + } + + def __init__(self, continuation_token=None, change_type=None, package_version=None): + super(PackageVersionChange, self).__init__() + self.continuation_token = continuation_token + self.change_type = change_type + self.package_version = package_version + + +class PackageVersionMetrics(Model): + """ + All metrics for a certain package version id + + :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 PackageVersionMetricsQuery(Model): + """ + Query to get package version metrics + + :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(PackageVersionMetricsQuery, self).__init__() + self.package_version_ids = package_version_ids + + +class PackageVersionProvenance(Model): + """ + Provenance for a published package version + + :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 ProjectReference(Model): + """ + :param id: Gets or sets id of the project. + :type id: str + :param name: Gets or sets name of the project. + :type name: str + :param visibility: Gets or sets 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 ProtocolMetadata(Model): + """ + Extended metadata for a specific package type. + + :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): + """ + Data about the origin of a published package + + :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): + """ + A single package version within the recycle bin. + + :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 and Cargo 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): + """ + 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 UpstreamSource(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param deleted_date: UTC date that this upstream was deleted. + :type deleted_date: datetime + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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_project_id: For an internal upstream type, track the project of the feed being referenced. + :type internal_upstream_project_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: Consistent 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 service_endpoint_id: The identity of the service endpoint that holds credentials to use when accessing the upstream. + :type service_endpoint_id: str + :param service_endpoint_project_id: Specifies the projectId of the Service Endpoint. + :type service_endpoint_project_id: str + :param status: Specifies the status of the upstream. + :type status: object + :param status_details: Provides a human-readable reason for the status of the upstream. + :type status_details: list of :class:`UpstreamStatusDetail ` + :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'}, + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'internal_upstream_collection_id': {'key': 'internalUpstreamCollectionId', 'type': 'str'}, + 'internal_upstream_feed_id': {'key': 'internalUpstreamFeedId', 'type': 'str'}, + 'internal_upstream_project_id': {'key': 'internalUpstreamProjectId', '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'}, + 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, + 'service_endpoint_project_id': {'key': 'serviceEndpointProjectId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_details': {'key': 'statusDetails', 'type': '[UpstreamStatusDetail]'}, + 'upstream_source_type': {'key': 'upstreamSourceType', 'type': 'object'} + } + + def __init__(self, deleted_date=None, display_location=None, id=None, internal_upstream_collection_id=None, internal_upstream_feed_id=None, internal_upstream_project_id=None, internal_upstream_view_id=None, location=None, name=None, protocol=None, service_endpoint_id=None, service_endpoint_project_id=None, status=None, status_details=None, upstream_source_type=None): + super(UpstreamSource, self).__init__() + self.deleted_date = deleted_date + self.display_location = display_location + self.id = id + self.internal_upstream_collection_id = internal_upstream_collection_id + self.internal_upstream_feed_id = internal_upstream_feed_id + self.internal_upstream_project_id = internal_upstream_project_id + self.internal_upstream_view_id = internal_upstream_view_id + self.location = location + self.name = name + self.protocol = protocol + self.service_endpoint_id = service_endpoint_id + self.service_endpoint_project_id = service_endpoint_project_id + self.status = status + self.status_details = status_details + self.upstream_source_type = upstream_source_type + + +class UpstreamStatusDetail(Model): + """ + :param reason: Provides a human-readable reason for the status of the upstream. + :type reason: str + """ + + _attribute_map = { + 'reason': {'key': 'reason', 'type': 'str'} + } + + def __init__(self, reason=None): + super(UpstreamStatusDetail, self).__init__() + self.reason = reason + + +class Feed(FeedCore): + """ + A container for artifacts. + + :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 project: The project that this feed is associated with. + :type project: :class:`ProjectReference ` + :param upstream_enabled: 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 permanent_deleted_date: The date that this feed was permanently deleted. + :type permanent_deleted_date: datetime + :param permissions: Explicit permissions for the feed. + :type permissions: list of :class:`FeedPermission ` + :param scheduled_permanent_delete_date: The date that this feed is scheduled to be permanently deleted. + :type scheduled_permanent_delete_date: datetime + :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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + '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'}, + 'permanent_deleted_date': {'key': 'permanentDeletedDate', 'type': 'iso-8601'}, + 'permissions': {'key': 'permissions', 'type': '[FeedPermission]'}, + 'scheduled_permanent_delete_date': {'key': 'scheduledPermanentDeleteDate', 'type': 'iso-8601'}, + '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, project=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, permanent_deleted_date=None, permissions=None, scheduled_permanent_delete_date=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, project=project, 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.permanent_deleted_date = permanent_deleted_date + self.permissions = permissions + self.scheduled_permanent_delete_date = scheduled_permanent_delete_date + self.upstream_enabled_changed_date = upstream_enabled_changed_date + self.url = url + + +__all__ = [ + 'FeedBatchData', + 'FeedBatchOperationData', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedIdsResult', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'Feed', +] diff --git a/azure-devops/azure/devops/v7_1/file_container/__init__.py b/azure-devops/azure/devops/v7_1/file_container/__init__.py new file mode 100644 index 00000000..93d64706 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/file_container/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'ContainerItemBlobReference', + 'FileContainer', + 'FileContainerItem', + 'FileContainerClient' +] diff --git a/azure-devops/azure/devops/v7_1/file_container/file_container_client.py b/azure-devops/azure/devops/v7_1/file_container/file_container_client.py new file mode 100644 index 00000000..2cfec2e4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/file_container/file_container_client.py @@ -0,0 +1,136 @@ +# -------------------------------------------------------------------------------------------- +# 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 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='7.1-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='7.1-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='7.1-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, ignore_requested_media_type=None, include_blob_metadata=None, save_absolute_path=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: + :param bool ignore_requested_media_type: + :param bool include_blob_metadata: + :param bool save_absolute_path: + :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') + if ignore_requested_media_type is not None: + query_parameters['ignoreRequestedMediaType'] = self._serialize.query('ignore_requested_media_type', ignore_requested_media_type, 'bool') + if include_blob_metadata is not None: + query_parameters['includeBlobMetadata'] = self._serialize.query('include_blob_metadata', include_blob_metadata, 'bool') + if save_absolute_path is not None: + query_parameters['saveAbsolutePath'] = self._serialize.query('save_absolute_path', save_absolute_path, 'bool') + response = self._send(http_method='GET', + location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[FileContainerItem]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/file_container/models.py b/azure-devops/azure/devops/v7_1/file_container/models.py new file mode 100644 index 00000000..7f645bfe --- /dev/null +++ b/azure-devops/azure/devops/v7_1/file_container/models.py @@ -0,0 +1,211 @@ +# -------------------------------------------------------------------------------------------- +# 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 ContainerItemBlobReference(Model): + """ + Represents an reference to a file in Blobstore + + :param artifact_hash: + :type artifact_hash: str + :param artifact_id: + :type artifact_id: long + :param compression_type: + :type compression_type: object + :param scope_identifier: + :type scope_identifier: str + :param session_id: + :type session_id: str + """ + + _attribute_map = { + 'artifact_hash': {'key': 'artifactHash', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'long'}, + 'compression_type': {'key': 'compressionType', 'type': 'object'}, + 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, + 'session_id': {'key': 'sessionId', 'type': 'str'} + } + + def __init__(self, artifact_hash=None, artifact_id=None, compression_type=None, scope_identifier=None, session_id=None): + super(ContainerItemBlobReference, self).__init__() + self.artifact_hash = artifact_hash + self.artifact_id = artifact_id + self.compression_type = compression_type + self.scope_identifier = scope_identifier + self.session_id = session_id + + +class FileContainer(Model): + """ + Represents a container that encapsulates a hierarchical file system. + + :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): + """ + Represents an item in a container. + + :param artifact_id: Id for Blobstore reference + :type artifact_id: long + :param blob_metadata: + :type blob_metadata: :class:`ContainerItemBlobReference ` + :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 = { + 'artifact_id': {'key': 'artifactId', 'type': 'long'}, + 'blob_metadata': {'key': 'blobMetadata', 'type': 'ContainerItemBlobReference'}, + '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, artifact_id=None, blob_metadata=None, 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.artifact_id = artifact_id + self.blob_metadata = blob_metadata + 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__ = [ + 'ContainerItemBlobReference', + 'FileContainer', + 'FileContainerItem', +] diff --git a/azure-devops/azure/devops/v7_1/gallery/__init__.py b/azure-devops/azure/devops/v7_1/gallery/__init__.py new file mode 100644 index 00000000..9801c2bc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/gallery/__init__.py @@ -0,0 +1,79 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'CustomerSupportRequest', + 'EventCounts', + 'ExtensionAcquisitionRequest', + 'ExtensionBadge', + 'ExtensionCategory', + 'ExtensionDailyStat', + 'ExtensionDailyStats', + 'ExtensionDraft', + 'ExtensionDraftAsset', + 'ExtensionDraftPatch', + 'ExtensionEvent', + 'ExtensionEvents', + 'ExtensionFile', + 'ExtensionFilterResult', + 'ExtensionFilterResultMetadata', + 'ExtensionPackage', + 'ExtensionPayload', + 'ExtensionQuery', + 'ExtensionQueryResult', + 'ExtensionShare', + 'ExtensionStatistic', + 'ExtensionStatisticUpdate', + 'ExtensionVersion', + 'FilterCriteria', + 'GraphSubjectBase', + 'IdentityRef', + 'InstallationTarget', + 'MetadataItem', + 'NotificationsData', + 'ProductCategoriesResult', + 'ProductCategory', + 'PublishedExtension', + 'Publisher', + 'PublisherBase', + 'PublisherFacts', + 'PublisherFilterResult', + 'PublisherQuery', + 'PublisherQueryResult', + 'PublisherRoleAssignment', + 'PublisherSecurityRole', + 'PublisherUserRoleAssignmentRef', + 'QnAItem', + 'QueryFilter', + 'Question', + 'QuestionsResult', + 'RatingCountPerRating', + 'ReferenceLinks', + 'Response', + 'Review', + 'ReviewPatch', + 'ReviewReply', + 'ReviewsResult', + 'ReviewSummary', + 'UnpackagedExtensionData', + 'UserIdentityRef', + 'UserReportedConcern', + 'GalleryClient' +] diff --git a/azure-devops/azure/devops/v7_1/gallery/gallery_client.py b/azure-devops/azure/devops/v7_1/gallery/gallery_client.py new file mode 100644 index 00000000..38fc3c8d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/gallery/gallery_client.py @@ -0,0 +1,1971 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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, product_architecture=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: + :param str product_architecture: + :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') + if product_architecture is not None: + query_parameters['productArchitecture'] = self._serialize.query('product_architecture', product_architecture, 'str') + response = self._send(http_method='GET', + location_id='1102bb42-82b0-4955-8d8a-435d6b4cedd3', + version='7.1-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='7.1-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='7.1-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='7.1-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_support_request(self, customer_support_request): + """CreateSupportRequest. + [Preview API] + :param :class:` ` customer_support_request: + """ + content = self._serialize.body(customer_support_request, 'CustomerSupportRequest') + self._send(http_method='POST', + location_id='8eded385-026a-4c15-b810-b8eb402771f1', + version='7.1-preview.1', + content=content) + + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + query_parameters=query_parameters, + additional_headers=additional_headers, + content=content) + return self._deserialize('ExtensionQueryResult', response) + + def create_extension(self, upload_stream, extension_type=None, re_captcha_token=None, **kwargs): + """CreateExtension. + [Preview API] + :param object upload_stream: Stream to upload + :param str extension_type: + :param str re_captcha_token: + :rtype: :class:` ` + """ + query_parameters = {} + if extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, '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='a41192c8-9525-4b58-bc86-179fa549d80d', + version='7.1-preview.2', + query_parameters=query_parameters, + 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='7.1-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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PublishedExtension', response) + + def update_extension_by_id(self, extension_id, re_captcha_token=None): + """UpdateExtensionById. + [Preview API] + :param str extension_id: + :param str re_captcha_token: + :rtype: :class:` ` + """ + route_values = {} + if extension_id is not None: + route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') + query_parameters = {} + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, 'str') + response = self._send(http_method='PUT', + location_id='a41192c8-9525-4b58-bc86-179fa549d80d', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PublishedExtension', response) + + def create_extension_with_publisher(self, upload_stream, publisher_name, extension_type=None, re_captcha_token=None, **kwargs): + """CreateExtensionWithPublisher. + [Preview API] + :param object upload_stream: Stream to upload + :param str publisher_name: + :param str extension_type: + :param str re_captcha_token: + :rtype: :class:` ` + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, '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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + 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='7.1-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='7.1-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, extension_type=None, re_captcha_token=None, 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 str extension_type: + :param str re_captcha_token: + :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 extension_type is not None: + query_parameters['extensionType'] = self._serialize.query('extension_type', extension_type, 'str') + if re_captcha_token is not None: + query_parameters['reCaptchaToken'] = self._serialize.query('re_captcha_token', re_captcha_token, 'str') + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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 fetch_domain_token(self, publisher_name): + """FetchDomainToken. + [Preview API] + :param str publisher_name: + :rtype: str + """ + 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='67a609ef-fa74-4b52-8664-78d76f7b3634', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('str', response) + + def verify_domain_token(self, publisher_name): + """VerifyDomainToken. + [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='PUT', + location_id='67a609ef-fa74-4b52-8664-78d76f7b3634', + version='7.1-preview.1', + route_values=route_values) + + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Publisher', response) + + def update_publisher_members(self, role_assignments, publisher_name, limit_to_caller_identity_domain=None): + """UpdatePublisherMembers. + [Preview API] Endpoint to add/modify publisher membership. Currently Supports only addition/modification of 1 user at a time Works only for adding members of same tenant. + :param [PublisherUserRoleAssignmentRef] role_assignments: List of user identifiers(email address) and role to be added. Currently only one entry is supported. + :param str publisher_name: The name/id of publisher to which users have to be added + :param bool limit_to_caller_identity_domain: Should cross tenant addtions be allowed or not. + :rtype: [PublisherRoleAssignment] + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if limit_to_caller_identity_domain is not None: + query_parameters['limitToCallerIdentityDomain'] = self._serialize.query('limit_to_caller_identity_domain', limit_to_caller_identity_domain, 'bool') + content = self._serialize.body(role_assignments, '[PublisherUserRoleAssignmentRef]') + response = self._send(http_method='POST', + location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[PublisherRoleAssignment]', self._unwrap_collection(response)) + + def get_publisher_without_token(self, publisher_name): + """GetPublisherWithoutToken. + [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='215a2ed8-458a-4850-ad5a-45f1dabc3461', + version='7.1-preview.1', + route_values=route_values) + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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 publisher 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='7.1-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 publisher 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('ExtensionDailyStats', response) + + def increment_extension_daily_stat(self, publisher_name, extension_name, version, stat_type, target_platform=None): + """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 + :param str target_platform: + """ + 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') + if target_platform is not None: + query_parameters['targetPlatform'] = self._serialize.query('target_platform', target_platform, 'str') + self._send(http_method='POST', + location_id='4fa7adb6-ca65-4075-a232-5f28323288ea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + + def get_verification_log(self, publisher_name, extension_name, version, target_platform=None, **kwargs): + """GetVerificationLog. + [Preview API] + :param str publisher_name: + :param str extension_name: + :param str version: + :param str target_platform: + :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 target_platform is not None: + query_parameters['targetPlatform'] = self._serialize.query('target_platform', target_platform, 'str') + response = self._send(http_method='GET', + location_id='c5523abe-b843-437f-875b-5833064efe4d', + version='7.1-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_vSCode_web_extension_statistics(self, item_name, version, stat_type): + """UpdateVSCodeWebExtensionStatistics. + [Preview API] + :param str item_name: + :param str version: + :param VSCodeWebExtensionStatisicsType stat_type: + """ + route_values = {} + if item_name is not None: + route_values['itemName'] = self._serialize.url('item_name', item_name, 'str') + if version is not None: + route_values['version'] = self._serialize.url('version', version, 'str') + if stat_type is not None: + route_values['statType'] = self._serialize.url('stat_type', stat_type, 'VSCodeWebExtensionStatisicsType') + self._send(http_method='POST', + location_id='205c91a8-7841-4fd3-ae4f-5a745d5a8df5', + version='7.1-preview.1', + route_values=route_values) + diff --git a/azure-devops/azure/devops/v7_1/gallery/models.py b/azure-devops/azure/devops/v7_1/gallery/models.py new file mode 100644 index 00000000..440f72e9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/gallery/models.py @@ -0,0 +1,2152 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param operation_state: State of 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): + """ + Market item acquisition options (install, buy, etc) for an installation target. + + :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): + """ + :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 publisher 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): + """ + :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): + """ + :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): + """ + :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): + """ + This is the set of categories in response to the get category query + + :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): + """ + Definition of one title of a category + + :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 CustomerSupportRequest(Model): + """ + An entity representing the data required to create a Customer Support Request. + + :param display_name: Display name of extension in concern + :type display_name: str + :param email_id: Email of user making the support request + :type email_id: str + :param extension_name: Extension name + :type extension_name: str + :param extension_uRL: Link to the extension details page + :type extension_uRL: str + :param message: User-provided support request message. + :type message: str + :param publisher_name: Publisher name + :type publisher_name: str + :param reason: Reason for support request + :type reason: str + :param re_captcha_token: + :type re_captcha_token: str + :param reporter_vSID: VSID of the user making the support request + :type reporter_vSID: str + :param review: Review under concern + :type review: :class:`Review ` + :param source_link: The UI source through which the request was made + :type source_link: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'email_id': {'key': 'emailId', 'type': 'str'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_uRL': {'key': 'extensionURL', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'}, + 'reporter_vSID': {'key': 'reporterVSID', 'type': 'str'}, + 'review': {'key': 'review', 'type': 'Review'}, + 'source_link': {'key': 'sourceLink', 'type': 'str'} + } + + def __init__(self, display_name=None, email_id=None, extension_name=None, extension_uRL=None, message=None, publisher_name=None, reason=None, re_captcha_token=None, reporter_vSID=None, review=None, source_link=None): + super(CustomerSupportRequest, self).__init__() + self.display_name = display_name + self.email_id = email_id + self.extension_name = extension_name + self.extension_uRL = extension_uRL + self.message = message + self.publisher_name = publisher_name + self.reason = reason + self.re_captcha_token = re_captcha_token + self.reporter_vSID = reporter_vSID + self.review = review + self.source_link = source_link + + +class EventCounts(Model): + """ + :param average_rating: Average rating on the day for extension + :type average_rating: float + :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': 'float'}, + '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): + """ + Contract for handling the extension acquisition process + + :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): + """ + :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): + """ + :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 language 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): + """ + :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): + """ + :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): + """ + :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): + """ + :param extension_data: + :type extension_data: :class:`UnpackagedExtensionData ` + :param operation: + :type operation: object + :param re_captcha_token: + :type re_captcha_token: str + """ + + _attribute_map = { + 'extension_data': {'key': 'extensionData', 'type': 'UnpackagedExtensionData'}, + 'operation': {'key': 'operation', 'type': 'object'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + def __init__(self, extension_data=None, operation=None, re_captcha_token=None): + super(ExtensionDraftPatch, self).__init__() + self.extension_data = extension_data + self.operation = operation + self.re_captcha_token = re_captcha_token + + +class ExtensionEvent(Model): + """ + Stores details of each event + + :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): + """ + Container object for all extension events. Stores all install and uninstall events related to an extension. The events container is generic so can store data of any type of event. New event types can be added without altering the contract. + + :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): + """ + :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): + """ + The FilterResult is the set of extensions that matched a particular query filter. + + :param extensions: This is the set of applications 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 is one set of metadata for the result e.g. Total count. There can be multiple metadata items for one metadata. + + :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): + """ + Package that will be used to create or update a published extension + + :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): + """ + :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): + """ + An ExtensionQuery is used to search the gallery for a set of extensions that match one of many filter values. + + :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 determine 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): + """ + This is the set of extensions that matched a supplied query through the filters given. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 target_platform: + :type target_platform: 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 }]'}, + 'target_platform': {'key': 'targetPlatform', 'type': '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, target_platform=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.target_platform = target_platform + self.validation_result_message = validation_result_message + self.version = version + self.version_description = version_description + + +class FilterCriteria(Model): + """ + One condition in a QueryFilter. + + :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 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 InstallationTarget(Model): + """ + :param extension_version: + :type extension_version: str + :param product_architecture: + :type product_architecture: str + :param target: + :type target: str + :param target_platform: + :type target_platform: str + :param target_version: + :type target_version: str + """ + + _attribute_map = { + 'extension_version': {'key': 'extensionVersion', 'type': 'str'}, + 'product_architecture': {'key': 'productArchitecture', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'target_platform': {'key': 'targetPlatform', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'} + } + + def __init__(self, extension_version=None, product_architecture=None, target=None, target_platform=None, target_version=None): + super(InstallationTarget, self).__init__() + self.extension_version = extension_version + self.product_architecture = product_architecture + self.target = target + self.target_platform = target_platform + self.target_version = target_version + + +class MetadataItem(Model): + """ + MetadataItem is one value of metadata under a given category of metadata + + :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): + """ + Information needed for sending mail notification + + :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): + """ + This is the set of categories in response to the get category query + + :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): + """ + This is the interface object to be used by Root Categories and Category Tree APIs for Visual Studio Ide. + + :param has_children: Indicator whether this is a leaf or there are children under this category + :type has_children: bool + :param children: + :type children: list of :class:`ProductCategory ` + :param id: Individual Guid of the Category + :type id: str + :param title: Category Title in the requested language + :type title: str + """ + + _attribute_map = { + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[ProductCategory]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'} + } + + def __init__(self, has_children=None, children=None, id=None, title=None): + super(ProductCategory, self).__init__() + self.has_children = has_children + self.children = children + self.id = id + self.title = title + + +class PublishedExtension(Model): + """ + :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 present_in_conflict_list: Check if Extension is in conflict list or not. Taking as String and not as boolean because we don't want end customer to see this flag and by making it Boolean it is coming as false for all the cases. + :type present_in_conflict_list: 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'}, + 'present_in_conflict_list': {'key': 'presentInConflictList', '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, present_in_conflict_list=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.present_in_conflict_list = present_in_conflict_list + 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): + """ + Keeping base class separate since publisher DB model class and publisher contract class share these common properties + + :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): + """ + High-level information about the publisher, like id's and names + + :param display_name: + :type display_name: str + :param domain: + :type domain: str + :param flags: + :type flags: object + :param is_domain_verified: + :type is_domain_verified: bool + :param publisher_id: + :type publisher_id: str + :param publisher_name: + :type publisher_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'flags': {'key': 'flags', 'type': 'object'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 'publisher_id': {'key': 'publisherId', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'} + } + + def __init__(self, display_name=None, domain=None, flags=None, is_domain_verified=None, publisher_id=None, publisher_name=None): + super(PublisherFacts, self).__init__() + self.display_name = display_name + self.domain = domain + self.flags = flags + self.is_domain_verified = is_domain_verified + self.publisher_id = publisher_id + self.publisher_name = publisher_name + + +class PublisherFilterResult(Model): + """ + The FilterResult is the set of publishers that matched a particular query filter. + + :param publishers: This is the set of applications 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): + """ + An PublisherQuery is used to search the gallery for a set of publishers that match one of many filter values. + + :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 determine 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): + """ + This is the set of publishers that matched a supplied query through the filters given. + + :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 PublisherRoleAssignment(Model): + """ + :param access: Designates the role as explicitly assigned or inherited. + :type access: object + :param access_display_name: User friendly description of access assignment. + :type access_display_name: str + :param identity: The user to whom the role is assigned. + :type identity: :class:`IdentityRef ` + :param role: The role assigned to the user. + :type role: :class:`PublisherSecurityRole ` + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'object'}, + 'access_display_name': {'key': 'accessDisplayName', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'IdentityRef'}, + 'role': {'key': 'role', 'type': 'PublisherSecurityRole'} + } + + def __init__(self, access=None, access_display_name=None, identity=None, role=None): + super(PublisherRoleAssignment, self).__init__() + self.access = access + self.access_display_name = access_display_name + self.identity = identity + self.role = role + + +class PublisherSecurityRole(Model): + """ + :param allow_permissions: Permissions the role is allowed. + :type allow_permissions: int + :param deny_permissions: Permissions the role is denied. + :type deny_permissions: int + :param description: Description of user access defined by the role + :type description: str + :param display_name: User friendly name of the role. + :type display_name: str + :param identifier: Globally unique identifier for the role. + :type identifier: str + :param name: Unique name of the role in the scope. + :type name: str + :param scope: Returns the id of the ParentScope. + :type scope: str + """ + + _attribute_map = { + 'allow_permissions': {'key': 'allowPermissions', 'type': 'int'}, + 'deny_permissions': {'key': 'denyPermissions', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'identifier': {'key': 'identifier', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'} + } + + def __init__(self, allow_permissions=None, deny_permissions=None, description=None, display_name=None, identifier=None, name=None, scope=None): + super(PublisherSecurityRole, self).__init__() + self.allow_permissions = allow_permissions + self.deny_permissions = deny_permissions + self.description = description + self.display_name = display_name + self.identifier = identifier + self.name = name + self.scope = scope + + +class PublisherUserRoleAssignmentRef(Model): + """ + :param role_name: The name of the role assigned. + :type role_name: str + :param unique_name: Identifier of the user given the role assignment. + :type unique_name: str + :param user_id: Unique id of the user given the role assignment. + :type user_id: str + """ + + _attribute_map = { + 'role_name': {'key': 'roleName', 'type': 'str'}, + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'} + } + + def __init__(self, role_name=None, unique_name=None, user_id=None): + super(PublisherUserRoleAssignmentRef, self).__init__() + self.role_name = role_name + self.unique_name = unique_name + self.user_id = user_id + + +class QnAItem(Model): + """ + The core structure of a QnA item + + :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): + """ + A filter used to define a set of extensions to return during a query. + + :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 embedded 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): + """ + The structure of the question / thread + + :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 re_captcha_token: + :type re_captcha_token: str + :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'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'}, + 'responses': {'key': 'responses', 'type': '[Response]'} + } + + def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, re_captcha_token=None, responses=None): + super(Question, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) + self.re_captcha_token = re_captcha_token + self.responses = responses + + +class QuestionsResult(Model): + """ + :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): + """ + :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): + """ + 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 Response(QnAItem): + """ + The structure of a 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 ` + :param re_captcha_token: + :type re_captcha_token: str + """ + + _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'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, re_captcha_token=None): + super(Response, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) + self.re_captcha_token = re_captcha_token + + +class Review(Model): + """ + :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 provided by the user + :type rating: str + :param re_captcha_token: + :type re_captcha_token: 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'}, + 're_captcha_token': {'key': 'reCaptchaToken', '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, re_captcha_token=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.re_captcha_token = re_captcha_token + 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): + """ + :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): + """ + :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): + """ + :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): + """ + :param average_rating: Average Rating + :type average_rating: float + :param rating_count: Count of total ratings + :type rating_count: long + :param rating_split: Split of count across rating + :type rating_split: list of :class:`RatingCountPerRating ` + """ + + _attribute_map = { + 'average_rating': {'key': 'averageRating', 'type': 'float'}, + '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): + """ + :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): + """ + Identity reference with name and guid + + :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): + """ + :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): + """ + The structure of a Concern Rather than defining a separate data structure having same fields as QnAItem, we are inheriting from the 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 ` + :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): + """ + :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): + """ + :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 ` + :param domain: + :type domain: str + :param is_dns_token_verified: + :type is_dns_token_verified: bool + :param is_domain_verified: + :type is_domain_verified: bool + :param re_captcha_token: + :type re_captcha_token: str + """ + + _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'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'is_dns_token_verified': {'key': 'isDnsTokenVerified', 'type': 'bool'}, + 'is_domain_verified': {'key': 'isDomainVerified', 'type': 'bool'}, + 're_captcha_token': {'key': 'reCaptchaToken', 'type': 'str'} + } + + 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, domain=None, is_dns_token_verified=None, is_domain_verified=None, re_captcha_token=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 + self.domain = domain + self.is_dns_token_verified = is_dns_token_verified + self.is_domain_verified = is_domain_verified + self.re_captcha_token = re_captcha_token + + +__all__ = [ + 'AcquisitionOperation', + 'AcquisitionOptions', + 'Answers', + 'AssetDetails', + 'AzurePublisher', + 'AzureRestApiRequestModel', + 'CategoriesResult', + 'CategoryLanguageTitle', + 'CustomerSupportRequest', + 'EventCounts', + 'ExtensionAcquisitionRequest', + 'ExtensionBadge', + 'ExtensionCategory', + 'ExtensionDailyStat', + 'ExtensionDailyStats', + 'ExtensionDraft', + 'ExtensionDraftPatch', + 'ExtensionEvent', + 'ExtensionEvents', + 'ExtensionFile', + 'ExtensionFilterResult', + 'ExtensionFilterResultMetadata', + 'ExtensionPackage', + 'ExtensionPayload', + 'ExtensionQuery', + 'ExtensionQueryResult', + 'ExtensionShare', + 'ExtensionStatistic', + 'ExtensionStatisticUpdate', + 'ExtensionVersion', + 'FilterCriteria', + 'GraphSubjectBase', + 'IdentityRef', + 'InstallationTarget', + 'MetadataItem', + 'NotificationsData', + 'ProductCategoriesResult', + 'ProductCategory', + 'PublishedExtension', + 'PublisherBase', + 'PublisherFacts', + 'PublisherFilterResult', + 'PublisherQuery', + 'PublisherQueryResult', + 'PublisherRoleAssignment', + 'PublisherSecurityRole', + 'PublisherUserRoleAssignmentRef', + 'QnAItem', + 'QueryFilter', + 'Question', + 'QuestionsResult', + 'RatingCountPerRating', + 'ReferenceLinks', + 'Response', + 'Review', + 'ReviewPatch', + 'ReviewReply', + 'ReviewsResult', + 'ReviewSummary', + 'UnpackagedExtensionData', + 'UserIdentityRef', + 'UserReportedConcern', + 'Concern', + 'ExtensionDraftAsset', + 'Publisher', +] diff --git a/azure-devops/azure/devops/v7_1/git/__init__.py b/azure-devops/azure/devops/v7_1/git/__init__.py new file mode 100644 index 00000000..74a474b5 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/git/__init__.py @@ -0,0 +1,126 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AdvSecEnablementStatus', + 'AdvSecEnablementUpdate', + 'Attachment', + 'BillableCommitter', + 'BillableCommitterDetail', + 'Comment', + 'CommentIterationContext', + 'CommentPosition', + 'CommentThread', + 'CommentThreadContext', + 'CommentTrackingCriteria', + 'FileContentMetadata', + 'FileDiff', + 'FileDiffParams', + 'FileDiffsCriteria', + 'GitAnnotatedTag', + 'GitAsyncRefOperation', + 'GitAsyncRefOperationDetail', + 'GitAsyncRefOperationParameters', + 'GitAsyncRefOperationSource', + 'GitBaseVersionDescriptor', + 'GitBlobRef', + 'GitBranchStats', + 'GitCommit', + 'GitCommitDiffs', + 'GitCommitChanges', + 'GitCommitRef', + 'GitConflict', + 'GitConflictUpdateResult', + 'GitDeletedRepository', + 'GitFilePathsCollection', + 'GitForkOperationStatusDetail', + 'GitForkRef', + 'GitForkSyncRequest', + 'GitForkSyncRequestParameters', + 'GitCherryPick', + 'GitImportGitSource', + 'GitImportRequest', + 'GitImportRequestParameters', + 'GitImportStatusDetail', + 'GitImportTfvcSource', + 'GitItem', + 'GitItemDescriptor', + 'GitItemRequestData', + 'GitMerge', + 'GitMergeOperationStatusDetail', + 'GitMergeOriginRef', + 'GitMergeParameters', + 'GitObject', + 'GitPolicyConfigurationResponse', + 'GitPullRequest', + 'GitPullRequestCommentThread', + 'GitPullRequestCommentThreadContext', + 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', + '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', + 'Change', + 'IdentityRef', + 'IdentityRefWithVote', + 'ImportRepositoryValidation', + 'ItemContent', + 'ItemModel', + 'JsonPatchOperation', + 'LineDiffBlock', + 'PolicyConfiguration', + 'PolicyConfigurationRef', + 'PolicyTypeRef', + 'ReferenceLinks', + 'ResourceRef', + 'ShareNotificationContext', + 'SourceToTargetRef', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'VersionedPolicyConfigurationRef', + 'VstsInfo', + 'WebApiCreateTagRequestData', + 'WebApiTagDefinition', + 'GitClient' +] diff --git a/azure-devops/azure/devops/v7_1/git/git_client.py b/azure-devops/azure/devops/v7_1/git/git_client.py new file mode 100644 index 00000000..c28e80df --- /dev/null +++ b/azure-devops/azure/devops/v7_1/git/git_client.py @@ -0,0 +1,39 @@ +# 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) \ No newline at end of file diff --git a/azure-devops/azure/devops/v7_1/git/git_client_base.py b/azure-devops/azure/devops/v7_1/git/git_client_base.py new file mode 100644 index 00000000..7d5efe20 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/git/git_client_base.py @@ -0,0 +1,3360 @@ +# -------------------------------------------------------------------------------------------- +# 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 get_permission(self, project_name=None, repository_id=None, permission=None): + """GetPermission. + [Preview API] GET Advanced Security Permission status. + :param str project_name: + :param str repository_id: Repository user is trying to access + :param str permission: Permission being requestd, must be "viewAlert" "dismissAlert" or "manage" + :rtype: bool + """ + query_parameters = {} + if project_name is not None: + query_parameters['$projectName'] = self._serialize.query('project_name', project_name, 'str') + if repository_id is not None: + query_parameters['$repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if permission is not None: + query_parameters['$permission'] = self._serialize.query('permission', permission, 'str') + response = self._send(http_method='GET', + location_id='61b21a05-a60f-4910-a733-ba5347c2142d', + version='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('bool', response) + + 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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-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_blobs_zip(self, blob_ids, repository_id, project=None, filename=None, **kwargs): + """GetBlobsZip. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-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 get_branch(self, repository_id, name, project=None, base_version_descriptor=None): + """GetBranch. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitBranchStats]', self._unwrap_collection(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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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 search_criteria.show_oldest_commits_first is not None: + query_parameters['searchCriteria.showOldestCommitsFirst'] = search_criteria.show_oldest_commits_first + 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-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. It syncs two existing forks. To create a fork, please see the repositories endpoint + :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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitForkSyncRequest]', self._unwrap_collection(response)) + + def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): + """GetChanges. + [Preview API] 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='7.1-preview.1', + 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='7.1-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 operation 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='7.1-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 operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations. + :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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitCherryPick', 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='7.1-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='7.1-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='7.1-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='7.1-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, sanitize=None): + """GetItem. + [Preview API] 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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.1-preview.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, sanitize=None, **kwargs): + """GetItemContent. + [Preview API] 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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.1-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_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, zip_for_unix=None): + """GetItems. + [Preview API] 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. + :param bool zip_for_unix: Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks + :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 + if zip_for_unix is not None: + query_parameters['zipForUnix'] = self._serialize.query('zip_for_unix', zip_for_unix, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.1-preview.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, sanitize=None, **kwargs): + """GetItemText. + [Preview API] 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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.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 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, sanitize=None, **kwargs): + """GetItemZip. + [Preview API] 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. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. 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') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') + response = self._send(http_method='GET', + location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', + version='7.1-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 get_items_batch(self, request_data, repository_id, project=None): + """GetItemsBatch. + [Preview API] 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='7.1-preview.1', + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) + + def create_merge_request(self, merge_parameters, project, repository_name_or_id, include_links=None): + """CreateMergeRequest. + [Preview API] Request a git merge operation. Currently we support merging only 2 commits. + :param :class:` ` merge_parameters: Parents commitIds and merge commit messsage. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :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(merge_parameters, 'GitMergeParameters') + response = self._send(http_method='POST', + location_id='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('GitMerge', response) + + def get_merge_request(self, project, repository_name_or_id, merge_operation_id, include_links=None): + """GetMergeRequest. + [Preview API] Get a specific merge operation's details. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :param int merge_operation_id: OperationId of the merge request. + :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 merge_operation_id is not None: + route_values['mergeOperationId'] = self._serialize.url('merge_operation_id', merge_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='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitMerge', response) + + def get_policy_configurations(self, project, repository_id=None, ref_name=None, policy_type=None, top=None, continuation_token=None): + """GetPolicyConfigurations. + [Preview API] Retrieve a list of policy configurations by a given set of scope/filtering criteria. + :param str project: Project ID or project name + :param str repository_id: The repository id. + :param str ref_name: The fully-qualified Git ref name (e.g. refs/heads/master). + :param str policy_type: The policy type filter. + :param int top: Maximum number of policies to return. + :param str continuation_token: Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint. + :rtype: :class:` ` + """ + 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 ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + if policy_type is not None: + query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, '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='2c420070-a0a2-49cc-9639-c9f271c5ff07', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.GitPolicyConfigurationResponse() + response_object.policy_configurations = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) + response_object.continuation_token = response.headers.get('x-ms-continuationtoken') + return response_object + + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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, top=None, skip=None): + """GetPullRequestIterationCommits. + [Preview API] 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='7.1-preview.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. + [Preview API] 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:`<[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') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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. + [Preview API] 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 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. Allowed values are between 1 and the maximum iteration on this pull request. + :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='7.1-preview.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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def create_unmaterialized_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, project=None): + """CreateUnmaterializedPullRequestReviewer. + [Preview API] Add an unmaterialized identity to the reviewers of a pull request. + :param :class:` ` reviewer: Reviewer 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: :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(reviewer, 'IdentityRefWithVote') + response = self._send(http_method='PUT', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', response) + + def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): + """DeletePullRequestReviewer. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): + """GetPullRequestReviewer. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('IdentityRefWithVote', response) + + def get_pull_request_reviewers(self, repository_id, pull_request_id, project=None): + """GetPullRequestReviewers. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + + def update_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): + """UpdatePullRequestReviewer. + [Preview API] Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined + :param :class:` ` reviewer: Reviewer data.
If the reviewer's ID is included here, it must match the reviewerID parameter. + :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='PATCH', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', response) + + def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): + """UpdatePullRequestReviewers. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_pull_request_by_id(self, pull_request_id, project=None): + """GetPullRequestById. + [Preview API] 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='7.1-preview.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. + [Preview API] 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 search_criteria.max_time is not None: + query_parameters['searchCriteria.maxTime'] = search_criteria.max_time + if search_criteria.min_time is not None: + query_parameters['searchCriteria.minTime'] = search_criteria.min_time + if search_criteria.query_time_range_type is not None: + query_parameters['searchCriteria.queryTimeRangeType'] = search_criteria.query_time_range_type + 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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 search_criteria.max_time is not None: + query_parameters['searchCriteria.maxTime'] = search_criteria.max_time + if search_criteria.min_time is not None: + query_parameters['searchCriteria.minTime'] = search_criteria.min_time + if search_criteria.query_time_range_type is not None: + query_parameters['searchCriteria.queryTimeRangeType'] = search_criteria.query_time_range_type + 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """GetComment. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Comment', response) + + def get_comments(self, repository_id, pull_request_id, thread_id, project=None): + """GetComments. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + + def create_push(self, push, repository_id, project=None): + """CreatePush. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.1-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='7.1-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='7.1-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, top=None, continuation_token=None): + """GetRefs. + [Preview API] 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:`<[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') + 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='7.1-preview.1', + 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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-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='7.1-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='7.1-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. + [Preview API] 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 omitted 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='7.1-preview.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. + [Preview API] Delete a git repository + :param str repository_id: The 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='7.1-preview.1', + route_values=route_values) + + def get_repositories(self, project=None, include_links=None, include_all_urls=None, include_hidden=None): + """GetRepositories. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('GitRepository', response) + + def get_repository_with_parent(self, repository_id, include_parent, project=None): + """GetRepositoryWithParent. + [Preview API] 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='7.1-preview.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. + [Preview API] 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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('GitRepository', response) + + def get_stats(self, project, repository_id): + """GetStats. + [Preview API] Retrieves statistics of a repository. + :param str project: Project ID or project name + :param str repository_id: Friendly name or guid of 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') + response = self._send(http_method='GET', + location_id='616a5255-74b3-40f5-ae1d-bbae2eec8db5', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('GitRepositoryStats', 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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-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) + diff --git a/azure-devops/azure/devops/v7_1/git/models.py b/azure-devops/azure/devops/v7_1/git/models.py new file mode 100644 index 00000000..2ce3f6e3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/git/models.py @@ -0,0 +1,3989 @@ +# -------------------------------------------------------------------------------------------- +# 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 AdvSecEnablementStatus(Model): + """ + :param enabled: Enabled status 0 disabled, 1 enabled, Null never explicitly set, always whatever project is, ya this should probably be an enum somewhere + :type enabled: bool + :param enabled_changed_on_date: Enabled changed on datetime To Be Removed M223 + + :type enabled_changed_on_date: datetime + :param changed_by_id: Enabled by VSID + :type changed_by_id: str + :param changed_on_date: Enabled changed on datetime + :type changed_on_date: datetime + :param project_id: ProjectId + :type project_id: str + :param repository_id: RepositoryId + :type repository_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'enabled_changed_on_date': {'key': 'enabledChangedOnDate', 'type': 'iso-8601'}, + 'changed_by_id': {'key': 'changedById', 'type': 'str'}, + 'changed_on_date': {'key': 'changedOnDate', 'type': 'iso-8601'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'repository_id': {'key': 'repositoryId', 'type': 'str'} + } + + def __init__(self, enabled=None, enabled_changed_on_date=None, changed_by_id=None, changed_on_date=None, project_id=None, repository_id=None): + super(AdvSecEnablementStatus, self).__init__() + self.enabled = enabled + self.enabled_changed_on_date = enabled_changed_on_date + self.changed_by_id = changed_by_id + self.changed_on_date = changed_on_date + self.project_id = project_id + self.repository_id = repository_id + + +class AdvSecEnablementUpdate(Model): + """ + :param new_status: New status + :type new_status: bool + :param project_id: ProjectId + :type project_id: str + :param repository_id: RepositoryId Actual RepositoryId to Modify or Magic Repository Id "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF" for ALL Repositories for that project + :type repository_id: str + """ + + _attribute_map = { + 'new_status': {'key': 'newStatus', 'type': 'bool'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'repository_id': {'key': 'repositoryId', 'type': 'str'} + } + + def __init__(self, new_status=None, project_id=None, repository_id=None): + super(AdvSecEnablementUpdate, self).__init__() + self.new_status = new_status + self.project_id = project_id + self.repository_id = repository_id + + +class Attachment(Model): + """ + Meta data for a file attached to an artifact. + + :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 BillableCommitter(Model): + """ + Used by AdvSec to return billable committers. + + :param repo_id: RepositoryId commit was pushed to. + :type repo_id: str + :param vsid: Visual Studio ID /Team Foundation ID + :type vsid: str + """ + + _attribute_map = { + 'repo_id': {'key': 'repoId', 'type': 'str'}, + 'vsid': {'key': 'vsid', 'type': 'str'} + } + + def __init__(self, repo_id=None, vsid=None): + super(BillableCommitter, self).__init__() + self.repo_id = repo_id + self.vsid = vsid + + +class BillableCommitterDetail(BillableCommitter): + """ + :param repo_id: RepositoryId commit was pushed to. + :type repo_id: str + :param vsid: Visual Studio ID /Team Foundation ID + :type vsid: str + :param commit_id: ID (SHA-1) of the commit. + :type commit_id: str + :param committer_email: Committer email address after parsing. + :type committer_email: str + :param commit_time: Time reported by the commit. + :type commit_time: datetime + :param project_id: Project Id commit was pushed to. + :type project_id: str + :param project_name: Project name commit was pushed to. + :type project_name: str + :param pushed_time: Time of the push that contained the commit. + :type pushed_time: datetime + :param push_id: Push Id that contained the commit. + :type push_id: int + :param repo_name: Repository name commit was pushed to. + :type repo_name: str + """ + + _attribute_map = { + 'repo_id': {'key': 'repoId', 'type': 'str'}, + 'vsid': {'key': 'vsid', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'committer_email': {'key': 'committerEmail', 'type': 'str'}, + 'commit_time': {'key': 'commitTime', 'type': 'iso-8601'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'}, + 'pushed_time': {'key': 'pushedTime', 'type': 'iso-8601'}, + 'push_id': {'key': 'pushId', 'type': 'int'}, + 'repo_name': {'key': 'repoName', 'type': 'str'} + } + + def __init__(self, repo_id=None, vsid=None, commit_id=None, committer_email=None, commit_time=None, project_id=None, project_name=None, pushed_time=None, push_id=None, repo_name=None): + super(BillableCommitterDetail, self).__init__(repo_id=repo_id, vsid=vsid) + self.commit_id = commit_id + self.committer_email = committer_email + self.commit_time = commit_time + self.project_id = project_id + self.project_name = project_name + self.pushed_time = pushed_time + self.push_id = push_id + self.repo_name = repo_name + + +class Comment(Model): + """ + Represents a comment which is one of potentially many in a comment thread. + + :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): + """ + Comment iteration context is used to identify which diff was being viewed when the thread was created. + + :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): + """ + :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): + """ + Represents a comment thread of a pull request. A thread contains meta data about the file it was left on along with one or more comments (an initial comment and the subsequent replies). + + :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): + """ + :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): + """ + Comment tracking criteria is used to identify which iteration context the thread has been tracked to (if any) along with some detail about the original position and filename. + + :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): + """ + :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): + """ + Provides properties that describe file differences + + :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): + """ + Provides parameters that describe inputs for the file diff + + :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): + """ + Provides properties that describe inputs for the file diffs + + :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): + """ + A Git annotated tag. + + :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): + """ + :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): + """ + Information about the progress of a cherry pick or revert operation. + + :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): + """ + Parameters that are provided in the request body when requesting to cherry pick or revert. + + :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 specifies the pull request or list of commits to use when making a cherry pick and revert operation request. Only one should be provided. + + :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): + """ + :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): + """ + Ahead and behind counts for a particular ref. + + :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 GitCommitDiffs(Model): + """ + :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 common_commit: + :type common_commit: str + :param change_counts: + :type change_counts: dict + :param changes: + :type changes: list of :class:`object ` + :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'}, + 'common_commit': {'key': 'commonCommit', 'type': 'str'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + 'target_commit': {'key': 'targetCommit', 'type': 'str'} + } + + def __init__(self, ahead_count=None, all_changes_included=None, base_commit=None, behind_count=None, common_commit=None, change_counts=None, changes=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.common_commit = common_commit + self.change_counts = change_counts + self.changes = changes + self.target_commit = target_commit + + +class GitCommitChanges(Model): + """ + :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 GitCommitRef(Model): + """ + Provides properties that describe a Git commit and associated metadata. + + :param _links: A collection of related REST reference links. + :type _links: :class:`ReferenceLinks ` + :param author: Author of the commit. + :type author: :class:`GitUserDate ` + :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 commit_too_many_changes: Indicates that commit contains too many changes to be displayed + :type commit_too_many_changes: bool + :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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'committer': {'key': 'committer', 'type': 'GitUserDate'}, + 'commit_too_many_changes': {'key': 'commitTooManyChanges', 'type': 'bool'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + '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, comment=None, comment_truncated=None, commit_id=None, committer=None, commit_too_many_changes=None, change_counts=None, changes=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.comment = comment + self.comment_truncated = comment_truncated + self.commit_id = commit_id + self.committer = committer + self.commit_too_many_changes = commit_too_many_changes + self.change_counts = change_counts + self.changes = changes + 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Status information about a requested fork operation. + + :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): + """ + Request to sync data between two forks. + + :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): + """ + Parameters for creating a fork request + + :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 GitCherryPick(GitAsyncRefOperation): + """ + This object is returned from Cherry Pick operations and provides the id and status of the operation + + :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 GitImportGitSource(Model): + """ + Parameter for creating a git import request when source is Git version control + + :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): + """ + A request to import data from a remote source control system. + + :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): + """ + Parameters for creating an import request + + :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): + """ + Additional status information about an import request. + + :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): + """ + Parameter for creating a git import request when source is tfvc version control + + :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): + """ + :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): + """ + :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): + """ + Status information about a requested merge operation. + + :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): + """ + :param cherry_pick_id: + :type cherry_pick_id: int + :param pull_request_id: + :type pull_request_id: int + :param revert_id: + :type revert_id: int + """ + + _attribute_map = { + 'cherry_pick_id': {'key': 'cherryPickId', 'type': 'int'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'}, + 'revert_id': {'key': 'revertId', 'type': 'int'} + } + + def __init__(self, cherry_pick_id=None, pull_request_id=None, revert_id=None): + super(GitMergeOriginRef, self).__init__() + self.cherry_pick_id = cherry_pick_id + self.pull_request_id = pull_request_id + self.revert_id = revert_id + + +class GitMergeParameters(Model): + """ + Parameters required for performing git merge. + + :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): + """ + Git object identifier and type information. + + :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 GitPolicyConfigurationResponse(Model): + """ + :param continuation_token: The HTTP client methods find the continuation token header in the response and populate this field. + :type continuation_token: str + :param policy_configurations: + :type policy_configurations: list of :class:`PolicyConfiguration ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'policy_configurations': {'key': 'policyConfigurations', 'type': '[PolicyConfiguration]'} + } + + def __init__(self, continuation_token=None, policy_configurations=None): + super(GitPolicyConfigurationResponse, self).__init__() + self.continuation_token = continuation_token + self.policy_configurations = policy_configurations + + +class GitPullRequest(Model): + """ + Represents all the data associated with a pull request. + + :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 has_multiple_merge_bases: Multiple mergebases warning + :type has_multiple_merge_bases: bool + :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'}, + 'has_multiple_merge_bases': {'key': 'hasMultipleMergeBases', 'type': 'bool'}, + '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, has_multiple_merge_bases=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.has_multiple_merge_bases = has_multiple_merge_bases + 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 GitPullRequestCommentThread(CommentThread): + """ + Represents a comment thread of a pull request. A thread contains meta data about the file it was left on (if any) along with one or more comments (an initial comment and the subsequent replies). + + :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): + """ + Comment thread context contains details about what diffs were being viewed at the time of thread creation and whether or not the thread has been tracked from that original diff. + + :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): + """ + Preferences about how the pull request should be completed. + + :param auto_complete_ignore_config_ids: List of any policy configuration Id's which auto-complete should not wait for. Only applies to optional policies (isBlocking == false). Auto-complete always waits for required policies (isBlocking == true). + :type auto_complete_ignore_config_ids: list of int + :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 merge_strategy: Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored. + :type merge_strategy: object + :param squash_merge: SquashMerge is deprecated. You should explicitly set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true. + :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 = { + 'auto_complete_ignore_config_ids': {'key': 'autoCompleteIgnoreConfigIds', 'type': '[int]'}, + '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'}, + 'merge_strategy': {'key': 'mergeStrategy', 'type': 'object'}, + 'squash_merge': {'key': 'squashMerge', 'type': 'bool'}, + 'transition_work_items': {'key': 'transitionWorkItems', 'type': 'bool'}, + 'triggered_by_auto_complete': {'key': 'triggeredByAutoComplete', 'type': 'bool'} + } + + def __init__(self, auto_complete_ignore_config_ids=None, bypass_policy=None, bypass_reason=None, delete_source_branch=None, merge_commit_message=None, merge_strategy=None, squash_merge=None, transition_work_items=None, triggered_by_auto_complete=None): + super(GitPullRequestCompletionOptions, self).__init__() + self.auto_complete_ignore_config_ids = auto_complete_ignore_config_ids + 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.merge_strategy = merge_strategy + self.squash_merge = squash_merge + self.transition_work_items = transition_work_items + self.triggered_by_auto_complete = triggered_by_auto_complete + + +class GitPullRequestChange(Model): + """ + Change made in a pull request. + + :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 GitPullRequestIteration(Model): + """ + Provides properties that describe a Git pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request. + + :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 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 change_list: Changes included with the pull request iteration. + :type change_list: list of :class:`GitPullRequestChange ` + :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'}, + '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'}, + 'change_list': {'key': 'changeList', 'type': '[GitPullRequestChange]'}, + '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, commits=None, common_ref_commit=None, created_date=None, description=None, has_more_commits=None, change_list=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.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.change_list = change_list + 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): + """ + Collection of changes made in a pull request. + + :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): + """ + The options which are used when a pull request merge is created. + + :param conflict_authorship_commits: If true, conflict resolutions applied during the merge will be put in separate commits to preserve authorship info for git blame, etc. + :type conflict_authorship_commits: bool + :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 = { + 'conflict_authorship_commits': {'key': 'conflictAuthorshipCommits', 'type': 'bool'}, + 'detect_rename_false_positives': {'key': 'detectRenameFalsePositives', 'type': 'bool'}, + 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} + } + + def __init__(self, conflict_authorship_commits=None, detect_rename_false_positives=None, disable_renames=None): + super(GitPullRequestMergeOptions, self).__init__() + self.conflict_authorship_commits = conflict_authorship_commits + self.detect_rename_false_positives = detect_rename_false_positives + self.disable_renames = disable_renames + + +class GitPullRequestQuery(Model): + """ + A set of pull request queries and their results. + + :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): + """ + Pull request query input parameters. + + :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): + """ + Pull requests can be searched for matching this criteria. + + :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 max_time: If set, search for pull requests that created/closed before this date based on the queryTimeRangeType specified + :type max_time: str + param min_time: If set, search for pull requests that created/closed after this date based on the queryTimeRangeType specified. + :type min_time: str + param query_time_range_type: The type of time range which should be used for minTime and maxTime. Defaults to Created if unset + :type query_time_range_type: str + :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'}, + 'max_time': {'key': 'maxTime', 'type': 'str'}, + 'min_time': {'key': 'minTime', 'type': 'str'}, + 'query_time_range_type': {'key': 'queryTimeRangeType', 'type': 'str'}, + '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, max_time=None, min_time=None, query_time_range_type='created', 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.max_time = max_time + self.min_time = min_time + self.query_time_range_type = query_time_range_type + 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 show_oldest_commits_first: If enabled, this option will ignore the itemVersion and compareVersion parameters + :type show_oldest_commits_first: bool + :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'}, + 'show_oldest_commits_first': {'key': 'showOldestCommitsFirst', 'type': 'bool'}, + '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, show_oldest_commits_first=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.show_oldest_commits_first = show_oldest_commits_first + self.to_commit_id = to_commit_id + self.to_date = to_date + self.user = user + + +class GitRecycleBinRepositoryDetails(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :param is_fork: True if the repository was created as a fork. + :type is_fork: bool + :param is_in_maintenance: True if the repository is in maintenance. False otherwise. + :type is_in_maintenance: 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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + 'is_fork': {'key': 'isFork', 'type': 'bool'}, + 'is_in_maintenance': {'key': 'isInMaintenance', '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=None, is_fork=None, is_in_maintenance=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + self.is_fork = is_fork + self.is_in_maintenance = is_in_maintenance + 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 + self.web_url = web_url + + +class GitRepositoryCreateOptions(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + This class contains the metadata of a service/extension posting a status. + + :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): + """ + Status context that uniquely identifies the status. + + :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): + """ + An object describing the git suggestion. Git suggestions are currently limited to suggested pull requests. + + :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): + """ + :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): + """ + :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 yield 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + User info and date for Git operations. + + :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): + """ + :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): + """ + Globally unique key for a repository. + + :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): + """ + :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 Change(Model): + """ + :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 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 IdentityRefWithVote(IdentityRef): + """ + Identity information including a vote on a pull request. + + :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 + :param has_declined: Indicates if this reviewer has declined to review this pull request. + :type has_declined: bool + :param is_flagged: Indicates if this reviewer is flagged for attention on this pull request. + :type is_flagged: bool + :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 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'}, + 'has_declined': {'key': 'hasDeclined', 'type': 'bool'}, + 'is_flagged': {'key': 'isFlagged', 'type': 'bool'}, + '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, has_declined=None, is_flagged=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.has_declined = has_declined + self.is_flagged = is_flagged + self.is_required = is_required + self.reviewer_url = reviewer_url + self.vote = vote + self.voted_for = voted_for + + +class ImportRepositoryValidation(Model): + """ + :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): + """ + :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): + """ + :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): + """ + 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 LineDiffBlock(Model): + """ + The class to represent the line diff block + + :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): + """ + Policy configuration reference. + + :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): + """ + Policy type reference. + + :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): + """ + 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 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 ShareNotificationContext(Model): + """ + Context used while sharing a pull request. + + :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): + """ + :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): + """ + Reference object for a TeamProjectCollection. + + :param avatar_url: Collection avatar Url. + :type avatar_url: str + :param id: Collection Id. + :type id: str + :param name: Collection Name. + :type name: str + :param url: Collection REST Url. + :type url: str + """ + + _attribute_map = { + 'avatar_url': {'key': 'avatarUrl', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, avatar_url=None, id=None, name=None, url=None): + super(TeamProjectCollectionReference, self).__init__() + self.avatar_url = avatar_url + self.id = id + self.name = name + self.url = url + + +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 VersionedPolicyConfigurationRef(PolicyConfigurationRef): + """ + A particular revision for a policy configuration. + + :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): + """ + :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): + """ + The representation of data needed to create a tag definition which is sent across the wire. + + :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): + """ + The representation of a tag definition which is sent across the wire. + + :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): + """ + :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): + """ + :param _links: A collection of related REST reference links. + :type _links: :class:`ReferenceLinks ` + :param author: Author of the commit. + :type author: :class:`GitUserDate ` + :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 commit_too_many_changes: Indicates that commit contains too many changes to be displayed + :type commit_too_many_changes: bool + :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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'committer': {'key': 'committer', 'type': 'GitUserDate'}, + 'commit_too_many_changes': {'key': 'commitTooManyChanges', 'type': 'bool'}, + 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, + 'changes': {'key': 'changes', 'type': '[object]'}, + '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, comment=None, comment_truncated=None, commit_id=None, committer=None, commit_too_many_changes=None, change_counts=None, changes=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, comment=comment, comment_truncated=comment_truncated, commit_id=commit_id, committer=committer, commit_too_many_changes=commit_too_many_changes, change_counts=change_counts, changes=changes, parents=parents, push=push, remote_url=remote_url, statuses=statuses, url=url, work_items=work_items) + self.tree_id = tree_id + + +class GitForkRef(GitRef): + """ + Information about a fork ref. + + :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): + """ + :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): + """ + :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): + """ + This class contains the metadata of a service/extension posting pull request status. Status can be associated with a pull request or an iteration. + + :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): + """ + :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): + """ + :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): + """ + The full policy configuration with settings. + + :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 is_enterprise_managed: If set, this policy requires "Manage Enterprise Policies" permission to create, edit, or delete. + :type is_enterprise_managed: 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'}, + 'is_enterprise_managed': {'key': 'isEnterpriseManaged', '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, is_enterprise_managed=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.is_enterprise_managed = is_enterprise_managed + self.settings = settings + + +__all__ = [ + 'AdvSecEnablementStatus', + 'AdvSecEnablementUpdate', + 'Attachment', + 'BillableCommitter', + 'BillableCommitterDetail', + 'Comment', + 'CommentIterationContext', + 'CommentPosition', + 'CommentThread', + 'CommentThreadContext', + 'CommentTrackingCriteria', + 'FileContentMetadata', + 'FileDiff', + 'FileDiffParams', + 'FileDiffsCriteria', + 'GitAnnotatedTag', + 'GitAsyncRefOperation', + 'GitAsyncRefOperationDetail', + 'GitAsyncRefOperationParameters', + 'GitAsyncRefOperationSource', + 'GitBlobRef', + 'GitBranchStats', + 'GitCommitDiffs', + 'GitCommitChanges', + 'GitCommitRef', + 'GitConflict', + 'GitConflictUpdateResult', + 'GitDeletedRepository', + 'GitFilePathsCollection', + 'GitForkOperationStatusDetail', + 'GitForkSyncRequest', + 'GitForkSyncRequestParameters', + 'GitCherryPick', + 'GitImportGitSource', + 'GitImportRequest', + 'GitImportRequestParameters', + 'GitImportStatusDetail', + 'GitImportTfvcSource', + 'GitItemDescriptor', + 'GitItemRequestData', + 'GitMergeOperationStatusDetail', + 'GitMergeOriginRef', + 'GitMergeParameters', + 'GitObject', + 'GitPolicyConfigurationResponse', + 'GitPullRequest', + 'GitPullRequestCommentThread', + 'GitPullRequestCommentThreadContext', + 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', + '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', + 'Change', + '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', +] diff --git a/azure-devops/azure/devops/v7_1/graph/__init__.py b/azure-devops/azure/devops/v7_1/graph/__init__.py new file mode 100644 index 00000000..fb5631e2 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/graph/__init__.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AadGraphMember', + 'Avatar', + 'GraphCachePolicies', + 'GraphDescriptorResult', + 'GraphFederatedProviderData', + 'GraphGroup', + 'GraphGroupCreationContext', + 'GraphMember', + 'GraphMembership', + 'GraphMembershipState', + 'GraphMembershipTraversal', + 'GraphProviderInfo', + 'GraphScope', + 'GraphScopeCreationContext', + 'GraphServicePrincipal', + 'GraphServicePrincipalCreationContext', + 'GraphServicePrincipalUpdateContext', + 'GraphStorageKeyResult', + 'GraphSubject', + 'GraphSubjectBase', + 'GraphSubjectLookup', + 'GraphSubjectLookupKey', + 'GraphSubjectQuery', + 'GraphUser', + 'GraphUserCreationContext', + 'GraphUserUpdateContext', + 'IdentityMapping', + 'IdentityMappings', + 'JsonPatchOperation', + 'MappingResult', + 'PagedGraphGroups', + 'PagedGraphMembers', + 'PagedGraphServicePrincipals', + 'PagedGraphUsers', + 'ReferenceLinks', + 'ResolveDisconnectedUsersResponse', + 'UserPrincipalName', + 'GraphClient' +] diff --git a/azure-devops/azure/devops/v7_1/graph/graph_client.py b/azure-devops/azure/devops/v7_1/graph/graph_client.py new file mode 100644 index 00000000..4f98d61a --- /dev/null +++ b/azure-devops/azure/devops/v7_1/graph/graph_client.py @@ -0,0 +1,519 @@ +# -------------------------------------------------------------------------------------------- +# 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 delete_avatar(self, subject_descriptor): + """DeleteAvatar. + [Preview API] + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + self._send(http_method='DELETE', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.1-preview.1', + route_values=route_values) + + def get_avatar(self, subject_descriptor, size=None, format=None): + """GetAvatar. + [Preview API] + :param str subject_descriptor: + :param str size: + :param str format: + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + query_parameters = {} + if size is not None: + query_parameters['size'] = self._serialize.query('size', size, 'str') + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + response = self._send(http_method='GET', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Avatar', response) + + def set_avatar(self, avatar, subject_descriptor): + """SetAvatar. + [Preview API] + :param :class:` ` avatar: + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + content = self._serialize.body(avatar, 'Avatar') + self._send(http_method='PUT', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.1-preview.1', + route_values=route_values, + content=content) + + 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='7.1-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 Azure DevOps 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='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('GraphGroup', response) + + def delete_group(self, group_descriptor): + """DeleteGroup. + [Preview API] Removes an Azure DevOps 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='7.1-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='7.1-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='7.1-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 an Azure DevOps 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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('GraphMembership', response) + + 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='7.1-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='7.1-preview.1', + route_values=route_values) + + 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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('GraphProviderInfo', response) + + def request_access(self, jsondocument): + """RequestAccess. + [Preview API] + :param :class:` ` jsondocument: + """ + content = self._serialize.body(jsondocument, 'object') + self._send(http_method='POST', + location_id='8d54bf92-8c99-47f2-9972-b21341f1722e', + version='7.1-preview.1', + content=content) + + def create_service_principal(self, creation_context, group_descriptors=None): + """CreateServicePrincipal. + [Preview API] Materialize an existing AAD service principal into the ADO account. + :param :class:` ` creation_context: The subset of the full graph service principal 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 service principal 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, 'GraphServicePrincipalCreationContext') + response = self._send(http_method='POST', + location_id='e1dbb0ae-49cb-4532-95a1-86cd89cfcab4', + version='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('GraphServicePrincipal', response) + + def delete_service_principal(self, service_principal_descriptor): + """DeleteServicePrincipal. + [Preview API] Disables a service principal. + :param str service_principal_descriptor: The descriptor of the service principal to delete. + """ + route_values = {} + if service_principal_descriptor is not None: + route_values['servicePrincipalDescriptor'] = self._serialize.url('service_principal_descriptor', service_principal_descriptor, 'str') + self._send(http_method='DELETE', + location_id='e1dbb0ae-49cb-4532-95a1-86cd89cfcab4', + version='7.1-preview.1', + route_values=route_values) + + def get_service_principal(self, service_principal_descriptor): + """GetServicePrincipal. + [Preview API] Get a service principal by its descriptor. + :param str service_principal_descriptor: The descriptor of the desired service principal. + :rtype: :class:` ` + """ + route_values = {} + if service_principal_descriptor is not None: + route_values['servicePrincipalDescriptor'] = self._serialize.url('service_principal_descriptor', service_principal_descriptor, 'str') + response = self._send(http_method='GET', + location_id='e1dbb0ae-49cb-4532-95a1-86cd89cfcab4', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('GraphServicePrincipal', response) + + def list_service_principals(self, continuation_token=None, scope_descriptor=None): + """ListServicePrincipals. + [Preview API] Get a list of all service principals in a given scope. + :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 str scope_descriptor: Specify a non-default scope (collection, project) to search for service principals. + :rtype: :class:` ` + """ + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if scope_descriptor is not None: + query_parameters['scopeDescriptor'] = self._serialize.query('scope_descriptor', scope_descriptor, 'str') + response = self._send(http_method='GET', + location_id='e1dbb0ae-49cb-4532-95a1-86cd89cfcab4', + version='7.1-preview.1', + query_parameters=query_parameters) + response_object = models.PagedGraphServicePrincipals() + response_object.graph_service_principals = self._deserialize('[GraphServicePrincipal]', self._unwrap_collection(response)) + response_object.continuation_token = response.headers.get('X-MS-ContinuationToken') + return response_object + + 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='7.1-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='7.1-preview.1', + content=content) + return self._deserialize('{GraphSubject}', self._unwrap_collection(response)) + + def query_subjects(self, subject_query): + """QuerySubjects. + [Preview API] Search for Azure Devops users, or/and groups. Results will be returned in a batch with no more than 100 graph subjects. + :param :class:` ` subject_query: The query that we'll be using to search includes the following: Query: the search term. The search will be prefix matching only. SubjectKind: "User" or "Group" can be specified, both or either ScopeDescriptor: Non-default scope can be specified, i.e. project scope descriptor + :rtype: [GraphSubject] + """ + content = self._serialize.body(subject_query, 'GraphSubjectQuery') + response = self._send(http_method='POST', + location_id='05942c89-006a-48ce-bb79-baeb8abf99c6', + version='7.1-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 ADO 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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('GraphUser', response) + + def list_users(self, subject_types=None, continuation_token=None, scope_descriptor=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. + :param str scope_descriptor: Specify a non-default scope (collection, project) to search for users. + :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') + if scope_descriptor is not None: + query_parameters['scopeDescriptor'] = self._serialize.query('scope_descriptor', scope_descriptor, 'str') + response = self._send(http_method='GET', + location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', + version='7.1-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 + + def update_user(self, update_context, user_descriptor): + """UpdateUser. + [Preview API] Map an existing user to a different user. + :param :class:` ` update_context: The subset of the full graph user used to uniquely find the graph subject in an external provider. + :param str user_descriptor: The descriptor of the user to update + :rtype: :class:` ` + """ + route_values = {} + if user_descriptor is not None: + route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') + content = self._serialize.body(update_context, 'GraphUserUpdateContext') + response = self._send(http_method='PATCH', + location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('GraphUser', response) + diff --git a/azure-devops/azure/devops/v7_1/graph/models.py b/azure-devops/azure/devops/v7_1/graph/models.py new file mode 100644 index 00000000..c4b08e69 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/graph/models.py @@ -0,0 +1,1099 @@ +# -------------------------------------------------------------------------------------------- +# 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 Avatar(Model): + """ + :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 GraphCachePolicies(Model): + """ + :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): + """ + Subject descriptor of a Graph entity + + :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): + """ + Represents a set of data used to communicate with a federated provider on behalf of a particular user. + + :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 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'}, + 'provider_name': {'key': 'providerName', 'type': 'str'}, + 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'} + } + + def __init__(self, access_token=None, provider_name=None, subject_descriptor=None, version=None): + super(GraphFederatedProviderData, self).__init__() + self.access_token = access_token + self.provider_name = provider_name + self.subject_descriptor = subject_descriptor + self.version = version + + +class GraphGroupCreationContext(Model): + """ + Do not attempt to use this type to create a new group. This type does not contain sufficient fields to create a new group. + + :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): + """ + Relationship between a container and a member + + :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): + """ + Status of a Graph membership (active/inactive) + + :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): + """ + :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): + """ + Who is the provider for this user and what is the identifier and domain that is used to uniquely identify the user. + + :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): + """ + This type is the subset of fields that can be provided by the user to create a Vsts scope. Scope creation is currently limited to internal back-compat scenarios. End users that attempt to create a scope with this API will fail. + + :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 GraphServicePrincipalCreationContext(Model): + """ + Do not attempt to use this type to create a new service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal. + + :param storage_key: Optional: If provided, we will use this identifier for the storage key of the created service principal + :type storage_key: str + """ + + _attribute_map = { + 'storage_key': {'key': 'storageKey', 'type': 'str'} + } + + def __init__(self, storage_key=None): + super(GraphServicePrincipalCreationContext, self).__init__() + self.storage_key = storage_key + + +class GraphServicePrincipalUpdateContext(Model): + """ + Do not attempt to use this type to update service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal. + + :param storage_key: Storage key should not be specified in case of updating service principal + :type storage_key: str + """ + + _attribute_map = { + 'storage_key': {'key': 'storageKey', 'type': 'str'} + } + + def __init__(self, storage_key=None): + super(GraphServicePrincipalUpdateContext, self).__init__() + self.storage_key = storage_key + + +class GraphStorageKeyResult(Model): + """ + Storage key of a Graph entity + + :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): + """ + :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): + """ + Batching of subjects to lookup using the Graph API + + :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): + """ + :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 GraphSubjectQuery(Model): + """ + Subject to search using the Graph API + + :param query: Search term to search for Azure Devops users or/and groups + :type query: str + :param scope_descriptor: Optional parameter. Specify a non-default scope (collection, project) to search for users or groups within the scope. + :type scope_descriptor: :class:`str ` + :param subject_kind: "User" or "Group" can be specified, both or either + :type subject_kind: list of str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'scope_descriptor': {'key': 'scopeDescriptor', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': '[str]'} + } + + def __init__(self, query=None, scope_descriptor=None, subject_kind=None): + super(GraphSubjectQuery, self).__init__() + self.query = query + self.scope_descriptor = scope_descriptor + self.subject_kind = subject_kind + + +class GraphUserCreationContext(Model): + """ + Do not attempt to use this type to create a new user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user. + + :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 GraphUserUpdateContext(Model): + """ + Do not attempt to use this type to update user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user. + + :param storage_key: Storage key should not be specified in case of updating user + :type storage_key: str + """ + + _attribute_map = { + 'storage_key': {'key': 'storageKey', 'type': 'str'} + } + + def __init__(self, storage_key=None): + super(GraphUserUpdateContext, self).__init__() + self.storage_key = storage_key + + +class IdentityMapping(Model): + """ + :param source: + :type source: :class:`UserPrincipalName ` + :param target: + :type target: :class:`UserPrincipalName ` + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'UserPrincipalName'}, + 'target': {'key': 'target', 'type': 'UserPrincipalName'} + } + + def __init__(self, source=None, target=None): + super(IdentityMapping, self).__init__() + self.source = source + self.target = target + + +class IdentityMappings(Model): + """ + :param mappings: + :type mappings: list of :class:`IdentityMapping ` + """ + + _attribute_map = { + 'mappings': {'key': 'mappings', 'type': '[IdentityMapping]'} + } + + def __init__(self, mappings=None): + super(IdentityMappings, self).__init__() + self.mappings = mappings + + +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 MappingResult(Model): + """ + :param code: + :type code: str + :param error_message: + :type error_message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'} + } + + def __init__(self, code=None, error_message=None): + super(MappingResult, self).__init__() + self.code = code + self.error_message = error_message + + +class PagedGraphGroups(Model): + """ + :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 PagedGraphMembers(Model): + """ + :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_members: The enumerable list of members found within a page. + :type graph_members: list of :class:`GraphMember ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, + 'graph_members': {'key': 'graphMembers', 'type': '[GraphMember]'} + } + + def __init__(self, continuation_token=None, graph_members=None): + super(PagedGraphMembers, self).__init__() + self.continuation_token = continuation_token + self.graph_members = graph_members + + +class PagedGraphServicePrincipals(Model): + """ + :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_service_principals: The enumerable list of service principals found within a page. + :type graph_service_principals: list of :class:`GraphServicePrincipal ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, + 'graph_service_principals': {'key': 'graphServicePrincipals', 'type': '[GraphServicePrincipal]'} + } + + def __init__(self, continuation_token=None, graph_service_principals=None): + super(PagedGraphServicePrincipals, self).__init__() + self.continuation_token = continuation_token + self.graph_service_principals = graph_service_principals + + +class PagedGraphUsers(Model): + """ + :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): + """ + 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 ResolveDisconnectedUsersResponse(Model): + """ + :param code: + :type code: str + :param error_message: + :type error_message: str + :param mapping_results: + :type mapping_results: list of :class:`MappingResult ` + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'mapping_results': {'key': 'mappingResults', 'type': '[MappingResult]'} + } + + def __init__(self, code=None, error_message=None, mapping_results=None): + super(ResolveDisconnectedUsersResponse, self).__init__() + self.code = code + self.error_message = error_message + self.mapping_results = mapping_results + + +class UserPrincipalName(Model): + """ + :param principal_name: + :type principal_name: str + """ + + _attribute_map = { + 'principal_name': {'key': 'principalName', 'type': 'str'} + } + + def __init__(self, principal_name=None): + super(UserPrincipalName, self).__init__() + self.principal_name = principal_name + + +class GraphSubject(GraphSubjectBase): + """ + Top-level graph entity + + :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): + """ + :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): + """ + Container where a graph entity is defined (organization, project, team) + + :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 AadGraphMember(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 + :param directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None): + super(AadGraphMember, 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.directory_alias = directory_alias + self.is_deleted_in_origin = is_deleted_in_origin + self.metadata_update_date = metadata_update_date + self.meta_type = meta_type + + +class GraphGroup(GraphMember): + """ + Graph group entity + + :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 + + +class GraphServicePrincipal(AadGraphMember): + """ + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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 + :param application_id: + :type application_id: 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'}, + 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, + 'metadata_update_date': {'key': 'metadataUpdateDate', 'type': 'iso-8601'}, + 'meta_type': {'key': 'metaType', 'type': 'str'}, + 'application_id': {'key': 'applicationId', '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, directory_alias=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None, application_id=None): + super(GraphServicePrincipal, 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, directory_alias=directory_alias, is_deleted_in_origin=is_deleted_in_origin, metadata_update_date=metadata_update_date, meta_type=meta_type) + self.application_id = application_id + + +class GraphUser(AadGraphMember): + """ + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=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, directory_alias=directory_alias, is_deleted_in_origin=is_deleted_in_origin, metadata_update_date=metadata_update_date, meta_type=meta_type) + + +__all__ = [ + 'Avatar', + 'GraphCachePolicies', + 'GraphDescriptorResult', + 'GraphFederatedProviderData', + 'GraphGroupCreationContext', + 'GraphMembership', + 'GraphMembershipState', + 'GraphMembershipTraversal', + 'GraphProviderInfo', + 'GraphScopeCreationContext', + 'GraphServicePrincipalCreationContext', + 'GraphServicePrincipalUpdateContext', + 'GraphStorageKeyResult', + 'GraphSubjectBase', + 'GraphSubjectLookup', + 'GraphSubjectLookupKey', + 'GraphSubjectQuery', + 'GraphUserCreationContext', + 'GraphUserUpdateContext', + 'IdentityMapping', + 'IdentityMappings', + 'JsonPatchOperation', + 'MappingResult', + 'PagedGraphGroups', + 'PagedGraphMembers', + 'PagedGraphServicePrincipals', + 'PagedGraphUsers', + 'ReferenceLinks', + 'ResolveDisconnectedUsersResponse', + 'UserPrincipalName', + 'GraphSubject', + 'GraphMember', + 'GraphScope', + 'AadGraphMember', + 'GraphGroup', + 'GraphServicePrincipal', + 'GraphUser', +] diff --git a/azure-devops/azure/devops/v7_1/identity/__init__.py b/azure-devops/azure/devops/v7_1/identity/__init__.py new file mode 100644 index 00000000..4b0c102e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/identity/__init__.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'CreateScopeInfo', + 'FrameworkIdentityInfo', + 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', + 'Identity', + 'IdentityBase', + 'IdentityBatchInfo', + 'IdentityRightsTransferData', + 'IdentityScope', + 'IdentitySelf', + 'IdentitySnapshot', + 'IdentityUpdateData', + 'JsonPatchOperation', + 'JsonWebToken', + 'PagedIdentities', + 'RefreshTokenGrant', + 'SwapIdentityInfo', + 'TenantInfo', + 'IdentityClient' +] diff --git a/azure-devops/azure/devops/v7_1/identity/identity_client.py b/azure-devops/azure/devops/v7_1/identity/identity_client.py new file mode 100644 index 00000000..f4a13177 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/identity/identity_client.py @@ -0,0 +1,611 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('str', response) + + def create_groups(self, container): + """CreateGroups. + [Preview API] + :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='7.1-preview.1', + content=content) + return self._deserialize('[Identity]', self._unwrap_collection(response)) + + def delete_group(self, group_id): + """DeleteGroup. + [Preview API] + :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='7.1-preview.1', + route_values=route_values) + + def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=None): + """ListGroups. + [Preview API] + :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='7.1-preview.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. + [Preview API] + :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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('ChangedIdentities', response) + + def get_user_identity_ids_by_domain_id(self, domain_id): + """GetUserIdentityIdsByDomainId. + [Preview API] + :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='7.1-preview.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. + [Preview API] Resolve legacy identity information for use with older APIs such as the Security APIs + :param str descriptors: A comma separated list of identity descriptors to resolve + :param str identity_ids: A comma seperated list of storage keys to resolve + :param str subject_descriptors: A comma seperated list of subject descriptors to resolve + :param str social_descriptors: + :param str search_filter: The type of search to perform. Values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups). + :param str filter_value: The search value, as specified by the searchFilter. + :param str query_membership: The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only) + :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='7.1-preview.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. + [Preview API] + :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='7.1-preview.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. + [Preview API] + :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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Identity', response) + + def update_identities(self, identities, allow_meta_data_update=None): + """UpdateIdentities. + [Preview API] + :param :class:` ` identities: + :param bool allow_meta_data_update: + :rtype: [IdentityUpdateData] + """ + query_parameters = {} + if allow_meta_data_update is not None: + query_parameters['allowMetaDataUpdate'] = self._serialize.query('allow_meta_data_update', allow_meta_data_update, 'bool') + content = self._serialize.body(identities, 'VssJsonCollectionWrapper') + response = self._send(http_method='PUT', + location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', + version='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('[IdentityUpdateData]', self._unwrap_collection(response)) + + def update_identity(self, identity, identity_id): + """UpdateIdentity. + [Preview API] + :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='7.1-preview.1', + route_values=route_values, + content=content) + + def create_identity(self, framework_identity_info): + """CreateIdentity. + [Preview API] + :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='7.1-preview.1', + 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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('IdentitySnapshot', response) + + def get_max_sequence_id(self): + """GetMaxSequenceId. + [Preview API] 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='7.1-preview.1') + return self._deserialize('long', response) + + def get_self(self): + """GetSelf. + [Preview API] Read identity of the home tenant request user. + :rtype: :class:` ` + """ + response = self._send(http_method='GET', + location_id='4bb02b5b-c120-4be2-b68e-21f7c50a4b82', + version='7.1-preview.1') + 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('bool', response) + + def force_remove_member(self, container_id, member_id, force_remove): + """ForceRemoveMember. + [Preview API] + :param str container_id: + :param str member_id: + :param bool force_remove: + :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') + query_parameters = {} + if force_remove is not None: + query_parameters['forceRemove'] = self._serialize.query('force_remove', force_remove, 'bool') + response = self._send(http_method='DELETE', + location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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='7.1-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='7.1-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='7.1-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='7.1-preview.2', + 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def refresh_members_of(self, member_id, query_membership=None): + """RefreshMembersOf. + [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='POST', + location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', + version='7.1-preview.2', + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('TenantInfo', response) + diff --git a/azure-devops/azure/devops/v7_1/identity/models.py b/azure-devops/azure/devops/v7_1/identity/models.py new file mode 100644 index 00000000..2c13b21c --- /dev/null +++ b/azure-devops/azure/devops/v7_1/identity/models.py @@ -0,0 +1,702 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 is_first_party_client: + :type is_first_party_client: bool + :param refresh_token: + :type refresh_token: :class:`RefreshTokenGrant ` + :param scope: + :type scope: str + :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'}, + 'is_first_party_client': {'key': 'isFirstPartyClient', 'type': 'bool'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'RefreshTokenGrant'}, + 'scope': {'key': 'scope', 'type': 'str'}, + '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, is_first_party_client=None, refresh_token=None, scope=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.is_first_party_client = is_first_party_client + self.refresh_token = refresh_token + self.scope = scope + self.token_type = token_type + self.valid_to = valid_to + + +class AuthorizationGrant(Model): + """ + :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 CreateScopeInfo(Model): + """ + :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): + """ + :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): + """ + :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 ChangedIdentities(Model): + """ + Container class for changed identities + + :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): + """ + Context class for changed identities + + :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 IdentityBase(Model): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class IdentityBatchInfo(Model): + """ + :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 social_descriptors: + :type social_descriptors: list of :class:`str ` + :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'}, + 'social_descriptors': {'key': 'socialDescriptors', 'type': '[str]'}, + 'subject_descriptors': {'key': 'subjectDescriptors', 'type': '[str]'} + } + + def __init__(self, descriptors=None, identity_ids=None, include_restricted_visibility=None, property_names=None, query_membership=None, social_descriptors=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.social_descriptors = social_descriptors + self.subject_descriptors = subject_descriptors + + +class IdentityRightsTransferData(Model): + """ + :param user_principal_name_mappings: + :type user_principal_name_mappings: dict + """ + + _attribute_map = { + 'user_principal_name_mappings': {'key': 'userPrincipalNameMappings', 'type': '{str}'} + } + + def __init__(self, user_principal_name_mappings=None): + super(IdentityRightsTransferData, self).__init__() + self.user_principal_name_mappings = user_principal_name_mappings + + +class IdentityScope(Model): + """ + :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): + """ + Identity information. + + :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): + """ + :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): + """ + :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): + """ + 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 JsonWebToken(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(JsonWebToken, self).__init__() + + +class PagedIdentities(Model): + """ + :param continuation_token: + :type continuation_token: list of str + :param identities: + :type identities: list of :class:`Identity ` + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, + 'identities': {'key': 'identities', 'type': '[Identity]'} + } + + def __init__(self, continuation_token=None, identities=None): + super(PagedIdentities, self).__init__() + self.continuation_token = continuation_token + self.identities = identities + + +class RefreshTokenGrant(AuthorizationGrant): + """ + :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): + """ + :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): + """ + :param home_tenant: + :type home_tenant: bool + :param tenant_id: + :type tenant_id: str + :param tenant_name: + :type tenant_name: str + :param verified_domains: + :type verified_domains: list of str + """ + + _attribute_map = { + 'home_tenant': {'key': 'homeTenant', 'type': 'bool'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_name': {'key': 'tenantName', 'type': 'str'}, + 'verified_domains': {'key': 'verifiedDomains', 'type': '[str]'} + } + + def __init__(self, home_tenant=None, tenant_id=None, tenant_name=None, verified_domains=None): + super(TenantInfo, self).__init__() + self.home_tenant = home_tenant + self.tenant_id = tenant_id + self.tenant_name = tenant_name + self.verified_domains = verified_domains + + +class Identity(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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +__all__ = [ + 'AccessTokenResult', + 'AuthorizationGrant', + 'CreateScopeInfo', + 'FrameworkIdentityInfo', + 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', + 'IdentityBase', + 'IdentityBatchInfo', + 'IdentityRightsTransferData', + 'IdentityScope', + 'IdentitySelf', + 'IdentitySnapshot', + 'IdentityUpdateData', + 'JsonPatchOperation', + 'JsonWebToken', + 'PagedIdentities', + 'RefreshTokenGrant', + 'SwapIdentityInfo', + 'TenantInfo', + 'Identity', +] diff --git a/azure-devops/azure/devops/v7_1/location/__init__.py b/azure-devops/azure/devops/v7_1/location/__init__.py new file mode 100644 index 00000000..37761f5d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/location/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/location/location_client.py b/azure-devops/azure/devops/v7_1/location/location_client.py new file mode 100644 index 00000000..4f347412 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/location/location_client.py @@ -0,0 +1,192 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + content=content) + diff --git a/azure-devops/azure/devops/v7_1/location/models.py b/azure-devops/azure/devops/v7_1/location/models.py new file mode 100644 index 00000000..2a434cd1 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/location/models.py @@ -0,0 +1,403 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + Data transfer class that holds information needed to set up a connection with a VSS server. + + :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): + """ + Base Identity class to allow "trimmed" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional [DataMember] properties + + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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.social_descriptor = social_descriptor + self.subject_descriptor = subject_descriptor + self.unique_user_id = unique_user_id + + +class LocationMapping(Model): + """ + :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): + """ + Data transfer class used to transfer data about the location service data over the web service. + + :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): + """ + :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): + """ + :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): + """ + :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: Identity Identifier. Also called Storage Key, or VSID + :type id: str + :param is_active: True if the identity has a membership in any Azure Devops group in the organization. + :type is_active: bool + :param is_container: True if the identity is a group. + :type is_container: bool + :param master_id: + :type master_id: str + :param member_ids: Id of the members of the identity (groups only). + :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 social_descriptor: + :type social_descriptor: :class:`str ` + :param subject_descriptor: Subject descriptor of a Graph entity. + :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'}, + 'social_descriptor': {'key': 'socialDescriptor', 'type': 'str'}, + '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, social_descriptor=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, social_descriptor=social_descriptor, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) + + +__all__ = [ + 'AccessMapping', + 'ConnectionData', + 'IdentityBase', + 'LocationMapping', + 'LocationServiceData', + 'ResourceAreaInfo', + 'ServiceDefinition', + 'Identity', +] diff --git a/azure-devops/azure/devops/v7_1/maven/__init__.py b/azure-devops/azure/devops/v7_1/maven/__init__.py new file mode 100644 index 00000000..fd366dbf --- /dev/null +++ b/azure-devops/azure/devops/v7_1/maven/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'JsonPatchOperation', + 'MavenDistributionManagement', + 'MavenMinimalPackageDetails', + 'MavenPackage', + 'MavenPackagesBatchRequest', + 'MavenPackageVersionDeletionState', + 'MavenPomBuild', + 'MavenPomCi', + 'MavenPomCiNotifier', + 'MavenPomDependency', + 'MavenPomDependencyManagement', + 'MavenPomGav', + 'MavenPomIssueManagement', + 'MavenPomLicense', + 'MavenPomMailingList', + 'MavenPomMetadata', + 'MavenPomOrganization', + 'MavenPomParent', + 'MavenPomPerson', + 'MavenPomScm', + 'MavenRecycleBinPackageVersionDetails', + 'MavenRepository', + 'MavenSnapshotRepository', + 'Package', + 'PackageVersionDetails', + 'Plugin', + 'PluginConfiguration', + 'ReferenceLink', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'MavenClient' +] diff --git a/azure-devops/azure/devops/v7_1/maven/maven_client.py b/azure-devops/azure/devops/v7_1/maven/maven_client.py new file mode 100644 index 00000000..1e2134fc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/maven/maven_client.py @@ -0,0 +1,314 @@ +# -------------------------------------------------------------------------------------------- +# 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 download_package(self, feed_id, group_id, artifact_id, version, file_name, project=None, **kwargs): + """DownloadPackage. + [Preview API] Fulfills Maven package file download requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem), returning the content as a stream. + :param str feed_id: Name or ID of the feed. + :param str group_id: GroupId of the maven package + :param str artifact_id: ArtifactId of the maven package + :param str version: Version of the package + :param str file_name: File name to download + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, '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') + 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='c338d4b5-d30a-47e2-95b7-f157ef558833', + version='7.1-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_package_versions(self, batch_request, feed_id, project=None): + """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: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'MavenPackagesBatchRequest') + self._send(http_method='POST', + location_id='b7c586b0-d947-4d35-811a-f1161de80e6c', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_packages(self, batch_request, feed, project=None): + """UpdateRecycleBinPackages. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. + :param str feed: + :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 feed is not None: + route_values['feed'] = self._serialize.url('feed', feed, 'str') + content = self._serialize.body(batch_request, 'MavenPackagesBatchRequest') + self._send(http_method='POST', + location_id='5dd6f547-c76f-4d9d-b2ec-4720feda641f', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed, group_id, artifact_id, version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed, group_id, artifact_id, version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed, group_id, artifact_id, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of a package within the context of a feed + :param str feed: The name or id of the feed + :param str group_id: The group id of the package + :param str artifact_id: The artifact id of the package + :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 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') + response = self._send(http_method='GET', + location_id='fba7ba8c-d1f5-4aeb-8f5d-f017a7d5e719', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed, group_id, artifact_id, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a package within the context of a feed + :param str feed: The name or id of the feed + :param str group_id: + :param str artifact_id: + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='fba7ba8c-d1f5-4aeb-8f5d-f017a7d5e719', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def get_package_version(self, feed, group_id, artifact_id, version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted packages. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def update_package_version(self, package_version_details, feed, group_id, artifact_id, version, project=None): + """UpdatePackageVersion. + [Preview API] Update state for a package version. + :param :class:` ` package_version_details: Details to be updated. + :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 str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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, 'PackageVersionDetails') + self._send(http_method='PATCH', + location_id='180ed967-377a-4112-986b-607adb14ded4', + version='7.1-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/maven/models.py b/azure-devops/azure/devops/v7_1/maven/models.py new file mode 100644 index 00000000..40061036 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/maven/models.py @@ -0,0 +1,906 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MavenDistributionManagement(Model): + """ + :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): + """ + Identifies a particular Maven package version + + :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): + """ + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a maven package. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 version metadata for a Maven 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): + """ + :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 Plugin(MavenPomGav): + """ + :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): + """ + :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): + """ + The class to represent a REST reference link. RFC: http://tools.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them. + + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class MavenPomDependency(MavenPomGav): + """ + :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): + """ + :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', + 'JsonPatchOperation', + 'MavenDistributionManagement', + 'MavenMinimalPackageDetails', + 'MavenPackage', + 'MavenPackagesBatchRequest', + 'MavenPackageVersionDeletionState', + 'MavenPomBuild', + 'MavenPomCi', + 'MavenPomCiNotifier', + 'MavenPomDependencyManagement', + 'MavenPomGav', + 'MavenPomIssueManagement', + 'MavenPomMailingList', + 'MavenPomMetadata', + 'MavenPomOrganization', + 'MavenPomParent', + 'MavenPomPerson', + 'MavenPomScm', + 'MavenRecycleBinPackageVersionDetails', + 'MavenRepository', + 'MavenSnapshotRepository', + 'Package', + 'PackageVersionDetails', + 'Plugin', + 'PluginConfiguration', + 'ReferenceLink', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'MavenPomDependency', + 'MavenPomLicense', +] diff --git a/azure-devops/azure/devops/v7_1/member_entitlement_management/__init__.py b/azure-devops/azure/devops/v7_1/member_entitlement_management/__init__.py new file mode 100644 index 00000000..8ba9434e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/member_entitlement_management/__init__.py @@ -0,0 +1,67 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'AadGraphMember', + 'AccessLevel', + 'BaseOperationResult', + 'EntitlementBase', + 'EntitlementOperationResultBase', + 'Extension', + 'ExtensionSummaryData', + 'GraphGroup', + 'GraphMember', + 'GraphServicePrincipal', + 'GraphSubject', + 'GraphSubjectBase', + 'GraphUser', + 'Group', + 'GroupEntitlement', + 'GroupEntitlementOperationReference', + 'GroupOperationResult', + 'GroupOption', + 'JsonPatchOperation', + 'LicenseSummaryData', + 'MemberEntitlement', + 'MemberEntitlement2', + 'MemberEntitlement2OperationReference', + 'MemberEntitlement2OperationResult', + 'MemberEntitlement2PatchResponse', + 'MemberEntitlement2PostResponse', + 'MemberEntitlement2ResponseBase', + 'MemberEntitlementOperationReference', + 'MemberEntitlementsPatchResponse', + 'MemberEntitlementsPostResponse', + 'MemberEntitlementsResponseBase', + 'OperationReference', + 'OperationResult', + 'PagedGraphMemberList', + 'PagedList', + 'ProjectEntitlement', + 'ProjectRef', + 'ReferenceLinks', + 'ServicePrincipalEntitlement', + 'ServicePrincipalEntitlementOperationReference', + 'ServicePrincipalEntitlementOperationResult', + 'ServicePrincipalEntitlementsPatchResponse', + 'ServicePrincipalEntitlementsPostResponse', + 'ServicePrincipalEntitlementsResponseBase', + 'SummaryData', + 'TeamRef', + 'UserEntitlement', + 'UserEntitlementOperationReference', + 'UserEntitlementOperationResult', + 'UserEntitlementsPatchResponse', + 'UserEntitlementsPostResponse', + 'UserEntitlementsResponseBase', + 'UsersSummary', + 'MemberEntitlementManagementClient' +] diff --git a/azure-devops/azure/devops/v7_1/member_entitlement_management/member_entitlement_management_client.py b/azure-devops/azure/devops/v7_1/member_entitlement_management/member_entitlement_management_client.py new file mode 100644 index 00000000..716c1bd9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/member_entitlement_management/member_entitlement_management_client.py @@ -0,0 +1,388 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('GroupEntitlement', 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('GroupEntitlementOperationReference', 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='9bce1f43-2629-419f-8f6c-7503be58a4f3', + version='7.1-preview.1') + return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) + + def search_member_entitlements(self, continuation_token=None, select=None, filter=None, order_by=None): + """SearchMemberEntitlements. + [Preview API] + :param str continuation_token: + :param str select: + :param str filter: + :param str order_by: + :rtype: :class:` ` + """ + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') + if order_by is not None: + query_parameters['$orderBy'] = self._serialize.query('order_by', order_by, 'str') + response = self._send(http_method='GET', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='7.1-preview.2', + query_parameters=query_parameters) + return self._deserialize('PagedList', 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='7.1-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 beginning 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='7.1-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='7.1-preview.1', + route_values=route_values) + + def add_service_principal_entitlement(self, service_principal_entitlement): + """AddServicePrincipalEntitlement. + [Preview API] Add a service principal, assign license and extensions and make them a member of a project group in an account. + :param :class:` ` service_principal_entitlement: ServicePrincipalEntitlement object specifying License, Extensions and Project/Team groups the service principal should be added to. + :rtype: :class:` ` + """ + content = self._serialize.body(service_principal_entitlement, 'ServicePrincipalEntitlement') + response = self._send(http_method='POST', + location_id='f03dbf50-80f8-41b7-8ca2-65b6a178caba', + version='7.1-preview.1', + content=content) + return self._deserialize('ServicePrincipalEntitlementsPostResponse', response) + + def update_service_principal_entitlements(self, document): + """UpdateServicePrincipalEntitlements. + [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more service principals. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform. + :rtype: :class:` ` + """ + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='f03dbf50-80f8-41b7-8ca2-65b6a178caba', + version='7.1-preview.1', + content=content, + media_type='application/json-patch+json') + return self._deserialize('ServicePrincipalEntitlementOperationReference', response) + + def delete_service_principal_entitlement(self, service_principal_id): + """DeleteServicePrincipalEntitlement. + [Preview API] Delete a service principal from the account. + :param str service_principal_id: ID of the service principal. + """ + route_values = {} + if service_principal_id is not None: + route_values['servicePrincipalId'] = self._serialize.url('service_principal_id', service_principal_id, 'str') + self._send(http_method='DELETE', + location_id='1d491a66-190b-43ae-86b8-9c2688c55186', + version='7.1-preview.1', + route_values=route_values) + + def get_service_principal_entitlement(self, service_principal_id): + """GetServicePrincipalEntitlement. + [Preview API] Get Service principal Entitlement for a service principal. + :param str service_principal_id: ID of the service principal. + :rtype: :class:` ` + """ + route_values = {} + if service_principal_id is not None: + route_values['servicePrincipalId'] = self._serialize.url('service_principal_id', service_principal_id, 'str') + response = self._send(http_method='GET', + location_id='1d491a66-190b-43ae-86b8-9c2688c55186', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('ServicePrincipalEntitlement', response) + + def update_service_principal_entitlement(self, document, service_principal_id): + """UpdateServicePrincipalEntitlement. + [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for a service principal. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the service principal. + :param str service_principal_id: ID of the service principal. + :rtype: :class:` ` + """ + route_values = {} + if service_principal_id is not None: + route_values['servicePrincipalId'] = self._serialize.url('service_principal_id', service_principal_id, 'str') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='1d491a66-190b-43ae-86b8-9c2688c55186', + version='7.1-preview.1', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('ServicePrincipalEntitlementsPatchResponse', response) + + 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='7.1-preview.3', + content=content) + return self._deserialize('UserEntitlementsPostResponse', response) + + def search_user_entitlements(self, continuation_token=None, select=None, filter=None, order_by=None): + """SearchUserEntitlements. + [Preview API] Get a paged set of user entitlements matching the filter and sort criteria built with properties that match the select input. + :param str continuation_token: Continuation token for getting the next page of data set. If null is passed, gets the first page. + :param str select: Comma (",") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'. + :param str filter: Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with "test" in email or displayname is "name eq 'test'". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'. + :param str order_by: PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name + :rtype: :class:` ` + """ + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') + if order_by is not None: + query_parameters['$orderBy'] = self._serialize.query('order_by', order_by, 'str') + response = self._send(http_method='GET', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='7.1-preview.3', + 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='7.1-preview.3', + 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='7.1-preview.3', + 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='7.1-preview.3', + 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='7.1-preview.3', + 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, 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('UsersSummary', response) + diff --git a/azure-devops/azure/devops/v7_1/member_entitlement_management/models.py b/azure-devops/azure/devops/v7_1/member_entitlement_management/models.py new file mode 100644 index 00000000..6190539e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/member_entitlement_management/models.py @@ -0,0 +1,1713 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + License assigned to a user + + :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): + """ + :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 EntitlementBase(Model): + """ + :param access_level: Member's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the member was added to the collection. + :type date_created: datetime + :param group_assignments: [Readonly] GroupEntitlements that this member 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 member last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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]'} + } + + def __init__(self, access_level=None, date_created=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None): + super(EntitlementBase, self).__init__() + self.access_level = access_level + self.date_created = date_created + self.group_assignments = group_assignments + self.id = id + self.last_accessed_date = last_accessed_date + self.project_entitlements = project_entitlements + + +class EntitlementOperationResultBase(Model): + """ + :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: Resulting entitlement property. For specific implementations, see also: + :type result: object + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'result': {'key': 'result', 'type': 'object'} + } + + def __init__(self, errors=None, is_success=None, result=None): + super(EntitlementOperationResultBase, self).__init__() + self.errors = errors + self.is_success = is_success + self.result = result + + +class Extension(Model): + """ + An extension assigned to a user + + :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): + """ + :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): + """ + Project Group (e.g. Contributor, Reader etc.) + + :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): + """ + A group entity with additional properties including its license, extensions, and project membership + + :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): + """ + :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): + """ + Group option to add a user to + + :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): + """ + 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 MemberEntitlement2(EntitlementBase): + """ + An AAD member entity + + :param access_level: Member's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the member was added to the collection. + :type date_created: datetime + :param group_assignments: [Readonly] GroupEntitlements that this member 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 member last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param member: + :type member: :class:`AadGraphMember ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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]'}, + 'member': {'key': 'member', 'type': 'AadGraphMember'} + } + + def __init__(self, access_level=None, date_created=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, member=None): + super(MemberEntitlement2, self).__init__(access_level=access_level, date_created=date_created, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements) + self.member = member + + +class MemberEntitlement2OperationResult(EntitlementOperationResultBase): + """ + :param member_id: Identifier of the Member being acted upon. + :type member_id: str + """ + + _attribute_map = { + 'member_id': {'key': 'memberId', 'type': 'str'} + } + + def __init__(self, member_id=None): + super(MemberEntitlement2OperationResult, self).__init__() + self.member_id = member_id + + +class MemberEntitlement2ResponseBase(Model): + """ + :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:`MemberEntitlement2 ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement2'} + } + + def __init__(self, is_success=None, member_entitlement=None): + super(MemberEntitlement2ResponseBase, self).__init__() + self.is_success = is_success + self.member_entitlement = member_entitlement + + +class MemberEntitlementsResponseBase(Model): + """ + :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): + """ + Reference for an async 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 + """ + + _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): + """ + :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): + """ + :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): + """ + Relation between a project and the user's effective permissions in that project. + + :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: [Deprecated] Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership. + :type is_project_permission_inherited: bool + :param project_permission_inherited: Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership. + :type project_permission_inherited: object + :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_permission_inherited': {'key': 'projectPermissionInherited', 'type': 'object'}, + '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_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_permission_inherited = project_permission_inherited + self.project_ref = project_ref + self.team_refs = team_refs + + +class ProjectRef(Model): + """ + A reference to a project + + :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): + """ + 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 ServicePrincipalEntitlement(EntitlementBase): + """ + :param access_level: Member's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the member was added to the collection. + :type date_created: datetime + :param group_assignments: [Readonly] GroupEntitlements that this member 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 member last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param service_principal: ServicePrincipal reference. + :type service_principal: :class:`GraphServicePrincipal ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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]'}, + 'service_principal': {'key': 'servicePrincipal', 'type': 'GraphServicePrincipal'} + } + + def __init__(self, access_level=None, date_created=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, service_principal=None): + super(ServicePrincipalEntitlement, self).__init__(access_level=access_level, date_created=date_created, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements) + self.service_principal = service_principal + + +class ServicePrincipalEntitlementOperationReference(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 + :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:`ServicePrincipalEntitlementOperationResult ` + """ + + _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': '[ServicePrincipalEntitlementOperationResult]'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(ServicePrincipalEntitlementOperationReference, 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 ServicePrincipalEntitlementOperationResult(EntitlementOperationResultBase): + """ + :param service_principal_id: Identifier of the ServicePrincipal being acted upon. + :type service_principal_id: str + """ + + _attribute_map = { + 'service_principal_id': {'key': 'servicePrincipalId', 'type': 'str'} + } + + def __init__(self, service_principal_id=None): + super(ServicePrincipalEntitlementOperationResult, self).__init__() + self.service_principal_id = service_principal_id + + +class ServicePrincipalEntitlementsResponseBase(Model): + """ + :param is_success: + :type is_success: bool + :param service_principal_entitlement: + :type service_principal_entitlement: :class:`ServicePrincipalEntitlement ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'service_principal_entitlement': {'key': 'servicePrincipalEntitlement', 'type': 'ServicePrincipalEntitlement'} + } + + def __init__(self, is_success=None, service_principal_entitlement=None): + super(ServicePrincipalEntitlementsResponseBase, self).__init__() + self.is_success = is_success + self.service_principal_entitlement = service_principal_entitlement + + +class SummaryData(Model): + """ + :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): + """ + A reference to a team + + :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(EntitlementBase): + """ + A user entity with additional properties including their license, extensions, and project membership + + :param access_level: Member's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the member was added to the collection. + :type date_created: datetime + :param group_assignments: [Readonly] GroupEntitlements that this member 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 member last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param extensions: User's extensions. + :type extensions: list of :class:`Extension ` + :param user: User reference. + :type user: :class:`GraphUser ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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]'}, + 'extensions': {'key': 'extensions', 'type': '[Extension]'}, + 'user': {'key': 'user', 'type': 'GraphUser'} + } + + def __init__(self, access_level=None, date_created=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, extensions=None, user=None): + super(UserEntitlement, self).__init__(access_level=access_level, date_created=date_created, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements) + self.extensions = extensions + self.user = user + + +class UserEntitlementOperationReference(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 + :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(EntitlementOperationResultBase): + """ + :param user_id: Identifier of the Member being acted upon. + :type user_id: str + """ + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'} + } + + def __init__(self, user_id=None): + super(UserEntitlementOperationResult, self).__init__() + self.user_id = user_id + + +class UserEntitlementsResponseBase(Model): + """ + :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): + """ + Summary of licenses and extensions assigned to users in the organization + + :param available_access_levels: Available Access Levels + :type available_access_levels: list of :class:`AccessLevel ` + :param default_access_level: Default Access Level + :type default_access_level: :class:`AccessLevel ` + :param extensions: Summary of Extensions in the organization + :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 organization + :type licenses: list of :class:`LicenseSummaryData ` + :param project_refs: Summary of Projects in the organization + :type project_refs: list of :class:`ProjectRef ` + """ + + _attribute_map = { + 'available_access_levels': {'key': 'availableAccessLevels', 'type': '[AccessLevel]'}, + 'default_access_level': {'key': 'defaultAccessLevel', '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, default_access_level=None, extensions=None, group_options=None, licenses=None, project_refs=None): + super(UsersSummary, self).__init__() + self.available_access_levels = available_access_levels + self.default_access_level = default_access_level + self.extensions = extensions + self.group_options = group_options + self.licenses = licenses + self.project_refs = project_refs + + +class ExtensionSummaryData(SummaryData): + """ + Summary of Extensions in the organization. + + :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): + """ + Top-level graph entity + + :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): + """ + :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): + """ + Summary of Licenses in the organization. + + :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): + """ + Deprecated: Use UserEntitlement instead + + :param access_level: Member's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param date_created: [Readonly] Date the member was added to the collection. + :type date_created: datetime + :param group_assignments: [Readonly] GroupEntitlements that this member 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 member last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param extensions: User's extensions. + :type extensions: list of :class:`Extension ` + :param user: User reference. + :type user: :class:`GraphUser ` + :param member: Member reference + :type member: :class:`GraphMember ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, + '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]'}, + 'extensions': {'key': 'extensions', 'type': '[Extension]'}, + 'user': {'key': 'user', 'type': 'GraphUser'}, + 'member': {'key': 'member', 'type': 'GraphMember'} + } + + def __init__(self, access_level=None, date_created=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, extensions=None, user=None, member=None): + super(MemberEntitlement, self).__init__(access_level=access_level, date_created=date_created, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements, extensions=extensions, user=user) + self.member = member + + +class MemberEntitlement2OperationReference(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 + :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:`MemberEntitlement2OperationResult ` + """ + + _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': '[MemberEntitlement2OperationResult]'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(MemberEntitlement2OperationReference, 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 MemberEntitlement2PatchResponse(MemberEntitlement2ResponseBase): + """ + :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:`MemberEntitlement2 ` + :param operation_results: List of results for each operation + :type operation_results: list of :class:`MemberEntitlement2OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement2'}, + 'operation_results': {'key': 'operationResults', 'type': '[MemberEntitlement2OperationResult]'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_results=None): + super(MemberEntitlement2PatchResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_results = operation_results + + +class MemberEntitlement2PostResponse(MemberEntitlement2ResponseBase): + """ + :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:`MemberEntitlement2 ` + :param operation_result: Operation result + :type operation_result: :class:`MemberEntitlement2OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement2'}, + 'operation_result': {'key': 'operationResult', 'type': 'MemberEntitlement2OperationResult'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_result=None): + super(MemberEntitlement2PostResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_result = operation_result + + +class MemberEntitlementOperationReference(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 + :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): + """ + :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): + """ + :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): + """ + A page of users + + :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 ServicePrincipalEntitlementsPatchResponse(ServicePrincipalEntitlementsResponseBase): + """ + :param is_success: + :type is_success: bool + :param service_principal_entitlement: + :type service_principal_entitlement: :class:`ServicePrincipalEntitlement ` + :param operation_results: + :type operation_results: list of :class:`ServicePrincipalEntitlementOperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'service_principal_entitlement': {'key': 'servicePrincipalEntitlement', 'type': 'ServicePrincipalEntitlement'}, + 'operation_results': {'key': 'operationResults', 'type': '[ServicePrincipalEntitlementOperationResult]'} + } + + def __init__(self, is_success=None, service_principal_entitlement=None, operation_results=None): + super(ServicePrincipalEntitlementsPatchResponse, self).__init__(is_success=is_success, service_principal_entitlement=service_principal_entitlement) + self.operation_results = operation_results + + +class ServicePrincipalEntitlementsPostResponse(ServicePrincipalEntitlementsResponseBase): + """ + :param is_success: + :type is_success: bool + :param service_principal_entitlement: + :type service_principal_entitlement: :class:`ServicePrincipalEntitlement ` + :param operation_result: + :type operation_result: :class:`ServicePrincipalEntitlementOperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'service_principal_entitlement': {'key': 'servicePrincipalEntitlement', 'type': 'ServicePrincipalEntitlement'}, + 'operation_result': {'key': 'operationResult', 'type': 'ServicePrincipalEntitlementOperationResult'} + } + + def __init__(self, is_success=None, service_principal_entitlement=None, operation_result=None): + super(ServicePrincipalEntitlementsPostResponse, self).__init__(is_success=is_success, service_principal_entitlement=service_principal_entitlement) + self.operation_result = operation_result + + +class UserEntitlementsPatchResponse(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 ` + :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): + """ + :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): + """ + :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 AadGraphMember(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 + :param directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None): + super(AadGraphMember, 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.directory_alias = directory_alias + self.is_deleted_in_origin = is_deleted_in_origin + self.metadata_update_date = metadata_update_date + self.meta_type = meta_type + + +class GraphGroup(GraphMember): + """ + Graph group entity + + :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 + + +class GraphServicePrincipal(AadGraphMember): + """ + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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 + :param application_id: + :type application_id: 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'}, + 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, + 'metadata_update_date': {'key': 'metadataUpdateDate', 'type': 'iso-8601'}, + 'meta_type': {'key': 'metaType', 'type': 'str'}, + 'application_id': {'key': 'applicationId', '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, directory_alias=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None, application_id=None): + super(GraphServicePrincipal, 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, directory_alias=directory_alias, is_deleted_in_origin=is_deleted_in_origin, metadata_update_date=metadata_update_date, meta_type=meta_type) + self.application_id = application_id + + +class GraphUser(AadGraphMember): + """ + :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 directory_alias: The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle. + :type directory_alias: str + :param is_deleted_in_origin: When true, the group has been deleted in the identity provider + :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'}, + 'directory_alias': {'key': 'directoryAlias', '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, directory_alias=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, directory_alias=directory_alias, is_deleted_in_origin=is_deleted_in_origin, metadata_update_date=metadata_update_date, meta_type=meta_type) + + +__all__ = [ + 'AccessLevel', + 'BaseOperationResult', + 'EntitlementBase', + 'EntitlementOperationResultBase', + 'Extension', + 'GraphSubjectBase', + 'Group', + 'GroupEntitlement', + 'GroupOperationResult', + 'GroupOption', + 'JsonPatchOperation', + 'MemberEntitlement2', + 'MemberEntitlement2OperationResult', + 'MemberEntitlement2ResponseBase', + 'MemberEntitlementsResponseBase', + 'OperationReference', + 'OperationResult', + 'PagedList', + 'ProjectEntitlement', + 'ProjectRef', + 'ReferenceLinks', + 'ServicePrincipalEntitlement', + 'ServicePrincipalEntitlementOperationReference', + 'ServicePrincipalEntitlementOperationResult', + 'ServicePrincipalEntitlementsResponseBase', + 'SummaryData', + 'TeamRef', + 'UserEntitlement', + 'UserEntitlementOperationReference', + 'UserEntitlementOperationResult', + 'UserEntitlementsResponseBase', + 'UsersSummary', + 'ExtensionSummaryData', + 'GraphSubject', + 'GroupEntitlementOperationReference', + 'LicenseSummaryData', + 'MemberEntitlement', + 'MemberEntitlement2OperationReference', + 'MemberEntitlement2PatchResponse', + 'MemberEntitlement2PostResponse', + 'MemberEntitlementOperationReference', + 'MemberEntitlementsPatchResponse', + 'MemberEntitlementsPostResponse', + 'PagedGraphMemberList', + 'ServicePrincipalEntitlementsPatchResponse', + 'ServicePrincipalEntitlementsPostResponse', + 'UserEntitlementsPatchResponse', + 'UserEntitlementsPostResponse', + 'GraphMember', + 'AadGraphMember', + 'GraphGroup', + 'GraphServicePrincipal', + 'GraphUser', +] diff --git a/azure-devops/azure/devops/v7_1/notification/__init__.py b/azure-devops/azure/devops/v7_1/notification/__init__.py new file mode 100644 index 00000000..9a25d3d0 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/notification/__init__.py @@ -0,0 +1,76 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ISubscriptionFilter', + 'ISubscriptionChannel', + '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', + 'SubscriptionDiagnostics', + 'SubscriptionEvaluationRequest', + 'SubscriptionEvaluationResult', + 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', + 'SubscriptionManagement', + 'SubscriptionQuery', + 'SubscriptionQueryCondition', + 'SubscriptionScope', + 'SubscriptionTracing', + 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'ValueDefinition', + 'VssNotificationEvent', + 'NotificationClient' +] diff --git a/azure-devops/azure/devops/v7_1/notification/models.py b/azure-devops/azure/devops/v7_1/notification/models.py new file mode 100644 index 00000000..a589b92c --- /dev/null +++ b/azure-devops/azure/devops/v7_1/notification/models.py @@ -0,0 +1,1784 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + Defines an "actor" for an event. + + :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): + """ + Defines a scope for an event. + + :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): + """ + Encapsulates events result properties. It defines the total number of events used and the number of matched events. + + :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): + """ + A transform request specify the properties of a notification event to be transformed. + + :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): + """ + Result of transforming a notification event. + + :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): + """ + Subscription Filter Clause represents a single clause in a subscription filter e.g. If the subscription has the following criteria "Project Name = [Current Project] AND Assigned To = [Me] it will be represented as two Filter Clauses Clause 1: Index = 1, Logical Operator: NULL , FieldName = 'Project Name', Operator = '=', Value = '[Current Project]' Clause 2: Index = 2, Logical Operator: 'AND' , FieldName = 'Assigned To' , Operator = '=', Value = '[Me]' + + :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): + """ + Represents a hierarchy of SubscritionFilterClauses that have been grouped together through either adding a group in the WebUI or using parethesis in the Subscription condition string + + :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): + """ + :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): + """ + :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 INotificationDiagnosticLog(Model): + """ + Abstraction interface for the diagnostic log. Primarily for deserialization. + + :param activity_id: Identifier used for correlating to other diagnostics that may have been recorded elsewhere. + :type activity_id: str + :param description: Description of what subscription or notification job is being logged. + :type description: str + :param end_time: Time the log ended. + :type end_time: datetime + :param id: Unique instance identifier. + :type id: str + :param log_type: Type of information being logged. + :type log_type: str + :param messages: List of log messages. + :type messages: list of :class:`NotificationDiagnosticLogMessage ` + :param properties: Dictionary of log properties and settings for the job. + :type properties: dict + :param source: This identifier depends on the logType. For notification jobs, this will be the job Id. For subscription tracing, this will be a special root Guid with the subscription Id encoded. + :type source: str + :param start_time: Time the log started. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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 ISubscriptionFilter(Model): + """ + :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 ISubscriptionChannel(Model): + """ + :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 NotificationAdminSettings(Model): + """ + :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): + """ + :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): + """ + :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): + """ + Encapsulates the properties of a filterable field. A filterable field is a field in an event that can used to filter notifications for a certain event type. + + :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): + """ + Encapsulates the properties of a field type. It includes a unique id for the operator and a localized string for display name + + :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): + """ + Encapsulates the properties of a field type. It describes the data type of a field, the operators it support and how to populate it in the UI + + :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): + """ + Encapsulates the properties of a notification event publisher. + + :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): + """ + Encapsulates the properties of an event role. An event Role is used for role based subscription for example for a buildCompletedEvent, one role is request by field + + :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): + """ + Encapsulates the properties of an event type. It defines the fields, that can be used for filtering, for that event type. + + :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): + """ + Encapsulates the properties of a category. A category will be used by the UI to group event types + + :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): + """ + :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): + """ + :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): + """ + Encapsulates notifications result properties. It defines the number of notifications and the recipients of notifications. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + A subscriber is a user or group that has the potential to receive notifications. + + :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): + """ + Updates to a subscriber. Typically used to change (or set) a preferred email address or default delivery preference. + + :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): + """ + A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. + + :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 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 channel: Channel for delivering notifications triggered by the subscription. + :type channel: :class:`ISubscriptionChannel ` + :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 subscription. + :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'}, + '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'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + '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, description=None, diagnostics=None, extended_properties=None, filter=None, flags=None, channel=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.description = description + self.diagnostics = diagnostics + self.extended_properties = extended_properties + self.filter = filter + self.flags = flags + self.channel = channel + 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): + """ + Parameters for creating a new subscription. A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. + + :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 channel: Channel for delivering notifications triggered by the new subscription. + :type channel: :class:`ISubscriptionChannel ` + :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 = { + 'description': {'key': 'description', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + 'scope': {'key': 'scope', 'type': 'SubscriptionScope'}, + 'subscriber': {'key': 'subscriber', 'type': 'IdentityRef'} + } + + def __init__(self, description=None, filter=None, channel=None, scope=None, subscriber=None): + super(NotificationSubscriptionCreateParameters, self).__init__() + self.description = description + self.filter = filter + self.channel = channel + self.scope = scope + self.subscriber = subscriber + + +class NotificationSubscriptionTemplate(Model): + """ + :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): + """ + Parameters for updating an existing subscription. A subscription defines criteria for matching events and how the subscription's subscriber should be notified about those events. Note: only the fields to be updated should be set. + + :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 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 channel: Channel for delivering notifications triggered by the subscription. + :type channel: :class:`ISubscriptionChannel ` + :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'}, + 'description': {'key': 'description', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, + 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, + '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, description=None, filter=None, channel=None, scope=None, status=None, status_message=None, user_settings=None): + super(NotificationSubscriptionUpdateParameters, self).__init__() + self.admin_settings = admin_settings + self.description = description + self.filter = filter + self.channel = channel + self.scope = scope + self.status = status + self.status_message = status_message + self.user_settings = user_settings + + +class OperatorConstraint(Model): + """ + Encapsulates the properties of an operator constraint. An operator constraint defines if some operator is available only for specific scope like a project scope. + + :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): + """ + 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 SubscriptionAdminSettings(Model): + """ + Admin-managed settings for a group subscription. + + :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 SubscriptionDiagnostics(Model): + """ + Contains all the diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`SubscriptionTracing ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`SubscriptionTracing ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Encapsulates the properties of a SubscriptionEvaluationRequest. It defines the subscription to be evaluated and time interval for events used in evaluation. + + :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): + """ + Encapsulates the subscription evaluation results. It defines the Date Interval that was used, number of events evaluated and events and notifications results + + :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): + """ + Encapsulates the subscription evaluation settings needed for the UI + + :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 SubscriptionChannelWithAddress(Model): + """ + :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 SubscriptionManagement(Model): + """ + Encapsulates the properties needed to manage subscriptions, opt in and out of subscriptions. + + :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): + """ + Notification subscriptions query input. + + :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): + """ + Conditions a subscription must match to qualify for the query result set. Not all fields are required. A subscription must match all conditions specified in order to qualify for the result set. + + :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 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): + """ + A resource, typically an account or project, in which events are published from. + + :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): + """ + Data controlling a single diagnostic setting for a subscription. + + :param enabled: Indicates whether the diagnostic tracing is enabled or not. + :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): + """ + User-managed settings for a group subscription. + + :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): + """ + Parameters to update diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Parameters to update a specific diagnostic setting. + + :param enabled: Indicates whether to enable to disable the diagnostic tracing. + :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): + """ + Encapsulates the properties of a field value definition. It has the information needed to retrieve the list of possible values for a certain field and how to handle that field values in the UI. This information includes what type of object this value represents, which property to use for UI display and which property to use for saving the subscription + + :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): + """ + This is the type used for firing notifications intended for the subsystem in the Notifications SDK. For components that can't take a dependency on the Notifications SDK directly, they can use ITeamFoundationEventService.PublishNotification and the Notifications SDK ISubscriber implementation will get it. + + :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 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): + """ + Artifact filter options. Used in "follow" subscriptions. + + :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): + """ + :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): + """ + :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', + 'ISubscriptionFilter', + 'ISubscriptionChannel', + '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', + 'SubscriptionDiagnostics', + 'SubscriptionEvaluationRequest', + 'SubscriptionEvaluationResult', + 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', + 'SubscriptionManagement', + 'SubscriptionQuery', + 'SubscriptionQueryCondition', + 'SubscriptionScope', + 'SubscriptionTracing', + 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'ValueDefinition', + 'VssNotificationEvent', + 'ArtifactFilter', + 'FieldInputValues', + 'FieldValuesQuery', +] diff --git a/azure-devops/azure/devops/v7_1/notification/notification_client.py b/azure-devops/azure/devops/v7_1/notification/notification_client.py new file mode 100644 index 00000000..2fe71ee7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/notification/notification_client.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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] 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='7.1-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] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionDiagnostics', response) + + def get_event_type(self, event_type): + """GetEventType. + [Preview API] 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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + content=content) + return self._deserialize('NotificationAdminSettings', response) + + def get_subscriber(self, subscriber_id): + """GetSubscriber. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('NotificationSubscriber', response) + + def update_subscriber(self, update_parameters, subscriber_id): + """UpdateSubscriber. + [Preview API] 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionUserSettings', response) + diff --git a/azure-devops/azure/devops/v7_1/npm/__init__.py b/azure-devops/azure/devops/v7_1/npm/__init__.py new file mode 100644 index 00000000..c9a2655f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/npm/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NpmClient' +] diff --git a/azure-devops/azure/devops/v7_1/npm/models.py b/azure-devops/azure/devops/v7_1/npm/models.py new file mode 100644 index 00000000..e078ff1a --- /dev/null +++ b/azure-devops/azure/devops/v7_1/npm/models.py @@ -0,0 +1,301 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of an npm package. + + :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): + """ + :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 version metadata for an npm 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): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class BatchDeprecateData(BatchOperationData): + """ + Data required to deprecate multiple package versions. Pass this while performing NpmBatchOperationTypes.Deprecate batch operation. + + :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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'BatchDeprecateData', +] diff --git a/azure-devops/azure/devops/v7_1/npm/npm_client.py b/azure-devops/azure/devops/v7_1/npm/npm_client.py new file mode 100644 index 00000000..095831b9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/npm/npm_client.py @@ -0,0 +1,589 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """GetContentScopedPackage. + [Preview API] + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :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 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='7.1-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, project=None, **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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_readme_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None, **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. + :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 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='7.1-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, project=None, **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. + :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 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='7.1-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 update_recycle_bin_packages(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackages. + [Preview API] Delete or restore several package versions from the recycle bin. + :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. + :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 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='eefe03ef-a6a2-4a7a-a0ec-2e65a5efd64c', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_scoped_package_version_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, project=None): + """GetScopedUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of the (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :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 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') + response = self._send(http_method='GET', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, behavior, project=None): + """SetScopedUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of the (unscoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def get_scoped_package_info(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-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, project=None): + """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: + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + + def get_package_info(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_package(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def update_package(self, package_version_details, feed_id, package_name, package_version, project=None): + """UpdatePackage. + [Preview API] + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_name: + :param str package_version: + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + diff --git a/azure-devops/azure/devops/v7_1/nuget/__init__.py b/azure-devops/azure/devops/v7_1/nuget/__init__.py new file mode 100644 index 00000000..5c8bf666 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/nuget/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NuGetClient' +] diff --git a/azure-devops/azure/devops/v7_1/nuget/models.py b/azure-devops/azure/devops/v7_1/nuget/models.py new file mode 100644 index 00000000..31e89d29 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/nuget/models.py @@ -0,0 +1,301 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a NuGet package. + + :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): + """ + :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 version metadata for a NuGet 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 listed: Indicates whether the package is marked as 'listed' within the NuGet protocol. If null or missing, the package's 'listed' state is unspecified. + :type listed: bool + :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'}, + 'listed': {'key': 'listed', 'type': 'bool'}, + '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, listed=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.listed = listed + self.name = name + self.permanently_deleted_date = permanently_deleted_date + self.source_chain = source_chain + self.version = version + + +class PackageVersionDetails(Model): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +class BatchListData(BatchOperationData): + """ + Data required to unlist or relist multiple package versions. Pass this while performing NuGetBatchOperationTypes.List batch operation. + + :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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'BatchListData', +] diff --git a/azure-devops/azure/devops/v7_1/nuget/nuget_client.py b/azure-devops/azure/devops/v7_1/nuget/nuget_client.py new file mode 100644 index 00000000..1c61a963 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/nuget/nuget_client.py @@ -0,0 +1,291 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, source_protocol_version=None, **kwargs): + """DownloadPackage. + [Preview API] Download a package version directly. + :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 project: Project ID or project name + :param str source_protocol_version: Unused + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Name or ID of the feed. + :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 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='6479ac16-32f4-40f7-aa96-9414de861352', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to include deleted packages in the response. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/operations/__init__.py b/azure-devops/azure/devops/v7_1/operations/__init__.py new file mode 100644 index 00000000..cd7611eb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/operations/__init__.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/operations/models.py b/azure-devops/azure/devops/v7_1/operations/models.py new file mode 100644 index 00000000..d491a8b6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/operations/models.py @@ -0,0 +1,119 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Reference for an async 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 + """ + + _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): + """ + :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): + """ + 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 Operation(OperationReference): + """ + Contains information about the progress or result of an async 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', +] diff --git a/azure-devops/azure/devops/v7_1/operations/operations_client.py b/azure-devops/azure/devops/v7_1/operations/operations_client.py new file mode 100644 index 00000000..de48d1f4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/operations/operations_client.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] Gets an operation from 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Operation', response) + diff --git a/azure-devops/azure/devops/v7_1/pipeline_permissions/__init__.py b/azure-devops/azure/devops/v7_1/pipeline_permissions/__init__.py new file mode 100644 index 00000000..7d3014fa --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipeline_permissions/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipeline_permissions_client import PipelinePermissionsClient + +__all__ = [ + 'GraphSubjectBase', + 'IdentityRef', + 'Permission', + 'PipelinePermission', + 'ReferenceLinks', + 'Resource', + 'ResourcePipelinePermissions', + 'PipelinePermissionsClient' +] diff --git a/azure-devops/azure/devops/v7_1/pipeline_permissions/models.py b/azure-devops/azure/devops/v7_1/pipeline_permissions/models.py new file mode 100644 index 00000000..c8869423 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipeline_permissions/models.py @@ -0,0 +1,216 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 Permission(Model): + """ + :param authorized: + :type authorized: bool + :param authorized_by: + :type authorized_by: :class:`IdentityRef ` + :param authorized_on: + :type authorized_on: datetime + """ + + _attribute_map = { + 'authorized': {'key': 'authorized', 'type': 'bool'}, + 'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'}, + 'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'} + } + + def __init__(self, authorized=None, authorized_by=None, authorized_on=None): + super(Permission, self).__init__() + self.authorized = authorized + self.authorized_by = authorized_by + self.authorized_on = authorized_on + + +class PipelinePermission(Permission): + """ + :param authorized: + :type authorized: bool + :param authorized_by: + :type authorized_by: :class:`IdentityRef ` + :param authorized_on: + :type authorized_on: datetime + :param id: + :type id: int + """ + + _attribute_map = { + 'authorized': {'key': 'authorized', 'type': 'bool'}, + 'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'}, + 'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, authorized=None, authorized_by=None, authorized_on=None, id=None): + super(PipelinePermission, self).__init__(authorized=authorized, authorized_by=authorized_by, authorized_on=authorized_on) + self.id = id + + +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 Resource(Model): + """ + :param id: Id of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :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(Resource, self).__init__() + self.id = id + self.name = name + self.type = type + + +class ResourcePipelinePermissions(Model): + """ + :param all_pipelines: + :type all_pipelines: :class:`Permission ` + :param pipelines: + :type pipelines: list of :class:`PipelinePermission ` + :param resource: + :type resource: :class:`Resource ` + """ + + _attribute_map = { + 'all_pipelines': {'key': 'allPipelines', 'type': 'Permission'}, + 'pipelines': {'key': 'pipelines', 'type': '[PipelinePermission]'}, + 'resource': {'key': 'resource', 'type': 'Resource'} + } + + def __init__(self, all_pipelines=None, pipelines=None, resource=None): + super(ResourcePipelinePermissions, self).__init__() + self.all_pipelines = all_pipelines + self.pipelines = pipelines + self.resource = resource + + +__all__ = [ + 'GraphSubjectBase', + 'IdentityRef', + 'Permission', + 'PipelinePermission', + 'ReferenceLinks', + 'Resource', + 'ResourcePipelinePermissions', +] diff --git a/azure-devops/azure/devops/v7_1/pipeline_permissions/pipeline_permissions_client.py b/azure-devops/azure/devops/v7_1/pipeline_permissions/pipeline_permissions_client.py new file mode 100644 index 00000000..e29875cd --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipeline_permissions/pipeline_permissions_client.py @@ -0,0 +1,90 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinePermissionsClient(Client): + """PipelinePermissions + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinePermissionsClient, 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 = 'a81a0441-de52-4000-aa15-ff0e07bfbbaa' + + def get_pipeline_permissions_for_resource(self, project, resource_type, resource_id): + """GetPipelinePermissionsForResource. + [Preview API] Given a ResourceType and ResourceId, returns authorized definitions for that resource. + :param str project: Project ID or project name + :param str resource_type: + :param str resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if resource_type is not None: + route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str') + response = self._send(http_method='GET', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('ResourcePipelinePermissions', response) + + def update_pipeline_permisions_for_resource(self, resource_authorization, project, resource_type, resource_id): + """UpdatePipelinePermisionsForResource. + [Preview API] Authorizes/Unauthorizes a list of definitions for a given resource. + :param :class:` ` resource_authorization: + :param str project: Project ID or project name + :param str resource_type: + :param str resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if resource_type is not None: + route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str') + content = self._serialize.body(resource_authorization, 'ResourcePipelinePermissions') + response = self._send(http_method='PATCH', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ResourcePipelinePermissions', response) + + def update_pipeline_permisions_for_resources(self, resource_authorizations, project): + """UpdatePipelinePermisionsForResources. + [Preview API] Batch API to authorize/unauthorize a list of definitions for a multiple resources. + :param [ResourcePipelinePermissions] resource_authorizations: + :param str project: Project ID or project name + :rtype: [ResourcePipelinePermissions] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(resource_authorizations, '[ResourcePipelinePermissions]') + response = self._send(http_method='PATCH', + location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[ResourcePipelinePermissions]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/pipelines/__init__.py b/azure-devops/azure/devops/v7_1/pipelines/__init__.py new file mode 100644 index 00000000..65f7f0f2 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines/__init__.py @@ -0,0 +1,43 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipelines_client import PipelinesClient + +__all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'Container', + 'ContainerResource', + 'ContainerResourceParameters', + 'CreatePipelineConfigurationParameters', + 'CreatePipelineParameters', + 'Log', + 'LogCollection', + 'PackageResourceParameters', + 'Pipeline', + 'PipelineBase', + 'PipelineConfiguration', + 'PipelineReference', + 'PipelineResource', + 'PipelineResourceParameters', + 'PreviewRun', + 'ReferenceLinks', + 'Repository', + 'RepositoryResource', + 'RepositoryResourceParameters', + 'Run', + 'RunPipelineParameters', + 'RunReference', + 'RunResources', + 'RunResourcesParameters', + 'SignalRConnection', + 'SignedUrl', + 'Variable', + 'PipelinesClient' +] diff --git a/azure-devops/azure/devops/v7_1/pipelines/models.py b/azure-devops/azure/devops/v7_1/pipelines/models.py new file mode 100644 index 00000000..7f1336d3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines/models.py @@ -0,0 +1,731 @@ +# -------------------------------------------------------------------------------------------- +# 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 Artifact(Model): + """ + Artifacts are collections of files produced by a pipeline. Use artifacts to share files between stages in a pipeline or between different pipelines. + + :param name: The name of the artifact. + :type name: str + :param signed_content: Signed url for downloading this artifact + :type signed_content: :class:`SignedUrl ` + :param url: Self-referential url + :type url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, name=None, signed_content=None, url=None): + super(Artifact, self).__init__() + self.name = name + self.signed_content = signed_content + self.url = url + + +class BuildResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(BuildResourceParameters, self).__init__() + self.version = version + + +class Container(Model): + """ + :param environment: + :type environment: dict + :param image: + :type image: str + :param map_docker_socket: + :type map_docker_socket: bool + :param options: + :type options: str + :param ports: + :type ports: list of str + :param volumes: + :type volumes: list of str + """ + + _attribute_map = { + 'environment': {'key': 'environment', 'type': '{str}'}, + 'image': {'key': 'image', 'type': 'str'}, + 'map_docker_socket': {'key': 'mapDockerSocket', 'type': 'bool'}, + 'options': {'key': 'options', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + 'volumes': {'key': 'volumes', 'type': '[str]'} + } + + def __init__(self, environment=None, image=None, map_docker_socket=None, options=None, ports=None, volumes=None): + super(Container, self).__init__() + self.environment = environment + self.image = image + self.map_docker_socket = map_docker_socket + self.options = options + self.ports = ports + self.volumes = volumes + + +class ContainerResource(Model): + """ + :param container: + :type container: :class:`Container ` + """ + + _attribute_map = { + 'container': {'key': 'container', 'type': 'Container'} + } + + def __init__(self, container=None): + super(ContainerResource, self).__init__() + self.container = container + + +class ContainerResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(ContainerResourceParameters, self).__init__() + self.version = version + + +class CreatePipelineConfigurationParameters(Model): + """ + Configuration parameters of the pipeline. + + :param type: Type of configuration. + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(CreatePipelineConfigurationParameters, self).__init__() + self.type = type + + +class CreatePipelineParameters(Model): + """ + Parameters to create a pipeline. + + :param configuration: Configuration parameters of the pipeline. + :type configuration: :class:`CreatePipelineConfigurationParameters ` + :param folder: Folder of the pipeline. + :type folder: str + :param name: Name of the pipeline. + :type name: str + """ + + _attribute_map = { + 'configuration': {'key': 'configuration', 'type': 'CreatePipelineConfigurationParameters'}, + 'folder': {'key': 'folder', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, configuration=None, folder=None, name=None): + super(CreatePipelineParameters, self).__init__() + self.configuration = configuration + self.folder = folder + self.name = name + + +class Log(Model): + """ + Log for a pipeline. + + :param created_on: The date and time the log was created. + :type created_on: datetime + :param id: The ID of the log. + :type id: int + :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 + :param signed_content: + :type signed_content: :class:`SignedUrl ` + :param url: + :type url: str + """ + + _attribute_map = { + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'}, + 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, + 'line_count': {'key': 'lineCount', 'type': 'long'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, created_on=None, id=None, last_changed_on=None, line_count=None, signed_content=None, url=None): + super(Log, self).__init__() + self.created_on = created_on + self.id = id + self.last_changed_on = last_changed_on + self.line_count = line_count + self.signed_content = signed_content + self.url = url + + +class LogCollection(Model): + """ + A collection of logs. + + :param logs: The list of logs. + :type logs: list of :class:`Log ` + :param signed_content: + :type signed_content: :class:`SignedUrl ` + :param url: URL of the log. + :type url: str + """ + + _attribute_map = { + 'logs': {'key': 'logs', 'type': '[Log]'}, + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, logs=None, signed_content=None, url=None): + super(LogCollection, self).__init__() + self.logs = logs + self.signed_content = signed_content + self.url = url + + +class PackageResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(PackageResourceParameters, self).__init__() + self.version = version + + +class PipelineBase(Model): + """ + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None): + super(PipelineBase, self).__init__() + self.folder = folder + self.id = id + self.name = name + self.revision = revision + + +class PipelineConfiguration(Model): + """ + :param type: + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(PipelineConfiguration, self).__init__() + self.type = type + + +class PipelineReference(PipelineBase): + """ + A reference to a Pipeline. + + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + :param url: + :type url: str + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None, url=None): + super(PipelineReference, self).__init__(folder=folder, id=id, name=name, revision=revision) + self.url = url + + +class PipelineResource(Model): + """ + :param pipeline: + :type pipeline: :class:`PipelineReference ` + :param version: + :type version: str + """ + + _attribute_map = { + 'pipeline': {'key': 'pipeline', 'type': 'PipelineReference'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, pipeline=None, version=None): + super(PipelineResource, self).__init__() + self.pipeline = pipeline + self.version = version + + +class PipelineResourceParameters(Model): + """ + :param version: + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, version=None): + super(PipelineResourceParameters, self).__init__() + self.version = version + + +class PreviewRun(Model): + """ + :param final_yaml: + :type final_yaml: str + """ + + _attribute_map = { + 'final_yaml': {'key': 'finalYaml', 'type': 'str'} + } + + def __init__(self, final_yaml=None): + super(PreviewRun, self).__init__() + self.final_yaml = final_yaml + + +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 Repository(Model): + """ + :param type: + :type type: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, type=None): + super(Repository, self).__init__() + self.type = type + + +class RepositoryResource(Model): + """ + :param ref_name: + :type ref_name: str + :param repository: + :type repository: :class:`Repository ` + :param version: + :type version: str + """ + + _attribute_map = { + 'ref_name': {'key': 'refName', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'Repository'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, ref_name=None, repository=None, version=None): + super(RepositoryResource, self).__init__() + self.ref_name = ref_name + self.repository = repository + self.version = version + + +class RepositoryResourceParameters(Model): + """ + :param ref_name: + :type ref_name: str + :param token: This is the security token to use when connecting to the repository. + :type token: str + :param token_type: Optional. This is the type of the token given. If not provided, a type of "Bearer" is assumed. Note: Use "Basic" for a PAT token. + :type token_type: str + :param version: + :type version: str + """ + + _attribute_map = { + 'ref_name': {'key': 'refName', 'type': 'str'}, + 'token': {'key': 'token', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, ref_name=None, token=None, token_type=None, version=None): + super(RepositoryResourceParameters, self).__init__() + self.ref_name = ref_name + self.token = token + self.token_type = token_type + self.version = version + + +class RunPipelineParameters(Model): + """ + Settings which influence pipeline runs. + + :param preview_run: If true, don't actually create a new run. Instead, return the final YAML document after parsing templates. + :type preview_run: bool + :param resources: The resources the run requires. + :type resources: :class:`RunResourcesParameters ` + :param stages_to_skip: + :type stages_to_skip: list of str + :param template_parameters: + :type template_parameters: dict + :param variables: + :type variables: dict + :param yaml_override: If you use the preview run option, you may optionally supply different YAML. This allows you to preview the final YAML document without committing a changed file. + :type yaml_override: str + """ + + _attribute_map = { + 'preview_run': {'key': 'previewRun', 'type': 'bool'}, + 'resources': {'key': 'resources', 'type': 'RunResourcesParameters'}, + 'stages_to_skip': {'key': 'stagesToSkip', 'type': '[str]'}, + 'template_parameters': {'key': 'templateParameters', 'type': '{str}'}, + 'variables': {'key': 'variables', 'type': '{Variable}'}, + 'yaml_override': {'key': 'yamlOverride', 'type': 'str'} + } + + def __init__(self, preview_run=None, resources=None, stages_to_skip=None, template_parameters=None, variables=None, yaml_override=None): + super(RunPipelineParameters, self).__init__() + self.preview_run = preview_run + self.resources = resources + self.stages_to_skip = stages_to_skip + self.template_parameters = template_parameters + self.variables = variables + self.yaml_override = yaml_override + + +class RunReference(Model): + """ + :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(RunReference, self).__init__() + self.id = id + self.name = name + + +class RunResources(Model): + """ + :param containers: + :type containers: dict + :param pipelines: + :type pipelines: dict + :param repositories: + :type repositories: dict + """ + + _attribute_map = { + 'containers': {'key': 'containers', 'type': '{ContainerResource}'}, + 'pipelines': {'key': 'pipelines', 'type': '{PipelineResource}'}, + 'repositories': {'key': 'repositories', 'type': '{RepositoryResource}'} + } + + def __init__(self, containers=None, pipelines=None, repositories=None): + super(RunResources, self).__init__() + self.containers = containers + self.pipelines = pipelines + self.repositories = repositories + + +class RunResourcesParameters(Model): + """ + :param builds: + :type builds: dict + :param containers: + :type containers: dict + :param packages: + :type packages: dict + :param pipelines: + :type pipelines: dict + :param repositories: + :type repositories: dict + """ + + _attribute_map = { + 'builds': {'key': 'builds', 'type': '{BuildResourceParameters}'}, + 'containers': {'key': 'containers', 'type': '{ContainerResourceParameters}'}, + 'packages': {'key': 'packages', 'type': '{PackageResourceParameters}'}, + 'pipelines': {'key': 'pipelines', 'type': '{PipelineResourceParameters}'}, + 'repositories': {'key': 'repositories', 'type': '{RepositoryResourceParameters}'} + } + + def __init__(self, builds=None, containers=None, packages=None, pipelines=None, repositories=None): + super(RunResourcesParameters, self).__init__() + self.builds = builds + self.containers = containers + self.packages = packages + self.pipelines = pipelines + self.repositories = repositories + + +class SignalRConnection(Model): + """ + :param signed_content: + :type signed_content: :class:`SignedUrl ` + """ + + _attribute_map = { + 'signed_content': {'key': 'signedContent', 'type': 'SignedUrl'} + } + + def __init__(self, signed_content=None): + super(SignalRConnection, self).__init__() + self.signed_content = signed_content + + +class SignedUrl(Model): + """ + A signed url allowing limited-time anonymous access to private resources. + + :param signature_expires: Timestamp when access expires. + :type signature_expires: datetime + :param url: The URL to allow access to. + :type url: str + """ + + _attribute_map = { + 'signature_expires': {'key': 'signatureExpires', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, signature_expires=None, url=None): + super(SignedUrl, self).__init__() + self.signature_expires = signature_expires + self.url = url + + +class Variable(Model): + """ + :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(Variable, self).__init__() + self.is_secret = is_secret + self.value = value + + +class Pipeline(PipelineBase): + """ + Definition of a pipeline. + + :param folder: Pipeline folder + :type folder: str + :param id: Pipeline ID + :type id: int + :param name: Pipeline name + :type name: str + :param revision: Revision number + :type revision: int + :param _links: + :type _links: :class:`ReferenceLinks ` + :param configuration: + :type configuration: :class:`PipelineConfiguration ` + :param url: URL of the pipeline + :type url: str + """ + + _attribute_map = { + 'folder': {'key': 'folder', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'configuration': {'key': 'configuration', 'type': 'PipelineConfiguration'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, folder=None, id=None, name=None, revision=None, _links=None, configuration=None, url=None): + super(Pipeline, self).__init__(folder=folder, id=id, name=name, revision=revision) + self._links = _links + self.configuration = configuration + self.url = url + + +class Run(RunReference): + """ + :param id: + :type id: int + :param name: + :type name: str + :param _links: + :type _links: :class:`ReferenceLinks ` + :param created_date: + :type created_date: datetime + :param final_yaml: + :type final_yaml: str + :param finished_date: + :type finished_date: datetime + :param pipeline: + :type pipeline: :class:`PipelineReference ` + :param resources: + :type resources: :class:`RunResources ` + :param result: + :type result: object + :param state: + :type state: object + :param template_parameters: + :type template_parameters: dict + :param url: + :type url: str + :param variables: + :type variables: dict + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'final_yaml': {'key': 'finalYaml', 'type': 'str'}, + 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, + 'pipeline': {'key': 'pipeline', 'type': 'PipelineReference'}, + 'resources': {'key': 'resources', 'type': 'RunResources'}, + 'result': {'key': 'result', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'object'}, + 'template_parameters': {'key': 'templateParameters', 'type': '{object}'}, + 'url': {'key': 'url', 'type': 'str'}, + 'variables': {'key': 'variables', 'type': '{Variable}'} + } + + def __init__(self, id=None, name=None, _links=None, created_date=None, final_yaml=None, finished_date=None, pipeline=None, resources=None, result=None, state=None, template_parameters=None, url=None, variables=None): + super(Run, self).__init__(id=id, name=name) + self._links = _links + self.created_date = created_date + self.final_yaml = final_yaml + self.finished_date = finished_date + self.pipeline = pipeline + self.resources = resources + self.result = result + self.state = state + self.template_parameters = template_parameters + self.url = url + self.variables = variables + + +__all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'Container', + 'ContainerResource', + 'ContainerResourceParameters', + 'CreatePipelineConfigurationParameters', + 'CreatePipelineParameters', + 'Log', + 'LogCollection', + 'PackageResourceParameters', + 'PipelineBase', + 'PipelineConfiguration', + 'PipelineReference', + 'PipelineResource', + 'PipelineResourceParameters', + 'PreviewRun', + 'ReferenceLinks', + 'Repository', + 'RepositoryResource', + 'RepositoryResourceParameters', + 'RunPipelineParameters', + 'RunReference', + 'RunResources', + 'RunResourcesParameters', + 'SignalRConnection', + 'SignedUrl', + 'Variable', + 'Pipeline', + 'Run', +] diff --git a/azure-devops/azure/devops/v7_1/pipelines/pipelines_client.py b/azure-devops/azure/devops/v7_1/pipelines/pipelines_client.py new file mode 100644 index 00000000..b4d9a28f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines/pipelines_client.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinesClient(Client): + """Pipelines + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesClient, 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_artifact(self, project, pipeline_id, run_id, artifact_name, expand=None): + """GetArtifact. + [Preview API] Get a specific artifact from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str artifact_name: Name of the artifact. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if artifact_name is not None: + query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='85023071-bd5e-4438-89b0-2a5bf362a19d', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Artifact', response) + + def get_log(self, project, pipeline_id, run_id, log_id, expand=None): + """GetLog. + [Preview API] Get a specific log from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param int log_id: ID of the log. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if log_id is not None: + route_values['logId'] = self._serialize.url('log_id', log_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Log', response) + + def list_logs(self, project, pipeline_id, run_id, expand=None): + """ListLogs. + [Preview API] Get a list of logs from a pipeline run. + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_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='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('LogCollection', response) + + def create_pipeline(self, input_parameters, project): + """CreatePipeline. + [Preview API] Create a pipeline. + :param :class:` ` input_parameters: Input 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(input_parameters, 'CreatePipelineParameters') + response = self._send(http_method='POST', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Pipeline', response) + + def get_pipeline(self, project, pipeline_id, pipeline_version=None): + """GetPipeline. + [Preview API] Gets a pipeline, optionally at the specified version + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID + :param int pipeline_version: The pipeline version + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + response = self._send(http_method='GET', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Pipeline', response) + + def list_pipelines(self, project, order_by=None, top=None, continuation_token=None): + """ListPipelines. + [Preview API] Get a list of pipelines. + :param str project: Project ID or project name + :param str order_by: A sort expression. Defaults to "name asc" + :param int top: The maximum number of pipelines to return + :param str continuation_token: A continuation token from a previous request, to retrieve the next page of results + :rtype: [Pipeline] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query('order_by', order_by, '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='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Pipeline]', self._unwrap_collection(response)) + + def preview(self, run_parameters, project, pipeline_id, pipeline_version=None): + """Preview. + [Preview API] Queues a dry run of the pipeline and returns an object containing the final yaml. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='53df2d18-29ea-46a9-bee0-933540f80abf', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('PreviewRun', response) + + def get_run(self, project, pipeline_id, run_id): + """GetRun. + [Preview API] Gets a run for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :param int run_id: The run id + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + 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='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('Run', response) + + def list_runs(self, project, pipeline_id): + """ListRuns. + [Preview API] Gets top 10000 runs for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :rtype: [Run] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + response = self._send(http_method='GET', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Run]', self._unwrap_collection(response)) + + def run_pipeline(self, run_parameters, project, pipeline_id, pipeline_version=None): + """RunPipeline. + [Preview API] Runs a pipeline. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Run', response) + diff --git a/azure-devops/azure/devops/v7_1/pipelines_checks/__init__.py b/azure-devops/azure/devops/v7_1/pipelines_checks/__init__.py new file mode 100644 index 00000000..2c51f9b6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines_checks/__init__.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .pipelines_checks_client import PipelinesChecksClient + +__all__ = [ + 'ApprovalConfig', + 'ApprovalConfigSettings', + 'GraphSubjectBase', + 'CheckConfiguration', + 'CheckConfigurationRef', + 'CheckIssue', + 'CheckRun', + 'CheckRunResult', + 'CheckSuite', + 'CheckSuiteRef', + 'CheckSuiteRequest', + 'CheckType', + 'IdentityRef', + 'ReferenceLinks', + 'Resource', + 'TaskCheckConfig', + 'TaskCheckDefinitionReference', + 'PipelinesChecksClient' +] diff --git a/azure-devops/azure/devops/v7_1/pipelines_checks/models.py b/azure-devops/azure/devops/v7_1/pipelines_checks/models.py new file mode 100644 index 00000000..17713252 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines_checks/models.py @@ -0,0 +1,530 @@ +# -------------------------------------------------------------------------------------------- +# 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 ApprovalConfig(Model): + """ + Config to create a new approval. + + :param approvers: Ordered list of approvers. + :type approvers: list of :class:`IdentityRef ` + :param blocked_approvers: Identities which are not allowed to approve. + :type blocked_approvers: list of :class:`IdentityRef ` + :param execution_order: Order in which approvers will be actionable. + :type execution_order: object + :param instructions: Instructions for the approver. + :type instructions: str + :param min_required_approvers: Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all. + :type min_required_approvers: int + """ + + _attribute_map = { + 'approvers': {'key': 'approvers', 'type': '[IdentityRef]'}, + 'blocked_approvers': {'key': 'blockedApprovers', 'type': '[IdentityRef]'}, + 'execution_order': {'key': 'executionOrder', 'type': 'object'}, + 'instructions': {'key': 'instructions', 'type': 'str'}, + 'min_required_approvers': {'key': 'minRequiredApprovers', 'type': 'int'} + } + + def __init__(self, approvers=None, blocked_approvers=None, execution_order=None, instructions=None, min_required_approvers=None): + super(ApprovalConfig, self).__init__() + self.approvers = approvers + self.blocked_approvers = blocked_approvers + self.execution_order = execution_order + self.instructions = instructions + self.min_required_approvers = min_required_approvers + + +class ApprovalConfigSettings(ApprovalConfig): + """ + Config to create a new approval. + + :param approvers: Ordered list of approvers. + :type approvers: list of :class:`IdentityRef ` + :param blocked_approvers: Identities which are not allowed to approve. + :type blocked_approvers: list of :class:`IdentityRef ` + :param execution_order: Order in which approvers will be actionable. + :type execution_order: object + :param instructions: Instructions for the approver. + :type instructions: str + :param min_required_approvers: Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all. + :type min_required_approvers: int + :param requester_cannot_be_approver: Determines whether check requester can approve the check. + :type requester_cannot_be_approver: bool + """ + + _attribute_map = { + 'approvers': {'key': 'approvers', 'type': '[IdentityRef]'}, + 'blocked_approvers': {'key': 'blockedApprovers', 'type': '[IdentityRef]'}, + 'execution_order': {'key': 'executionOrder', 'type': 'object'}, + 'instructions': {'key': 'instructions', 'type': 'str'}, + 'min_required_approvers': {'key': 'minRequiredApprovers', 'type': 'int'}, + 'requester_cannot_be_approver': {'key': 'requesterCannotBeApprover', 'type': 'bool'} + } + + def __init__(self, approvers=None, blocked_approvers=None, execution_order=None, instructions=None, min_required_approvers=None, requester_cannot_be_approver=None): + super(ApprovalConfigSettings, self).__init__(approvers=approvers, blocked_approvers=blocked_approvers, execution_order=execution_order, instructions=instructions, min_required_approvers=min_required_approvers) + self.requester_cannot_be_approver = requester_cannot_be_approver + + +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 CheckConfigurationRef(Model): + """ + :param id: Check configuration id. + :type id: int + :param resource: Resource on which check get configured. + :type resource: :class:`Resource ` + :param type: Check configuration type + :type type: :class:`CheckType ` + :param url: The URL from which one can fetch the configured check. + :type url: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'resource': {'key': 'resource', 'type': 'Resource'}, + 'type': {'key': 'type', 'type': 'CheckType'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, id=None, resource=None, type=None, url=None): + super(CheckConfigurationRef, self).__init__() + self.id = id + self.resource = resource + self.type = type + self.url = url + + +class CheckIssue(Model): + """ + An issue (error, warning) associated with a check configuration. + + :param detailed_message: A more detailed description of issue. + :type detailed_message: str + :param message: A description of issue. + :type message: str + :param type: The type (error, warning) of the issue. + :type type: object + """ + + _attribute_map = { + 'detailed_message': {'key': 'detailedMessage', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, detailed_message=None, message=None, type=None): + super(CheckIssue, self).__init__() + self.detailed_message = detailed_message + self.message = message + self.type = type + + +class CheckRunResult(Model): + """ + :param result_message: + :type result_message: str + :param status: + :type status: object + """ + + _attribute_map = { + 'result_message': {'key': 'resultMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, result_message=None, status=None): + super(CheckRunResult, self).__init__() + self.result_message = result_message + self.status = status + + +class CheckSuiteRef(Model): + """ + :param context: Evaluation context for the check suite request + :type context: :class:`object ` + :param id: Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage + :type id: str + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, context=None, id=None): + super(CheckSuiteRef, self).__init__() + self.context = context + self.id = id + + +class CheckSuiteRequest(Model): + """ + :param context: + :type context: :class:`object ` + :param id: + :type id: str + :param resources: + :type resources: list of :class:`Resource ` + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[Resource]'} + } + + def __init__(self, context=None, id=None, resources=None): + super(CheckSuiteRequest, self).__init__() + self.context = context + self.id = id + self.resources = resources + + +class CheckType(Model): + """ + :param id: Gets or sets check type id. + :type id: str + :param name: Name of the check type. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(CheckType, self).__init__() + self.id = id + self.name = name + + +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 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 Resource(Model): + """ + :param id: Id of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :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(Resource, self).__init__() + self.id = id + self.name = name + self.type = type + + +class TaskCheckConfig(Model): + """ + Config to facilitate task check + + :param definition_ref: + :type definition_ref: :class:`TaskCheckDefinitionReference ` + :param display_name: + :type display_name: str + :param inputs: + :type inputs: dict + :param linked_variable_group: + :type linked_variable_group: str + :param retry_interval: + :type retry_interval: int + """ + + _attribute_map = { + 'definition_ref': {'key': 'definitionRef', 'type': 'TaskCheckDefinitionReference'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '{str}'}, + 'linked_variable_group': {'key': 'linkedVariableGroup', 'type': 'str'}, + 'retry_interval': {'key': 'retryInterval', 'type': 'int'} + } + + def __init__(self, definition_ref=None, display_name=None, inputs=None, linked_variable_group=None, retry_interval=None): + super(TaskCheckConfig, self).__init__() + self.definition_ref = definition_ref + self.display_name = display_name + self.inputs = inputs + self.linked_variable_group = linked_variable_group + self.retry_interval = retry_interval + + +class TaskCheckDefinitionReference(Model): + """ + :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(TaskCheckDefinitionReference, self).__init__() + self.id = id + self.name = name + self.version = version + + +class CheckConfiguration(CheckConfigurationRef): + """ + :param id: Check configuration id. + :type id: int + :param resource: Resource on which check get configured. + :type resource: :class:`Resource ` + :param type: Check configuration type + :type type: :class:`CheckType ` + :param url: The URL from which one can fetch the configured check. + :type url: str + :param _links: Reference links. + :type _links: :class:`ReferenceLinks ` + :param created_by: Identity of person who configured check. + :type created_by: :class:`IdentityRef ` + :param created_on: Time when check got configured. + :type created_on: datetime + :param issue: Issue connected to check configuration. + :type issue: :class:`CheckIssue ` + :param modified_by: Identity of person who modified the configured check. + :type modified_by: :class:`IdentityRef ` + :param modified_on: Time when configured check was modified. + :type modified_on: datetime + :param timeout: Timeout in minutes for the check. + :type timeout: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'resource': {'key': 'resource', 'type': 'Resource'}, + 'type': {'key': 'type', 'type': 'CheckType'}, + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'issue': {'key': 'issue', 'type': 'CheckIssue'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'timeout': {'key': 'timeout', 'type': 'int'} + } + + def __init__(self, id=None, resource=None, type=None, url=None, _links=None, created_by=None, created_on=None, issue=None, modified_by=None, modified_on=None, timeout=None): + super(CheckConfiguration, self).__init__(id=id, resource=resource, type=type, url=url) + self._links = _links + self.created_by = created_by + self.created_on = created_on + self.issue = issue + self.modified_by = modified_by + self.modified_on = modified_on + self.timeout = timeout + + +class CheckRun(CheckRunResult): + """ + :param result_message: + :type result_message: str + :param status: + :type status: object + :param completed_date: + :type completed_date: datetime + :param created_date: + :type created_date: datetime + :param check_configuration_ref: + :type check_configuration_ref: :class:`CheckConfigurationRef ` + :param id: + :type id: str + """ + + _attribute_map = { + 'result_message': {'key': 'resultMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'check_configuration_ref': {'key': 'checkConfigurationRef', 'type': 'CheckConfigurationRef'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, result_message=None, status=None, completed_date=None, created_date=None, check_configuration_ref=None, id=None): + super(CheckRun, self).__init__(result_message=result_message, status=status) + self.completed_date = completed_date + self.created_date = created_date + self.check_configuration_ref = check_configuration_ref + self.id = id + + +class CheckSuite(CheckSuiteRef): + """ + :param context: Evaluation context for the check suite request + :type context: :class:`object ` + :param id: Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage + :type id: str + :param _links: Reference links. + :type _links: :class:`ReferenceLinks ` + :param completed_date: Completed date of the given check suite request + :type completed_date: datetime + :param check_runs: List of check runs associated with the given check suite request. + :type check_runs: list of :class:`CheckRun ` + :param message: Optional message for the given check suite request + :type message: str + :param status: Overall check runs status for the given suite request. This is check suite status + :type status: object + """ + + _attribute_map = { + 'context': {'key': 'context', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'check_runs': {'key': 'checkRuns', 'type': '[CheckRun]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, context=None, id=None, _links=None, completed_date=None, check_runs=None, message=None, status=None): + super(CheckSuite, self).__init__(context=context, id=id) + self._links = _links + self.completed_date = completed_date + self.check_runs = check_runs + self.message = message + self.status = status + + +__all__ = [ + 'ApprovalConfig', + 'ApprovalConfigSettings', + 'GraphSubjectBase', + 'CheckConfigurationRef', + 'CheckIssue', + 'CheckRunResult', + 'CheckSuiteRef', + 'CheckSuiteRequest', + 'CheckType', + 'IdentityRef', + 'ReferenceLinks', + 'Resource', + 'TaskCheckConfig', + 'TaskCheckDefinitionReference', + 'CheckConfiguration', + 'CheckRun', + 'CheckSuite', +] diff --git a/azure-devops/azure/devops/v7_1/pipelines_checks/pipelines_checks_client.py b/azure-devops/azure/devops/v7_1/pipelines_checks/pipelines_checks_client.py new file mode 100644 index 00000000..b5d4e2cf --- /dev/null +++ b/azure-devops/azure/devops/v7_1/pipelines_checks/pipelines_checks_client.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# 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 PipelinesChecksClient(Client): + """PipelinesChecks + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesChecksClient, 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 = '4a933897-0488-45af-bd82-6fd3ad33f46a' + + def add_check_configuration(self, configuration, project): + """AddCheckConfiguration. + [Preview API] Add a check configuration + :param :class:` ` 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(configuration, 'CheckConfiguration') + response = self._send(http_method='POST', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CheckConfiguration', response) + + def delete_check_configuration(self, project, id): + """DeleteCheckConfiguration. + [Preview API] Delete check configuration by id + :param str project: Project ID or project name + :param int id: check configuration id + """ + 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='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.1-preview.1', + route_values=route_values) + + def get_check_configuration(self, project, id, expand=None): + """GetCheckConfiguration. + [Preview API] Get Check configuration by Id + :param str project: Project ID or project name + :param int id: + :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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CheckConfiguration', response) + + def get_check_configurations_on_resource(self, project, resource_type=None, resource_id=None, expand=None): + """GetCheckConfigurationsOnResource. + [Preview API] Get Check configuration by resource type and id + :param str project: Project ID or project name + :param str resource_type: resource type + :param str resource_id: resource id + :param str expand: + :rtype: [CheckConfiguration] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if resource_type is not None: + query_parameters['resourceType'] = self._serialize.query('resource_type', resource_type, 'str') + if resource_id is not None: + query_parameters['resourceId'] = self._serialize.query('resource_id', resource_id, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[CheckConfiguration]', self._unwrap_collection(response)) + + def update_check_configuration(self, configuration, project, id): + """UpdateCheckConfiguration. + [Preview API] Update check configuration + :param :class:` ` configuration: check configuration + :param str project: Project ID or project name + :param int id: check configuration id + :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(configuration, 'CheckConfiguration') + response = self._send(http_method='PATCH', + location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CheckConfiguration', response) + + def query_check_configurations_on_resources(self, resources, project, expand=None): + """QueryCheckConfigurationsOnResources. + [Preview API] Get check configurations for multiple resources by resource type and id. + :param [Resource] resources: List of resources. + :param str project: Project ID or project name + :param str expand: The properties that should be expanded in the list of check configurations. + :rtype: [CheckConfiguration] + """ + 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') + content = self._serialize.body(resources, '[Resource]') + response = self._send(http_method='POST', + location_id='5f3d0e64-f943-4584-8811-77eb495e831e', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[CheckConfiguration]', self._unwrap_collection(response)) + + def evaluate_check_suite(self, request, project, expand=None): + """EvaluateCheckSuite. + [Preview API] Initiate an evaluation for a check in a pipeline + :param :class:` ` request: + :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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + content = self._serialize.body(request, 'CheckSuiteRequest') + response = self._send(http_method='POST', + location_id='91282c1d-c183-444f-9554-1485bfb3879d', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CheckSuite', response) + + def get_check_suite(self, project, check_suite_id, expand=None): + """GetCheckSuite. + [Preview API] Get details for a specific check evaluation + :param str project: Project ID or project name + :param str check_suite_id: + :param str expand: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if check_suite_id is not None: + route_values['checkSuiteId'] = self._serialize.url('check_suite_id', check_suite_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='91282c1d-c183-444f-9554-1485bfb3879d', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CheckSuite', response) + diff --git a/azure-devops/azure/devops/v7_1/policy/__init__.py b/azure-devops/azure/devops/v7_1/policy/__init__.py new file mode 100644 index 00000000..1279c3e8 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/policy/__init__.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/policy/models.py b/azure-devops/azure/devops/v7_1/policy/models.py new file mode 100644 index 00000000..251c35cb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/policy/models.py @@ -0,0 +1,333 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 PolicyConfigurationRef(Model): + """ + Policy configuration reference. + + :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): + """ + This record encapsulates the current state of a policy as it applies to one specific pull request. Each pull request has a unique PolicyEvaluationRecord for each pull request which the policy applies to. + + :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): + """ + Policy type reference. + + :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): + """ + 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 VersionedPolicyConfigurationRef(PolicyConfigurationRef): + """ + A particular revision for a policy configuration. + + :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): + """ + The full policy configuration with settings. + + :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 is_enterprise_managed: If set, this policy requires "Manage Enterprise Policies" permission to create, edit, or delete. + :type is_enterprise_managed: 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'}, + 'is_enterprise_managed': {'key': 'isEnterpriseManaged', '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, is_enterprise_managed=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.is_enterprise_managed = is_enterprise_managed + self.settings = settings + + +class PolicyType(PolicyTypeRef): + """ + User-friendly policy type with description (used for querying policy types). + + :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', +] diff --git a/azure-devops/azure/devops/v7_1/policy/policy_client.py b/azure-devops/azure/devops/v7_1/policy/policy_client.py new file mode 100644 index 00000000..77ed4c84 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/policy/policy_client.py @@ -0,0 +1,274 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """CreatePolicyConfiguration. + [Preview API] 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 + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(configuration, 'PolicyConfiguration') + response = self._send(http_method='POST', + location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('PolicyConfiguration', response) + + def delete_policy_configuration(self, project, configuration_id): + """DeletePolicyConfiguration. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_policy_configuration(self, project, configuration_id): + """GetPolicyConfiguration. + [Preview API] 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='7.1-preview.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. + [Preview API] 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:`<[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 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='7.1-preview.1', + 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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('PolicyConfiguration', response) + + def get_policy_configuration_revisions(self, project, configuration_id, top=None, skip=None): + """GetPolicyConfigurationRevisions. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('PolicyType', response) + + def get_policy_types(self, project): + """GetPolicyTypes. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[PolicyType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/profile/__init__.py b/azure-devops/azure/devops/v7_1/profile/__init__.py new file mode 100644 index 00000000..c9b00c7e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile/__init__.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ProfileClient' +] diff --git a/azure-devops/azure/devops/v7_1/profile/models.py b/azure-devops/azure/devops/v7_1/profile/models.py new file mode 100644 index 00000000..c27f82c3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile/models.py @@ -0,0 +1,299 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Identifies an attribute with a name and a container. + + :param attribute_name: The name of the attribute. + :type attribute_name: str + :param container_name: The container the attribute resides in. + :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): + """ + Stores a set of named profile attributes. + + :param attributes: The attributes stored by the container. + :type attributes: dict + :param container_name: The name of the container. + :type container_name: str + :param revision: The maximum revision number of any attribute within the container. + :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): + """ + :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): + """ + :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: The current state of the profile. + :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): + """ + :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): + """ + A user profile. + + :param application_container: The attributes of this profile. + :type application_container: :class:`AttributesContainer ` + :param core_attributes: The core attributes of this profile. + :type core_attributes: dict + :param core_revision: The maximum revision number of any attribute. + :type core_revision: int + :param id: The unique identifier of the profile. + :type id: str + :param profile_state: The current state of the profile. + :type profile_state: object + :param revision: The maximum revision number of any attribute. + :type revision: int + :param time_stamp: The time at which this profile was last changed. + :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): + """ + :param descriptor: The descriptor of the attribute. + :type descriptor: :class:`AttributeDescriptor ` + :param revision: The revision number of the attribute. + :type revision: int + :param time_stamp: The time the attribute was last changed. + :type time_stamp: datetime + :param value: The value of the attribute. + :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): + """ + Country/region information + + :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): + """ + Container of country/region information + + :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 CoreProfileAttribute(ProfileAttributeBase): + """ + A profile attribute which always has a value for each profile. + + """ + + _attribute_map = { + } + + def __init__(self): + super(CoreProfileAttribute, self).__init__() + + +class ProfileAttribute(ProfileAttributeBase): + """ + A named object associated with a profile. + + """ + + _attribute_map = { + } + + def __init__(self): + super(ProfileAttribute, self).__init__() + + +__all__ = [ + 'AttributeDescriptor', + 'AttributesContainer', + 'Avatar', + 'CreateProfileContext', + 'GeoRegion', + 'Profile', + 'ProfileAttributeBase', + 'ProfileRegion', + 'ProfileRegions', + 'CoreProfileAttribute', + 'ProfileAttribute', +] diff --git a/azure-devops/azure/devops/v7_1/profile/profile_client.py b/azure-devops/azure/devops/v7_1/profile/profile_client.py new file mode 100644 index 00000000..76886367 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile/profile_client.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Profile', response) + diff --git a/azure-devops/azure/devops/v7_1/profile_regions/__init__.py b/azure-devops/azure/devops/v7_1/profile_regions/__init__.py new file mode 100644 index 00000000..b9ae801f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile_regions/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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_regions_client import ProfileRegionsClient + +__all__ = [ + 'GeoRegion', + 'ProfileRegion', + 'ProfileRegions', + 'ProfileRegionsClient' +] diff --git a/azure-devops/azure/devops/v7_1/profile_regions/models.py b/azure-devops/azure/devops/v7_1/profile_regions/models.py new file mode 100644 index 00000000..bcb60c4e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile_regions/models.py @@ -0,0 +1,77 @@ +# -------------------------------------------------------------------------------------------- +# 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 GeoRegion(Model): + """ + :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 ProfileRegion(Model): + """ + Country/region information + + :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): + """ + Container of country/region information + + :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 + + +__all__ = [ + 'GeoRegion', + 'ProfileRegion', + 'ProfileRegions', +] diff --git a/azure-devops/azure/devops/v7_1/profile_regions/profile_regions_client.py b/azure-devops/azure/devops/v7_1/profile_regions/profile_regions_client.py new file mode 100644 index 00000000..382bf7d7 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/profile_regions/profile_regions_client.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------------------------- +# 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 ProfileRegionsClient(Client): + """ProfileRegions + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ProfileRegionsClient, 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_geo_region(self, ip): + """GetGeoRegion. + [Preview API] Lookup up country/region based on provided IPv4, null if using the remote IPv4 address. + :param str ip: + :rtype: :class:` ` + """ + query_parameters = {} + if ip is not None: + query_parameters['ip'] = self._serialize.query('ip', ip, 'str') + response = self._send(http_method='GET', + location_id='35b3ff1d-ab4c-4d1c-98bb-f6ea21d86bd9', + version='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('GeoRegion', response) + + def get_regions(self): + """GetRegions. + [Preview API] + :rtype: :class:` ` + """ + response = self._send(http_method='GET', + location_id='b129ca90-999d-47bb-ab37-0dcf784ee633', + version='7.1-preview.1') + return self._deserialize('ProfileRegions', response) + diff --git a/azure-devops/azure/devops/v7_1/project_analysis/__init__.py b/azure-devops/azure/devops/v7_1/project_analysis/__init__.py new file mode 100644 index 00000000..a38ea5dc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/project_analysis/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/project_analysis/models.py b/azure-devops/azure/devops/v7_1/project_analysis/models.py new file mode 100644 index 00000000..3f1b0feb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/project_analysis/models.py @@ -0,0 +1,240 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/project_analysis/project_analysis_client.py b/azure-devops/azure/devops/v7_1/project_analysis/project_analysis_client.py new file mode 100644 index 00000000..780f2421 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/project_analysis/project_analysis_client.py @@ -0,0 +1,120 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RepositoryActivityMetrics', response) + diff --git a/azure-devops/azure/devops/v7_1/provenance/__init__.py b/azure-devops/azure/devops/v7_1/provenance/__init__.py new file mode 100644 index 00000000..47a6a388 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/provenance/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/provenance/models.py b/azure-devops/azure/devops/v7_1/provenance/models.py new file mode 100644 index 00000000..45158e2f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/provenance/models.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/provenance/provenance_client.py b/azure-devops/azure/devops/v7_1/provenance/provenance_client.py new file mode 100644 index 00000000..e4b60674 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/provenance/provenance_client.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None): + """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 + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SessionResponse', response) + diff --git a/azure-devops/azure/devops/v7_1/py_pi_api/__init__.py b/azure-devops/azure/devops/v7_1/py_pi_api/__init__.py new file mode 100644 index 00000000..8c8bd71b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/py_pi_api/__init__.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'PyPiApiClient' +] diff --git a/azure-devops/azure/devops/v7_1/py_pi_api/models.py b/azure-devops/azure/devops/v7_1/py_pi_api/models.py new file mode 100644 index 00000000..cd217fc8 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/py_pi_api/models.py @@ -0,0 +1,275 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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 version metadata for a Python 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): + """ + :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): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a Python package. + + :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): + """ + :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): + """ + 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 UpstreamingBehavior(Model): + """ + Describes upstreaming behavior for a given feed/protocol/package + + :param versions_from_external_upstreams: Indicates whether external upstream versions should be considered for this package + :type versions_from_external_upstreams: object + """ + + _attribute_map = { + 'versions_from_external_upstreams': {'key': 'versionsFromExternalUpstreams', 'type': 'object'} + } + + def __init__(self, versions_from_external_upstreams=None): + super(UpstreamingBehavior, self).__init__() + self.versions_from_external_upstreams = versions_from_external_upstreams + + +class UpstreamSourceInfo(Model): + """ + Upstream source definition, including its Identity, package type, and other associated information. + + :param display_location: Locator for connecting to the upstream source in a user friendly format, that may potentially change over time + :type display_location: str + :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 = { + 'display_location': {'key': 'displayLocation', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source_type': {'key': 'sourceType', 'type': 'object'} + } + + def __init__(self, display_location=None, id=None, location=None, name=None, source_type=None): + super(UpstreamSourceInfo, self).__init__() + self.display_location = display_location + self.id = id + self.location = location + self.name = name + self.source_type = source_type + + +__all__ = [ + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'Package', + 'PackageVersionDetails', + 'PyPiPackagesBatchRequest', + 'PyPiPackageVersionDeletionState', + 'PyPiRecycleBinPackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', +] diff --git a/azure-devops/azure/devops/v7_1/py_pi_api/py_pi_api_client.py b/azure-devops/azure/devops/v7_1/py_pi_api/py_pi_api_client.py new file mode 100644 index 00000000..5c82d657 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/py_pi_api/py_pi_api_client.py @@ -0,0 +1,289 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None, **kwargs): + """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 + :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 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='7.1-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_package_versions(self, batch_request, feed_id, project=None): + """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. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'PyPiPackagesBatchRequest') + self._send(http_method='POST', + location_id='4e53d561-70c1-4c98-b937-0f22acb27b0b', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'PyPiPackagesBatchRequest') + self._send(http_method='POST', + location_id='d2d89918-c69e-4ef4-b357-1c3ccb4d28d2', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + [Preview API] Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :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 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='21b8c9a7-7080-45be-a5ba-e50bb4c18130', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + [Preview API] Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :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 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') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='21b8c9a7-7080-45be-a5ba-e50bb4c18130', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted package versions. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/release/__init__.py b/azure-devops/azure/devops/v7_1/release/__init__.py new file mode 100644 index 00000000..e4dc0746 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/release/__init__.py @@ -0,0 +1,115 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'ComplianceSettings', + 'Condition', + 'ConfigurationVariableValue', + 'DataSourceBindingBase', + 'DefinitionEnvironmentReference', + 'Deployment', + 'DeploymentAttempt', + 'DeploymentJob', + 'DeploymentQueryParameters', + 'EmailRecipients', + 'EnvironmentExecutionPolicy', + 'EnvironmentOptions', + 'EnvironmentRetentionPolicy', + 'EnvironmentTrigger', + 'FavoriteItem', + 'Folder', + 'GateUpdateMetadata', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'IgnoredGate', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'InputValuesQuery', + 'Issue', + 'MailMessage', + 'ManualIntervention', + 'ManualInterventionUpdateMetadata', + 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', + 'PipelineProcess', + 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', + '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', + 'ReleaseSettings', + 'ReleaseShallowReference', + 'ReleaseSchedule', + 'ReleaseStartEnvironmentMetadata', + 'ReleaseStartMetadata', + 'ReleaseTask', + 'ReleaseTaskAttachment', + 'ReleaseUpdateMetadata', + 'ReleaseWorkItemRef', + 'RetentionPolicy', + 'RetentionSettings', + 'SourcePullRequestVersion', + 'SummaryMailSection', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskSourceDefinitionBase', + 'VariableGroup', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'WorkflowTask', + 'WorkflowTaskReference', + 'ReleaseClient' +] diff --git a/azure-devops/azure/devops/v7_1/release/models.py b/azure-devops/azure/devops/v7_1/release/models.py new file mode 100644 index 00000000..7d641050 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/release/models.py @@ -0,0 +1,3848 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param alias: Gets or sets the artifact definition alias. + :type alias: str + :param artifact_type: Gets or sets the artifact type. + :type artifact_type: object + :param details: Gets or sets the artifact definition details. + :type details: str + :param name: Gets or sets the name of artifact definition. + :type name: str + :param version: Gets or sets the version of artifact definition. + :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): + """ + :param auto_triggered_and_previous_environment_approved_can_be_skipped: Specify whether the approval can be skipped if the same approver approved the previous stage. + :type auto_triggered_and_previous_environment_approved_can_be_skipped: bool + :param enforce_identity_revalidation: Specify whether revalidate identity of approver before completing the approval. + :type enforce_identity_revalidation: bool + :param execution_order: Approvals execution order. + :type execution_order: object + :param release_creator_can_be_approver: Specify whether the user requesting a release or deployment should allow to approver. + :type release_creator_can_be_approver: bool + :param required_approver_count: The number of approvals required to move release forward. '0' means all approvals required. + :type required_approver_count: int + :param timeout_in_minutes: Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days. + :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): + """ + :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: Indicates whether artifact is primary or not. + :type is_primary: bool + :param is_retained: Indicates whether artifact is retained by release or not. + :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): + """ + :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): + """ + :param id: ID of the artifact source. + :type id: str + :param name: Name of the artifact source. + :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): + """ + :param is_trigger_supported: Gets or sets the whether trigger is supported or not. + :type is_trigger_supported: bool + :param is_trigger_supported_only_in_hosted: Gets or sets the whether trigger is supported only on hosted environment. + :type is_trigger_supported_only_in_hosted: bool + :param is_webhook_supported_at_server_level: Gets or sets the whether webhook is supported at server level. + :type is_webhook_supported_at_server_level: bool + :param payload_hash_header_name: Gets or sets the payload hash header name for the artifact trigger configuration. + :type payload_hash_header_name: str + :param resources: Gets or sets the resources for artifact trigger configuration. + :type resources: dict + :param webhook_payload_mapping: Gets or sets the webhook payload mapping for artifact trigger configuration. + :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): + """ + :param artifact_trigger_configuration: Gets or sets the artifact trigger configuration of artifact type definition. + :type artifact_trigger_configuration: :class:`ArtifactTriggerConfiguration ` + :param artifact_type: Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'. + :type artifact_type: str + :param display_name: Gets or sets the display name of artifact type definition. + :type display_name: str + :param endpoint_type_id: Gets or sets the endpoint type id of artifact type definition. + :type endpoint_type_id: str + :param input_descriptors: Gets or sets the input descriptors of artifact type definition. + :type input_descriptors: list of :class:`InputDescriptor ` + :param is_commits_traceability_supported: Gets or sets the is commits tracebility supported value of artifact type defintion. + :type is_commits_traceability_supported: bool + :param is_workitems_traceability_supported: Gets or sets the is workitems tracebility supported value of artifact type defintion. + :type is_workitems_traceability_supported: bool + :param name: Gets or sets the name of artifact type definition. + :type name: str + :param unique_source_identifier: Gets or sets the unique source identifier of artifact type definition. + :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]'}, + 'is_commits_traceability_supported': {'key': 'isCommitsTraceabilitySupported', 'type': 'bool'}, + 'is_workitems_traceability_supported': {'key': 'isWorkitemsTraceabilitySupported', 'type': 'bool'}, + '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, is_commits_traceability_supported=None, is_workitems_traceability_supported=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.is_commits_traceability_supported = is_commits_traceability_supported + self.is_workitems_traceability_supported = is_workitems_traceability_supported + self.name = name + self.unique_source_identifier = unique_source_identifier + + +class ArtifactVersion(Model): + """ + :param alias: Gets or sets the alias of artifact. + :type alias: str + :param default_version: Gets or sets the default version of artifact. + :type default_version: :class:`BuildVersion ` + :param error_message: Gets or sets the error message encountered during querying of versions for artifact. + :type error_message: str + :param source_id: + :type source_id: str + :param versions: Gets or sets the list of build versions of artifact. + :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): + """ + :param artifact_versions: Gets or sets the list for artifact versions of artifact version query result. + :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): + """ + :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): + """ + :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): + """ + :param commit_message: Gets or sets the commit message for the artifact. + :type commit_message: str + :param definition_id: Gets or sets the definition id. + :type definition_id: str + :param definition_name: Gets or sets the definition name. + :type definition_name: str + :param id: Gets or sets the build id. + :type id: str + :param is_multi_definition_type: Gets or sets if the artifact supports multiple definitions. + :type is_multi_definition_type: bool + :param name: Gets or sets the build number. + :type name: str + :param source_branch: Gets or sets the source branch for the artifact. + :type source_branch: str + :param source_pull_request_version: Gets or sets the source pull request version for the artifact. + :type source_pull_request_version: :class:`SourcePullRequestVersion ` + :param source_repository_id: Gets or sets the repository id for the artifact. + :type source_repository_id: str + :param source_repository_type: Gets or sets the repository type for the artifact. + :type source_repository_type: str + :param source_version: Gets or sets the source version for the artifact. + :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 ComplianceSettings(Model): + """ + :param check_for_credentials_and_other_secrets: Scan the release definition for secrets + :type check_for_credentials_and_other_secrets: bool + """ + + _attribute_map = { + 'check_for_credentials_and_other_secrets': {'key': 'checkForCredentialsAndOtherSecrets', 'type': 'bool'} + } + + def __init__(self, check_for_credentials_and_other_secrets=None): + super(ComplianceSettings, self).__init__() + self.check_for_credentials_and_other_secrets = check_for_credentials_and_other_secrets + + +class Condition(Model): + """ + :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): + """ + :param allow_override: Gets and 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 and 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): + """ + 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 DefinitionEnvironmentReference(Model): + """ + :param definition_environment_id: Definition environment ID. + :type definition_environment_id: int + :param definition_environment_name: Definition environment name. + :type definition_environment_name: str + :param release_definition_id: ReleaseDefinition ID. + :type release_definition_id: int + :param release_definition_name: ReleaseDefinition 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): + """ + :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): + """ + :param attempt: Deployment attempt. + :type attempt: int + :param deployment_id: ID of the deployment. + :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: ID of deployment. + :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: Identity who last modified this deployment. + :type last_modified_by: :class:`IdentityRef ` + :param last_modified_on: Time when this deployment last modified. + :type last_modified_on: datetime + :param operation_status: Deployment operation status. + :type operation_status: object + :param post_deployment_gates: Post deployment gates that executed in this deployment. + :type post_deployment_gates: :class:`ReleaseGates ` + :param pre_deployment_gates: Pre deployment gates that executed in this deployment. + :type pre_deployment_gates: :class:`ReleaseGates ` + :param queued_on: When this deployment queued on. + :type queued_on: datetime + :param reason: Reason for the deployment. + :type reason: object + :param release_deploy_phases: List of release deployphases executed in this deployment. + :type release_deploy_phases: list of :class:`ReleaseDeployPhase ` + :param requested_by: Identity who requested this deployment. + :type requested_by: :class:`IdentityRef ` + :param requested_for: Identity for this deployment requested. + :type requested_for: :class:`IdentityRef ` + :param run_plan_id: + :type run_plan_id: str + :param status: status of the deployment. + :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): + """ + :param job: Parent task of all executed tasks. + :type job: :class:`ReleaseTask ` + :param tasks: List of executed tasks with in job. + :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): + """ + :param artifact_source_id: Query deployments based specified artifact source id. + :type artifact_source_id: str + :param artifact_type_id: Query deployments based specified artifact type id. + :type artifact_type_id: str + :param artifact_versions: Query deployments based specified artifact versions. + :type artifact_versions: list of str + :param deployments_per_environment: Query deployments number of deployments per environment. + :type deployments_per_environment: int + :param deployment_status: Query deployment based on deployment status. + :type deployment_status: object + :param environments: Query deployments of specified environments. + :type environments: list of :class:`DefinitionEnvironmentReference ` + :param expands: Query deployments based specified expands. + :type expands: object + :param is_deleted: Specify deleted deployments should return or not. + :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: Query deployment based on deployment operation status. + :type operation_status: object + :param query_order: + :type query_order: object + :param query_type: Query deployments based query type. + :type query_type: object + :param source_branch: Query deployments based specified 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): + """ + :param email_addresses: List of email addresses. + :type email_addresses: list of str + :param tfs_ids: List of TFS IDs guids. + :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): + """ + Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied. + + :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): + """ + :param auto_link_work_items: Gets and sets as the auto link workitems or not. + :type auto_link_work_items: bool + :param badge_enabled: Gets and sets as the badge enabled or not. + :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: Gets and sets as the publish deployment status or not. + :type publish_deployment_status: bool + :param pull_request_deployment_enabled: Gets and sets as the.pull request deployment enabled or not. + :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): + """ + :param days_to_keep: Gets and sets the number of days to keep environment. + :type days_to_keep: int + :param releases_to_keep: Gets and sets the number of releases to keep. + :type releases_to_keep: int + :param retain_build: Gets and sets as the build to be retained or not. + :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): + """ + :param definition_environment_id: Definition environment ID on which this trigger applicable. + :type definition_environment_id: int + :param release_definition_id: ReleaseDefinition ID on which this trigger applicable. + :type release_definition_id: int + :param trigger_content: Gets or sets the trigger content. + :type trigger_content: str + :param trigger_type: Gets or sets the 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): + """ + Class to represent favorite entry. + + :param data: Application specific data for the entry. + :type data: str + :param id: Unique Id of 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): + """ + :param created_by: Identity who created this folder. + :type created_by: :class:`IdentityRef ` + :param created_on: Time when this folder created. + :type created_on: datetime + :param description: Description of the folder. + :type description: str + :param last_changed_by: Identity who last changed this folder. + :type last_changed_by: :class:`IdentityRef ` + :param last_changed_date: Time when this folder last changed. + :type last_changed_date: datetime + :param path: path of the folder. + :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): + """ + :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): + """ + :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 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 change_type: The type of source. "TfsVersionControl", "TfsGit", etc. + :type change_type: 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'}, + 'display_uri': {'key': 'displayUri', 'type': 'str'}, + 'change_type': {'key': 'changeType', '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, display_uri=None, change_type=None, id=None, location=None, message=None, pushed_by=None, pusher=None, timestamp=None): + super(Change, self).__init__() + self.author = author + self.display_uri = display_uri + self.change_type = change_type + self.id = id + self.location = location + self.message = message + self.pushed_by = pushed_by + self.pusher = pusher + self.timestamp = timestamp + + +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 IgnoredGate(Model): + """ + :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): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + :param data: Issue data. + :type data: dict + :param issue_type: Issue type, for example error, warning or info. + :type issue_type: str + :param message: Issue 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): + """ + :param body: Body of mail. + :type body: str + :param cc: Mail CC recipients. + :type cc: :class:`EmailRecipients ` + :param in_reply_to: Reply to. + :type in_reply_to: str + :param message_id: Message ID of the mail. + :type message_id: str + :param reply_by: Data when should be replied to mail. + :type reply_by: datetime + :param reply_to: Reply to Email recipients. + :type reply_to: :class:`EmailRecipients ` + :param sections: List of mail section types. + :type sections: list of MailSectionType + :param sender_type: Mail sender type. + :type sender_type: object + :param subject: Subject of the mail. + :type subject: str + :param to: Mail To recipients. + :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): + """ + :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): + """ + :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): + """ + :param name: Name of the Metric. + :type name: str + :param value: Value of the Metric. + :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 OrgPipelineReleaseSettings(Model): + """ + :param has_manage_pipeline_policies_permission: Defines whether user can manage pipeline settings. + :type has_manage_pipeline_policies_permission: bool + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'has_manage_pipeline_policies_permission': {'key': 'hasManagePipelinePoliciesPermission', 'type': 'bool'}, + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, has_manage_pipeline_policies_permission=None, org_enforce_job_auth_scope=None): + super(OrgPipelineReleaseSettings, self).__init__() + self.has_manage_pipeline_policies_permission = has_manage_pipeline_policies_permission + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + + +class OrgPipelineReleaseSettingsUpdateParameters(Model): + """ + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, org_enforce_job_auth_scope=None): + super(OrgPipelineReleaseSettingsUpdateParameters, self).__init__() + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + + +class PipelineProcess(Model): + """ + :param type: Pipeline process 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): + """ + :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 ProjectPipelineReleaseSettings(Model): + """ + :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + :param has_manage_settings_permission: Defines whether user can manage pipeline settings. + :type has_manage_settings_permission: bool + :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. + :type org_enforce_job_auth_scope: bool + :param public_project: Defines whether project is public. + :type public_project: bool + """ + + _attribute_map = { + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, + 'has_manage_settings_permission': {'key': 'hasManageSettingsPermission', 'type': 'bool'}, + 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'}, + 'public_project': {'key': 'publicProject', 'type': 'bool'} + } + + def __init__(self, enforce_job_auth_scope=None, has_manage_settings_permission=None, org_enforce_job_auth_scope=None, public_project=None): + super(ProjectPipelineReleaseSettings, self).__init__() + self.enforce_job_auth_scope = enforce_job_auth_scope + self.has_manage_settings_permission = has_manage_settings_permission + self.org_enforce_job_auth_scope = org_enforce_job_auth_scope + self.public_project = public_project + + +class ProjectPipelineReleaseSettingsUpdateParameters(Model): + """ + :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope: bool + """ + + _attribute_map = { + 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'} + } + + def __init__(self, enforce_job_auth_scope=None): + super(ProjectPipelineReleaseSettingsUpdateParameters, self).__init__() + self.enforce_job_auth_scope = enforce_job_auth_scope + + +class ProjectReference(Model): + """ + :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): + """ + :param project_id: Project ID of the release. + :type project_id: str + :param queue_position: Release queue position. + :type queue_position: int + :param release_id: Queued 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): + """ + 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 Release(Model): + """ + :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_for: Gets or sets the identity for whom release was created. + :type created_for: :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_definition_revision: Gets or sets the release definition revision. + :type release_definition_revision: int + :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_for': {'key': 'createdFor', '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_definition_revision': {'key': 'releaseDefinitionRevision', 'type': 'int'}, + '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_for=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_definition_revision=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_for = created_for + 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_definition_revision = release_definition_revision + 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): + """ + :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): + """ + :param approver: Identity of the approver. + :type approver: :class:`IdentityRef ` + :param comments: Approval history comments. + :type comments: str + :param created_on: Time when this approval created. + :type created_on: datetime + :param changed_by: Identity of the object who changed approval. + :type changed_by: :class:`IdentityRef ` + :param modified_on: Time when this approval modified. + :type modified_on: datetime + :param revision: Approval history revision. + :type revision: int + """ + + _attribute_map = { + 'approver': {'key': 'approver', 'type': 'IdentityRef'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, approver=None, comments=None, created_on=None, changed_by=None, modified_on=None, revision=None): + super(ReleaseApprovalHistory, self).__init__() + self.approver = approver + self.comments = comments + self.created_on = created_on + self.changed_by = changed_by + self.modified_on = modified_on + self.revision = revision + + +class ReleaseCondition(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 + :param result: The release condition 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): + """ + :param approval_options: Gets or sets the approval options. + :type approval_options: :class:`ApprovalOptions ` + :param approvals: Gets or sets the 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): + """ + :param badge_url: Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment. + :type badge_url: str + :param conditions: Gets or sets the environment conditions. + :type conditions: list of :class:`Condition ` + :param current_release: Gets or sets the current release reference. + :type current_release: :class:`ReleaseShallowReference ` + :param demands: Gets or sets the demands. + :type demands: list of :class:`object ` + :param deploy_phases: Gets or sets the deploy phases of environment. + :type deploy_phases: list of :class:`object ` + :param deploy_step: Gets or sets the deploystep. + :type deploy_step: :class:`ReleaseDefinitionDeployStep ` + :param environment_options: Gets or sets the environment options. + :type environment_options: :class:`EnvironmentOptions ` + :param environment_triggers: Gets or sets the triggers on environment. + :type environment_triggers: list of :class:`EnvironmentTrigger ` + :param execution_policy: Gets or sets the environment execution policy. + :type execution_policy: :class:`EnvironmentExecutionPolicy ` + :param id: Gets and sets the ID of the ReleaseDefinitionEnvironment. + :type id: int + :param name: Gets and sets the name of the ReleaseDefinitionEnvironment. + :type name: str + :param owner: Gets and sets the Owner of the ReleaseDefinitionEnvironment. + :type owner: :class:`IdentityRef ` + :param post_deploy_approvals: Gets or sets the post deployment approvals. + :type post_deploy_approvals: :class:`ReleaseDefinitionApprovals ` + :param post_deployment_gates: Gets or sets the post deployment gates. + :type post_deployment_gates: :class:`ReleaseDefinitionGatesStep ` + :param pre_deploy_approvals: Gets or sets the pre deployment approvals. + :type pre_deploy_approvals: :class:`ReleaseDefinitionApprovals ` + :param pre_deployment_gates: Gets or sets the pre deployment gates. + :type pre_deployment_gates: :class:`ReleaseDefinitionGatesStep ` + :param process_parameters: Gets or sets the environment process parameters. + :type process_parameters: :class:`ProcessParameters ` + :param properties: Gets or sets the properties on environment. + :type properties: :class:`object ` + :param queue_id: Gets or sets the queue ID. + :type queue_id: int + :param rank: Gets and sets the rank of the ReleaseDefinitionEnvironment. + :type rank: int + :param retention_policy: Gets or sets the environment retention policy. + :type retention_policy: :class:`EnvironmentRetentionPolicy ` + :param run_options: + :type run_options: dict + :param schedules: Gets or sets the schedules + :type schedules: list of :class:`ReleaseSchedule ` + :param variable_groups: Gets or sets the variable groups. + :type variable_groups: list of int + :param variables: Gets and sets the 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): + """ + :param id: ID of the approval or deploy step. + :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): + """ + :param id: ID of ReleaseDefinition environment summary. + :type id: int + :param last_releases: List of release shallow reference deployed using this ReleaseDefinition. + :type last_releases: list of :class:`ReleaseShallowReference ` + :param name: Name of ReleaseDefinition environment summary. + :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): + """ + :param can_delete: Indicates whether template can be deleted or not. + :type can_delete: bool + :param category: Category of the ReleaseDefinition environment template. + :type category: str + :param description: Description of the ReleaseDefinition environment template. + :type description: str + :param environment: ReleaseDefinition environment data which used to create this template. + :type environment: :class:`ReleaseDefinitionEnvironment ` + :param icon_task_id: ID of the task which used to display icon used for this template. + :type icon_task_id: str + :param icon_uri: Icon uri of the template. + :type icon_uri: str + :param id: ID of the ReleaseDefinition environment template. + :type id: str + :param is_deleted: Indicates whether template deleted or not. + :type is_deleted: bool + :param name: Name of the ReleaseDefinition environment template. + :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): + """ + :param tasks: Gets or sets the gates workflow. + :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): + """ + :param is_enabled: Gets or sets as the gates enabled or not. + :type is_enabled: bool + :param minimum_success_duration: Gets or sets the minimum duration for steady results after a successful gates evaluation. + :type minimum_success_duration: int + :param sampling_interval: Gets or sets the time between re-evaluation of gates. + :type sampling_interval: int + :param stabilization_time: Gets or sets the delay before evaluation. + :type stabilization_time: int + :param timeout: Gets or sets the timeout after which gates fail. + :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): + """ + :param gates: Gets or sets the gates. + :type gates: list of :class:`ReleaseDefinitionGate ` + :param gates_options: Gets or sets the gate options. + :type gates_options: :class:`ReleaseDefinitionGatesOptions ` + :param id: ID of the ReleaseDefinitionGateStep. + :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): + """ + :param api_version: Gets api-version for revision object. + :type api_version: str + :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 changed_by: Gets the identity who did change. + :type changed_by: :class:`IdentityRef ` + :param changed_date: Gets date on which ReleaseDefinition changed. + :type changed_date: datetime + :param change_type: Gets type of change. + :type change_type: object + :param revision: Get revision number of the definition. + :type revision: int + """ + + _attribute_map = { + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_id': {'key': 'definitionId', 'type': 'int'}, + 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, api_version=None, comment=None, definition_id=None, definition_url=None, changed_by=None, changed_date=None, change_type=None, revision=None): + super(ReleaseDefinitionRevision, self).__init__() + self.api_version = api_version + self.comment = comment + self.definition_id = definition_id + self.definition_url = definition_url + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + self.revision = revision + + +class ReleaseDefinitionShallowReference(Model): + """ + :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): + """ + :param environments: List of Release Definition environment summary. + :type environments: list of :class:`ReleaseDefinitionEnvironmentSummary ` + :param release_definition: Release Definition reference. + :type release_definition: :class:`ReleaseDefinitionShallowReference ` + :param releases: List of releases deployed using this Release Definition. + :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): + """ + :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): + """ + :param deployment_jobs: Deployment jobs of the phase. + :type deployment_jobs: list of :class:`DeploymentJob ` + :param error_log: Phase execution error logs. + :type error_log: str + :param id: ID of the phase. + :type id: int + :param manual_interventions: List of manual intervention tasks execution information in phase. + :type manual_interventions: list of :class:`ManualIntervention ` + :param name: Name of the phase. + :type name: str + :param phase_id: ID of the phase. + :type phase_id: str + :param phase_type: Type of the phase. + :type phase_type: object + :param rank: Rank of the phase. + :type rank: int + :param run_plan_id: Run Plan ID of the phase. + :type run_plan_id: str + :param started_on: Phase start time. + :type started_on: datetime + :param status: Status of the phase. + :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): + """ + :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: Post deployment gates snapshot data. + :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: Pre deployment gates snapshot data. + :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): + """ + :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): + """ + :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): + """ + :param deployment_jobs: Contains the gates job details of each evaluation. + :type deployment_jobs: list of :class:`DeploymentJob ` + :param id: ID of release gates. + :type id: int + :param ignored_gates: List of ignored gates. + :type ignored_gates: list of :class:`IgnoredGate ` + :param last_modified_on: Gates last modified time. + :type last_modified_on: datetime + :param run_plan_id: Run plan ID of the gates. + :type run_plan_id: str + :param stabilization_completed_on: Gates stabilization completed date and time. + :type stabilization_completed_on: datetime + :param started_on: Gates evaluation started time. + :type started_on: datetime + :param status: Status of release gates. + :type status: object + :param succeeding_since: Date and time at which all gates executed successfully. + :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): + """ + :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 release. + :type created_by: :class:`IdentityRef ` + :param created_on: Gets date on when this release created. + :type created_on: datetime + :param description: Gets description. + :type description: str + :param id: ID of the Release. + :type id: int + :param modified_by: Gets the identity who modified release. + :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): + """ + :param comment: Comment of the revision. + :type comment: str + :param definition_snapshot_revision: Release ID of which this revision belongs. + :type definition_snapshot_revision: int + :param changed_by: Gets or sets the identity who changed. + :type changed_by: :class:`IdentityRef ` + :param changed_date: Change date of the revision. + :type changed_date: datetime + :param change_details: Change details of the revision. + :type change_details: str + :param change_type: Change details of the revision. Typically ChangeDetails values are Add and Update. + :type change_type: str + :param release_id: Gets or sets the release ID of which this revision belongs. + :type release_id: int + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, + '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'}, + 'release_id': {'key': 'releaseId', 'type': 'int'} + } + + def __init__(self, comment=None, definition_snapshot_revision=None, changed_by=None, changed_date=None, change_details=None, change_type=None, release_id=None): + super(ReleaseRevision, self).__init__() + self.comment = comment + self.definition_snapshot_revision = definition_snapshot_revision + self.changed_by = changed_by + self.changed_date = changed_date + self.change_details = change_details + self.change_type = change_type + self.release_id = release_id + + +class ReleaseSettings(Model): + """ + :param compliance_settings: Release Compliance settings. + :type compliance_settings: :class:`ComplianceSettings ` + :param retention_settings: Release retention settings. + :type retention_settings: :class:`RetentionSettings ` + """ + + _attribute_map = { + 'compliance_settings': {'key': 'complianceSettings', 'type': 'ComplianceSettings'}, + 'retention_settings': {'key': 'retentionSettings', 'type': 'RetentionSettings'} + } + + def __init__(self, compliance_settings=None, retention_settings=None): + super(ReleaseSettings, self).__init__() + self.compliance_settings = compliance_settings + self.retention_settings = retention_settings + + +class ReleaseShallowReference(Model): + """ + :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 ReleaseSchedule(Model): + """ + :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 schedule_only_with_changes: Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed. + :type schedule_only_with_changes: bool + :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'}, + 'schedule_only_with_changes': {'key': 'scheduleOnlyWithChanges', 'type': 'bool'}, + '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, schedule_only_with_changes=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.schedule_only_with_changes = schedule_only_with_changes + self.start_hours = start_hours + self.start_minutes = start_minutes + self.time_zone_id = time_zone_id + + +class ReleaseStartEnvironmentMetadata(Model): + """ + :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): + """ + :param artifacts: Sets list of artifact to create a release. + :type artifacts: list of :class:`ArtifactMetadata ` + :param created_for: Optionally provide a requestor identity + :type created_for: str + :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]'}, + 'created_for': {'key': 'createdFor', 'type': 'str'}, + '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, created_for=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.created_for = created_for + 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): + """ + :param agent_name: Agent name on which task executed. + :type agent_name: str + :param date_ended: + :type date_ended: datetime + :param date_started: + :type date_started: datetime + :param finish_time: Finish time of the release task. + :type finish_time: datetime + :param id: ID of the release task. + :type id: int + :param issues: List of issues occurred while execution of task. + :type issues: list of :class:`Issue ` + :param line_count: Number of lines log release task has. + :type line_count: long + :param log_url: Log URL of the task. + :type log_url: str + :param name: Name of the task. + :type name: str + :param percent_complete: Task execution complete precent. + :type percent_complete: int + :param rank: Rank of the release task. + :type rank: int + :param result_code: Result code of the task. + :type result_code: str + :param start_time: ID of the release task. + :type start_time: datetime + :param status: Status of release task. + :type status: object + :param task: Workflow task reference. + :type task: :class:`WorkflowTaskReference ` + :param timeline_record_id: Timeline record ID of the release task. + :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): + """ + :param _links: Reference links of task. + :type _links: :class:`ReferenceLinks ` + :param created_on: Data and time when it created. + :type created_on: datetime + :param modified_by: Identity who modified. + :type modified_by: :class:`IdentityRef ` + :param modified_on: Data and time when modified. + :type modified_on: datetime + :param name: Name of the task attachment. + :type name: str + :param record_id: Record ID of the task. + :type record_id: str + :param timeline_id: Timeline ID of the task. + :type timeline_id: str + :param type: Type of task attachment. + :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): + """ + :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 name: Sets name of the release. + :type name: 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]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, comment=None, keep_forever=None, manual_environments=None, name=None, status=None): + super(ReleaseUpdateMetadata, self).__init__() + self.comment = comment + self.keep_forever = keep_forever + self.manual_environments = manual_environments + self.name = name + self.status = status + + +class ReleaseWorkItemRef(Model): + """ + :param assignee: + :type assignee: str + :param id: Gets or sets the ID. + :type id: str + :param provider: Gets or sets the provider. + :type provider: str + :param state: Gets or sets the state. + :type state: str + :param title: Gets or sets the title. + :type title: str + :param type: Gets or sets the type. + :type type: str + :param url: Gets or sets the workitem url. + :type url: str + """ + + _attribute_map = { + 'assignee': {'key': 'assignee', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', '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, provider=None, state=None, title=None, type=None, url=None): + super(ReleaseWorkItemRef, self).__init__() + self.assignee = assignee + self.id = id + self.provider = provider + self.state = state + self.title = title + self.type = type + self.url = url + + +class RetentionPolicy(Model): + """ + :param days_to_keep: Indicates the number of days to keep deployment. + :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): + """ + :param days_to_keep_deleted_releases: Number of days to keep deleted releases. + :type days_to_keep_deleted_releases: int + :param default_environment_retention_policy: Specifies the default environment retention policy. + :type default_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` + :param maximum_environment_retention_policy: Specifies the 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): + """ + :param iteration_id: Pull Request Iteration Id for which the release will publish status. + :type iteration_id: str + :param pull_request_id: Pull Request Id for which the release will publish status. + :type pull_request_id: str + :param pull_request_merged_at: Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request. + :type pull_request_merged_at: datetime + :param source_branch: Source branch of the Pull Request. + :type source_branch: str + :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 + :param target_branch: Target branch of the Pull Request. + :type target_branch: str + """ + + _attribute_map = { + 'iteration_id': {'key': 'iterationId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'str'}, + 'pull_request_merged_at': {'key': 'pullRequestMergedAt', 'type': 'iso-8601'}, + 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, + 'source_branch_commit_id': {'key': 'sourceBranchCommitId', 'type': 'str'}, + 'target_branch': {'key': 'targetBranch', 'type': 'str'} + } + + def __init__(self, iteration_id=None, pull_request_id=None, pull_request_merged_at=None, source_branch=None, source_branch_commit_id=None, target_branch=None): + super(SourcePullRequestVersion, self).__init__() + self.iteration_id = iteration_id + self.pull_request_id = pull_request_id + self.pull_request_merged_at = pull_request_merged_at + self.source_branch = source_branch + self.source_branch_commit_id = source_branch_commit_id + self.target_branch = target_branch + + +class SummaryMailSection(Model): + """ + :param html_content: Html content of summary mail. + :type html_content: str + :param rank: Rank of the summary mail. + :type rank: int + :param section_type: Summary mail section type. MailSectionType has section types. + :type section_type: object + :param title: Title of the summary mail. + :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): + """ + :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 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 VariableGroup(Model): + """ + :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 variable_group_project_references: all project references where the variable group is shared with other projects. + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :param variables: Gets and sets the dictionary of 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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + '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, variable_group_project_references=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.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupProjectReference(Model): + """ + A variable group reference is a shallow reference to variable group. + + :param description: Gets or sets description of the variable group. + :type description: str + :param name: Gets or sets name of the variable group. + :type name: str + :param project_reference: Gets or sets project reference of the variable group. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(VariableGroupProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class VariableGroupProviderData(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(VariableGroupProviderData, self).__init__() + + +class VariableValue(Model): + """ + :param is_read_only: Gets or sets if the variable is read only or not. + :type is_read_only: bool + :param is_secret: Gets or sets as the variable is secret or not. + :type is_secret: bool + :param value: Gets or sets the value. + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class WorkflowTask(Model): + """ + :param always_run: Gets or sets as the task always run or not. + :type always_run: bool + :param condition: Gets or sets the task condition. + :type condition: str + :param continue_on_error: Gets or sets as the task continue run on error or not. + :type continue_on_error: bool + :param definition_type: Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'. + :type definition_type: str + :param enabled: Gets or sets as the task enabled or not. + :type enabled: bool + :param environment: Gets or sets the task environment variables. + :type environment: dict + :param inputs: Gets or sets the task inputs. + :type inputs: dict + :param name: Gets or sets the name of the task. + :type name: str + :param override_inputs: Gets or sets the task override inputs. + :type override_inputs: dict + :param ref_name: Gets or sets the reference name of the task. + :type ref_name: str + :param retry_count_on_task_failure: Gets or sets the task retryCount. + :type retry_count_on_task_failure: int + :param task_id: Gets or sets the ID of the task. + :type task_id: str + :param timeout_in_minutes: Gets or sets the task timeout. + :type timeout_in_minutes: int + :param version: Gets or sets the version of the task. + :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'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + self.task_id = task_id + self.timeout_in_minutes = timeout_in_minutes + self.version = version + + +class WorkflowTaskReference(Model): + """ + :param id: Task identifier. + :type id: str + :param name: Name of the task. + :type name: str + :param version: Version of the task. + :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): + """ + :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): + """ + :param id: ID of the approval or deploy step. + :type id: int + :param approver: Gets and sets the approver. + :type approver: :class:`IdentityRef ` + :param is_automated: Indicates whether the approval automated. + :type is_automated: bool + :param is_notification_on: Indicates whether the approval notification set. + :type is_notification_on: bool + :param rank: Gets or sets the rank of approval step. + :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): + """ + :param id: ID of the approval or deploy step. + :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', + 'ComplianceSettings', + 'Condition', + 'ConfigurationVariableValue', + 'DataSourceBindingBase', + 'DefinitionEnvironmentReference', + 'Deployment', + 'DeploymentAttempt', + 'DeploymentJob', + 'DeploymentQueryParameters', + 'EmailRecipients', + 'EnvironmentExecutionPolicy', + 'EnvironmentOptions', + 'EnvironmentRetentionPolicy', + 'EnvironmentTrigger', + 'FavoriteItem', + 'Folder', + 'GateUpdateMetadata', + 'GraphSubjectBase', + 'Change', + 'IdentityRef', + 'IgnoredGate', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'InputValuesQuery', + 'Issue', + 'MailMessage', + 'ManualIntervention', + 'ManualInterventionUpdateMetadata', + 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', + 'PipelineProcess', + 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', + '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', + 'ReleaseSettings', + 'ReleaseShallowReference', + 'ReleaseSchedule', + 'ReleaseStartEnvironmentMetadata', + 'ReleaseStartMetadata', + 'ReleaseTask', + 'ReleaseTaskAttachment', + 'ReleaseUpdateMetadata', + 'ReleaseWorkItemRef', + 'RetentionPolicy', + 'RetentionSettings', + 'SourcePullRequestVersion', + 'SummaryMailSection', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskSourceDefinitionBase', + 'VariableGroup', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'WorkflowTask', + 'WorkflowTaskReference', + 'ReleaseDefinition', + 'ReleaseDefinitionApprovalStep', + 'ReleaseDefinitionDeployStep', +] diff --git a/azure-devops/azure/devops/v7_1/release/release_client.py b/azure-devops/azure/devops/v7_1/release/release_client.py new file mode 100644 index 00000000..46636952 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/release/release_client.py @@ -0,0 +1,877 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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:`<[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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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] Get a release task attachment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str timeline_id: Timeline Id of the task. + :param str record_id: Record Id of attachment. + :param str type: Type of the attachment. + :param str name: Name of the attachment. + :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='7.1-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] Get the release task attachments. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str type: Type of the attachment. + :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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[ReleaseTaskAttachment]', self._unwrap_collection(response)) + + def create_release_definition(self, release_definition, project): + """CreateReleaseDefinition. + [Preview API] 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='7.1-preview.4', + 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. + [Preview API] 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='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + + def get_release_definition(self, project, definition_id, property_filters=None): + """GetReleaseDefinition. + [Preview API] 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='7.1-preview.4', + 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. + [Preview API] 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:`<[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') + 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='7.1-preview.4', + 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. + [Preview API] 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='7.1-preview.4', + 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. + [Preview API] + :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:`<[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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Deployment]', self._unwrap_collection(response)) + + def get_release_environment(self, project, release_id, environment_id, expand=None): + """GetReleaseEnvironment. + [Preview API] Get a release environment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param str expand: A property that should be expanded in the 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', + version='7.1-preview.7', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReleaseEnvironment', 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='7.1-preview.7', + route_values=route_values, + content=content) + return self._deserialize('ReleaseEnvironment', response) + + def delete_folder(self, project, path): + """DeleteFolder. + [Preview API] Deletes a definition folder for given folder name and path and all it's existing definitions. + :param str project: Project ID or project name + :param str path: Path of the folder to delete. + """ + 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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.1-preview.2', + route_values=route_values) + + def get_folders(self, project, path=None, query_order=None): + """GetFolders. + [Preview API] Gets folders. + :param str project: Project ID or project name + :param str path: Path of the folder. + :param str query_order: Gets the results in the defined order. Default is 'None'. + :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='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.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: folder. + :param str project: Project ID or project name + :param str path: Path of the folder to update. + :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='PATCH', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('Folder', 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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('ManualIntervention', response) + + def get_manual_interventions(self, project, release_id): + """GetManualInterventions. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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:`<[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') + 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='7.1-preview.8', + 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. + [Preview API] 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='7.1-preview.8', + 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. + [Preview API] 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='7.1-preview.8', + 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. + [Preview API] 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='7.1-preview.8', + 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. + [Preview API] 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='7.1-preview.8', + route_values=route_values, + content=content) + return self._deserialize('Release', response) + + def update_release_resource(self, release_update_metadata, project, release_id): + """UpdateReleaseResource. + [Preview API] 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='7.1-preview.8', + 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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/sbom/__init__.py b/azure-devops/azure/devops/v7_1/sbom/__init__.py new file mode 100644 index 00000000..35cd2743 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/sbom/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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 .sbom_client import SBOMClient + +__all__ = [ + 'Configuration', + 'ConfigurationSetting', + 'FileHash', + 'ManifestInfo', + 'SBOMFile', + 'SBOMTelemetry', + 'SignResponseBase', + 'SignStatusResponse', + 'SBOMClient' +] diff --git a/azure-devops/azure/devops/v7_1/sbom/models.py b/azure-devops/azure/devops/v7_1/sbom/models.py new file mode 100644 index 00000000..d7867a02 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/sbom/models.py @@ -0,0 +1,306 @@ +# -------------------------------------------------------------------------------------------- +# 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 Configuration(Model): + """ + This holds the configuration for the ManifestTool. The values in this file are populated from the command line, config file and default. + + :param additional_component_detector_args: Additional set of command-line arguments for Component Detector. + :type additional_component_detector_args: :class:`ConfigurationSetting ` + :param build_component_path: The folder containing the build components and packages. + :type build_component_path: :class:`ConfigurationSetting ` + :param build_drop_path: The root folder of the drop directory to validate or generate. + :type build_drop_path: :class:`ConfigurationSetting ` + :param build_list_file: Full file name of a list file that contains all files to be validated. + :type build_list_file: :class:`ConfigurationSetting ` + :param catalog_file_path: The path of the signed catalog file used to validate the manifest.json. + :type catalog_file_path: :class:`ConfigurationSetting ` + :param config_file_path: The json file that contains the configuration for the DropValidator. + :type config_file_path: :class:`ConfigurationSetting ` + :param docker_images_to_scan: Comma separated list of docker image names or hashes to be scanned for packages, ex: ubuntu:16.04, 56bab49eef2ef07505f6a1b0d5bd3a601dfc3c76ad4460f24c91d6fa298369ab. + :type docker_images_to_scan: :class:`ConfigurationSetting ` + :param external_document_reference_list_file: Full file path to a file that contains list of external SBOMs to be included as External document reference. + :type external_document_reference_list_file: :class:`ConfigurationSetting ` + :param hash_algorithm: The Hash algorithm to use while verifying the hash value of a file. + :type hash_algorithm: :class:`ConfigurationSetting ` + :param ignore_missing: If set, will not fail validation on the files presented in Manifest but missing on the disk. + :type ignore_missing: :class:`ConfigurationSetting ` + :param manifest_dir_path: The root folder where the generated manifest (and other files like bsi.json) files will be placed. By default we will generate this folder in the same level as the build drop with the name '_manifest' + :type manifest_dir_path: :class:`ConfigurationSetting ` + :param manifest_info: A list of name and version of the manifest that we are generating. + :type manifest_info: :class:`ConfigurationSetting ` + :param manifest_tool_action: The action currently being performed by the manifest tool. + :type manifest_tool_action: object + :param package_name: The name of the package this SBOM represents. + :type package_name: :class:`ConfigurationSetting ` + :param package_version: The version of the package this SBOM represents. + :type package_version: :class:`ConfigurationSetting ` + :param parallelism: The number of parallel threads to use for the workflows. + :type parallelism: :class:`ConfigurationSetting ` + :param root_path_filter: If you're downloading only a part of the drop using the '-r' or 'root' parameter in the drop client, specify the same string value here in order to skip validating paths that are not downloaded. + :type root_path_filter: :class:`ConfigurationSetting ` + :param telemetry_file_path: If specified, we will store the generated telemetry for the execution of the SBOM tool at this path. + :type telemetry_file_path: :class:`ConfigurationSetting ` + :param validate_signature: If set, will validate the manifest using the signed catalog file. + :type validate_signature: :class:`ConfigurationSetting ` + """ + + _attribute_map = { + 'additional_component_detector_args': {'key': 'additionalComponentDetectorArgs', 'type': 'ConfigurationSetting'}, + 'build_component_path': {'key': 'buildComponentPath', 'type': 'ConfigurationSetting'}, + 'build_drop_path': {'key': 'buildDropPath', 'type': 'ConfigurationSetting'}, + 'build_list_file': {'key': 'buildListFile', 'type': 'ConfigurationSetting'}, + 'catalog_file_path': {'key': 'catalogFilePath', 'type': 'ConfigurationSetting'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'ConfigurationSetting'}, + 'docker_images_to_scan': {'key': 'dockerImagesToScan', 'type': 'ConfigurationSetting'}, + 'external_document_reference_list_file': {'key': 'externalDocumentReferenceListFile', 'type': 'ConfigurationSetting'}, + 'hash_algorithm': {'key': 'hashAlgorithm', 'type': 'ConfigurationSetting'}, + 'ignore_missing': {'key': 'ignoreMissing', 'type': 'ConfigurationSetting'}, + 'manifest_dir_path': {'key': 'manifestDirPath', 'type': 'ConfigurationSetting'}, + 'manifest_info': {'key': 'manifestInfo', 'type': 'ConfigurationSetting'}, + 'manifest_tool_action': {'key': 'manifestToolAction', 'type': 'object'}, + 'package_name': {'key': 'packageName', 'type': 'ConfigurationSetting'}, + 'package_version': {'key': 'packageVersion', 'type': 'ConfigurationSetting'}, + 'parallelism': {'key': 'parallelism', 'type': 'ConfigurationSetting'}, + 'root_path_filter': {'key': 'rootPathFilter', 'type': 'ConfigurationSetting'}, + 'telemetry_file_path': {'key': 'telemetryFilePath', 'type': 'ConfigurationSetting'}, + 'validate_signature': {'key': 'validateSignature', 'type': 'ConfigurationSetting'} + } + + def __init__(self, additional_component_detector_args=None, build_component_path=None, build_drop_path=None, build_list_file=None, catalog_file_path=None, config_file_path=None, docker_images_to_scan=None, external_document_reference_list_file=None, hash_algorithm=None, ignore_missing=None, manifest_dir_path=None, manifest_info=None, manifest_tool_action=None, package_name=None, package_version=None, parallelism=None, root_path_filter=None, telemetry_file_path=None, validate_signature=None): + super(Configuration, self).__init__() + self.additional_component_detector_args = additional_component_detector_args + self.build_component_path = build_component_path + self.build_drop_path = build_drop_path + self.build_list_file = build_list_file + self.catalog_file_path = catalog_file_path + self.config_file_path = config_file_path + self.docker_images_to_scan = docker_images_to_scan + self.external_document_reference_list_file = external_document_reference_list_file + self.hash_algorithm = hash_algorithm + self.ignore_missing = ignore_missing + self.manifest_dir_path = manifest_dir_path + self.manifest_info = manifest_info + self.manifest_tool_action = manifest_tool_action + self.package_name = package_name + self.package_version = package_version + self.parallelism = parallelism + self.root_path_filter = root_path_filter + self.telemetry_file_path = telemetry_file_path + self.validate_signature = validate_signature + + +class ConfigurationSetting(Model): + """ + Encapsulates a configuration setting to provide metadata about the setting source and type. + + :param source: The source where this setting came from. + :type source: str + :param value: The actual value of the setting. + :type value: object + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'} + } + + def __init__(self, source=None, value=None): + super(ConfigurationSetting, self).__init__() + self.source = source + self.value = value + + +class FileHash(Model): + """ + Used to provide the filename and hash of the SBOM file to be added to the catalog file. + + :param file_name: The filename of the SBOM. + :type file_name: str + :param hash: The string hash of the SBOM file. + :type hash: str + :param hash_algorithm_name: The HashAlgorithmName used to generate the hash of the file. + :type hash_algorithm_name: HashAlgorithmName + """ + + _attribute_map = { + 'file_name': {'key': 'fileName', 'type': 'str'}, + 'hash': {'key': 'hash', 'type': 'str'}, + 'hash_algorithm_name': {'key': 'hashAlgorithmName', 'type': 'HashAlgorithmName'} + } + + def __init__(self, file_name=None, hash=None, hash_algorithm_name=None): + super(FileHash, self).__init__() + self.file_name = file_name + self.hash = hash + self.hash_algorithm_name = hash_algorithm_name + + +class ManifestInfo(Model): + """ + Defines a manifest name and version. + + :param name: The name of the manifest. + :type name: str + :param version: The version of the manifest. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, name=None, version=None): + super(ManifestInfo, self).__init__() + self.name = name + self.version = version + + +class SBOMFile(Model): + """ + Represents a SBOM file object and contains additional properties related to the file. + + :param file_size_in_bytes: The size of the SBOM file in bytes. + :type file_size_in_bytes: long + :param sbom_file_path: The path where the final generated SBOM is placed. + :type sbom_file_path: str + :param sbom_format_name: The name and version of the format of the generated SBOM. + :type sbom_format_name: :class:`ManifestInfo ` + """ + + _attribute_map = { + 'file_size_in_bytes': {'key': 'fileSizeInBytes', 'type': 'long'}, + 'sbom_file_path': {'key': 'sbomFilePath', 'type': 'str'}, + 'sbom_format_name': {'key': 'sbomFormatName', 'type': 'ManifestInfo'} + } + + def __init__(self, file_size_in_bytes=None, sbom_file_path=None, sbom_format_name=None): + super(SBOMFile, self).__init__() + self.file_size_in_bytes = file_size_in_bytes + self.sbom_file_path = sbom_file_path + self.sbom_format_name = sbom_format_name + + +class SBOMTelemetry(Model): + """ + The telemetry that is logged to a file/console for the given SBOM execution. + + :param bsi_data: All available bsi data from the task build execution which includes build and system environment variables like repository and build information. + :type bsi_data: dict + :param bsi_source: The source of the bsi data. + :type bsi_source: str + :param e2_eTask_result: The end to end results of the extension task. + :type e2_eTask_result: str + :param parameters: A list of ConfigurationSetting`1 representing each input parameter used in the validation. + :type parameters: :class:`Configuration ` + :param result: The result of the execution + :type result: str + :param sbom_formats_used: A list of the SBOM formats and related file properties that was used in the generation/validation of the SBOM. + :type sbom_formats_used: list of :class:`SBOMFile ` + :param switches: Any internal switches and their value that were used during the execution. A switch can be something that was provided through a configuraiton or an environment variable. + :type switches: dict + :param task_error_message: Error messages that came from the extension task. + :type task_error_message: str + :param telemetry_id: The unique id for this telemetry + :type telemetry_id: str + :param tool_execution_result: The result of the tool as a numeric value. + :type tool_execution_result: int + """ + + _attribute_map = { + 'bsi_data': {'key': 'bsiData', 'type': '{str}'}, + 'bsi_source': {'key': 'bsiSource', 'type': 'str'}, + 'e2_eTask_result': {'key': 'e2ETaskResult', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'Configuration'}, + 'result': {'key': 'result', 'type': 'str'}, + 'sbom_formats_used': {'key': 'sbomFormatsUsed', 'type': '[SBOMFile]'}, + 'switches': {'key': 'switches', 'type': '{object}'}, + 'task_error_message': {'key': 'taskErrorMessage', 'type': 'str'}, + 'telemetry_id': {'key': 'telemetryId', 'type': 'str'}, + 'tool_execution_result': {'key': 'toolExecutionResult', 'type': 'int'} + } + + def __init__(self, bsi_data=None, bsi_source=None, e2_eTask_result=None, parameters=None, result=None, sbom_formats_used=None, switches=None, task_error_message=None, telemetry_id=None, tool_execution_result=None): + super(SBOMTelemetry, self).__init__() + self.bsi_data = bsi_data + self.bsi_source = bsi_source + self.e2_eTask_result = e2_eTask_result + self.parameters = parameters + self.result = result + self.sbom_formats_used = sbom_formats_used + self.switches = switches + self.task_error_message = task_error_message + self.telemetry_id = telemetry_id + self.tool_execution_result = tool_execution_result + + +class SignResponseBase(Model): + """ + The base reponse object for all responses from the signing api. + + :param customer_correlation_id: The customer correlation id that is sent to ESRP for correlating the current request to ESRP. + :type customer_correlation_id: str + :param error_info: If this is an error response, it will have more information about the error. + :type error_info: str + :param result: The result of the response. + :type result: object + """ + + _attribute_map = { + 'customer_correlation_id': {'key': 'customerCorrelationId', 'type': 'str'}, + 'error_info': {'key': 'errorInfo', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'object'} + } + + def __init__(self, customer_correlation_id=None, error_info=None, result=None): + super(SignResponseBase, self).__init__() + self.customer_correlation_id = customer_correlation_id + self.error_info = error_info + self.result = result + + +class SignStatusResponse(SignResponseBase): + """ + The response returned by the sign status api. + + :param customer_correlation_id: The customer correlation id that is sent to ESRP for correlating the current request to ESRP. + :type customer_correlation_id: str + :param error_info: If this is an error response, it will have more information about the error. + :type error_info: str + :param result: The result of the response. + :type result: object + :param download_url: The pre-signed download url used to download the signed catalog file. + :type download_url: str + """ + + _attribute_map = { + 'customer_correlation_id': {'key': 'customerCorrelationId', 'type': 'str'}, + 'error_info': {'key': 'errorInfo', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'object'}, + 'download_url': {'key': 'downloadUrl', 'type': 'str'} + } + + def __init__(self, customer_correlation_id=None, error_info=None, result=None, download_url=None): + super(SignStatusResponse, self).__init__(customer_correlation_id=customer_correlation_id, error_info=error_info, result=result) + self.download_url = download_url + + +__all__ = [ + 'Configuration', + 'ConfigurationSetting', + 'FileHash', + 'ManifestInfo', + 'SBOMFile', + 'SBOMTelemetry', + 'SignResponseBase', + 'SignStatusResponse', +] diff --git a/azure-devops/azure/devops/v7_1/sbom/sbom_client.py b/azure-devops/azure/devops/v7_1/sbom/sbom_client.py new file mode 100644 index 00000000..98ed021b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/sbom/sbom_client.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------------- +# 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 SBOMClient(Client): + """SBOM + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(SBOMClient, 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 = '2e504d18-2c0c-46f8-af8f-322d2af0068a' + diff --git a/azure-devops/azure/devops/v7_1/search/__init__.py b/azure-devops/azure/devops/v7_1/search/__init__.py new file mode 100644 index 00000000..ca31a2b8 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/search/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'BoardResult', + 'BoardSearchRequest', + 'BoardSearchResponse', + 'BranchInfo', + 'CodeResult', + 'CodeSearchRequest', + 'CodeSearchResponse', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequest', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchRequest', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchRequest', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchRequest', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchRequest', + 'WorkItemSearchResponse', + 'SearchClient' +] diff --git a/azure-devops/azure/devops/v7_1/search/models.py b/azure-devops/azure/devops/v7_1/search/models.py new file mode 100644 index 00000000..879b9173 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/search/models.py @@ -0,0 +1,1247 @@ +# -------------------------------------------------------------------------------------------- +# 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 BoardResult(Model): + """ + Defines the Board result that matched a Board search request. + + :param boardtype: Board Type of the board document. + :type boardtype: str + :param collection: Collection details of the baord document. + :type collection: :class:`Collection ` + :param project: Project details of the board document. + :type project: :class:`Project ` + :param team: Team details of the board document. + :type team: :class:`Team ` + """ + + _attribute_map = { + 'boardtype': {'key': 'boardtype', 'type': 'str'}, + 'collection': {'key': 'collection', 'type': 'Collection'}, + 'project': {'key': 'project', 'type': 'Project'}, + 'team': {'key': 'team', 'type': 'Team'} + } + + def __init__(self, boardtype=None, collection=None, project=None, team=None): + super(BoardResult, self).__init__() + self.boardtype = boardtype + self.collection = collection + self.project = project + self.team = team + + +class BranchInfo(Model): + """ + Information about the configured branch. + + :param last_indexed_change_id: The commit Id of the last Git commit indexed in this branch + :type last_indexed_change_id: str + :param last_processed_time: The last time this branch was processed by the Search service + :type last_processed_time: datetime + :param name: Name of the indexed branch + :type name: str + """ + + _attribute_map = { + 'last_indexed_change_id': {'key': 'lastIndexedChangeId', 'type': 'str'}, + 'last_processed_time': {'key': 'lastProcessedTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, last_indexed_change_id=None, last_processed_time=None, name=None): + super(BranchInfo, self).__init__() + self.last_indexed_change_id = last_indexed_change_id + self.last_processed_time = last_processed_time + self.name = name + + +class CodeResult(Model): + """ + Defines the code result containing information of the searched files and its metadata. + + :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:`Version ` + """ + + _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': '[Version]'} + } + + 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): + """ + Defines the details of the 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 CustomRepositoryBranchStatusResponse(Model): + """ + :param last_indexed_change_id: + :type last_indexed_change_id: long + :param last_indexed_change_id_change_time: + :type last_indexed_change_id_change_time: datetime + :param latest_change_id: + :type latest_change_id: long + :param latest_change_id_change_time: + :type latest_change_id_change_time: datetime + """ + + _attribute_map = { + 'last_indexed_change_id': {'key': 'lastIndexedChangeId', 'type': 'long'}, + 'last_indexed_change_id_change_time': {'key': 'lastIndexedChangeIdChangeTime', 'type': 'iso-8601'}, + 'latest_change_id': {'key': 'latestChangeId', 'type': 'long'}, + 'latest_change_id_change_time': {'key': 'latestChangeIdChangeTime', 'type': 'iso-8601'} + } + + def __init__(self, last_indexed_change_id=None, last_indexed_change_id_change_time=None, latest_change_id=None, latest_change_id_change_time=None): + super(CustomRepositoryBranchStatusResponse, self).__init__() + self.last_indexed_change_id = last_indexed_change_id + self.last_indexed_change_id_change_time = last_indexed_change_id_change_time + self.latest_change_id = latest_change_id + self.latest_change_id_change_time = latest_change_id_change_time + + +class CustomRepositoryStatusResponse(Model): + """ + Defines the custom repository status. + + :param id: Repository Id. + :type id: str + :param indexed_top_level_folders: List of indexed top level folders info. + :type indexed_top_level_folders: list of :class:`DepotInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexed_top_level_folders': {'key': 'indexedTopLevelFolders', 'type': '[DepotInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexed_top_level_folders=None, name=None): + super(CustomRepositoryStatusResponse, self).__init__() + self.id = id + self.indexed_top_level_folders = indexed_top_level_folders + self.name = name + + +class DepotInfo(Model): + """ + Information about the custom repository indexing freshness for configured branches and depots. + + :param indexed_branches: List of Indexed branches info. + :type indexed_branches: list of :class:`BranchInfo ` + :param name: Name of the indexed top level folder (depot). + :type name: str + """ + + _attribute_map = { + 'indexed_branches': {'key': 'indexedBranches', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, indexed_branches=None, name=None): + super(DepotInfo, self).__init__() + self.indexed_branches = indexed_branches + self.name = name + + +class EntitySearchRequestBase(Model): + """ + Base class for search request types. + + :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): + """ + Defines the base contract for search response. + + :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 FeedInfo(Model): + """ + Defines the details of a feed. + + :param collection_id: Id of the collection. + :type collection_id: str + :param collection_name: Name of the collection. + :type collection_name: str + :param feed_id: Id of the feed. + :type feed_id: str + :param feed_name: Name of the feed. + :type feed_name: str + :param latest_matched_version: Latest matched version of package in this Feed. + :type latest_matched_version: str + :param latest_version: Latest version of package in this Feed. + :type latest_version: str + :param package_url: Url of package in this Feed. + :type package_url: str + :param views: List of views which contain the matched package. + :type views: list of str + """ + + _attribute_map = { + 'collection_id': {'key': 'collectionId', 'type': 'str'}, + 'collection_name': {'key': 'collectionName', 'type': 'str'}, + 'feed_id': {'key': 'feedId', 'type': 'str'}, + 'feed_name': {'key': 'feedName', 'type': 'str'}, + 'latest_matched_version': {'key': 'latestMatchedVersion', 'type': 'str'}, + 'latest_version': {'key': 'latestVersion', 'type': 'str'}, + 'package_url': {'key': 'packageUrl', 'type': 'str'}, + 'views': {'key': 'views', 'type': '[str]'} + } + + def __init__(self, collection_id=None, collection_name=None, feed_id=None, feed_name=None, latest_matched_version=None, latest_version=None, package_url=None, views=None): + super(FeedInfo, self).__init__() + self.collection_id = collection_id + self.collection_name = collection_name + self.feed_id = feed_id + self.feed_name = feed_name + self.latest_matched_version = latest_matched_version + self.latest_version = latest_version + self.package_url = package_url + self.views = views + + +class Filter(Model): + """ + Describes a filter bucket item representing the total matches of search result, name and id. + + :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): + """ + Describes the position of a piece of text in a document. + + :param code_snippet: Gets or sets an extract of code where the match appears. Usually it is the line where there is the match. + :type code_snippet: str + :param column: Gets or sets the column number where the match appears in the line. + :type column: int + :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 + :param line: Gets or sets the line number where the match appears in the file. + :type line: int + :param type: Gets or sets the name of type of a piece of text. + :type type: str + """ + + _attribute_map = { + 'code_snippet': {'key': 'codeSnippet', 'type': 'str'}, + 'column': {'key': 'column', 'type': 'int'}, + 'char_offset': {'key': 'charOffset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'line': {'key': 'line', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, code_snippet=None, column=None, char_offset=None, length=None, line=None, type=None): + super(Hit, self).__init__() + self.code_snippet = code_snippet + self.column = column + self.char_offset = char_offset + self.length = length + self.line = line + self.type = type + + +class PackageHit(Model): + """ + Defines the matched terms in the field of the package result. + + :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(PackageHit, self).__init__() + self.field_reference_name = field_reference_name + self.highlights = highlights + + +class PackageResult(Model): + """ + Defines the package result that matched a package search request. + + :param description: Description of the package. + :type description: str + :param feeds: List of feeds which contain the matching package. + :type feeds: list of :class:`FeedInfo ` + :param hits: List of highlighted fields for the match. + :type hits: list of :class:`PackageHit ` + :param id: Id of the package. + :type id: str + :param name: Name of the package. + :type name: str + :param protocol_type: Type of the package. + :type protocol_type: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'feeds': {'key': 'feeds', 'type': '[FeedInfo]'}, + 'hits': {'key': 'hits', 'type': '[PackageHit]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'} + } + + def __init__(self, description=None, feeds=None, hits=None, id=None, name=None, protocol_type=None): + super(PackageResult, self).__init__() + self.description = description + self.feeds = feeds + self.hits = hits + self.id = id + self.name = name + self.protocol_type = protocol_type + + +class PackageSearchResponse(Model): + """ + :param activity_id: + :type activity_id: list of str + :param content: + :type content: :class:`PackageSearchResponseContent ` + """ + + _attribute_map = { + 'activity_id': {'key': 'activityId', 'type': '[str]'}, + 'content': {'key': 'content', 'type': 'PackageSearchResponseContent'} + } + + def __init__(self, activity_id=None, content=None): + super(PackageSearchResponse, self).__init__() + self.activity_id = activity_id + self.content = content + + +class PackageSearchResponseContent(EntitySearchResponse): + """ + Defines a response item that is returned for a package search request. + + :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 packages. + :type count: int + :param results: List of matched packages. + :type results: list of :class:`PackageResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[PackageResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(PackageSearchResponseContent, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class Project(Model): + """ + Defines the details of the 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): + """ + Defines the details of the project. + + :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): + """ + Defines the details of the 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 RepositoryStatusResponse(Model): + """ + Defines the repository status. + + :param id: Repository Id. + :type id: str + :param indexed_branches: List of Indexed branches info. + :type indexed_branches: list of :class:`BranchInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexed_branches': {'key': 'indexedBranches', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexed_branches=None, name=None): + super(RepositoryStatusResponse, self).__init__() + self.id = id + self.indexed_branches = indexed_branches + self.name = name + + +class ScrollSearchRequest(EntitySearchRequestBase): + """ + Defines a scroll code search request. + + :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 scroll_id: Scroll Id for scroll search query. + :type scroll_id: str + :param scroll_size: Size of data to return for scroll search query. Min value is 201. + :type scroll_size: int + """ + + _attribute_map = { + 'filters': {'key': 'filters', 'type': '{[str]}'}, + 'search_text': {'key': 'searchText', 'type': 'str'}, + 'scroll_id': {'key': '$scrollId', 'type': 'str'}, + 'scroll_size': {'key': '$scrollSize', 'type': 'int'} + } + + def __init__(self, filters=None, search_text=None, scroll_id=None, scroll_size=None): + super(ScrollSearchRequest, self).__init__(filters=filters, search_text=search_text) + self.scroll_id = scroll_id + self.scroll_size = scroll_size + + +class SettingResult(Model): + """ + Defines the setting result that matched a setting search request + + :param description: Description of the settings page + :type description: str + :param icon: Icon name of the settings page + :type icon: str + :param route_id: Contribution url route id of the corresponding settings page + :type route_id: str + :param route_parameter_mapping: Contribution url route parameter of the corresponding settings page + :type route_parameter_mapping: dict + :param scope: Scope of the settings page, either organization, project or user + :type scope: object + :param title: Title of the settings page + :type title: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'icon': {'key': 'icon', 'type': 'str'}, + 'route_id': {'key': 'routeId', 'type': 'str'}, + 'route_parameter_mapping': {'key': 'routeParameterMapping', 'type': '{str}'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'title': {'key': 'title', 'type': 'str'} + } + + def __init__(self, description=None, icon=None, route_id=None, route_parameter_mapping=None, scope=None, title=None): + super(SettingResult, self).__init__() + self.description = description + self.icon = icon + self.route_id = route_id + self.route_parameter_mapping = route_parameter_mapping + self.scope = scope + self.title = title + + +class SettingSearchResponse(EntitySearchResponse): + """ + Defines a setting search response item + + :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 setting documents. + :type count: int + :param results: List of top matched setting documents. + :type results: list of :class:`SettingResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[SettingResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(SettingSearchResponse, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class SortOption(Model): + """ + Defines how to sort the result. + + :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 Team(Model): + """ + Defines the details of the team. + + :param id: Id of the team. + :type id: str + :param name: Name of the Team. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(Team, self).__init__() + self.id = id + self.name = name + + +class TfvcRepositoryStatusResponse(Model): + """ + Defines the TFVC repository status. + + :param id: Repository Id. + :type id: str + :param indexing_information: List of Indexing Information for TFVC repository + :type indexing_information: list of :class:`BranchInfo ` + :param name: Repository Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'indexing_information': {'key': 'indexingInformation', 'type': '[BranchInfo]'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, indexing_information=None, name=None): + super(TfvcRepositoryStatusResponse, self).__init__() + self.id = id + self.indexing_information = indexing_information + self.name = name + + +class Version(Model): + """ + Describes the details pertaining to a version of the result file. + + :param branch_name: Name of the branch. + :type branch_name: str + :param change_id: ChangeId in the given branch associated with this match. + :type change_id: str + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'change_id': {'key': 'changeId', 'type': 'str'} + } + + def __init__(self, branch_name=None, change_id=None): + super(Version, self).__init__() + self.branch_name = branch_name + self.change_id = change_id + + +class Wiki(Model): + """ + Defines the details of 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): + """ + Defines the matched terms in the field of the wiki result. + + :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): + """ + Defines the wiki result that matched a wiki search request. + + :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): + """ + Defines a wiki search response item. + + :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): + """ + Defines the matched terms in the field of the work item result. + + :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): + """ + Defines the work item result that matched a work item search request. + + :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): + """ + Defines a response item that is returned for a work item search request. + + :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 BoardSearchResponse(EntitySearchResponse): + """ + Defines a Board search response item. + + :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 Board documents. + :type count: int + :param results: List of top matched Board documents. + :type results: list of :class:`BoardResult ` + """ + + _attribute_map = { + 'facets': {'key': 'facets', 'type': '{[Filter]}'}, + 'info_code': {'key': 'infoCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'results': {'key': 'results', 'type': '[BoardResult]'} + } + + def __init__(self, facets=None, info_code=None, count=None, results=None): + super(BoardSearchResponse, self).__init__(facets=facets, info_code=info_code) + self.count = count + self.results = results + + +class CodeSearchResponse(EntitySearchResponse): + """ + Defines a code search response item. + + :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): + """ + Base contract for search request types without scroll support. + + :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 PackageSearchRequest(EntitySearchRequest): + """ + Defines a package search request. + + :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(PackageSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class SettingSearchRequest(EntitySearchRequest): + """ + Defines a setting search request + + :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(SettingSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class WikiSearchRequest(EntitySearchRequest): + """ + Defines a wiki search request. + + :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): + """ + Defines a work item search request. + + :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 BoardSearchRequest(EntitySearchRequest): + """ + Defines a Board search request. + + :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(BoardSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + + +class CodeSearchRequest(EntitySearchRequest): + """ + Defines a code search request. + + :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 + :param include_snippet: Flag to opt for including matched code snippet in the result. Default behavior is false. + :type include_snippet: 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'}, + 'include_snippet': {'key': 'includeSnippet', 'type': 'bool'} + } + + def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None, include_snippet=None): + super(CodeSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) + self.include_snippet = include_snippet + + +__all__ = [ + 'BoardResult', + 'BranchInfo', + 'CodeResult', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchResponse', + 'BoardSearchResponse', + 'CodeSearchResponse', + 'EntitySearchRequest', + 'PackageSearchRequest', + 'SettingSearchRequest', + 'WikiSearchRequest', + 'WorkItemSearchRequest', + 'BoardSearchRequest', + 'CodeSearchRequest', +] diff --git a/azure-devops/azure/devops/v7_1/search/search_client.py b/azure-devops/azure/devops/v7_1/search/search_client.py new file mode 100644 index 00000000..8a0d0deb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/search/search_client.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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_scroll_code_search_results(self, request, project=None): + """FetchScrollCodeSearchResults. + [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, 'ScrollSearchRequest') + response = self._send(http_method='POST', + location_id='852dac94-e8f7-45a2-9910-927ae35766a2', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_package_search_results(self, request): + """FetchPackageSearchResults. + [Preview API] Provides a set of results for the search text. + :param :class:` ` request: The Package Search Request. + :rtype: :class:` ` + """ + content = self._serialize.body(request, 'PackageSearchRequest') + response = self._send(http_method='POST', + location_id='f62ada48-eedc-4c8e-93f0-de870e4ecce0', + version='7.1-preview.1', + content=content) + response_object = models.PackageSearchResponse() + response_object.content = self._deserialize('PackageSearchResponseContent', response) + response_object.activity_id = response.headers.get('ActivityId') + return response_object + + def get_repository_status(self, project, repository): + """GetRepositoryStatus. + [Preview API] Provides status of Repository. + :param str project: Project ID or project name + :param str repository: Repository ID or repository name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository is not None: + route_values['repository'] = self._serialize.url('repository', repository, 'str') + response = self._send(http_method='GET', + location_id='1f60303c-7261-4387-80f1-742a2ecf2964', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('RepositoryStatusResponse', response) + + def get_tfvc_repository_status(self, project): + """GetTfvcRepositoryStatus. + [Preview API] Provides status of TFVC 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') + response = self._send(http_method='GET', + location_id='d5bf4e52-e0af-4626-8c50-8a80b18fa69f', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('TfvcRepositoryStatusResponse', 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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemSearchResponse', response) + diff --git a/azure-devops/azure/devops/v7_1/security/__init__.py b/azure-devops/azure/devops/v7_1/security/__init__.py new file mode 100644 index 00000000..6ddc7288 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/security/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/security/models.py b/azure-devops/azure/devops/v7_1/security/models.py new file mode 100644 index 00000000..b651ed24 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/security/models.py @@ -0,0 +1,267 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Class for encapsulating the allowed and denied permissions for a given IdentityDescriptor. + + :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): + """ + The AccessControlList class is meant to associate a set of AccessControlEntries with a security token and its inheritance settings. + + :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): + """ + A list of AccessControlList. An AccessControlList is meant to associate a set of AccessControlEntries with a security token and its inheritance settings. + + """ + + _attribute_map = { + } + + def __init__(self): + super(AccessControlListsCollection, self).__init__() + + +class AceExtendedInformation(Model): + """ + Holds the inherited and effective permission information for a given AccessControlEntry. + + :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): + """ + :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): + """ + Represents an evaluated permission. + + :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): + """ + Represents a set of evaluated permissions. + + :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): + """ + Class for describing the details of a TeamFoundationSecurityNamespace. + + :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', +] diff --git a/azure-devops/azure/devops/v7_1/security/security_client.py b/azure-devops/azure/devops/v7_1/security/security_client.py new file mode 100644 index 00000000..2b737699 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/security/security_client.py @@ -0,0 +1,224 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + + def has_permissions_batch(self, eval_batch): + """HasPermissionsBatch. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/service_endpoint/__init__.py b/azure-devops/azure/devops/v7_1/service_endpoint/__init__.py new file mode 100644 index 00000000..83d7f982 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_endpoint/__init__.py @@ -0,0 +1,55 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'ServiceEndpointClient' +] diff --git a/azure-devops/azure/devops/v7_1/service_endpoint/models.py b/azure-devops/azure/devops/v7_1/service_endpoint/models.py new file mode 100644 index 00000000..cde67daa --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_endpoint/models.py @@ -0,0 +1,1434 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Specifies the authentication scheme to be used for authentication. + + :param inputs: Gets or sets the key and value of the fields used for authentication. + :type inputs: dict + :param type: Gets or sets the type of authentication scheme of an endpoint. + :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): + """ + Represents the header of the REST request. + + :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): + """ + Azure Management Group + + :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): + """ + Azure management group query result + + :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): + """ + :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): + """ + :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): + """ + Specifies the client certificate to be used for the endpoint request. + + :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): + """ + Specifies the data sources for this endpoint. + + :param authentication_scheme: Gets or sets the authentication scheme for the endpoint request. + :type authentication_scheme: :class:`AuthenticationSchemeReference ` + :param callback_context_template: Gets or sets the pagination format supported by this data source(ContinuationToken/SkipTop). + :type callback_context_template: str + :param callback_required_template: Gets or sets the template to check if subsequent call is needed. + :type callback_required_template: str + :param endpoint_url: Gets or sets the endpoint url of the data source. + :type endpoint_url: str + :param headers: Gets or sets the authorization headers of the request. + :type headers: list of :class:`AuthorizationHeader ` + :param initial_context_template: Gets or sets the initial value of the query params. + :type initial_context_template: str + :param name: Gets or sets the name of the data source. + :type name: str + :param request_content: Gets or sets the request content of the endpoint request. + :type request_content: str + :param request_verb: Gets or sets the request method of the endpoint request. + :type request_verb: str + :param resource_url: Gets or sets the resource url of the endpoint request. + :type resource_url: str + :param result_selector: Gets or sets the result selector to filter the response of the endpoint request. + :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): + """ + 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 DataSourceDetails(Model): + """ + Represents details of the service endpoint data source. + + :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): + """ + Represents the details of the input on which a given input is dependent. + + :param key: Gets or sets the value of the field on which url is dependent. + :type key: str + :param value: Gets or sets the corresponding value of url. + :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): + """ + Represents the dependency data for the endpoint inputs. + + :param input: Gets or sets the category of dependency data. + :type input: str + :param map: Gets or sets the key-value pair to specify properties and their values. + :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): + """ + Represents the inputs on which any given input is dependent. + + :param input: Gets or sets the ID of the field on which URL's value is dependent. + :type input: str + :param map: Gets or sets key-value pair containing other's field value and corresponding url value. + :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): + """ + Represents the authorization used for service endpoint. + + :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): + """ + Represents url of the service endpoint. + + :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 format: Gets or sets the format of the url. + :type format: 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'}, + 'format': {'key': 'format', '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, format=None, help_text=None, is_visible=None, value=None): + super(EndpointUrl, self).__init__() + self.depends_on = depends_on + self.display_name = display_name + self.format = format + self.help_text = help_text + self.is_visible = is_visible + self.value = value + + +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 HelpLink(Model): + """ + Specifies the public url of the help documentation. + + :param text: Gets or sets the help text. + :type text: str + :param url: Gets or sets the public url of the help documentation. + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 RefreshAuthenticationParameters(Model): + """ + Specify the properties for refreshing the endpoint authentication object being queried + + :param endpoint_id: EndpointId which needs new authentication params + :type endpoint_id: str + :param scope: Scope of the token requested. For GitHub marketplace apps, scope contains repository Ids + :type scope: list of int + :param token_validity_in_minutes: The requested endpoint authentication should be valid for _ minutes. Authentication params will not be refreshed if the token contained in endpoint already has active token. + :type token_validity_in_minutes: int + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': '[int]'}, + 'token_validity_in_minutes': {'key': 'tokenValidityInMinutes', 'type': 'int'} + } + + def __init__(self, endpoint_id=None, scope=None, token_validity_in_minutes=None): + super(RefreshAuthenticationParameters, self).__init__() + self.endpoint_id = endpoint_id + self.scope = scope + self.token_validity_in_minutes = token_validity_in_minutes + + +class ResultTransformationDetails(Model): + """ + Represents template to transform the result data. + + :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): + """ + Represents an endpoint which may be used by an orchestration job. + + :param administrators_group: This is a deprecated field. + :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: This is a deprecated field. + :type group_scope_id: str + :param id: Gets or sets the identifier of this endpoint. + :type id: str + :param is_ready: EndPoint state indicator + :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 service_endpoint_project_references: All other project references where the service endpoint is shared. + :type service_endpoint_project_references: list of :class:`ServiceEndpointProjectReference ` + :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'}, + 'service_endpoint_project_references': {'key': 'serviceEndpointProjectReferences', 'type': '[ServiceEndpointProjectReference]'}, + '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, service_endpoint_project_references=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.service_endpoint_project_references = service_endpoint_project_references + self.type = type + self.url = url + + +class ServiceEndpointAuthenticationScheme(Model): + """ + Represents the authentication scheme used to authenticate the endpoint. + + :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: Gets or sets the data source bindings of the endpoint. + :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 properties: Gets or sets the properties of service endpoint authentication scheme. + :type properties: dict + :param requires_oAuth2_configuration: Gets or sets whether this auth scheme requires OAuth2 configuration or not. + :type requires_oAuth2_configuration: bool + :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]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'requires_oAuth2_configuration': {'key': 'requiresOAuth2Configuration', 'type': 'bool'}, + '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, properties=None, requires_oAuth2_configuration=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.properties = properties + self.requires_oAuth2_configuration = requires_oAuth2_configuration + self.scheme = scheme + + +class ServiceEndpointDetails(Model): + """ + Represents details of the service endpoint. + + :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): + """ + Represents service endpoint execution data. + + :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 owner_details: Gets the additional details about the instance that used the service endpoint. + :type owner_details: str + :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'}, + 'owner_details': {'key': 'ownerDetails', 'type': 'str'}, + '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, owner_details=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.owner_details = owner_details + self.plan_type = plan_type + self.result = result + self.start_time = start_time + + +class ServiceEndpointExecutionOwner(Model): + """ + Represents execution owner of the service endpoint. + + :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): + """ + Represents the details of service endpoint execution. + + :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): + """ + :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 ServiceEndpointProjectReference(Model): + """ + :param description: Gets or sets description of the service endpoint. + :type description: str + :param name: Gets or sets name of the service endpoint. + :type name: str + :param project_reference: Gets or sets project reference of the service endpoint. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(ServiceEndpointProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class ServiceEndpointRequest(Model): + """ + :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): + """ + Represents result of the service endpoint request. + + :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): + """ + Represents type of the service endpoint. + + :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: Gets or sets the help text shown at the endpoint create dialog. + :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): + """ + Represents the data source binding of the endpoint. + + :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(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, request_content=request_content, request_verb=request_verb, 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', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'DataSourceBinding', +] diff --git a/azure-devops/azure/devops/v7_1/service_endpoint/service_endpoint_client.py b/azure-devops/azure/devops/v7_1/service_endpoint/service_endpoint_client.py new file mode 100644 index 00000000..1e887a45 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_endpoint/service_endpoint_client.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpointRequestResult', response) + + def create_service_endpoint(self, endpoint): + """CreateServiceEndpoint. + [Preview API] Creates a new service endpoint + :param :class:` ` endpoint: Service endpoint to create + :rtype: :class:` ` + """ + content = self._serialize.body(endpoint, 'ServiceEndpoint') + response = self._send(http_method='POST', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.1-preview.4', + content=content) + return self._deserialize('ServiceEndpoint', response) + + def delete_service_endpoint(self, endpoint_id, project_ids, deep=None): + """DeleteServiceEndpoint. + [Preview API] Delete a service endpoint + :param str endpoint_id: Endpoint Id of endpoint to delete + :param [str] project_ids: project Ids from which endpoint needs to be deleted + :param bool deep: delete the spn created by endpoint + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + if deep is not None: + query_parameters['deep'] = self._serialize.query('deep', deep, 'bool') + self._send(http_method='DELETE', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + + def share_service_endpoint(self, endpoint_project_references, endpoint_id): + """ShareServiceEndpoint. + [Preview API] Share service endpoint across projects + :param [ServiceEndpointProjectReference] endpoint_project_references: Project reference details of the target project + :param str endpoint_id: Endpoint Id of the endpoint to share + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + content = self._serialize.body(endpoint_project_references, '[ServiceEndpointProjectReference]') + self._send(http_method='PATCH', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.1-preview.4', + route_values=route_values, + content=content) + + def update_service_endpoint(self, endpoint, endpoint_id, operation=None): + """UpdateServiceEndpoint. + [Preview API] Update the service endpoint + :param :class:` ` endpoint: Updated data for the endpoint + :param str endpoint_id: Endpoint Id of the endpoint to update + :param str operation: operation type + :rtype: :class:` ` + """ + route_values = {} + 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='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpoint', response) + + def update_service_endpoints(self, endpoints): + """UpdateServiceEndpoints. + [Preview API] Update the service endpoints. + :param [ServiceEndpoint] endpoints: Names of the service endpoints to update. + :rtype: [ServiceEndpoint] + """ + content = self._serialize.body(endpoints, '[ServiceEndpoint]') + response = self._send(http_method='PUT', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.1-preview.4', + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_details(self, project, endpoint_id, action_filter=None): + """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. + :param str action_filter: Action filter for the service connection. It specifies the action which can be performed on the service connection. + :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 action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ServiceEndpoint', response) + + def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, owner=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 str owner: Owner 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 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.1-preview.4', + 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, owner=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 str owner: Owner 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 owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, '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='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoints_with_refreshed_authentication(self, refresh_authentication_parameters, project, endpoint_ids): + """GetServiceEndpointsWithRefreshedAuthentication. + [Preview API] Gets the service endpoints and patch new authorization parameters + :param [RefreshAuthenticationParameters] refresh_authentication_parameters: Scope, Validity of Token requested. + :param str project: Project ID or project name + :param [str] endpoint_ids: Ids of the service endpoints. + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_ids is not None: + endpoint_ids = ",".join(endpoint_ids) + query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') + content = self._serialize.body(refresh_authentication_parameters, '[RefreshAuthenticationParameters]') + response = self._send(http_method='POST', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_execution_records(self, project, endpoint_id, top=None, continuation_token=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. + :param long continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of records + :rtype: :class:`<[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') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') + response = self._send(http_method='GET', + location_id='10a16738-9299-4cd1-9a81-fd23ad6200d0', + version='7.1-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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpointType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/service_hooks/__init__.py b/azure-devops/azure/devops/v7_1/service_hooks/__init__.py new file mode 100644 index 00000000..ba25f866 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_hooks/__init__.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'SubscriptionInputValuesQuery', + 'SubscriptionsQuery', + 'SubscriptionTracing', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'VersionedResource', + 'ServiceHooksClient' +] diff --git a/azure-devops/azure/devops/v7_1/service_hooks/models.py b/azure-devops/azure/devops/v7_1/service_hooks/models.py new file mode 100644 index 00000000..b572b0b2 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_hooks/models.py @@ -0,0 +1,1357 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Defines the data contract of a 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): + """ + Defines the data contract of a consumer action. + + :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): + """ + Encapsulates the properties of an 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): + """ + Describes a type of event + + :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): + """ + Describes how to configure a subscription that is managed externally. + + :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): + """ + Provides different formats of an event message + + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Defines a filter for subscription inputs. The filter matches a set of inputs if any (one or more) of the groups evaluates to true. + + :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): + """ + An expression which can be applied to filter a list of subscription inputs + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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): + """ + :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): + """ + Defines the data contract of the result of processing an event for a subscription. + + :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): + """ + Defines the data contract of notification details. + + :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 response. + :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): + """ + Summary of a particular result and count. + + :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): + """ + Defines a query for service hook notifications. + + :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): + """ + Summary of the notifications for a subscription. + + :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): + """ + Defines the data contract of an event 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): + """ + Wrapper around an event which is being published + + :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 notification. + :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 matched 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): + """ + Defines a query for service hook publishers. + + :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): + """ + 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 ResourceContainer(Model): + """ + The base class for all resource containers, i.e. Account, Collection, Project + + :param base_url: Gets or sets the container's base URL, i.e. the URL of the host (collection, application, or deployment) 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): + """ + Represents a session token to be attached in Events for Consumer actions that need it. + + :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): + """ + Encapsulates an event 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 last_probation_retry_date: + :type last_probation_retry_date: datetime + :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'}, + 'last_probation_retry_date': {'key': 'lastProbationRetryDate', 'type': 'iso-8601'}, + '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, last_probation_retry_date=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.last_probation_retry_date = last_probation_retry_date + 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): + """ + Contains all the diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`SubscriptionTracing ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`SubscriptionTracing ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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 SubscriptionInputValuesQuery(Model): + """ + Query for obtaining information about the possible/allowed values for one or more subscription inputs + + :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 scope: The scope at which the properties to query belong + :type scope: object + :param subscription: Subscription containing information about the publisher/consumer and the current input values + :type subscription: :class:`Subscription ` + """ + + _attribute_map = { + 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'subscription': {'key': 'subscription', 'type': 'Subscription'} + } + + def __init__(self, input_values=None, scope=None, subscription=None): + super(SubscriptionInputValuesQuery, self).__init__() + self.input_values = input_values + self.scope = scope + self.subscription = subscription + + +class SubscriptionsQuery(Model): + """ + Defines a query for service hook subscriptions. + + :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): + """ + Data controlling a single diagnostic setting for a subscription. + + :param enabled: Indicates whether the diagnostic tracing is enabled or not. + :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): + """ + Parameters to update diagnostics settings for a subscription. + + :param delivery_results: Diagnostics settings for retaining delivery results. Used for Service Hooks subscriptions. + :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` + :param delivery_tracing: Diagnostics settings for troubleshooting notification delivery. + :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` + :param evaluation_tracing: Diagnostics settings for troubleshooting event matching. + :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): + """ + Parameters to update a specific diagnostic setting. + + :param enabled: Indicates whether to enable to disable the diagnostic tracing. + :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): + """ + Encapsulates the resource version and its data or reference to the compatible version. Only one of the two last fields should be not null. + + :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', + 'SubscriptionInputValuesQuery', + 'SubscriptionsQuery', + 'SubscriptionTracing', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', + 'VersionedResource', +] diff --git a/azure-devops/azure/devops/v7_1/service_hooks/service_hooks_client.py b/azure-devops/azure/devops/v7_1/service_hooks/service_hooks_client.py new file mode 100644 index 00000000..7ac0201e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/service_hooks/service_hooks_client.py @@ -0,0 +1,398 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Consumer', response) + + def list_consumers(self, publisher_id=None): + """ListConsumers. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionDiagnostics', response) + + def get_event_type(self, publisher_id, event_type_id): + """GetEventType. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('EventTypeDescriptor', response) + + def list_event_types(self, publisher_id): + """ListEventTypes. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[EventTypeDescriptor]', self._unwrap_collection(response)) + + def get_notification(self, subscription_id, notification_id): + """GetNotification. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Notification', response) + + def get_notifications(self, subscription_id, max_results=None, status=None, result=None): + """GetNotifications. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Notification]', self._unwrap_collection(response)) + + def query_notifications(self, query): + """QueryNotifications. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('NotificationsQuery', response) + + def query_input_values(self, input_values_query, publisher_id): + """QueryInputValues. + [Preview API] + :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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('InputValuesQuery', response) + + def get_publisher(self, publisher_id): + """GetPublisher. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Publisher', response) + + def list_publishers(self): + """ListPublishers. + [Preview API] Get a list of publishers. + :rtype: [Publisher] + """ + response = self._send(http_method='GET', + location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', + version='7.1-preview.1') + return self._deserialize('[Publisher]', self._unwrap_collection(response)) + + def query_publishers(self, query): + """QueryPublishers. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('PublishersQuery', response) + + def create_subscription(self, subscription): + """CreateSubscription. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('Subscription', response) + + def delete_subscription(self, subscription_id): + """DeleteSubscription. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_subscription(self, subscription_id): + """GetSubscription. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[Subscription]', self._unwrap_collection(response)) + + def replace_subscription(self, subscription, subscription_id=None): + """ReplaceSubscription. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Subscription', response) + + def create_subscriptions_query(self, query): + """CreateSubscriptionsQuery. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('SubscriptionsQuery', response) + + def create_test_notification(self, test_notification, use_real_data=None): + """CreateTestNotification. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('Notification', response) + diff --git a/azure-devops/azure/devops/v7_1/settings/__init__.py b/azure-devops/azure/devops/v7_1/settings/__init__.py new file mode 100644 index 00000000..3798fc24 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/settings/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/settings/settings_client.py b/azure-devops/azure/devops/v7_1/settings/settings_client.py new file mode 100644 index 00000000..b75e2f08 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/settings/settings_client.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/symbol/__init__.py b/azure-devops/azure/devops/v7_1/symbol/__init__.py new file mode 100644 index 00000000..98f9674b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/symbol/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'Request', + 'ResourceBase', + 'SymbolClient' +] diff --git a/azure-devops/azure/devops/v7_1/symbol/models.py b/azure-devops/azure/devops/v7_1/symbol/models.py new file mode 100644 index 00000000..79ac7616 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/symbol/models.py @@ -0,0 +1,261 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + A batch of debug entry to create. + + :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 ` + :param proof_nodes: Serialized Proof nodes, used to verify uploads on server side for Chunk Dedup DebugEntry + :type proof_nodes: list of str + """ + + _attribute_map = { + 'create_behavior': {'key': 'createBehavior', 'type': 'object'}, + 'debug_entries': {'key': 'debugEntries', 'type': '[DebugEntry]'}, + 'proof_nodes': {'key': 'proofNodes', 'type': '[str]'} + } + + def __init__(self, create_behavior=None, debug_entries=None, proof_nodes=None): + super(DebugEntryCreateBatch, self).__init__() + self.create_behavior = create_behavior + self.debug_entries = debug_entries + self.proof_nodes = proof_nodes + + +class IDomainId(Model): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(IDomainId, self).__init__() + + +class JsonBlobBlockHash(Model): + """ + BlobBlock hash formatted to be deserialized for symbol service. + + :param hash_bytes: Array of 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): + """ + :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): + """ + BlobIdentifier with block hashes formatted to be deserialzied for symbol service. + + :param block_hashes: List of blob block hashes. + :type block_hashes: list of :class:`JsonBlobBlockHash ` + :param identifier_value: Array of blobId bytes. + :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): + """ + :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): + """ + A dual-purpose data object, the debug entry is used by the client to publish the symbol file (with file's blob identifier, which can be calculated from VSTS hashing algorithm) or query the file (with a client key). Since the symbol server tries to return a matched symbol file with the richest information level, it may not always point to the same symbol file for different queries with same client key. + + :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: Details of the blob formatted to be deserialized for symbol service. + :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 domain_id: The Domain Id where this debugEntry lives. This property should not be null. + :type domain_id: :class:`IDomainId ` + :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 size: The size for the debug entry. + :type size: long + :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'}, + 'domain_id': {'key': 'domainId', 'type': 'IDomainId'}, + 'information_level': {'key': 'informationLevel', 'type': 'object'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + '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, domain_id=None, information_level=None, request_id=None, size=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.domain_id = domain_id + self.information_level = information_level + self.request_id = request_id + self.size = size + self.status = status + + +class Request(ResourceBase): + """ + Symbol 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 domain_id: The Domain Id where this request lives. This property should not be null. + :type domain_id: :class:`IDomainId ` + :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 is_chunked: Indicates if request should be chunk dedup + :type is_chunked: bool + :param name: A human-facing name for the request. Required on POST, ignored on PATCH. + :type name: str + :param size: The total Size for this request. + :type size: long + :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'}, + 'domain_id': {'key': 'domainId', 'type': 'IDomainId'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'is_chunked': {'key': 'isChunked', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, created_by=None, created_date=None, id=None, storage_eTag=None, url=None, description=None, domain_id=None, expiration_date=None, is_chunked=None, name=None, size=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.domain_id = domain_id + self.expiration_date = expiration_date + self.is_chunked = is_chunked + self.name = name + self.size = size + self.status = status + + +__all__ = [ + 'DebugEntryCreateBatch', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'ResourceBase', + 'DebugEntry', + 'Request', +] diff --git a/azure-devops/azure/devops/v7_1/symbol/symbol_client.py b/azure-devops/azure/devops/v7_1/symbol/symbol_client.py new file mode 100644 index 00000000..37175f7c --- /dev/null +++ b/azure-devops/azure/devops/v7_1/symbol/symbol_client.py @@ -0,0 +1,244 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-preview.1') + + def get_debug_entry_content(self, request_id, debug_entry_id): + """GetDebugEntryContent. + [Preview API] Get a stitched debug entry for a symbol request as specified by symbol request identifier and debug entry identifier. + :param str request_id: The symbol request identifier. + :param str debug_entry_id: The debug entry identifier. + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + if debug_entry_id is not None: + route_values['debugEntryId'] = self._serialize.url('debug_entry_id', debug_entry_id, 'str') + self._send(http_method='GET', + location_id='0f98d9f5-caf7-44fd-a5c9-55f3a9b34399', + version='7.1-preview.1', + route_values=route_values) + + 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='7.1-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='7.1-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: The symbol 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='7.1-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='7.1-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: The symbol 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='7.1-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='7.1-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: The symbol 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='7.1-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='7.1-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: The symbol 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='7.1-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='7.1-preview.1', + route_values=route_values) + diff --git a/azure-devops/azure/devops/v7_1/task/__init__.py b/azure-devops/azure/devops/v7_1/task/__init__.py new file mode 100644 index 00000000..f2bc29d5 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task/__init__.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'JobEvent', + 'JobOption', + 'MaskHint', + 'PlanEnvironment', + 'ProjectReference', + 'ReferenceLinks', + 'TaskAgentJob', + 'TaskAgentJobStep', + 'TaskAgentJobTask', + 'TaskAgentJobVariable', + 'TaskAttachment', + 'TaskHubOidcToken', + 'TaskLog', + 'TaskLogReference', + 'TaskOrchestrationContainer', + 'TaskOrchestrationItem', + 'TaskOrchestrationOwner', + 'TaskOrchestrationPlan', + 'TaskOrchestrationPlanGroupsQueueMetrics', + 'TaskOrchestrationPlanReference', + 'TaskOrchestrationQueuedPlan', + 'TaskOrchestrationQueuedPlanGroup', + 'TaskReference', + 'Timeline', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineRecordFeedLinesWrapper', + 'TimelineReference', + 'VariableValue', + 'TaskClient' +] diff --git a/azure-devops/azure/devops/v7_1/task/models.py b/azure-devops/azure/devops/v7_1/task/models.py new file mode 100644 index 00000000..01164af4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task/models.py @@ -0,0 +1,1056 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + An issue (error, warning) associated with a pipeline run. + + :param category: The category of the issue.
Example: Code - refers to compilation errors
Example: General - refers to generic errors + :type category: str + :param data: A dictionary containing details about the issue. + :type data: dict + :param message: A description of 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 JobEvent(Model): + """ + A pipeline job event to be processed by the execution plan. + + :param job_id: The ID of the pipeline job affected by the event. + :type job_id: str + :param name: The name of the pipeline job event. + :type name: str + """ + + _attribute_map = { + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, job_id=None, name=None): + super(JobEvent, self).__init__() + self.job_id = job_id + self.name = name + + +class JobOption(Model): + """ + Represents an option that may affect the way an agent runs the job. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 TaskAgentJob(Model): + """ + :param container: + :type container: str + :param id: + :type id: str + :param name: + :type name: str + :param sidecar_containers: + :type sidecar_containers: dict + :param steps: + :type steps: list of :class:`TaskAgentJobStep ` + :param variables: + :type variables: list of :class:`TaskAgentJobVariable ` + """ + + _attribute_map = { + 'container': {'key': 'container', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sidecar_containers': {'key': 'sidecarContainers', 'type': '{str}'}, + 'steps': {'key': 'steps', 'type': '[TaskAgentJobStep]'}, + 'variables': {'key': 'variables', 'type': '[TaskAgentJobVariable]'} + } + + def __init__(self, container=None, id=None, name=None, sidecar_containers=None, steps=None, variables=None): + super(TaskAgentJob, self).__init__() + self.container = container + self.id = id + self.name = name + self.sidecar_containers = sidecar_containers + self.steps = steps + self.variables = variables + + +class TaskAgentJobStep(Model): + """ + :param condition: + :type condition: str + :param continue_on_error: + :type continue_on_error: bool + :param enabled: + :type enabled: bool + :param env: + :type env: dict + :param id: + :type id: str + :param inputs: + :type inputs: dict + :param name: + :type name: str + :param retry_count_on_task_failure: + :type retry_count_on_task_failure: int + :param task: + :type task: :class:`TaskAgentJobTask ` + :param timeout_in_minutes: + :type timeout_in_minutes: int + :param type: + :type type: object + """ + + _attribute_map = { + 'condition': {'key': 'condition', 'type': 'str'}, + 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'env': {'key': 'env', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + 'task': {'key': 'task', 'type': 'TaskAgentJobTask'}, + 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, condition=None, continue_on_error=None, enabled=None, env=None, id=None, inputs=None, name=None, retry_count_on_task_failure=None, task=None, timeout_in_minutes=None, type=None): + super(TaskAgentJobStep, self).__init__() + self.condition = condition + self.continue_on_error = continue_on_error + self.enabled = enabled + self.env = env + self.id = id + self.inputs = inputs + self.name = name + self.retry_count_on_task_failure = retry_count_on_task_failure + self.task = task + self.timeout_in_minutes = timeout_in_minutes + self.type = type + + +class TaskAgentJobTask(Model): + """ + :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(TaskAgentJobTask, self).__init__() + self.id = id + self.name = name + self.version = version + + +class TaskAgentJobVariable(Model): + """ + :param name: + :type name: str + :param secret: + :type secret: bool + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, name=None, secret=None, value=None): + super(TaskAgentJobVariable, self).__init__() + self.name = name + self.secret = secret + self.value = value + + +class TaskAttachment(Model): + """ + :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 TaskHubOidcToken(Model): + """ + :param oidc_token: + :type oidc_token: str + """ + + _attribute_map = { + 'oidc_token': {'key': 'oidcToken', 'type': 'str'} + } + + def __init__(self, oidc_token=None): + super(TaskHubOidcToken, self).__init__() + self.oidc_token = oidc_token + + +class TaskLogReference(Model): + """ + A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run. + + :param id: The ID of the task log. + :type id: int + :param location: The REST URL of the task log. + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + A reference to a task. + + :param id: The ID of the task definition. Corresponds to the id value of task.json file.
Example: CmdLineV2 { "id": "D9BAFED4-0B18-4F58-968D-86655B4D2CE9" } + :type id: str + :param inputs: A dictionary of inputs specific to a task definition. Corresponds to inputs value of task.json file. + :type inputs: dict + :param name: The name of the task definition. Corresponds to the name value of task.json file.
Example: CmdLineV2 { "name": "CmdLine" } + :type name: str + :param version: The version of the task definition. Corresponds to the version value of task.json file.
Example: CmdLineV2 { "version": { "Major": 2, "Minor": 212, "Patch": 0 } } + :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): + """ + An attempt to update a TimelineRecord. + + :param attempt: The attempt of the record. + :type attempt: int + :param identifier: The unique identifier for the record. + :type identifier: str + :param record_id: The record identifier located within the specified timeline. + :type record_id: str + :param timeline_id: 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): + """ + Detailed information about the execution of different operations during pipeline run. + + :param agent_specification: The specification of an agent running a pipeline job, in binary format. Applicable when record is of type Job.
Example: { "VMImage" : "windows-2019" } + :type agent_specification: :class:`object ` + :param attempt: The number of record attempts. + :type attempt: 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 of the record. + :type finish_time: datetime + :param change_id: The ID connecting all records updated at the same time. This value is taken from timeline's ChangeId. + :type change_id: int + :param id: The ID of the record. + :type id: str + :param identifier: String identifier that is consistent across attempts. + :type identifier: str + :param issues: The list of issues produced by this operation. + :type issues: list of :class:`Issue ` + :param last_modified: The time the record was last modified. + :type last_modified: datetime + :param location: The REST URL of the record. + :type location: str + :param log: A reference to the log produced by this operation. + :type log: :class:`TaskLogReference ` + :param name: The name of the record. + :type name: str + :param order: An ordinal value relative to other records within the timeline. + :type order: int + :param parent_id: The ID of the record's parent.
Example: Stage is a parent of a Phase, Phase is a parent of a Job, Job is a parent of a Task. + :type parent_id: str + :param percent_complete: The percentage of record completion. + :type percent_complete: int + :param previous_attempts: The previous record attempts. + :type previous_attempts: list of :class:`TimelineAttempt ` + :param queue_id: The ID of the queue which connects projects to agent pools on which the operation ran on. Applicable when record is of type Job. + :type queue_id: int + :param ref_name: Name of the referenced record. + :type ref_name: str + :param result: The result of the record. + :type result: object + :param result_code: Evaluation of predefined conditions upon completion of record's operation.
Example: Evaluating `succeeded()`, Result = True
Example: Evaluating `and(succeeded(), eq(variables['system.debug'], False))`, Result = False + :type result_code: str + :param start_time: The start time of the record. + :type start_time: datetime + :param state: The state of the record. + :type state: object + :param task: A reference to the task. Applicable when record is of type Task. + :type task: :class:`TaskReference ` + :param type: The type of operation being tracked by the record.
Example: Stage, Phase, Job, Task... + :type type: str + :param variables: The variables of the record. + :type variables: dict + :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. Applicable when record is of type Job. + :type worker_name: str + """ + + _attribute_map = { + 'agent_specification': {'key': 'agentSpecification', 'type': 'object'}, + 'attempt': {'key': 'attempt', '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'}, + 'change_id': {'key': 'changeId', 'type': 'int'}, + '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]'}, + 'queue_id': {'key': 'queueId', 'type': 'int'}, + '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, agent_specification=None, attempt=None, current_operation=None, details=None, error_count=None, finish_time=None, change_id=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, queue_id=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.agent_specification = agent_specification + self.attempt = attempt + self.current_operation = current_operation + self.details = details + self.error_count = error_count + self.finish_time = finish_time + self.change_id = change_id + 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.queue_id = queue_id + 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): + """ + :param count: + :type count: int + :param end_line: + :type end_line: long + :param start_line: + :type start_line: long + :param step_id: + :type step_id: str + :param value: + :type value: list of str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'end_line': {'key': 'endLine', 'type': 'long'}, + 'start_line': {'key': 'startLine', 'type': 'long'}, + 'step_id': {'key': 'stepId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[str]'} + } + + def __init__(self, count=None, end_line=None, start_line=None, step_id=None, value=None): + super(TimelineRecordFeedLinesWrapper, self).__init__() + self.count = count + self.end_line = end_line + self.start_line = start_line + self.step_id = step_id + self.value = value + + +class TimelineReference(Model): + """ + 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 location: The REST URL of the timeline. + :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): + """ + A wrapper class for a generic variable. + + :param is_read_only: Indicates whether the variable can be changed during script's execution runtime. + :type is_read_only: bool + :param is_secret: Indicates whether the variable should be encrypted at rest. + :type is_secret: bool + :param value: The value of the variable. + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class TaskLog(TaskLogReference): + """ + A task log connected to a timeline record. + + :param id: The ID of the task log. + :type id: int + :param location: The REST URL of the task log. + :type location: str + :param created_on: The time of the task log creation. + :type created_on: datetime + :param index_location: The REST URL of the task log when indexed. + :type index_location: str + :param last_changed_on: The time of the last modification of the task log. + :type last_changed_on: datetime + :param line_count: The number of the task log lines. + :type line_count: long + :param path: The path of the task log. + :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): + """ + :param item_type: + :type item_type: object + :param continue_on_error: + :type continue_on_error: bool + :param data: + :type data: dict + :param children: + :type children: list of :class:`TaskOrchestrationItem ` + :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'}, + 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, + 'data': {'key': 'data', 'type': '{str}'}, + 'children': {'key': 'children', 'type': '[TaskOrchestrationItem]'}, + 'max_concurrency': {'key': 'maxConcurrency', 'type': 'int'}, + 'parallel': {'key': 'parallel', 'type': 'bool'}, + 'rollback': {'key': 'rollback', 'type': 'TaskOrchestrationContainer'} + } + + def __init__(self, item_type=None, continue_on_error=None, data=None, children=None, max_concurrency=None, parallel=None, rollback=None): + super(TaskOrchestrationContainer, self).__init__(item_type=item_type) + self.continue_on_error = continue_on_error + self.data = data + self.children = children + self.max_concurrency = max_concurrency + self.parallel = parallel + self.rollback = rollback + + +class TaskOrchestrationPlan(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 + :param environment: + :type environment: :class:`PlanEnvironment ` + :param expanded_yaml: + :type expanded_yaml: :class:`TaskLogReference ` + :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'}, + 'expanded_yaml': {'key': 'expandedYaml', 'type': 'TaskLogReference'}, + '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, expanded_yaml=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.expanded_yaml = expanded_yaml + 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): + """ + :param change_id: The change ID. + :type change_id: int + :param id: The ID of the timeline. + :type id: str + :param location: The REST URL of the timeline. + :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', + 'JobEvent', + 'JobOption', + 'MaskHint', + 'PlanEnvironment', + 'ProjectReference', + 'ReferenceLinks', + 'TaskAgentJob', + 'TaskAgentJobStep', + 'TaskAgentJobTask', + 'TaskAgentJobVariable', + 'TaskAttachment', + 'TaskHubOidcToken', + 'TaskLogReference', + 'TaskOrchestrationItem', + 'TaskOrchestrationOwner', + 'TaskOrchestrationPlanGroupsQueueMetrics', + 'TaskOrchestrationPlanReference', + 'TaskOrchestrationQueuedPlan', + 'TaskOrchestrationQueuedPlanGroup', + 'TaskReference', + 'TimelineAttempt', + 'TimelineRecord', + 'TimelineRecordFeedLinesWrapper', + 'TimelineReference', + 'VariableValue', + 'TaskLog', + 'TaskOrchestrationContainer', + 'TaskOrchestrationPlan', + 'Timeline', +] diff --git a/azure-devops/azure/devops/v7_1/task/task_client.py b/azure-devops/azure/devops/v7_1/task/task_client.py new file mode 100644 index 00000000..83d4a2c3 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task/task_client.py @@ -0,0 +1,562 @@ +# -------------------------------------------------------------------------------------------- +# 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. Common examples: "build", "rm", "checks" + :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='7.1-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. Common examples: "build", "rm", "checks" + :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='7.1-preview.1', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskAttachment', response) + + def create_attachment_from_artifact(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, artifact_hash, length): + """CreateAttachmentFromArtifact. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :param str artifact_hash: + :param long length: + :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') + query_parameters = {} + if artifact_hash is not None: + query_parameters['artifactHash'] = self._serialize.query('artifact_hash', artifact_hash, 'str') + if length is not None: + query_parameters['length'] = self._serialize.query('length', length, 'long') + response = self._send(http_method='PUT', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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. Common examples: "build", "rm", "checks" + :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='7.1-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. Common examples: "build", "rm", "checks" + :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='7.1-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. Common examples: "build", "rm", "checks" + :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='7.1-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. + [Preview API] Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream. + :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. Common examples: "build", "rm", "checks" + :param str plan_id: The ID of the plan. + :param int log_id: The ID of the log. + :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='7.1-preview.1', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskLog', response) + + def associate_log(self, scope_identifier, hub_name, plan_id, log_id, serialized_blob_id, line_count): + """AssociateLog. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :param str plan_id: + :param int log_id: + :param str serialized_blob_id: + :param int line_count: + :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') + query_parameters = {} + if serialized_blob_id is not None: + query_parameters['serializedBlobId'] = self._serialize.query('serialized_blob_id', serialized_blob_id, 'str') + if line_count is not None: + query_parameters['lineCount'] = self._serialize.query('line_count', line_count, 'int') + response = self._send(http_method='POST', + location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskLog', response) + + def create_log(self, log, scope_identifier, hub_name, plan_id): + """CreateLog. + [Preview API] Create a log and connect it to a pipeline run's execution plan. + :param :class:` ` log: An object that contains information about log's path. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :param str plan_id: The ID of the plan. + :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='7.1-preview.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. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.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. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[TaskLog]', self._unwrap_collection(response)) + + def create_oidc_token(self, claims, scope_identifier, hub_name, plan_id, job_id, service_connection_id): + """CreateOidcToken. + [Preview API] + :param {str} claims: + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :param str plan_id: + :param str job_id: + :param str service_connection_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 job_id is not None: + route_values['jobId'] = self._serialize.url('job_id', job_id, 'str') + query_parameters = {} + if service_connection_id is not None: + query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') + content = self._serialize.body(claims, '{str}') + response = self._send(http_method='POST', + location_id='69a319f4-28c1-4bfd-93e6-ea0ff5c6f1a2', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TaskHubOidcToken', response) + + def get_records(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None): + """GetRecords. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.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. + [Preview API] Update timeline records if they already exist, otherwise create new ones for the same timeline. + :param :class:` ` records: The array of timeline records to be updated. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :param str plan_id: The ID of the plan. + :param str timeline_id: The ID of the timeline. + :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='7.1-preview.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. + [Preview API] + :param :class:` ` timeline: + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.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. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.1', + route_values=route_values) + + def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None, include_records=None): + """GetTimeline. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.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. + [Preview API] + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub. Common examples: "build", "rm", "checks" + :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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Timeline]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/task_agent/__init__.py b/azure-devops/azure/devops/v7_1/task_agent/__init__.py new file mode 100644 index 00000000..37508bf9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task_agent/__init__.py @@ -0,0 +1,136 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + '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', + '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', + 'TaskAgentJobRequest', + 'TaskAgentMessage', + 'TaskAgentPool', + 'TaskAgentPoolMaintenanceDefinition', + 'TaskAgentPoolMaintenanceJob', + 'TaskAgentPoolMaintenanceJobTargetAgent', + 'TaskAgentPoolMaintenanceOptions', + 'TaskAgentPoolMaintenanceRetentionPolicy', + 'TaskAgentPoolMaintenanceSchedule', + 'TaskAgentPoolReference', + 'TaskAgentPublicKey', + 'TaskAgentQueue', + 'TaskAgentReference', + 'TaskAgentSession', + 'TaskAgentSessionKey', + 'TaskAgentUpdate', + 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', + 'TaskDefinition', + 'TaskDefinitionEndpoint', + 'TaskDefinitionReference', + 'TaskExecution', + 'TaskGroup', + 'TaskGroupCreateParameter', + 'TaskGroupDefinition', + 'TaskGroupRevision', + 'TaskGroupStep', + 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', + 'TaskHubLicenseDetails', + 'TaskInputDefinition', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationOwner', + 'TaskOutputVariable', + 'TaskPackageMetadata', + 'TaskReference', + 'TaskRestrictions', + 'TaskSourceDefinition', + 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', + 'TaskVersion', + 'ValidationItem', + 'VariableGroup', + 'VariableGroupParameters', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'VirtualMachine', + 'VirtualMachineGroup', + 'VirtualMachineGroupCreateParameters', + 'TaskAgentClient' +] diff --git a/azure-devops/azure/devops/v7_1/task_agent/models.py b/azure-devops/azure/devops/v7_1/task_agent/models.py new file mode 100644 index 00000000..4579f867 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task_agent/models.py @@ -0,0 +1,4506 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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): + """ + Azure Management Group + + :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 belongs + :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): + """ + Azure management group query result + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 DataSourceDetails(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Properties to create Deployment group. + + :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): + """ + Properties of Deployment pool to create Deployment group. + + :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): + """ + Deployment group metrics. + + :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): + """ + Deployment group reference. This is useful for referring a deployment group in another object. + + :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): + """ + Deployment group update parameter. + + :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): + """ + Deployment target. + + :param agent: Deployment agent. + :type agent: :class:`TaskAgent ` + :param id: Deployment target Identifier. + :type id: int + :param properties: Properties of the deployment target. + :type properties: :class:`object ` + :param tags: Tags of the deployment target. + :type tags: list of str + """ + + _attribute_map = { + 'agent': {'key': 'agent', 'type': 'TaskAgent'}, + 'id': {'key': 'id', 'type': 'int'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, agent=None, id=None, properties=None, tags=None): + super(DeploymentMachine, self).__init__() + self.agent = agent + self.id = id + self.properties = properties + self.tags = tags + + +class DeploymentMachineGroupReference(Model): + """ + :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): + """ + Deployment pool summary. + + :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 ` + :param resource: Virtual machine Resource referring in pool. + :type resource: :class:`EnvironmentResourceReference ` + """ + + _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'}, + 'resource': {'key': 'resource', 'type': 'EnvironmentResourceReference'} + } + + def __init__(self, deployment_groups=None, offline_agents_count=None, online_agents_count=None, pool=None, resource=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 + self.resource = resource + + +class DeploymentTargetUpdateParameter(Model): + """ + Deployment target update parameter. + + :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): + """ + :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): + """ + Represents url of the service endpoint. + + :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 EnvironmentCreateParameter(Model): + """ + Properties to create Environment. + + :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 EnvironmentDeploymentExecutionRecord(Model): + """ + EnvironmentDeploymentExecutionRecord. + + :param definition: Definition of the environment deployment execution owner + :type definition: :class:`TaskOrchestrationOwner ` + :param environment_id: Id of the Environment + :type environment_id: int + :param finish_time: Finish time of the environment deployment execution + :type finish_time: datetime + :param id: Id of the Environment deployment execution history record + :type id: long + :param job_attempt: Job Attempt + :type job_attempt: int + :param job_name: Job name + :type job_name: str + :param owner: Owner of the environment deployment execution record + :type owner: :class:`TaskOrchestrationOwner ` + :param plan_id: Plan Id + :type plan_id: str + :param plan_type: Plan type of the environment deployment execution record + :type plan_type: str + :param queue_time: Queue time of the environment deployment execution + :type queue_time: datetime + :param request_identifier: Request identifier of the Environment deployment execution history record + :type request_identifier: str + :param resource_id: Resource Id + :type resource_id: int + :param result: Result of the environment deployment execution + :type result: object + :param scope_id: Project Id + :type scope_id: str + :param service_owner: Service owner Id + :type service_owner: str + :param stage_attempt: Stage Attempt + :type stage_attempt: int + :param stage_name: Stage name + :type stage_name: str + :param start_time: Start time of the environment deployment execution + :type start_time: datetime + """ + + _attribute_map = { + 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, + 'environment_id': {'key': 'environmentId', 'type': 'int'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'long'}, + 'job_attempt': {'key': 'jobAttempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'}, + 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, + 'plan_id': {'key': 'planId', 'type': 'str'}, + 'plan_type': {'key': 'planType', 'type': 'str'}, + 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, + 'request_identifier': {'key': 'requestIdentifier', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'int'}, + 'result': {'key': 'result', 'type': 'object'}, + 'scope_id': {'key': 'scopeId', 'type': 'str'}, + 'service_owner': {'key': 'serviceOwner', 'type': 'str'}, + 'stage_attempt': {'key': 'stageAttempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'} + } + + def __init__(self, definition=None, environment_id=None, finish_time=None, id=None, job_attempt=None, job_name=None, owner=None, plan_id=None, plan_type=None, queue_time=None, request_identifier=None, resource_id=None, result=None, scope_id=None, service_owner=None, stage_attempt=None, stage_name=None, start_time=None): + super(EnvironmentDeploymentExecutionRecord, self).__init__() + self.definition = definition + self.environment_id = environment_id + self.finish_time = finish_time + self.id = id + self.job_attempt = job_attempt + self.job_name = job_name + self.owner = owner + self.plan_id = plan_id + self.plan_type = plan_type + self.queue_time = queue_time + self.request_identifier = request_identifier + self.resource_id = resource_id + self.result = result + self.scope_id = scope_id + self.service_owner = service_owner + self.stage_attempt = stage_attempt + self.stage_name = stage_name + self.start_time = start_time + + +class EnvironmentInstance(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 project: Project information for environment. + :type project: :class:`ProjectReference ` + :param resources: + :type resources: list of :class:`EnvironmentResourceReference ` + """ + + _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'}, + 'project': {'key': 'project', 'type': 'ProjectReference'}, + 'resources': {'key': 'resources', 'type': '[EnvironmentResourceReference]'} + } + + def __init__(self, created_by=None, created_on=None, description=None, id=None, last_modified_by=None, last_modified_on=None, name=None, project=None, resources=None): + super(EnvironmentInstance, 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.project = project + self.resources = resources + + +class EnvironmentReference(Model): + """ + :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 EnvironmentResource(Model): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource 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'}, + 'tags': {'key': 'tags', '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, tags=None, type=None): + super(EnvironmentResource, 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.tags = tags + self.type = type + + +class EnvironmentResourceReference(Model): + """ + EnvironmentResourceReference. + + :param id: Id of the resource. + :type id: int + :param name: Name of the resource. + :type name: str + :param tags: Tags of the Environment Resource Reference. + :type tags: list of str + :param type: Type of the resource. + :type type: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, id=None, name=None, tags=None, type=None): + super(EnvironmentResourceReference, self).__init__() + self.id = id + self.name = name + self.tags = tags + self.type = type + + +class EnvironmentUpdateParameter(Model): + """ + Properties to update Environment. + + :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): + """ + :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): + """ + :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): + """ + :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 InputDescriptor(Model): + """ + Describes an input for subscriptions. + + :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): + """ + Describes what values are valid for a subscription input + + :param data_type: Gets or sets the data type to validate. + :type data_type: object + :param is_required: Gets or sets if this is a required field. + :type is_required: bool + :param max_length: Gets or sets the maximum length of this descriptor. + :type max_length: int + :param max_value: Gets or sets the minimum value for this descriptor. + :type max_value: decimal + :param min_length: Gets or sets the minimum length of this descriptor. + :type min_length: int + :param min_value: Gets or sets the minimum value for this descriptor. + :type min_value: decimal + :param pattern: Gets or sets the pattern to validate. + :type pattern: str + :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. + :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): + """ + :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): + """ + Information about a single value for an input + + :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): + """ + Information about the possible/allowed values for a given subscription input + + :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): + """ + Error information related to a subscription input value. + + :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 KubernetesResource(EnvironmentResource): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource type + :type type: object + :param cluster_name: + :type cluster_name: str + :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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + '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, tags=None, type=None, cluster_name=None, namespace=None, service_endpoint_id=None): + super(KubernetesResource, 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, tags=tags, type=type) + self.cluster_name = cluster_name + self.namespace = namespace + self.service_endpoint_id = service_endpoint_id + + +class KubernetesResourceCreateParameters(Model): + """ + :param cluster_name: + :type cluster_name: str + :param name: + :type name: str + :param namespace: + :type namespace: str + :param tags: Tags of the kubernetes resource. + :type tags: list of str + """ + + _attribute_map = { + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, cluster_name=None, name=None, namespace=None, tags=None): + super(KubernetesResourceCreateParameters, self).__init__() + self.cluster_name = cluster_name + self.name = name + self.namespace = namespace + self.tags = tags + + +class MetricsColumnMetaData(Model): + """ + Meta data for a metrics column. + + :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): + """ + Metrics columns header + + :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): + """ + Metrics row. + + :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): + """ + Represents a downloadable package. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + 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 ResourceLimit(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Represents an endpoint which may be used by an orchestration job. + + :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 indicator + :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: Gets or sets the owner of the endpoint. + :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): + """ + :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): + """ + :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): + """ + Represents service endpoint execution data. + + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Represents type of the service endpoint. + + :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 TaskAgentAuthorization(Model): + """ + Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows. + + :param authorization_url: Endpoint used to obtain access tokens from the configured token service. + :type authorization_url: str + :param client_id: Client identifier for this agent. + :type client_id: str + :param public_key: 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): + """ + :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 acquisition_timeout: + :type acquisition_timeout: int + :param agent_cloud_id: + :type agent_cloud_id: int + :param get_account_parallelism_endpoint: + :type get_account_parallelism_endpoint: str + :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 id: + :type id: str + :param internal: Signifies that this Agent Cloud is internal and should not be user-manageable + :type internal: bool + :param max_parallelism: + :type max_parallelism: int + :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'}, + 'acquisition_timeout': {'key': 'acquisitionTimeout', 'type': 'int'}, + 'agent_cloud_id': {'key': 'agentCloudId', 'type': 'int'}, + 'get_account_parallelism_endpoint': {'key': 'getAccountParallelismEndpoint', 'type': 'str'}, + 'get_agent_definition_endpoint': {'key': 'getAgentDefinitionEndpoint', 'type': 'str'}, + 'get_agent_request_status_endpoint': {'key': 'getAgentRequestStatusEndpoint', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'internal': {'key': 'internal', 'type': 'bool'}, + 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, + '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, acquisition_timeout=None, agent_cloud_id=None, get_account_parallelism_endpoint=None, get_agent_definition_endpoint=None, get_agent_request_status_endpoint=None, id=None, internal=None, max_parallelism=None, name=None, release_agent_endpoint=None, shared_secret=None, type=None): + super(TaskAgentCloud, self).__init__() + self.acquire_agent_endpoint = acquire_agent_endpoint + self.acquisition_timeout = acquisition_timeout + self.agent_cloud_id = agent_cloud_id + self.get_account_parallelism_endpoint = get_account_parallelism_endpoint + self.get_agent_definition_endpoint = get_agent_definition_endpoint + self.get_agent_request_status_endpoint = get_agent_request_status_endpoint + self.id = id + self.internal = internal + self.max_parallelism = max_parallelism + self.name = name + self.release_agent_endpoint = release_agent_endpoint + self.shared_secret = shared_secret + self.type = type + + +class TaskAgentCloudRequest(Model): + """ + :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): + """ + :param display_name: Gets or sets the display name of agent 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 TaskAgentJobRequest(Model): + """ + A job request for an agent. + + :param agent_specification: + :type agent_specification: :class:`object ` + :param assign_time: The date/time this request was assigned. + :type assign_time: datetime + :param data: Additional data about the request. + :type data: dict + :param definition: The pipeline definition associated with this request + :type definition: :class:`TaskOrchestrationOwner ` + :param demands: A list of demands required to fulfill this request. + :type demands: list of :class:`object ` + :param finish_time: The date/time this request was finished. + :type finish_time: datetime + :param host_id: The host which triggered this request. + :type host_id: str + :param job_id: ID of the job resulting from this request. + :type job_id: str + :param job_name: Name of the job resulting from this request. + :type job_name: str + :param locked_until: The deadline for the agent to renew the lock. + :type locked_until: datetime + :param matched_agents: + :type matched_agents: list of :class:`TaskAgentReference ` + :param matches_all_agents_in_pool: + :type matches_all_agents_in_pool: bool + :param orchestration_id: + :type orchestration_id: str + :param owner: The pipeline associated with this request + :type owner: :class:`TaskOrchestrationOwner ` + :param plan_group: + :type plan_group: str + :param plan_id: Internal ID for the orchestration plan connected with this request. + :type plan_id: str + :param plan_type: Internal detail representing the type of orchestration plan. + :type plan_type: str + :param pool_id: The ID of the pool this request targets + :type pool_id: int + :param priority: + :type priority: int + :param queue_id: The ID of the queue this request targets + :type queue_id: int + :param queue_time: The date/time this request was queued. + :type queue_time: datetime + :param receive_time: The date/time this request was receieved by an agent. + :type receive_time: datetime + :param request_id: ID of the request. + :type request_id: long + :param reserved_agent: The agent allocated for this request. + :type reserved_agent: :class:`TaskAgentReference ` + :param result: The result of this request. + :type result: object + :param scope_id: Scope of the pipeline; matches the project ID. + :type scope_id: str + :param service_owner: The service which owns this request. + :type service_owner: str + :param status_message: + :type status_message: str + :param user_delayed: + :type user_delayed: bool + """ + + _attribute_map = { + '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]'}, + '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]'}, + 'matches_all_agents_in_pool': {'key': 'matchesAllAgentsInPool', 'type': 'bool'}, + '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'}, + 'priority': {'key': 'priority', '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'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'user_delayed': {'key': 'userDelayed', 'type': 'bool'} + } + + def __init__(self, agent_specification=None, assign_time=None, data=None, definition=None, demands=None, finish_time=None, host_id=None, job_id=None, job_name=None, locked_until=None, matched_agents=None, matches_all_agents_in_pool=None, orchestration_id=None, owner=None, plan_group=None, plan_id=None, plan_type=None, pool_id=None, priority=None, queue_id=None, queue_time=None, receive_time=None, request_id=None, reserved_agent=None, result=None, scope_id=None, service_owner=None, status_message=None, user_delayed=None): + super(TaskAgentJobRequest, self).__init__() + self.agent_specification = agent_specification + self.assign_time = assign_time + self.data = data + self.definition = definition + self.demands = demands + 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.matches_all_agents_in_pool = matches_all_agents_in_pool + 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.priority = priority + 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 + self.status_message = status_message + self.user_delayed = user_delayed + + +class TaskAgentMessage(Model): + """ + Provides a contract for receiving messages from the task orchestrator. + + :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 initialization 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + 'pool_type': {'key': 'poolType', 'type': 'object'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None): + super(TaskAgentPoolReference, self).__init__() + self.id = id + self.is_hosted = is_hosted + self.is_legacy = is_legacy + self.name = name + self.options = options + self.pool_type = pool_type + self.scope = scope + self.size = size + + +class TaskAgentPublicKey(Model): + """ + Represents the public key portion of an RSA asymmetric key. + + :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): + """ + An agent queue. + + :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): + """ + A reference to an agent. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param access_point: This agent's access point. + :type access_point: str + :param enabled: Whether or not this agent should run jobs. + :type enabled: bool + :param id: Identifier of the agent. + :type id: int + :param name: Name of the agent. + :type name: str + :param os_description: Agent OS. + :type os_description: str + :param provisioning_state: Provisioning state of this agent. + :type provisioning_state: str + :param status: Whether or not the agent is online. + :type status: object + :param version: Agent version. + :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): + """ + Represents a session for performing message exchanges from an agent. + + :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): + """ + Represents a symmetric key used for message-level encryption for communication sent to an agent. + + :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): + """ + Details about an agent update. + + :param current_state: Current state of this agent update. + :type current_state: str + :param reason: Reason for this update. + :type reason: :class:`TaskAgentUpdateReason ` + :param requested_by: Identity which requested this update. + :type requested_by: :class:`IdentityRef ` + :param request_time: Date on which this update was requested. + :type request_time: datetime + :param source_version: Source agent version of the update. + :type source_version: :class:`PackageVersion ` + :param target_version: Target agent version of the 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): + """ + :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 TaskCommandRestrictions(Model): + """ + :param mode: + :type mode: object + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'object'} + } + + def __init__(self, mode=None): + super(TaskCommandRestrictions, self).__init__() + self.mode = mode + + +class TaskDefinition(Model): + """ + :param _build_config_mapping: + :type _build_config_mapping: dict + :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 ecosystem: + :type ecosystem: str + :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 help_url: + :type help_url: 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 restrictions: + :type restrictions: :class:`TaskRestrictions ` + :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 = { + '_build_config_mapping': {'key': '_buildConfigMapping', 'type': '{str}'}, + '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'}, + 'ecosystem': {'key': 'ecosystem', 'type': 'str'}, + 'execution': {'key': 'execution', 'type': '{object}'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, + 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', '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'}, + 'restrictions': {'key': 'restrictions', 'type': 'TaskRestrictions'}, + '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, _build_config_mapping=None, 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, ecosystem=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, help_url=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, restrictions=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._build_config_mapping = _build_config_mapping + 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.ecosystem = ecosystem + self.execution = execution + self.friendly_name = friendly_name + self.groups = groups + self.help_mark_down = help_mark_down + self.help_url = help_url + 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.restrictions = restrictions + 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): + """ + :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. Essentially, 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): + """ + :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): + """ + :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): + """ + :param _build_config_mapping: + :type _build_config_mapping: dict + :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 ecosystem: + :type ecosystem: str + :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 help_url: + :type help_url: 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 restrictions: + :type restrictions: :class:`TaskRestrictions ` + :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 = { + '_build_config_mapping': {'key': '_buildConfigMapping', 'type': '{str}'}, + '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'}, + 'ecosystem': {'key': 'ecosystem', 'type': 'str'}, + 'execution': {'key': 'execution', 'type': '{object}'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, + 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', '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'}, + 'restrictions': {'key': 'restrictions', 'type': 'TaskRestrictions'}, + '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, _build_config_mapping=None, 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, ecosystem=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, help_url=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, restrictions=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__(_build_config_mapping=_build_config_mapping, 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, ecosystem=ecosystem, execution=execution, friendly_name=friendly_name, groups=groups, help_mark_down=help_mark_down, help_url=help_url, 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, restrictions=restrictions, 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): + """ + :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): + """ + :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): + """ + :param comment: + :type comment: str + :param file_id: + :type file_id: int + :param changed_by: + :type changed_by: :class:`IdentityRef ` + :param changed_date: + :type changed_date: datetime + :param change_type: + :type change_type: object + :param major_version: + :type major_version: int + :param revision: + :type revision: int + :param task_group_id: + :type task_group_id: str + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'file_id': {'key': 'fileId', 'type': 'int'}, + 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, + 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, + 'change_type': {'key': 'changeType', 'type': 'object'}, + 'major_version': {'key': 'majorVersion', 'type': 'int'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'task_group_id': {'key': 'taskGroupId', 'type': 'str'} + } + + def __init__(self, comment=None, file_id=None, changed_by=None, changed_date=None, change_type=None, major_version=None, revision=None, task_group_id=None): + super(TaskGroupRevision, self).__init__() + self.comment = comment + self.file_id = file_id + self.changed_by = changed_by + self.changed_date = changed_date + self.change_type = change_type + self.major_version = major_version + self.revision = revision + self.task_group_id = task_group_id + + +class TaskGroupStep(Model): + """ + Represents tasks in the task group. + + :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 retry_count_on_task_failure: Gets or sets the maximum number of retries + :type retry_count_on_task_failure: int + :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}'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, + '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, retry_count_on_task_failure=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.retry_count_on_task_failure = retry_count_on_task_failure + self.task = task + self.timeout_in_minutes = timeout_in_minutes + + +class TaskGroupUpdateParameter(Model): + """ + :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 TaskGroupUpdatePropertiesBase(Model): + """ + :param comment: Comment for this update request + :type comment: str + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'} + } + + def __init__(self, comment=None): + super(TaskGroupUpdatePropertiesBase, self).__init__() + self.comment = comment + + +class TaskHubLicenseDetails(Model): + """ + :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 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'}, + '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, 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.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): + """ + :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 TaskOrchestrationOwner(Model): + """ + :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): + """ + :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): + """ + :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): + """ + A reference to a task. + + :param id: The ID of the task definition. Corresponds to the id value of task.json file.
Example: CmdLineV2 { "id": "D9BAFED4-0B18-4F58-968D-86655B4D2CE9" } + :type id: str + :param inputs: A dictionary of inputs specific to a task definition. Corresponds to inputs value of task.json file. + :type inputs: dict + :param name: The name of the task definition. Corresponds to the name value of task.json file.
Example: CmdLineV2 { "name": "CmdLine" } + :type name: str + :param version: The version of the task definition. Corresponds to the version value of task.json file.
Example: CmdLineV2 { "version": { "Major": 2, "Minor": 212, "Patch": 0 } } + :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 TaskRestrictions(Model): + """ + :param commands: + :type commands: :class:`TaskCommandRestrictions ` + :param settable_variables: + :type settable_variables: :class:`TaskVariableRestrictions ` + """ + + _attribute_map = { + 'commands': {'key': 'commands', 'type': 'TaskCommandRestrictions'}, + 'settable_variables': {'key': 'settableVariables', 'type': 'TaskVariableRestrictions'} + } + + def __init__(self, commands=None, settable_variables=None): + super(TaskRestrictions, self).__init__() + self.commands = commands + self.settable_variables = settable_variables + + +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 TaskVariableRestrictions(Model): + """ + :param allowed: + :type allowed: list of str + """ + + _attribute_map = { + 'allowed': {'key': 'allowed', 'type': '[str]'} + } + + def __init__(self, allowed=None): + super(TaskVariableRestrictions, self).__init__() + self.allowed = allowed + + +class TaskVersion(Model): + """ + :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): + """ + :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): + """ + A variable group is a collection of related variables. + + :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 variable_group_project_references: all project references where the variable group is shared with other projects. + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + '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, variable_group_project_references=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.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupParameters(Model): + """ + :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 variable_group_project_references: + :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` + :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'}, + 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, + 'variables': {'key': 'variables', 'type': '{VariableValue}'} + } + + def __init__(self, description=None, name=None, provider_data=None, type=None, variable_group_project_references=None, variables=None): + super(VariableGroupParameters, self).__init__() + self.description = description + self.name = name + self.provider_data = provider_data + self.type = type + self.variable_group_project_references = variable_group_project_references + self.variables = variables + + +class VariableGroupProjectReference(Model): + """ + A variable group reference is a shallow reference to variable group. + + :param description: Gets or sets description of the variable group. + :type description: str + :param name: Gets or sets name of the variable group. + :type name: str + :param project_reference: Gets or sets project reference of the variable group. + :type project_reference: :class:`ProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} + } + + def __init__(self, description=None, name=None, project_reference=None): + super(VariableGroupProjectReference, self).__init__() + self.description = description + self.name = name + self.project_reference = project_reference + + +class VariableGroupProviderData(Model): + """ + Defines provider data of the variable group. + + """ + + _attribute_map = { + } + + def __init__(self): + super(VariableGroupProviderData, self).__init__() + + +class VariableValue(Model): + """ + A wrapper class for a generic variable. + + :param is_read_only: Indicates whether the variable can be changed during script's execution runtime. + :type is_read_only: bool + :param is_secret: Indicates whether the variable should be encrypted at rest. + :type is_secret: bool + :param value: The value of the variable. + :type value: str + """ + + _attribute_map = { + 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + 'value': {'key': 'value', 'type': 'str'} + } + + def __init__(self, is_read_only=None, is_secret=None, value=None): + super(VariableValue, self).__init__() + self.is_read_only = is_read_only + self.is_secret = is_secret + self.value = value + + +class VirtualMachine(Model): + """ + :param agent: + :type agent: :class:`TaskAgent ` + :param id: + :type id: int + :param tags: + :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(VirtualMachine, self).__init__() + self.agent = agent + self.id = id + self.tags = tags + + +class VirtualMachineGroup(EnvironmentResource): + """ + :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 tags: Tags of the Environment Resource. + :type tags: list of str + :param type: Environment resource type + :type type: object + :param pool_id: + :type pool_id: int + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'object'}, + 'pool_id': {'key': 'poolId', 'type': 'int'} + } + + def __init__(self, created_by=None, created_on=None, environment_reference=None, id=None, last_modified_by=None, last_modified_on=None, name=None, tags=None, type=None, pool_id=None): + super(VirtualMachineGroup, 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, tags=tags, type=type) + self.pool_id = pool_id + + +class VirtualMachineGroupCreateParameters(Model): + """ + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(VirtualMachineGroupCreateParameters, self).__init__() + self.name = name + + +class DataSourceBinding(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 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(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, request_content=request_content, request_verb=request_verb, result_selector=result_selector, result_template=result_template, target=target) + + +class DeploymentGroup(DeploymentGroupReference): + """ + Deployment group. + + :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): + """ + :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 TaskAgent(TaskAgentReference): + """ + A task agent. + + :param _links: + :type _links: :class:`ReferenceLinks ` + :param access_point: This agent's access point. + :type access_point: str + :param enabled: Whether or not this agent should run jobs. + :type enabled: bool + :param id: Identifier of the agent. + :type id: int + :param name: Name of the agent. + :type name: str + :param os_description: Agent OS. + :type os_description: str + :param provisioning_state: Provisioning state of this agent. + :type provisioning_state: str + :param status: Whether or not the agent is online. + :type status: object + :param version: Agent version. + :type version: str + :param assigned_agent_cloud_request: The agent cloud request that's currently associated with this agent. + :type assigned_agent_cloud_request: :class:`TaskAgentCloudRequest ` + :param assigned_request: The request which is currently assigned to this agent. + :type assigned_request: :class:`TaskAgentJobRequest ` + :param authorization: Authorization information for this agent. + :type authorization: :class:`TaskAgentAuthorization ` + :param created_on: Date on which this agent was created. + :type created_on: datetime + :param last_completed_request: The last request which was completed by this agent. + :type last_completed_request: :class:`TaskAgentJobRequest ` + :param max_parallelism: Maximum job parallelism allowed for this agent. + :type max_parallelism: int + :param pending_update: Pending update for this agent. + :type pending_update: :class:`TaskAgentUpdate ` + :param properties: + :type properties: :class:`object ` + :param status_changed_on: Date on which the last connectivity status change occurred. + :type status_changed_on: datetime + :param system_capabilities: System-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities. + :type system_capabilities: dict + :param user_capabilities: User-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing 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): + """ + An organization-level grouping of agents. + + :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 is_legacy: Determines whether the pool is legacy. + :type is_legacy: bool + :param name: + :type name: str + :param options: Additional pool settings and details + :type options: object + :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: The ID of the associated agent cloud. + :type agent_cloud_id: int + :param auto_provision: Whether or not a queue should be automatically provisioned for each project collection. + :type auto_provision: bool + :param auto_size: Whether or not the pool should autosize itself based on the Agent Cloud Provider settings. + :type auto_size: bool + :param auto_update: Whether or not agents in this pool are allowed to automatically update + :type auto_update: bool + :param created_by: Creator of the 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: The date/time of the pool creation. + :type created_on: datetime + :param owner: Owner or administrator of the pool. + :type owner: :class:`IdentityRef ` + :param properties: + :type properties: :class:`object ` + :param target_size: Target parallelism - Only applies to agent pools that are backed by pool providers. It will be null for regular pools. + :type target_size: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, + 'is_legacy': {'key': 'isLegacy', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'options': {'key': 'options', 'type': 'object'}, + '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'}, + 'auto_update': {'key': 'autoUpdate', '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'}, + 'target_size': {'key': 'targetSize', 'type': 'int'} + } + + def __init__(self, id=None, is_hosted=None, is_legacy=None, name=None, options=None, pool_type=None, scope=None, size=None, agent_cloud_id=None, auto_provision=None, auto_size=None, auto_update=None, created_by=None, created_on=None, owner=None, properties=None, target_size=None): + super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, is_legacy=is_legacy, name=name, options=options, 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.auto_update = auto_update + self.created_by = created_by + self.created_on = created_on + self.owner = owner + self.properties = properties + self.target_size = target_size + + +class TaskInputDefinition(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(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): + """ + :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__ = [ + 'AuthenticationSchemeReference', + 'AuthorizationHeader', + 'AzureManagementGroup', + 'AzureManagementGroupQueryResult', + 'AzureSubscription', + 'AzureSubscriptionQueryResult', + 'ClientCertificate', + 'DataSource', + 'DataSourceBindingBase', + 'DataSourceDetails', + 'DependencyBinding', + 'DependencyData', + 'DependsOn', + 'DeploymentGroupCreateParameter', + 'DeploymentGroupCreateParameterPoolProperty', + 'DeploymentGroupMetrics', + 'DeploymentGroupReference', + 'DeploymentGroupUpdateParameter', + 'DeploymentMachine', + 'DeploymentMachineGroupReference', + 'DeploymentPoolSummary', + 'DeploymentTargetUpdateParameter', + 'EndpointAuthorization', + 'EndpointUrl', + 'EnvironmentCreateParameter', + 'EnvironmentDeploymentExecutionRecord', + 'EnvironmentInstance', + 'EnvironmentReference', + 'EnvironmentResource', + 'EnvironmentResourceReference', + 'EnvironmentUpdateParameter', + 'GraphSubjectBase', + 'HelpLink', + 'IdentityRef', + 'InputDescriptor', + 'InputValidation', + 'InputValidationRequest', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'KubernetesResource', + 'KubernetesResourceCreateParameters', + 'MetricsColumnMetaData', + 'MetricsColumnsHeader', + 'MetricsRow', + 'PackageMetadata', + 'PackageVersion', + 'ProjectReference', + 'PublishTaskGroupMetadata', + 'ReferenceLinks', + 'ResourceLimit', + 'ResourceUsage', + 'ResultTransformationDetails', + 'SecureFile', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'TaskAgentAuthorization', + 'TaskAgentCloud', + 'TaskAgentCloudRequest', + 'TaskAgentCloudType', + 'TaskAgentJobRequest', + 'TaskAgentMessage', + 'TaskAgentPoolMaintenanceDefinition', + 'TaskAgentPoolMaintenanceJob', + 'TaskAgentPoolMaintenanceJobTargetAgent', + 'TaskAgentPoolMaintenanceOptions', + 'TaskAgentPoolMaintenanceRetentionPolicy', + 'TaskAgentPoolMaintenanceSchedule', + 'TaskAgentPoolReference', + 'TaskAgentPublicKey', + 'TaskAgentQueue', + 'TaskAgentReference', + 'TaskAgentSession', + 'TaskAgentSessionKey', + 'TaskAgentUpdate', + 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', + 'TaskDefinition', + 'TaskDefinitionEndpoint', + 'TaskDefinitionReference', + 'TaskExecution', + 'TaskGroup', + 'TaskGroupCreateParameter', + 'TaskGroupDefinition', + 'TaskGroupRevision', + 'TaskGroupStep', + 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', + 'TaskHubLicenseDetails', + 'TaskInputDefinitionBase', + 'TaskInputValidation', + 'TaskOrchestrationOwner', + 'TaskOutputVariable', + 'TaskPackageMetadata', + 'TaskReference', + 'TaskRestrictions', + 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', + 'TaskVersion', + 'ValidationItem', + 'VariableGroup', + 'VariableGroupParameters', + 'VariableGroupProjectReference', + 'VariableGroupProviderData', + 'VariableValue', + 'VirtualMachine', + 'VirtualMachineGroup', + 'VirtualMachineGroupCreateParameters', + 'DataSourceBinding', + 'DeploymentGroup', + 'DeploymentMachineGroup', + 'TaskAgent', + 'TaskAgentPool', + 'TaskInputDefinition', + 'TaskSourceDefinition', +] diff --git a/azure-devops/azure/devops/v7_1/task_agent/task_agent_client.py b/azure-devops/azure/devops/v7_1/task_agent/task_agent_client.py new file mode 100644 index 00000000..fec90d55 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/task_agent/task_agent_client.py @@ -0,0 +1,1214 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-preview.1') + return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) + + def update_agent_cloud(self, updated_cloud, agent_cloud_id): + """UpdateAgentCloud. + [Preview API] + :param :class:` ` updated_cloud: + :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') + content = self._serialize.body(updated_cloud, 'TaskAgentCloud') + response = self._send(http_method='PATCH', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentCloud', 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='7.1-preview.1') + return self._deserialize('[TaskAgentCloudType]', self._unwrap_collection(response)) + + def add_agent(self, agent, pool_id): + """AddAgent. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskAgent', response) + + def delete_agent(self, pool_id, agent_id): + """DeleteAgent. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskAgent', response) + + def update_agent(self, agent, pool_id, agent_id): + """UpdateAgent. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskAgent', 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='7.1-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='7.1-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='7.1-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: :class:`<[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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def get_environment_deployment_execution_records(self, project, environment_id, continuation_token=None, top=None): + """GetEnvironmentDeploymentExecutionRecords. + [Preview API] Get environment deployment execution history + :param str project: Project ID or project name + :param int environment_id: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentDeploymentExecutionRecord]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_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') + response = self._send(http_method='GET', + location_id='51bb5d21-4305-4ea6-9dbb-b7488af73334', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentDeploymentExecutionRecord]', self._unwrap_collection(response)) + + def add_environment(self, environment_create_parameter, project): + """AddEnvironment. + [Preview API] Create an environment. + :param :class:` ` environment_create_parameter: Environment 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(environment_create_parameter, 'EnvironmentCreateParameter') + response = self._send(http_method='POST', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def delete_environment(self, project, environment_id): + """DeleteEnvironment. + [Preview API] Delete the specified environment. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + self._send(http_method='DELETE', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.1-preview.1', + route_values=route_values) + + def get_environment_by_id(self, project, environment_id, expands=None): + """GetEnvironmentById. + [Preview API] Get an environment by its ID. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :param str expands: 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 environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if expands is not None: + query_parameters['expands'] = self._serialize.query('expands', expands, 'str') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('EnvironmentInstance', response) + + def get_environments(self, project, name=None, continuation_token=None, top=None): + """GetEnvironments. + [Preview API] Get all environments. + :param str project: Project ID or project name + :param str name: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentInstance]> ` + """ + 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 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') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentInstance]', self._unwrap_collection(response)) + + def update_environment(self, environment_update_parameter, project, environment_id): + """UpdateEnvironment. + [Preview API] Update the specified environment. + :param :class:` ` environment_update_parameter: Environment data to update. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(environment_update_parameter, 'EnvironmentUpdateParameter') + response = self._send(http_method='PATCH', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def add_kubernetes_resource(self, create_parameters, project, environment_id): + """AddKubernetesResource. + [Preview API] + :param :class:` ` create_parameters: + :param str project: Project ID or project name + :param int environment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(create_parameters, 'KubernetesResourceCreateParameters') + response = self._send(http_method='POST', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('KubernetesResource', response) + + def delete_kubernetes_resource(self, project, environment_id, resource_id): + """DeleteKubernetesResource. + [Preview API] + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + self._send(http_method='DELETE', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.1-preview.1', + route_values=route_values) + + def get_kubernetes_resource(self, project, environment_id, resource_id): + """GetKubernetesResource. + [Preview API] + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + response = self._send(http_method='GET', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('KubernetesResource', response) + + def add_agent_pool(self, pool): + """AddAgentPool. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('TaskAgentPool', response) + + def delete_agent_pool(self, pool_id): + """DeleteAgentPool. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_agent_pool(self, pool_id, properties=None, action_filter=None): + """GetAgentPool. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[TaskAgentPool]', self._unwrap_collection(response)) + + def update_agent_pool(self, pool, pool_id): + """UpdateAgentPool. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentPool', response) + + def add_agent_queue(self, queue, project=None, authorize_pipelines=None): + """AddAgentQueue. + [Preview API] Create a new agent queue to connect a project to an agent pool. + :param :class:` ` queue: Details about the queue to create + :param str project: Project ID or project name + :param bool authorize_pipelines: Automatically authorize this queue when using YAML + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if authorize_pipelines is not None: + query_parameters['authorizePipelines'] = self._serialize.query('authorize_pipelines', authorize_pipelines, 'bool') + content = self._serialize.body(queue, 'TaskAgentQueue') + response = self._send(http_method='POST', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TaskAgentQueue', response) + + def delete_agent_queue(self, queue_id, project=None): + """DeleteAgentQueue. + [Preview API] Removes an agent queue from a project. + :param int queue_id: The agent queue 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 queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + self._send(http_method='DELETE', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values) + + def get_agent_queue(self, queue_id, project=None, action_filter=None): + """GetAgentQueue. + [Preview API] Get information about an agent queue. + :param int queue_id: The agent queue to get information about + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + query_parameters = {} + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAgentQueue', response) + + def get_agent_queues(self, project=None, queue_name=None, action_filter=None): + """GetAgentQueues. + [Preview API] Get a list of agent queues. + :param str project: Project ID or project name + :param str queue_name: Filter on the agent queue name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_name is not None: + query_parameters['queueName'] = self._serialize.query('queue_name', queue_name, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_ids(self, queue_ids, project=None, action_filter=None): + """GetAgentQueuesByIds. + [Preview API] Get a list of agent queues by their IDs + :param [int] queue_ids: A comma-separated list of agent queue IDs to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_ids is not None: + queue_ids = ",".join(map(str, queue_ids)) + query_parameters['queueIds'] = self._serialize.query('queue_ids', queue_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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_names(self, queue_names, project=None, action_filter=None): + """GetAgentQueuesByNames. + [Preview API] Get a list of agent queues by their names + :param [str] queue_names: A comma-separated list of agent names to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_names is not None: + queue_names = ",".join(queue_names) + query_parameters['queueNames'] = self._serialize.query('queue_names', queue_names, '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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_for_pools(self, pool_ids, project=None, action_filter=None): + """GetAgentQueuesForPools. + [Preview API] Get a list of agent queues by pool ids + :param [int] pool_ids: A comma-separated list of pool ids to get the corresponding queues for + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(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='7.1-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='7.1-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='7.1-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, property_filters=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. + :param [str] property_filters: + :rtype: :class:`<[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') + 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='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def add_variable_group(self, variable_group_parameters): + """AddVariableGroup. + [Preview API] Add a variable group. + :param :class:` ` variable_group_parameters: + :rtype: :class:` ` + """ + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='POST', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.1-preview.2', + content=content) + return self._deserialize('VariableGroup', response) + + def delete_variable_group(self, group_id, project_ids): + """DeleteVariableGroup. + [Preview API] Delete a variable group + :param int group_id: Id of the variable group. + :param [str] project_ids: + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + self._send(http_method='DELETE', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + + def share_variable_group(self, variable_group_project_references, variable_group_id): + """ShareVariableGroup. + [Preview API] Add a variable group. + :param [VariableGroupProjectReference] variable_group_project_references: + :param int variable_group_id: + """ + query_parameters = {} + if variable_group_id is not None: + query_parameters['variableGroupId'] = self._serialize.query('variable_group_id', variable_group_id, 'int') + content = self._serialize.body(variable_group_project_references, '[VariableGroupProjectReference]') + self._send(http_method='PATCH', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.1-preview.2', + query_parameters=query_parameters, + content=content) + + def update_variable_group(self, variable_group_parameters, group_id): + """UpdateVariableGroup. + [Preview API] Update a variable group. + :param :class:` ` variable_group_parameters: + :param int group_id: Id of the variable group to update. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='PUT', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('VariableGroup', response) + + 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='7.1-preview.2', + 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='7.1-preview.2', + 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) + + def get_yaml_schema(self, validate_task_names=None): + """GetYamlSchema. + [Preview API] GET the Yaml schema used for Yaml file validation. + :param bool validate_task_names: Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). + :rtype: object + """ + query_parameters = {} + if validate_task_names is not None: + query_parameters['validateTaskNames'] = self._serialize.query('validate_task_names', validate_task_names, 'bool') + response = self._send(http_method='GET', + location_id='1f9990b9-1dba-441f-9c2e-6485888c42b6', + version='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('object', response) + diff --git a/azure-devops/azure/devops/v7_1/test/__init__.py b/azure-devops/azure/devops/v7_1/test/__init__.py new file mode 100644 index 00000000..b6456e75 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test/__init__.py @@ -0,0 +1,129 @@ +# -------------------------------------------------------------------------------------------- +# 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', + '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' +] diff --git a/azure-devops/azure/devops/v7_1/test/models.py b/azure-devops/azure/devops/v7_1/test/models.py new file mode 100644 index 00000000..f05f5b00 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test/models.py @@ -0,0 +1,4679 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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): + """ + :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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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 BuildConfiguration(Model): + """ + BuildConfiguration Details. + + :param branch_name: Branch name for which build is generated. + :type branch_name: str + :param build_definition_id: BuildDefinitionId for build. + :type build_definition_id: int + :param build_system: Build system. + :type build_system: str + :param creation_date: Build Creation Date. + :type creation_date: datetime + :param flavor: Build flavor (eg Build/Release). + :type flavor: str + :param id: BuildConfiguration Id. + :type id: int + :param number: Build Number. + :type number: str + :param platform: BuildConfiguration Platform. + :type platform: str + :param project: Project associated with this BuildConfiguration. + :type project: :class:`ShallowReference ` + :param repository_guid: Repository Guid for the Build. + :type repository_guid: str + :param repository_id: Repository Id. + :type repository_id: int + :param repository_type: Repository Type (eg. TFSGit). + :type repository_type: str + :param source_version: Source Version(/first commit) for the build was triggered. + :type source_version: str + :param target_branch_name: Target BranchName. + :type target_branch_name: str + :param uri: Build 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'}, + 'target_branch_name': {'key': 'targetBranchName', '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, target_branch_name=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.target_branch_name = target_branch_name + self.uri = uri + + +class BuildCoverage(Model): + """ + Build Coverage Detail + + :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): + """ + Reference to a build. + + :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): + """ + Detail About Clone Operation. + + :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 Succeeded or Failed, the operation is complete + :type state: object + :param url: Url for getting 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): + """ + Clone options for cloning the test suite. + + :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 hierarchy + :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): + """ + Clone Statistics Details. + + :param cloned_requirements_count: Number of requirements 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): + """ + Represents the build configuration (platform, flavor) and coverage data for the build + + :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): + """ + Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) + + :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): + """ + Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build + + :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 ` + :param status: Uri of build against which difference in coverage is computed + :type status: object + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'ShallowReference'}, + 'coverage_data': {'key': 'coverageData', 'type': '[CodeCoverageData]'}, + 'delta_build': {'key': 'deltaBuild', 'type': 'ShallowReference'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, build=None, coverage_data=None, delta_build=None, status=None): + super(CodeCoverageSummary, self).__init__() + self.build = build + self.coverage_data = coverage_data + self.delta_build = delta_build + self.status = status + + +class CoverageStatistics(Model): + """ + :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): + """ + A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool) + + :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): + """ + :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): + """ + This is a temporary class to provide the details for the test run environment. + + :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): + """ + Failing since information of a test result. + + :param build: Build reference since failing. + :type build: :class:`BuildReference ` + :param date: Time since failing(UTC). + :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): + """ + :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): + """ + :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): + """ + :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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +class LastResultDetails(Model): + """ + Last result details of test point. + + :param date_completed: Completed date of last result. + :type date_completed: datetime + :param duration: Duration of the last result in milliseconds. + :type duration: long + :param run_by: The user who executed the last result. + :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): + """ + :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): + """ + :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): + """ + :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): + """ + Name value pair + + :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 PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +class PlanUpdateModel(Model): + """ + A model class used for creating and updating test plans. + + :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): + """ + Adding test cases to a suite creates one of more test points based on the default configurations and testers assigned to the test suite. PointAssignment is the list of test points that were created for each of the test cases that were added to the test suite. + + :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): + """ + Filter class for test point. + + :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): + """ + Model to update test point. + + :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): + """ + The class to represent a Generic store for test session data. + + :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): + """ + :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): + """ + 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 ReleaseEnvironmentDefinitionReference(Model): + """ + Reference to release environment resource. + + :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): + """ + Reference to a release. + + :param attempt: Number of Release Attempt. + :type attempt: int + :param creation_date: Release Creation Date(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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): + """ + Test result retention settings + + :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): + """ + :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): + """ + Test run create details. + + :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: BuildReference of the test run. + :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: Additional properties of test Run. + :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: Filter used for discovering the Run. + :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 pipeline_reference: Reference of the pipeline to which this test run belongs. PipelineReference.PipelineId should be equal to RunCreateModel.Build.Id + :type pipeline_reference: :class:`PipelineReference ` + :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: Reference to release associated with test run. + :type release_reference: :class:`ReleaseReference ` + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param run_timeout: Timespan till the run times out. + :type run_timeout: object + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :type source_workflow: str + :param start_date: Start date time of the run. + :type start_date: str + :param state: The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting + :type state: str + :param tags: Tags to attach with the test run, maximum of 5 tags can be added to run. + :type tags: list of :class:`TestTag ` + :param test_configurations_mapping: TestConfigurationMapping of the test run. + :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 of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun) + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'run_timeout': {'key': 'runTimeout', 'type': 'object'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=None, plan=None, point_ids=None, release_environment_uri=None, release_reference=None, release_uri=None, run_summary=None, run_timeout=None, source_workflow=None, start_date=None, state=None, tags=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.pipeline_reference = pipeline_reference + 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_summary = run_summary + self.run_timeout = run_timeout + self.source_workflow = source_workflow + self.start_date = start_date + self.state = state + self.tags = tags + 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): + """ + This class is used to provide the filters used for discovery + + :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): + """ + Test run statistics per outcome. + + :param count: Test result count fo the given outcome. + :type count: int + :param outcome: Test result outcome + :type outcome: str + :param resolution_state: Test run Resolution State. + :type resolution_state: :class:`TestResolutionState ` + :param result_metadata: ResultMetadata for the given outcome/count. + :type result_metadata: object + :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'}, + 'result_metadata': {'key': 'resultMetadata', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, count=None, outcome=None, resolution_state=None, result_metadata=None, state=None): + super(RunStatistic, self).__init__() + self.count = count + self.outcome = outcome + self.resolution_state = resolution_state + self.result_metadata = result_metadata + self.state = state + + +class RunSummaryModel(Model): + """ + Run summary for each output type of test. + + :param duration: Total time taken in milliseconds. + :type duration: long + :param result_count: Number of results for Outcome TestOutcome + :type result_count: int + :param test_outcome: Summary is based on outcome + :type test_outcome: object + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'long'}, + 'result_count': {'key': 'resultCount', 'type': 'int'}, + 'test_outcome': {'key': 'testOutcome', 'type': 'object'} + } + + def __init__(self, duration=None, result_count=None, test_outcome=None): + super(RunSummaryModel, self).__init__() + self.duration = duration + self.result_count = result_count + self.test_outcome = test_outcome + + +class RunUpdateModel(Model): + """ + :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 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: true to delete inProgess Results , false otherwise. + :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: URI of release environment associated with the run. + :type release_environment_uri: str + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :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: The types of sub states for test run. + :type substate: object + :param tags: Tags to attach with the test run. + :type tags: list of :class:`TestTag ` + :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 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'}, + 'run_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'started_date': {'key': 'startedDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'substate': {'key': 'substate', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, run_summary=None, source_workflow=None, started_date=None, state=None, substate=None, tags=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.run_summary = run_summary + self.source_workflow = source_workflow + self.started_date = started_date + self.state = state + self.substate = substate + self.tags = tags + self.test_environment_id = test_environment_id + self.test_settings = test_settings + + +class ShallowReference(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :param automated_test_name: + :type automated_test_name: str + :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 tags: + :type tags: list of str + :param test_case_title: + :type test_case_title: str + """ + + _attribute_map = { + 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} + } + + def __init__(self, automated_test_name=None, 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, tags=None, test_case_title=None): + super(ShallowTestCaseResult, self).__init__() + self.automated_test_name = automated_test_name + 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.tags = tags + self.test_case_title = test_case_title + + +class SharedStepModel(Model): + """ + Reference to shared step workitem. + + :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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +class SuiteCreateModel(Model): + """ + Suite create model + + :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): + """ + A suite entry defines properties for a test suite. + + :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): + """ + A model to define sequence of test suite entries in a test suite. + + :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): + """ + Test case for the suite. + + :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): + """ + Test suite update model. + + :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): + """ + Test suite update model. + + :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): + """ + The Team Context for an operation. + + :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): + """ + 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 TestAttachment(Model): + """ + :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): + """ + Reference to test attachment. + + :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): + """ + Test attachment request model + + :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): + """ + Represents a test result. + + :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: TypeId of automated test. + :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 with maxSize= 1000 chars. + :type comment: str + :param completed_date: Time when test execution completed(UTC). Completed date should be greater than StartedDate. + :type completed_date: datetime + :param computer_name: Machine name where test executed. + :type computer_name: str + :param configuration: Reference to test configuration. Type ShallowReference. + :type configuration: :class:`ShallowReference ` + :param created_date: Timestamp when test result created(UTC). + :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. If not provided value will be set as CompletedDate - StartedDate + :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. Valid Value= (Known Issue, New Issue, Regression, Unknown, None) + :type failure_type: str + :param id: ID of a test result. + :type id: int + :param iteration_details: Test result details of test iterations used only for Manual Testing. + :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(UTC). + :type last_updated_date: datetime + :param outcome: Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted) + :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: ResetCount. + :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 with maxSize= 1000 chars. + :type stack_trace: str + :param started_date: Time when test execution started(UTC). + :type started_date: datetime + :param state: State of test result. Type TestRunState. + :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 TestResultMetaData + :type test_case_reference_id: int + :param test_case_revision: TestCaseRevision Number. + :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): + """ + Test attachment information in a test iteration. + + :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): + """ + Reference to a test result. + + :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): + """ + :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): + """ + Test configuration + + :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 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): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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): + """ + :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): + """ + :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 TestFlakyIdentifier(Model): + """ + Test Flaky Identifier + + :param branch_name: Branch Name where Flakiness has to be Marked/Unmarked + :type branch_name: str + :param is_flaky: State for Flakiness + :type is_flaky: bool + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'is_flaky': {'key': 'isFlaky', 'type': 'bool'} + } + + def __init__(self, branch_name=None, is_flaky=None): + super(TestFlakyIdentifier, self).__init__() + self.branch_name = branch_name + self.is_flaky = is_flaky + + +class TestHistoryQuery(Model): + """ + Filter to get TestCase result history. + + :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 BuildDefinitionId. 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 test_case_id: Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname + :type test_case_id: int + :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]'}, + 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, + '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, test_case_id=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.test_case_id = test_case_id + self.trend_days = trend_days + + +class TestIterationDetailsModel(Model): + """ + Represents a test iteration result. + + :param action_results: Test step results in an iteration. + :type action_results: list of :class:`TestActionResultModel ` + :param attachments: Reference 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(UTC). + :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(UTC). + :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): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :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): + """ + Class representing a reference to an operation. + + :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): + """ + Test outcome settings + + :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): + """ + The test plan resource. + + :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): + """ + :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): + """ + Test point. + + :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): + """ + Test point query class. + + :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): + """ + Test Resolution State Details. + + :param id: Test Resolution state Id. + :type id: int + :param name: Test Resolution State 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): + """ + :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): + """ + :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): + """ + :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): + """ + :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): + """ + List of test results filtered on the basis of GroupByValue + + :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): + """ + Represents a Meta Data of a test result. + + :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 flaky_identifiers: List of Flaky Identifier for TestCaseReferenceId + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + :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'}, + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'}, + '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, flaky_identifiers=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.flaky_identifiers = flaky_identifiers + 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): + """ + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :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): + """ + Test parameter information in a test iteration. + + :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. Deprecated in hosted environment. + :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): + """ + :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): + """ + :param build: + :type build: :class:`BuildReference ` + :param context_type: + :type context_type: object + :param pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + self.release = release + + +class TestResultsDetails(Model): + """ + :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): + """ + :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 + :param tags: + :type tags: list of str + """ + + _attribute_map = { + 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, + 'results': {'key': 'results', 'type': '[TestCaseResult]'}, + 'results_count_by_outcome': {'key': 'resultsCountByOutcome', 'type': '{AggregatedResultsByOutcome}'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, group_by_value=None, results=None, results_count_by_outcome=None, tags=None): + super(TestResultsDetailsForGroup, self).__init__() + self.group_by_value = group_by_value + self.results = results + self.results_count_by_outcome = results_count_by_outcome + self.tags = tags + + +class TestResultsGroupsForBuild(Model): + """ + :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): + """ + :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): + """ + :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): + """ + :param aggregated_results_analysis: + :type aggregated_results_analysis: :class:`AggregatedResultsAnalysis ` + :param no_config_runs_count: + :type no_config_runs_count: int + :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 ` + :param total_runs_count: + :type total_runs_count: int + """ + + _attribute_map = { + 'aggregated_results_analysis': {'key': 'aggregatedResultsAnalysis', 'type': 'AggregatedResultsAnalysis'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'team_project': {'key': 'teamProject', 'type': 'TeamProjectReference'}, + 'test_failures': {'key': 'testFailures', 'type': 'TestFailuresAnalysis'}, + 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, aggregated_results_analysis=None, no_config_runs_count=None, team_project=None, test_failures=None, test_results_context=None, total_runs_count=None): + super(TestResultSummary, self).__init__() + self.aggregated_results_analysis = aggregated_results_analysis + self.no_config_runs_count = no_config_runs_count + self.team_project = team_project + self.test_failures = test_failures + self.test_results_context = test_results_context + self.total_runs_count = total_runs_count + + +class TestResultTrendFilter(Model): + """ + :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): + """ + Test run details. + + :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: Test Run Controller. + :type controller: str + :param created_date: Test Run CreatedDate. + :type created_date: datetime + :param custom_fields: List of Custom Fields for TestRun. + :type custom_fields: list of :class:`CustomTestField ` + :param drop_location: Drop Location for the test Run. + :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: Number of 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: Number of 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: Phase/State for the testRun. + :type phase: str + :param pipeline_reference: Reference of the pipeline to which this test run belongs. + :type pipeline_reference: :class:`PipelineReference ` + :param plan: Test plan associated with this test run. + :type plan: :class:`ShallowReference ` + :param post_process_state: Post Process State. + :type post_process_state: str + :param project: Project associated with this run. + :type project: :class:`ShallowReference ` + :param release: Release Reference for the Test Run. + :type release: :class:`ReleaseReference ` + :param release_environment_uri: Release Environment Uri for TestRun. + :type release_environment_uri: str + :param release_uri: Release Uri for TestRun. + :type release_uri: str + :param revision: + :type revision: int + :param run_statistics: RunSummary by outcome. + :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. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation + :type state: str + :param substate: TestRun Substate. + :type substate: object + :param tags: Tags attached with this test run. + :type tags: list of :class:`TestTag ` + :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: Number of failed tests in the run. + :type unanalyzed_tests: int + :param url: Url of the test run + :type url: str + :param web_access_url: Web Access Url for TestRun. + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=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, tags=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.pipeline_reference = pipeline_reference + 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.tags = tags + 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): + """ + Test Run Code Coverage Details + + :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): + """ + Test run statistics. + + :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): + """ + Test Session + + :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): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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): + """ + Represents a sub result of a test result. + + :param comment: Comment in sub result. + :type comment: str + :param completed_date: Time when test execution completed(UTC). + :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(UTC). + :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(UTC). + :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): + """ + Test suite + + :param area_uri: Area uri of the test suite. + :type area_uri: str + :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 children: Child test suites of current test suite. + :type children: list of :class:`TestSuite ` + :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'}, + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[ShallowReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[ShallowReference]'}, + 'children': {'key': 'children', 'type': '[TestSuite]'}, + '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, default_configurations=None, default_testers=None, children=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.default_configurations = default_configurations + self.default_testers = default_testers + self.children = children + 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): + """ + Test suite clone request + + :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): + """ + :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 TestTag(Model): + """ + Tag attached to a run or result. + + :param name: Name of the tag, alphanumeric value less than 30 chars + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(TestTag, self).__init__() + self.name = name + + +class TestToWorkItemLinks(Model): + """ + :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): + """ + :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): + """ + WorkItem reference Details. + + :param id: WorkItem Id. + :type id: str + :param name: WorkItem Name. + :type name: str + :param type: WorkItem Type. + :type type: str + :param url: WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case) + :type url: str + :param web_url: WorkItem WebUrl. + :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): + """ + :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): + """ + Represents a test step result. + + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :type started_date: datetime + :param action_path: Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step + :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. Deprecated in hosted environment. + :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', + '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', + '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', + 'TestActionResultModel', +] diff --git a/azure-devops/azure/devops/v7_1/test/test_client.py b/azure-devops/azure/devops/v7_1/test/test_client.py new file mode 100644 index 00000000..b60cb4e6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test/test_client.py @@ -0,0 +1,1181 @@ +# -------------------------------------------------------------------------------------------- +# 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 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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_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='7.1-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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestRunCoverage]', self._unwrap_collection(response)) + + def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, include_action_results=None): + """GetTestIteration. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestIterationDetailsModel]', self._unwrap_collection(response)) + + def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): + """GetPoint. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.6', + 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. + [Preview API] 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='7.1-preview.6', + 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. + [Preview API] 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='7.1-preview.6', + 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. + [Preview API] 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='7.1-preview.6', + route_values=route_values, + content=content) + return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) + + def get_test_run_statistics(self, project, run_id): + """GetTestRunStatistics. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('TestRunStatistic', response) + + def create_test_run(self, test_run, project): + """CreateTestRun. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('TestRun', response) + + def delete_test_run(self, project, run_id): + """DeleteTestRun. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + + def get_test_run_by_id(self, project, run_id, include_details=None): + """GetTestRunById. + [Preview API] 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: Default value is true. It includes details like run statistics, release, build, test environment, 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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 separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma separated 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 separated list of valid ids (limit no. of ids 10). + :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma separated 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 separated 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:`<[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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestSession', response) + + def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): + """AddTestCasesToSuite. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('SuiteTestCase', response) + + def get_test_cases(self, project, plan_id, suite_id): + """GetTestCases. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + + def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id, suite_id, test_case_ids): + """UpdateSuiteTestCases. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('[SuiteTestCase]', 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='7.1-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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('TestHistoryQuery', response) + diff --git a/azure-devops/azure/devops/v7_1/test_plan/__init__.py b/azure-devops/azure/devops/v7_1/test_plan/__init__.py new file mode 100644 index 00000000..e37d1710 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_plan/__init__.py @@ -0,0 +1,78 @@ +# -------------------------------------------------------------------------------------------- +# 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_plan_client import TestPlanClient + +__all__ = [ + 'BuildDefinitionReference', + 'CloneOperationCommonResponse', + 'CloneOptions', + 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', + 'CloneTestPlanOperationInformation', + 'CloneTestPlanParams', + 'CloneTestSuiteOperationInformation', + 'CloneTestSuiteParams', + 'Configuration', + 'DestinationTestPlanCloneParams', + 'DestinationTestSuiteInfo', + 'GraphSubjectBase', + 'IdentityRef', + 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', + 'NameValuePair', + 'PointAssignment', + 'ReferenceLinks', + 'ReleaseEnvironmentDefinitionReference', + 'Results', + 'SourceTestPlanInfo', + 'SourceTestplanResponse', + 'SourceTestSuiteInfo', + 'SourceTestSuiteResponse', + 'SuiteEntry', + 'SuiteEntryUpdateParams', + 'SuiteTestCaseCreateUpdateParameters', + 'TeamProjectReference', + 'TestCase', + 'TestCaseAssociatedResult', + 'TestCaseReference', + 'TestCaseResultsData', + 'TestConfiguration', + 'TestConfigurationCreateUpdateParameters', + 'TestConfigurationReference', + 'TestEntityCount', + 'TestEnvironment', + 'TestOutcomeSettings', + 'TestPlan', + 'TestPlanCreateParams', + 'TestPlanDetailedReference', + 'TestPlanReference', + 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', + 'TestPlanUpdateParams', + 'TestPoint', + 'TestPointDetailedReference', + 'TestPointResults', + 'TestPointUpdateParams', + 'TestSettings', + 'TestSuite', + 'TestSuiteCreateParams', + 'TestSuiteCreateUpdateCommonParams', + 'TestSuiteReference', + 'TestSuiteReferenceWithProject', + 'TestSuiteUpdateParams', + 'TestVariable', + 'TestVariableCreateUpdateParameters', + 'WorkItem', + 'WorkItemDetails', + 'TestPlanClient' +] diff --git a/azure-devops/azure/devops/v7_1/test_plan/models.py b/azure-devops/azure/devops/v7_1/test_plan/models.py new file mode 100644 index 00000000..cc31e67b --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_plan/models.py @@ -0,0 +1,2284 @@ +# -------------------------------------------------------------------------------------------- +# 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 BuildDefinitionReference(Model): + """ + The build definition reference resource + + :param id: ID of the build definition + :type id: int + :param name: Name of the build definition + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(BuildDefinitionReference, self).__init__() + self.id = id + self.name = name + + +class CloneOperationCommonResponse(Model): + """ + Common Response for clone operation + + :param clone_statistics: Various statistics related to the clone operation + :type clone_statistics: :class:`CloneStatistics ` + :param completion_date: Completion data of the operation + :type completion_date: datetime + :param creation_date: Creation data of the operation + :type creation_date: datetime + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param message: Message related to the job + :type message: str + :param op_id: Clone operation Id + :type op_id: int + :param state: Clone operation state + :type state: object + """ + + _attribute_map = { + 'clone_statistics': {'key': 'cloneStatistics', 'type': 'CloneStatistics'}, + 'completion_date': {'key': 'completionDate', 'type': 'iso-8601'}, + 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'message': {'key': 'message', 'type': 'str'}, + 'op_id': {'key': 'opId', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, clone_statistics=None, completion_date=None, creation_date=None, links=None, message=None, op_id=None, state=None): + super(CloneOperationCommonResponse, self).__init__() + self.clone_statistics = clone_statistics + self.completion_date = completion_date + self.creation_date = creation_date + self.links = links + self.message = message + self.op_id = op_id + self.state = state + + +class CloneOptions(Model): + """ + Clone options for cloning the test suite. + + :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 hierarchy + :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): + """ + Clone Statistics Details. + + :param cloned_requirements_count: Number of requirements 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 CloneTestCaseOperationInformation(Model): + """ + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneTestCaseOptions ` + :param destination_test_suite: Information of destination Test Suite + :type destination_test_suite: :class:`TestSuiteReferenceWithProject ` + :param source_test_suite: Information of source Test Suite + :type source_test_suite: :class:`SourceTestSuiteResponse ` + """ + + _attribute_map = { + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneTestCaseOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteResponse'} + } + + def __init__(self, clone_operation_response=None, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestCaseOperationInformation, self).__init__() + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class CloneTestCaseOptions(Model): + """ + :param include_attachments: If set to true, include the attachments + :type include_attachments: bool + :param include_links: If set to true, include the links + :type include_links: bool + :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 = { + 'include_attachments': {'key': 'includeAttachments', 'type': 'bool'}, + 'include_links': {'key': 'includeLinks', 'type': 'bool'}, + 'related_link_comment': {'key': 'relatedLinkComment', 'type': 'str'} + } + + def __init__(self, include_attachments=None, include_links=None, related_link_comment=None): + super(CloneTestCaseOptions, self).__init__() + self.include_attachments = include_attachments + self.include_links = include_links + self.related_link_comment = related_link_comment + + +class CloneTestCaseParams(Model): + """ + Parameters for Test Suite clone operation + + :param clone_options: Test Case Clone create parameters + :type clone_options: :class:`CloneTestCaseOptions ` + :param destination_test_plan: Information about destination Test Plan + :type destination_test_plan: :class:`TestPlanReference ` + :param destination_test_suite: Information about destination Test Suite + :type destination_test_suite: :class:`DestinationTestSuiteInfo ` + :param source_test_plan: Information about source Test Plan + :type source_test_plan: :class:`TestPlanReference ` + :param source_test_suite: Information about source Test Suite + :type source_test_suite: :class:`SourceTestSuiteInfo ` + :param test_case_ids: Test Case IDs + :type test_case_ids: list of int + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneTestCaseOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'TestPlanReference'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'DestinationTestSuiteInfo'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'TestPlanReference'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteInfo'}, + 'test_case_ids': {'key': 'testCaseIds', 'type': '[int]'} + } + + def __init__(self, clone_options=None, destination_test_plan=None, destination_test_suite=None, source_test_plan=None, source_test_suite=None, test_case_ids=None): + super(CloneTestCaseParams, self).__init__() + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.destination_test_suite = destination_test_suite + self.source_test_plan = source_test_plan + self.source_test_suite = source_test_suite + self.test_case_ids = test_case_ids + + +class CloneTestPlanOperationInformation(Model): + """ + Response for Test Plan clone operation + + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_plan: Information of destination Test Plan + :type destination_test_plan: :class:`TestPlan ` + :param source_test_plan: Information of source Test Plan + :type source_test_plan: :class:`SourceTestplanResponse ` + """ + + _attribute_map = { + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'TestPlan'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'SourceTestplanResponse'} + } + + def __init__(self, clone_operation_response=None, clone_options=None, destination_test_plan=None, source_test_plan=None): + super(CloneTestPlanOperationInformation, self).__init__() + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.source_test_plan = source_test_plan + + +class CloneTestPlanParams(Model): + """ + Parameters for Test Plan clone operation + + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_plan: Information about destination Test Plan + :type destination_test_plan: :class:`DestinationTestPlanCloneParams ` + :param source_test_plan: Information about source Test Plan + :type source_test_plan: :class:`SourceTestPlanInfo ` + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'DestinationTestPlanCloneParams'}, + 'source_test_plan': {'key': 'sourceTestPlan', 'type': 'SourceTestPlanInfo'} + } + + def __init__(self, clone_options=None, destination_test_plan=None, source_test_plan=None): + super(CloneTestPlanParams, self).__init__() + self.clone_options = clone_options + self.destination_test_plan = destination_test_plan + self.source_test_plan = source_test_plan + + +class CloneTestSuiteOperationInformation(Model): + """ + Response for Test Suite clone operation + + :param cloned_test_suite: Information of newly cloned Test Suite + :type cloned_test_suite: :class:`TestSuiteReferenceWithProject ` + :param clone_operation_response: Various information related to the clone + :type clone_operation_response: :class:`CloneOperationCommonResponse ` + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_suite: Information of destination Test Suite + :type destination_test_suite: :class:`TestSuiteReferenceWithProject ` + :param source_test_suite: Information of source Test Suite + :type source_test_suite: :class:`TestSuiteReferenceWithProject ` + """ + + _attribute_map = { + 'cloned_test_suite': {'key': 'clonedTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'clone_operation_response': {'key': 'cloneOperationResponse', 'type': 'CloneOperationCommonResponse'}, + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'TestSuiteReferenceWithProject'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'TestSuiteReferenceWithProject'} + } + + def __init__(self, cloned_test_suite=None, clone_operation_response=None, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestSuiteOperationInformation, self).__init__() + self.cloned_test_suite = cloned_test_suite + self.clone_operation_response = clone_operation_response + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class CloneTestSuiteParams(Model): + """ + Parameters for Test Suite clone operation + + :param clone_options: Test Plan Clone create parameters + :type clone_options: :class:`CloneOptions ` + :param destination_test_suite: Information about destination Test Suite + :type destination_test_suite: :class:`DestinationTestSuiteInfo ` + :param source_test_suite: Information about source Test Suite + :type source_test_suite: :class:`SourceTestSuiteInfo ` + """ + + _attribute_map = { + 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, + 'destination_test_suite': {'key': 'destinationTestSuite', 'type': 'DestinationTestSuiteInfo'}, + 'source_test_suite': {'key': 'sourceTestSuite', 'type': 'SourceTestSuiteInfo'} + } + + def __init__(self, clone_options=None, destination_test_suite=None, source_test_suite=None): + super(CloneTestSuiteParams, self).__init__() + self.clone_options = clone_options + self.destination_test_suite = destination_test_suite + self.source_test_suite = source_test_suite + + +class Configuration(Model): + """ + Configuration of the Test Point + + :param configuration_id: Id of the Configuration Assigned to the Test Point + :type configuration_id: int + """ + + _attribute_map = { + 'configuration_id': {'key': 'configurationId', 'type': 'int'} + } + + def __init__(self, configuration_id=None): + super(Configuration, self).__init__() + self.configuration_id = configuration_id + + +class DestinationTestSuiteInfo(Model): + """ + Destination Test Suite information for Test Suite clone operation + + :param id: Destination Suite Id + :type id: int + :param project: Destination Project Name + :type project: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'str'} + } + + def __init__(self, id=None, project=None): + super(DestinationTestSuiteInfo, self).__init__() + self.id = id + 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 LastResultDetails(Model): + """ + Last result details of test point. + + :param date_completed: Completed date of last result. + :type date_completed: datetime + :param duration: Duration of the last result in milliseconds. + :type duration: long + :param run_by: The user who executed the last result. + :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 LibraryWorkItemsData(Model): + """ + This data model is used in Work item-based tabs of Test Plans Library. + + :param column_options: Specifies the column option field names + :type column_options: list of str + :param continuation_token: Continuation token to fetch next set of elements. Present only when HasMoreElements is true. + :type continuation_token: str + :param exceeded_work_item_query_limit: Boolean indicating if the WIQL query has exceeded the limit of items returned. + :type exceeded_work_item_query_limit: bool + :param has_more_elements: Boolean indicating if there are more elements present than what are being sent. + :type has_more_elements: bool + :param return_code: Specifies if there was an error while execution of data provider. + :type return_code: object + :param work_item_ids: List of work items returned when OrderByField is sent something other than Id. + :type work_item_ids: list of int + :param work_items: List of work items to be returned. + :type work_items: list of :class:`WorkItemDetails ` + """ + + _attribute_map = { + 'column_options': {'key': 'columnOptions', 'type': '[str]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'exceeded_work_item_query_limit': {'key': 'exceededWorkItemQueryLimit', 'type': 'bool'}, + 'has_more_elements': {'key': 'hasMoreElements', 'type': 'bool'}, + 'return_code': {'key': 'returnCode', 'type': 'object'}, + 'work_item_ids': {'key': 'workItemIds', 'type': '[int]'}, + 'work_items': {'key': 'workItems', 'type': '[WorkItemDetails]'} + } + + def __init__(self, column_options=None, continuation_token=None, exceeded_work_item_query_limit=None, has_more_elements=None, return_code=None, work_item_ids=None, work_items=None): + super(LibraryWorkItemsData, self).__init__() + self.column_options = column_options + self.continuation_token = continuation_token + self.exceeded_work_item_query_limit = exceeded_work_item_query_limit + self.has_more_elements = has_more_elements + self.return_code = return_code + self.work_item_ids = work_item_ids + self.work_items = work_items + + +class LibraryWorkItemsDataProviderRequest(Model): + """ + This is the request data contract for LibraryTestCaseDataProvider. + + :param column_options: Specifies the list of column options to show in test cases table. + :type column_options: list of str + :param continuation_token: The continuation token required for paging of work items. This is required when getting subsequent sets of work items when OrderByField is Id. + :type continuation_token: str + :param filter_values: List of filter values to be supplied. Currently supported filters are Title, State, AssignedTo, Priority, AreaPath. + :type filter_values: list of :class:`TestPlansLibraryWorkItemFilter ` + :param is_ascending: Whether the data is to be sorted in ascending or descending order. When not supplied, defaults to descending. + :type is_ascending: bool + :param library_query_type: The type of query to run. + :type library_query_type: object + :param order_by_field: Work item field on which to order the results. When not supplied, defaults to work item IDs. + :type order_by_field: str + :param work_item_ids: List of work items to query for field details. This is required when getting subsequent sets of work item fields when OrderByField is other than Id. + :type work_item_ids: list of int + """ + + _attribute_map = { + 'column_options': {'key': 'columnOptions', 'type': '[str]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'filter_values': {'key': 'filterValues', 'type': '[TestPlansLibraryWorkItemFilter]'}, + 'is_ascending': {'key': 'isAscending', 'type': 'bool'}, + 'library_query_type': {'key': 'libraryQueryType', 'type': 'object'}, + 'order_by_field': {'key': 'orderByField', 'type': 'str'}, + 'work_item_ids': {'key': 'workItemIds', 'type': '[int]'} + } + + def __init__(self, column_options=None, continuation_token=None, filter_values=None, is_ascending=None, library_query_type=None, order_by_field=None, work_item_ids=None): + super(LibraryWorkItemsDataProviderRequest, self).__init__() + self.column_options = column_options + self.continuation_token = continuation_token + self.filter_values = filter_values + self.is_ascending = is_ascending + self.library_query_type = library_query_type + self.order_by_field = order_by_field + self.work_item_ids = work_item_ids + + +class NameValuePair(Model): + """ + Name value pair + + :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 PointAssignment(Configuration): + """ + Assignments for the Test Point + + :param configuration_id: Id of the Configuration Assigned to the Test Point + :type configuration_id: int + :param configuration_name: Name of the Configuration Assigned to the Test Point + :type configuration_name: str + :param id: Id of the Test Point + :type id: int + :param tester: Tester Assigned to the Test Point + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'configuration_id': {'key': 'configurationId', 'type': 'int'}, + 'configuration_name': {'key': 'configurationName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, configuration_id=None, configuration_name=None, id=None, tester=None): + super(PointAssignment, self).__init__(configuration_id=configuration_id) + self.configuration_name = configuration_name + self.id = id + self.tester = tester + + +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 ReleaseEnvironmentDefinitionReference(Model): + """ + Reference to release environment resource. + + :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 Results(Model): + """ + Results class for Test Point + + :param outcome: Outcome of the Test Point + :type outcome: object + """ + + _attribute_map = { + 'outcome': {'key': 'outcome', 'type': 'object'} + } + + def __init__(self, outcome=None): + super(Results, self).__init__() + self.outcome = outcome + + +class SourceTestPlanInfo(Model): + """ + Source Test Plan information for Test Plan clone operation + + :param id: ID of the source Test Plan + :type id: int + :param suite_ids: Id of suites to be cloned inside source Test Plan + :type suite_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'suite_ids': {'key': 'suiteIds', 'type': '[int]'} + } + + def __init__(self, id=None, suite_ids=None): + super(SourceTestPlanInfo, self).__init__() + self.id = id + self.suite_ids = suite_ids + + +class SourceTestSuiteInfo(Model): + """ + Source Test Suite information for Test Suite clone operation + + :param id: Id of the Source Test Suite + :type id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, id=None): + super(SourceTestSuiteInfo, self).__init__() + self.id = id + + +class SuiteEntryUpdateParams(Model): + """ + A suite entry defines properties for a test suite. + + :param id: Id of the suite entry in the test suite: either a test case id or child suite id. + :type id: int + :param sequence_number: Sequence number for the suite entry object in the test suite. + :type sequence_number: int + :param suite_entry_type: Defines whether the entry is of type test case or suite. + :type suite_entry_type: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'suite_entry_type': {'key': 'suiteEntryType', 'type': 'object'} + } + + def __init__(self, id=None, sequence_number=None, suite_entry_type=None): + super(SuiteEntryUpdateParams, self).__init__() + self.id = id + self.sequence_number = sequence_number + self.suite_entry_type = suite_entry_type + + +class SuiteTestCaseCreateUpdateParameters(Model): + """ + Create and Update Suite Test Case Parameters + + :param point_assignments: Configurations Ids + :type point_assignments: list of :class:`Configuration ` + :param work_item: Id of Test Case to be updated or created + :type work_item: :class:`WorkItem ` + """ + + _attribute_map = { + 'point_assignments': {'key': 'pointAssignments', 'type': '[Configuration]'}, + 'work_item': {'key': 'workItem', 'type': 'WorkItem'} + } + + def __init__(self, point_assignments=None, work_item=None): + super(SuiteTestCaseCreateUpdateParameters, self).__init__() + self.point_assignments = point_assignments + self.work_item = work_item + + +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 TestCase(Model): + """ + Test Case Class + + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param order: Order of the TestCase in the Suite + :type order: int + :param point_assignments: List of Points associated with the Test Case + :type point_assignments: list of :class:`PointAssignment ` + :param project: Project under which the Test Case is + :type project: :class:`TeamProjectReference ` + :param test_plan: Test Plan under which the Test Case is + :type test_plan: :class:`TestPlanReference ` + :param test_suite: Test Suite under which the Test Case is + :type test_suite: :class:`TestSuiteReference ` + :param work_item: Work Item details of the TestCase + :type work_item: :class:`WorkItemDetails ` + """ + + _attribute_map = { + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'order': {'key': 'order', 'type': 'int'}, + 'point_assignments': {'key': 'pointAssignments', 'type': '[PointAssignment]'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanReference'}, + 'test_suite': {'key': 'testSuite', 'type': 'TestSuiteReference'}, + 'work_item': {'key': 'workItem', 'type': 'WorkItemDetails'} + } + + def __init__(self, links=None, order=None, point_assignments=None, project=None, test_plan=None, test_suite=None, work_item=None): + super(TestCase, self).__init__() + self.links = links + self.order = order + self.point_assignments = point_assignments + self.project = project + self.test_plan = test_plan + self.test_suite = test_suite + self.work_item = work_item + + +class TestCaseAssociatedResult(Model): + """ + :param completed_date: + :type completed_date: datetime + :param configuration: + :type configuration: :class:`TestConfigurationReference ` + :param outcome: + :type outcome: object + :param plan: + :type plan: :class:`TestPlanReference ` + :param point_id: + :type point_id: int + :param result_id: + :type result_id: int + :param run_by: + :type run_by: :class:`IdentityRef ` + :param run_id: + :type run_id: int + :param suite: + :type suite: :class:`TestSuiteReference ` + :param tester: + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'point_id': {'key': 'pointId', 'type': 'int'}, + 'result_id': {'key': 'resultId', 'type': 'int'}, + 'run_by': {'key': 'runBy', 'type': 'IdentityRef'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'suite': {'key': 'suite', 'type': 'TestSuiteReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, completed_date=None, configuration=None, outcome=None, plan=None, point_id=None, result_id=None, run_by=None, run_id=None, suite=None, tester=None): + super(TestCaseAssociatedResult, self).__init__() + self.completed_date = completed_date + self.configuration = configuration + self.outcome = outcome + self.plan = plan + self.point_id = point_id + self.result_id = result_id + self.run_by = run_by + self.run_id = run_id + self.suite = suite + self.tester = tester + + +class TestCaseReference(Model): + """ + Test Case Reference + + :param assigned_to: Identity to whom the test case is assigned + :type assigned_to: :class:`IdentityRef ` + :param id: Test Case Id + :type id: int + :param name: Test Case Name + :type name: str + :param state: State of the test case work item + :type state: str + """ + + _attribute_map = { + 'assigned_to': {'key': 'assignedTo', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, assigned_to=None, id=None, name=None, state=None): + super(TestCaseReference, self).__init__() + self.assigned_to = assigned_to + self.id = id + self.name = name + self.state = state + + +class TestCaseResultsData(Model): + """ + This data model is used in TestCaseResultsDataProvider and populates the data required for initial page load + + :param context_point: Point information from where the execution history was viewed. Used to set initial filters. + :type context_point: :class:`TestPointDetailedReference ` + :param results: Use to store the results displayed in the table + :type results: list of :class:`TestCaseAssociatedResult ` + :param test_case_name: Test Case Name to be displayed in the table header + :type test_case_name: str + """ + + _attribute_map = { + 'context_point': {'key': 'contextPoint', 'type': 'TestPointDetailedReference'}, + 'results': {'key': 'results', 'type': '[TestCaseAssociatedResult]'}, + 'test_case_name': {'key': 'testCaseName', 'type': 'str'} + } + + def __init__(self, context_point=None, results=None, test_case_name=None): + super(TestCaseResultsData, self).__init__() + self.context_point = context_point + self.results = results + self.test_case_name = test_case_name + + +class TestConfigurationCreateUpdateParameters(Model): + """ + Test Configuration Create or Update Parameters + + :param description: Description of the configuration + :type description: str + :param is_default: Is the configuration a default for the test plans + :type is_default: bool + :param name: Name of the configuration + :type name: str + :param state: State of the configuration + :type state: object + :param values: Dictionary of Test Variable, Selected Value + :type values: list of :class:`NameValuePair ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'object'}, + 'values': {'key': 'values', 'type': '[NameValuePair]'} + } + + def __init__(self, description=None, is_default=None, name=None, state=None, values=None): + super(TestConfigurationCreateUpdateParameters, self).__init__() + self.description = description + self.is_default = is_default + self.name = name + self.state = state + self.values = values + + +class TestConfigurationReference(Model): + """ + Test Configuration Reference + + :param id: Id of the configuration + :type id: int + :param name: Name of the configuration + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestConfigurationReference, self).__init__() + self.id = id + self.name = name + + +class TestEntityCount(Model): + """ + Test Entity Count Used to store test cases count (define tab) and test point count (execute tab) Used to store test cases count (define tab) and test point count (execute tab) + + :param count: Test Entity Count + :type count: int + :param test_plan_id: Test Plan under which the Test Entities are + :type test_plan_id: int + :param test_suite_id: Test Suite under which the Test Entities are + :type test_suite_id: int + :param total_count: Total test entities in the suite without the applied filters + :type total_count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'test_plan_id': {'key': 'testPlanId', 'type': 'int'}, + 'test_suite_id': {'key': 'testSuiteId', 'type': 'int'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, count=None, test_plan_id=None, test_suite_id=None, total_count=None): + super(TestEntityCount, self).__init__() + self.count = count + self.test_plan_id = test_plan_id + self.test_suite_id = test_suite_id + self.total_count = total_count + + +class TestEnvironment(Model): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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 TestOutcomeSettings(Model): + """ + Test outcome settings + + :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 TestPlanCreateParams(Model): + """ + The test plan create parameters. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 ` + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None): + super(TestPlanCreateParams, self).__init__() + self.area_path = area_path + self.automated_test_environment = automated_test_environment + self.automated_test_settings = automated_test_settings + self.build_definition = build_definition + self.build_id = build_id + 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.test_outcome_settings = test_outcome_settings + + +class TestPlanReference(Model): + """ + The test plan reference resource. + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestPlanReference, self).__init__() + self.id = id + self.name = name + + +class TestPlansHubRefreshData(Model): + """ + This data model is used in TestPlansHubRefreshDataProvider and populates the data required for initial page load + + :param define_column_option_fields: + :type define_column_option_fields: list of str + :param define_tab_custom_column_field_map: + :type define_tab_custom_column_field_map: dict + :param error_message: + :type error_message: str + :param execute_column_option_fields: + :type execute_column_option_fields: list of str + :param execute_tab_custom_column_field_map: + :type execute_tab_custom_column_field_map: dict + :param is_advanced_extension_enabled: + :type is_advanced_extension_enabled: bool + :param selected_pivot_id: + :type selected_pivot_id: str + :param selected_suite_id: + :type selected_suite_id: int + :param test_case_page_size: + :type test_case_page_size: int + :param test_cases: + :type test_cases: list of :class:`TestCase ` + :param test_cases_continuation_token: + :type test_cases_continuation_token: str + :param test_plan: + :type test_plan: :class:`TestPlanDetailedReference ` + :param test_point_page_size: + :type test_point_page_size: int + :param test_points: + :type test_points: list of :class:`TestPoint ` + :param test_points_continuation_token: + :type test_points_continuation_token: str + :param test_suites: + :type test_suites: list of :class:`TestSuite ` + :param test_suites_continuation_token: + :type test_suites_continuation_token: str + """ + + _attribute_map = { + 'define_column_option_fields': {'key': 'defineColumnOptionFields', 'type': '[str]'}, + 'define_tab_custom_column_field_map': {'key': 'defineTabCustomColumnFieldMap', 'type': '{str}'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'execute_column_option_fields': {'key': 'executeColumnOptionFields', 'type': '[str]'}, + 'execute_tab_custom_column_field_map': {'key': 'executeTabCustomColumnFieldMap', 'type': '{str}'}, + 'is_advanced_extension_enabled': {'key': 'isAdvancedExtensionEnabled', 'type': 'bool'}, + 'selected_pivot_id': {'key': 'selectedPivotId', 'type': 'str'}, + 'selected_suite_id': {'key': 'selectedSuiteId', 'type': 'int'}, + 'test_case_page_size': {'key': 'testCasePageSize', 'type': 'int'}, + 'test_cases': {'key': 'testCases', 'type': '[TestCase]'}, + 'test_cases_continuation_token': {'key': 'testCasesContinuationToken', 'type': 'str'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanDetailedReference'}, + 'test_point_page_size': {'key': 'testPointPageSize', 'type': 'int'}, + 'test_points': {'key': 'testPoints', 'type': '[TestPoint]'}, + 'test_points_continuation_token': {'key': 'testPointsContinuationToken', 'type': 'str'}, + 'test_suites': {'key': 'testSuites', 'type': '[TestSuite]'}, + 'test_suites_continuation_token': {'key': 'testSuitesContinuationToken', 'type': 'str'} + } + + def __init__(self, define_column_option_fields=None, define_tab_custom_column_field_map=None, error_message=None, execute_column_option_fields=None, execute_tab_custom_column_field_map=None, is_advanced_extension_enabled=None, selected_pivot_id=None, selected_suite_id=None, test_case_page_size=None, test_cases=None, test_cases_continuation_token=None, test_plan=None, test_point_page_size=None, test_points=None, test_points_continuation_token=None, test_suites=None, test_suites_continuation_token=None): + super(TestPlansHubRefreshData, self).__init__() + self.define_column_option_fields = define_column_option_fields + self.define_tab_custom_column_field_map = define_tab_custom_column_field_map + self.error_message = error_message + self.execute_column_option_fields = execute_column_option_fields + self.execute_tab_custom_column_field_map = execute_tab_custom_column_field_map + self.is_advanced_extension_enabled = is_advanced_extension_enabled + self.selected_pivot_id = selected_pivot_id + self.selected_suite_id = selected_suite_id + self.test_case_page_size = test_case_page_size + self.test_cases = test_cases + self.test_cases_continuation_token = test_cases_continuation_token + self.test_plan = test_plan + self.test_point_page_size = test_point_page_size + self.test_points = test_points + self.test_points_continuation_token = test_points_continuation_token + self.test_suites = test_suites + self.test_suites_continuation_token = test_suites_continuation_token + + +class TestPlansLibraryWorkItemFilter(Model): + """ + Container to hold information about a filter being applied in Test Plans Library. + + :param field_name: Work item field name on which the items are to be filtered. + :type field_name: str + :param field_values: Work item field values corresponding to the field name. + :type field_values: list of str + :param filter_mode: Mode of the filter. + :type filter_mode: object + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'field_values': {'key': 'fieldValues', 'type': '[str]'}, + 'filter_mode': {'key': 'filterMode', 'type': 'object'} + } + + def __init__(self, field_name=None, field_values=None, filter_mode=None): + super(TestPlansLibraryWorkItemFilter, self).__init__() + self.field_name = field_name + self.field_values = field_values + self.filter_mode = filter_mode + + +class TestPlanUpdateParams(TestPlanCreateParams): + """ + The test plan update parameters. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 revision: Revision of the test plan. + :type revision: int + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, revision=None): + super(TestPlanUpdateParams, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings) + self.revision = revision + + +class TestPoint(Model): + """ + Test Point Class + + :param comment: Comment associated to the Test Point + :type comment: str + :param configuration: Configuration associated with the Test Point + :type configuration: :class:`TestConfigurationReference ` + :param id: Id of the Test Point + :type id: int + :param is_active: Variable to decide whether the test case is Active or not + :type is_active: bool + :param is_automated: Is the Test Point for Automated Test Case or Manual + :type is_automated: bool + :param last_reset_to_active: Last Reset to Active Time Stamp for the Test Point + :type last_reset_to_active: datetime + :param last_updated_by: Last Updated details for the Test Point + :type last_updated_by: :class:`IdentityRef ` + :param last_updated_date: Last Update Time Stamp for the Test Point + :type last_updated_date: datetime + :param links: Reference links + :type links: :class:`ReferenceLinks ` + :param project: Project under which the Test Point is + :type project: :class:`TeamProjectReference ` + :param results: Results associated to the Test Point + :type results: :class:`TestPointResults ` + :param test_case_reference: Test Case Reference + :type test_case_reference: :class:`TestCaseReference ` + :param tester: Tester associated with the Test Point + :type tester: :class:`IdentityRef ` + :param test_plan: Test Plan under which the Test Point is + :type test_plan: :class:`TestPlanReference ` + :param test_suite: Test Suite under which the Test Point is + :type test_suite: :class:`TestSuiteReference ` + """ + + _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, + 'last_reset_to_active': {'key': 'lastResetToActive', 'type': 'iso-8601'}, + 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, + 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, + 'links': {'key': 'links', 'type': 'ReferenceLinks'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'results': {'key': 'results', 'type': 'TestPointResults'}, + 'test_case_reference': {'key': 'testCaseReference', 'type': 'TestCaseReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'}, + 'test_plan': {'key': 'testPlan', 'type': 'TestPlanReference'}, + 'test_suite': {'key': 'testSuite', 'type': 'TestSuiteReference'} + } + + def __init__(self, comment=None, configuration=None, id=None, is_active=None, is_automated=None, last_reset_to_active=None, last_updated_by=None, last_updated_date=None, links=None, project=None, results=None, test_case_reference=None, tester=None, test_plan=None, test_suite=None): + super(TestPoint, self).__init__() + self.comment = comment + self.configuration = configuration + self.id = id + self.is_active = is_active + self.is_automated = is_automated + self.last_reset_to_active = last_reset_to_active + self.last_updated_by = last_updated_by + self.last_updated_date = last_updated_date + self.links = links + self.project = project + self.results = results + self.test_case_reference = test_case_reference + self.tester = tester + self.test_plan = test_plan + self.test_suite = test_suite + + +class TestPointDetailedReference(Model): + """ + :param configuration: + :type configuration: :class:`TestConfigurationReference ` + :param plan: + :type plan: :class:`TestPlanReference ` + :param point_id: + :type point_id: int + :param suite: + :type suite: :class:`TestSuiteReference ` + :param tester: + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'configuration': {'key': 'configuration', 'type': 'TestConfigurationReference'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'point_id': {'key': 'pointId', 'type': 'int'}, + 'suite': {'key': 'suite', 'type': 'TestSuiteReference'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, configuration=None, plan=None, point_id=None, suite=None, tester=None): + super(TestPointDetailedReference, self).__init__() + self.configuration = configuration + self.plan = plan + self.point_id = point_id + self.suite = suite + self.tester = tester + + +class TestPointResults(Model): + """ + Test Point Results + + :param failure_type: Failure Type for the Test Point + :type failure_type: object + :param last_resolution_state: Last Resolution State Id for the Test Point + :type last_resolution_state: object + :param last_result_details: Last Result Details for the Test Point + :type last_result_details: :class:`LastResultDetails ` + :param last_result_id: Last Result Id + :type last_result_id: int + :param last_result_state: Last Result State of the Test Point + :type last_result_state: object + :param last_run_build_number: Last RUn Build Number for the Test Point + :type last_run_build_number: str + :param last_test_run_id: Last Test Run Id for the Test Point + :type last_test_run_id: int + :param outcome: Outcome of the Test Point + :type outcome: object + :param state: State of the Test Point + :type state: object + """ + + _attribute_map = { + 'failure_type': {'key': 'failureType', 'type': 'object'}, + 'last_resolution_state': {'key': 'lastResolutionState', 'type': 'object'}, + 'last_result_details': {'key': 'lastResultDetails', 'type': 'LastResultDetails'}, + 'last_result_id': {'key': 'lastResultId', 'type': 'int'}, + 'last_result_state': {'key': 'lastResultState', 'type': 'object'}, + 'last_run_build_number': {'key': 'lastRunBuildNumber', 'type': 'str'}, + 'last_test_run_id': {'key': 'lastTestRunId', 'type': 'int'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, failure_type=None, last_resolution_state=None, last_result_details=None, last_result_id=None, last_result_state=None, last_run_build_number=None, last_test_run_id=None, outcome=None, state=None): + super(TestPointResults, self).__init__() + self.failure_type = failure_type + self.last_resolution_state = last_resolution_state + self.last_result_details = last_result_details + self.last_result_id = last_result_id + self.last_result_state = last_result_state + self.last_run_build_number = last_run_build_number + self.last_test_run_id = last_test_run_id + self.outcome = outcome + self.state = state + + +class TestPointUpdateParams(Model): + """ + Test Point Update Parameters + + :param id: Id of Test Point to be updated + :type id: int + :param is_active: Reset the Test Point to Active + :type is_active: bool + :param results: Results of the test point + :type results: :class:`Results ` + :param tester: Tester of the Test Point + :type tester: :class:`IdentityRef ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'results': {'key': 'results', 'type': 'Results'}, + 'tester': {'key': 'tester', 'type': 'IdentityRef'} + } + + def __init__(self, id=None, is_active=None, results=None, tester=None): + super(TestPointUpdateParams, self).__init__() + self.id = id + self.is_active = is_active + self.results = results + self.tester = tester + + +class TestSettings(Model): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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 TestSuiteCreateUpdateCommonParams(Model): + """ + Test Suite Create/Update Common Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :param query_string: Test suite query string, for dynamic suites. + :type query_string: str + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None): + super(TestSuiteCreateUpdateCommonParams, self).__init__() + self.default_configurations = default_configurations + self.default_testers = default_testers + self.inherit_default_configurations = inherit_default_configurations + self.name = name + self.parent_suite = parent_suite + self.query_string = query_string + + +class TestSuiteReference(Model): + """ + The test suite reference resource. + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TestSuiteReference, self).__init__() + self.id = id + self.name = name + + +class TestSuiteReferenceWithProject(TestSuiteReference): + """ + Test Suite Reference with Project + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + :param project: Reference of destination Project + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, id=None, name=None, project=None): + super(TestSuiteReferenceWithProject, self).__init__(id=id, name=name) + self.project = project + + +class TestSuiteUpdateParams(TestSuiteCreateUpdateCommonParams): + """ + Test Suite Update Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :param query_string: Test suite query string, for dynamic suites. + :type query_string: str + :param revision: Test suite revision. + :type revision: int + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, revision=None): + super(TestSuiteUpdateParams, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string) + self.revision = revision + + +class TestVariableCreateUpdateParameters(Model): + """ + Test Variable Create or Update Parameters + + :param description: Description of the test variable + :type description: str + :param name: Name of the test variable + :type name: str + :param values: List of allowed values + :type values: list of str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'} + } + + def __init__(self, description=None, name=None, values=None): + super(TestVariableCreateUpdateParameters, self).__init__() + self.description = description + self.name = name + self.values = values + + +class WorkItem(Model): + """ + Work Item + + :param id: Id of the Work Item + :type id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'} + } + + def __init__(self, id=None): + super(WorkItem, self).__init__() + self.id = id + + +class WorkItemDetails(Model): + """ + Work Item Class + + :param id: Work Item Id + :type id: int + :param name: Work Item Name + :type name: str + :param work_item_fields: Work Item Fields + :type work_item_fields: list of object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'work_item_fields': {'key': 'workItemFields', 'type': '[object]'} + } + + def __init__(self, id=None, name=None, work_item_fields=None): + super(WorkItemDetails, self).__init__() + self.id = id + self.name = name + self.work_item_fields = work_item_fields + + +class DestinationTestPlanCloneParams(TestPlanCreateParams): + """ + Destination Test Plan create parameters + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 project: Destination Project Name + :type project: str + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'project': {'key': 'project', 'type': 'str'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, project=None): + super(DestinationTestPlanCloneParams, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings) + self.project = project + + +class SourceTestplanResponse(TestPlanReference): + """ + Source Test Plan Response for Test Plan clone operation + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + :param project: project reference + :type project: :class:`TeamProjectReference ` + :param suite_ids: Id of suites to be cloned inside source Test Plan + :type suite_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'suite_ids': {'key': 'suiteIds', 'type': '[int]'} + } + + def __init__(self, id=None, name=None, project=None, suite_ids=None): + super(SourceTestplanResponse, self).__init__(id=id, name=name) + self.project = project + self.suite_ids = suite_ids + + +class SourceTestSuiteResponse(TestSuiteReference): + """ + Source Test Suite Response for Test Case clone operation + + :param id: ID of the test suite. + :type id: int + :param name: Name of the test suite. + :type name: str + :param project: project reference + :type project: :class:`TeamProjectReference ` + :param test_case_ids: Id of suites to be cloned inside source Test Plan + :type test_case_ids: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'test_case_ids': {'key': 'testCaseIds', 'type': '[int]'} + } + + def __init__(self, id=None, name=None, project=None, test_case_ids=None): + super(SourceTestSuiteResponse, self).__init__(id=id, name=name) + self.project = project + self.test_case_ids = test_case_ids + + +class SuiteEntry(SuiteEntryUpdateParams): + """ + A suite entry defines properties for a test suite. + + :param id: Id of the suite entry in the test suite: either a test case id or child suite id. + :type id: int + :param sequence_number: Sequence number for the suite entry object in the test suite. + :type sequence_number: int + :param suite_entry_type: Defines whether the entry is of type test case or suite. + :type suite_entry_type: object + :param suite_id: Id for the test suite. + :type suite_id: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'suite_entry_type': {'key': 'suiteEntryType', 'type': 'object'}, + 'suite_id': {'key': 'suiteId', 'type': 'int'} + } + + def __init__(self, id=None, sequence_number=None, suite_entry_type=None, suite_id=None): + super(SuiteEntry, self).__init__(id=id, sequence_number=sequence_number, suite_entry_type=suite_entry_type) + self.suite_id = suite_id + + +class TestConfiguration(TestConfigurationCreateUpdateParameters): + """ + Test configuration + + :param description: Description of the configuration + :type description: str + :param is_default: Is the configuration a default for the test plans + :type is_default: bool + :param name: Name of the configuration + :type name: str + :param state: State of the configuration + :type state: object + :param values: Dictionary of Test Variable, Selected Value + :type values: list of :class:`NameValuePair ` + :param id: Id of the configuration + :type id: int + :param project: Id of the test configuration variable + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'object'}, + 'values': {'key': 'values', 'type': '[NameValuePair]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, description=None, is_default=None, name=None, state=None, values=None, id=None, project=None): + super(TestConfiguration, self).__init__(description=description, is_default=is_default, name=name, state=state, values=values) + self.id = id + self.project = project + + +class TestPlan(TestPlanUpdateParams): + """ + The test plan resource. + + :param area_path: Area of the test plan. + :type area_path: str + :param automated_test_environment: + :type automated_test_environment: :class:`TestEnvironment ` + :param automated_test_settings: + :type automated_test_settings: :class:`TestSettings ` + :param build_definition: The Build Definition that generates a build associated with this test plan. + :type build_definition: :class:`BuildDefinitionReference ` + :param build_id: Build to be tested. + :type build_id: int + :param description: Description of the test plan. + :type description: str + :param end_date: End date for the test plan. + :type end_date: datetime + :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 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: 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 revision: Revision of the test plan. + :type revision: int + :param _links: Relevant links + :type _links: :class:`ReferenceLinks ` + :param id: ID of the test plan. + :type id: int + :param previous_build_id: Previous build Id associated with the test plan + :type previous_build_id: int + :param project: Project which contains the test plan. + :type project: :class:`TeamProjectReference ` + :param root_suite: Root test suite of the test plan. + :type root_suite: :class:`TestSuiteReference ` + :param updated_by: Identity Reference for the last update of the test plan + :type updated_by: :class:`IdentityRef ` + :param updated_date: Updated date of the test plan + :type updated_date: datetime + """ + + _attribute_map = { + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, + 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, + 'build_definition': {'key': 'buildDefinition', 'type': 'BuildDefinitionReference'}, + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + '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': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, + 'revision': {'key': 'revision', 'type': 'int'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'id': {'key': 'id', 'type': 'int'}, + 'previous_build_id': {'key': 'previousBuildId', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'root_suite': {'key': 'rootSuite', 'type': 'TestSuiteReference'}, + 'updated_by': {'key': 'updatedBy', 'type': 'IdentityRef'}, + 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} + } + + def __init__(self, area_path=None, automated_test_environment=None, automated_test_settings=None, build_definition=None, build_id=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, test_outcome_settings=None, revision=None, _links=None, id=None, previous_build_id=None, project=None, root_suite=None, updated_by=None, updated_date=None): + super(TestPlan, self).__init__(area_path=area_path, automated_test_environment=automated_test_environment, automated_test_settings=automated_test_settings, build_definition=build_definition, build_id=build_id, description=description, end_date=end_date, iteration=iteration, manual_test_environment=manual_test_environment, manual_test_settings=manual_test_settings, name=name, owner=owner, release_environment_definition=release_environment_definition, start_date=start_date, state=state, test_outcome_settings=test_outcome_settings, revision=revision) + self._links = _links + self.id = id + self.previous_build_id = previous_build_id + self.project = project + self.root_suite = root_suite + self.updated_by = updated_by + self.updated_date = updated_date + + +class TestPlanDetailedReference(TestPlanReference): + """ + The test plan detailed reference resource. Contains additional workitem realted information + + :param id: ID of the test plan. + :type id: int + :param name: Name of the test plan. + :type name: str + :param area_path: Area of the test plan. + :type area_path: str + :param end_date: End date for the test plan. + :type end_date: datetime + :param iteration: Iteration path of the test plan. + :type iteration: str + :param root_suite_id: Root Suite Id + :type root_suite_id: int + :param start_date: Start date for the test plan. + :type start_date: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'area_path': {'key': 'areaPath', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'root_suite_id': {'key': 'rootSuiteId', 'type': 'int'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'} + } + + def __init__(self, id=None, name=None, area_path=None, end_date=None, iteration=None, root_suite_id=None, start_date=None): + super(TestPlanDetailedReference, self).__init__(id=id, name=name) + self.area_path = area_path + self.end_date = end_date + self.iteration = iteration + self.root_suite_id = root_suite_id + self.start_date = start_date + + +class TestSuiteCreateParams(TestSuiteCreateUpdateCommonParams): + """ + Test suite Create Parameters + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :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 suite_type: Test suite type. + :type suite_type: object + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'requirement_id': {'key': 'requirementId', 'type': 'int'}, + 'suite_type': {'key': 'suiteType', 'type': 'object'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, requirement_id=None, suite_type=None): + super(TestSuiteCreateParams, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string) + self.requirement_id = requirement_id + self.suite_type = suite_type + + +class TestVariable(TestVariableCreateUpdateParameters): + """ + Test Variable + + :param description: Description of the test variable + :type description: str + :param name: Name of the test variable + :type name: str + :param values: List of allowed values + :type values: list of str + :param id: Id of the test variable + :type id: int + :param project: Id of the test variable + :type project: :class:`TeamProjectReference ` + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'} + } + + def __init__(self, description=None, name=None, values=None, id=None, project=None): + super(TestVariable, self).__init__(description=description, name=name, values=values) + self.id = id + self.project = project + + +class TestSuite(TestSuiteCreateParams): + """ + Test suite + + :param default_configurations: Test suite default configurations. + :type default_configurations: list of :class:`TestConfigurationReference ` + :param default_testers: Test suite default testers. + :type default_testers: list of :class:`IdentityRef ` + :param inherit_default_configurations: Default configuration was inherited or not. + :type inherit_default_configurations: bool + :param name: Name of test suite. + :type name: str + :param parent_suite: Test suite parent shallow reference. + :type parent_suite: :class:`TestSuiteReference ` + :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 suite_type: Test suite type. + :type suite_type: object + :param _links: Links: self, testPoints, testCases, parent + :type _links: :class:`ReferenceLinks ` + :param has_children: Boolean value dictating if Child test suites are present + :type has_children: bool + :param children: Child test suites of current test suite. + :type children: list of :class:`TestSuite ` + :param id: Id of test suite. + :type id: int + :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 plan: Test plan to which the test suite belongs. + :type plan: :class:`TestPlanReference ` + :param project: Test suite project shallow reference. + :type project: :class:`TeamProjectReference ` + :param revision: Test suite revision. + :type revision: int + """ + + _attribute_map = { + 'default_configurations': {'key': 'defaultConfigurations', 'type': '[TestConfigurationReference]'}, + 'default_testers': {'key': 'defaultTesters', 'type': '[IdentityRef]'}, + 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parent_suite': {'key': 'parentSuite', 'type': 'TestSuiteReference'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + 'requirement_id': {'key': 'requirementId', 'type': 'int'}, + 'suite_type': {'key': 'suiteType', 'type': 'object'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[TestSuite]'}, + 'id': {'key': 'id', 'type': 'int'}, + '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'}, + 'plan': {'key': 'plan', 'type': 'TestPlanReference'}, + 'project': {'key': 'project', 'type': 'TeamProjectReference'}, + 'revision': {'key': 'revision', 'type': 'int'} + } + + def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent_suite=None, query_string=None, requirement_id=None, suite_type=None, _links=None, has_children=None, children=None, id=None, last_error=None, last_populated_date=None, last_updated_by=None, last_updated_date=None, plan=None, project=None, revision=None): + super(TestSuite, self).__init__(default_configurations=default_configurations, default_testers=default_testers, inherit_default_configurations=inherit_default_configurations, name=name, parent_suite=parent_suite, query_string=query_string, requirement_id=requirement_id, suite_type=suite_type) + self._links = _links + self.has_children = has_children + self.children = children + self.id = id + 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.plan = plan + self.project = project + self.revision = revision + + +__all__ = [ + 'BuildDefinitionReference', + 'CloneOperationCommonResponse', + 'CloneOptions', + 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', + 'CloneTestPlanOperationInformation', + 'CloneTestPlanParams', + 'CloneTestSuiteOperationInformation', + 'CloneTestSuiteParams', + 'Configuration', + 'DestinationTestSuiteInfo', + 'GraphSubjectBase', + 'IdentityRef', + 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', + 'NameValuePair', + 'PointAssignment', + 'ReferenceLinks', + 'ReleaseEnvironmentDefinitionReference', + 'Results', + 'SourceTestPlanInfo', + 'SourceTestSuiteInfo', + 'SuiteEntryUpdateParams', + 'SuiteTestCaseCreateUpdateParameters', + 'TeamProjectReference', + 'TestCase', + 'TestCaseAssociatedResult', + 'TestCaseReference', + 'TestCaseResultsData', + 'TestConfigurationCreateUpdateParameters', + 'TestConfigurationReference', + 'TestEntityCount', + 'TestEnvironment', + 'TestOutcomeSettings', + 'TestPlanCreateParams', + 'TestPlanReference', + 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', + 'TestPlanUpdateParams', + 'TestPoint', + 'TestPointDetailedReference', + 'TestPointResults', + 'TestPointUpdateParams', + 'TestSettings', + 'TestSuiteCreateUpdateCommonParams', + 'TestSuiteReference', + 'TestSuiteReferenceWithProject', + 'TestSuiteUpdateParams', + 'TestVariableCreateUpdateParameters', + 'WorkItem', + 'WorkItemDetails', + 'DestinationTestPlanCloneParams', + 'SourceTestplanResponse', + 'SourceTestSuiteResponse', + 'SuiteEntry', + 'TestConfiguration', + 'TestPlan', + 'TestPlanDetailedReference', + 'TestSuiteCreateParams', + 'TestVariable', + 'TestSuite', +] diff --git a/azure-devops/azure/devops/v7_1/test_plan/test_plan_client.py b/azure-devops/azure/devops/v7_1/test_plan/test_plan_client.py new file mode 100644 index 00000000..430aea0f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_plan/test_plan_client.py @@ -0,0 +1,911 @@ +# -------------------------------------------------------------------------------------------- +# 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 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 create_test_configuration(self, test_configuration_create_update_parameters, project): + """CreateTestConfiguration. + [Preview API] Create a test configuration. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :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_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestConfiguration', response) + + def delete_test_confguration(self, project, test_configuartion_id): + """DeleteTestConfguration. + [Preview API] Delete a test configuration by its ID. + :param str project: Project ID or project name + :param int test_configuartion_id: ID of the test configuration to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + self._send(http_method='DELETE', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + + 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='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('TestConfiguration', response) + + def get_test_configurations(self, project, continuation_token=None): + """GetTestConfigurations. + [Preview API] Get a list of test configurations. + :param str project: Project ID or project name + :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. + :rtype: :class:`<[TestConfiguration]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestConfiguration]', self._unwrap_collection(response)) + + def update_test_configuration(self, test_configuration_create_update_parameters, project, test_configuartion_id): + """UpdateTestConfiguration. + [Preview API] Update a test configuration by its ID. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :param str project: Project ID or project name + :param int test_configuartion_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') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + content = self._serialize.body(test_configuration_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestConfiguration', response) + + def create_test_plan(self, test_plan_create_params, project): + """CreateTestPlan. + [Preview API] Create a test plan. + :param :class:` ` test_plan_create_params: A testPlanCreateParams object.TestPlanCreateParams + :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_create_params, 'TestPlanCreateParams') + response = self._send(http_method='POST', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def delete_test_plan(self, project, plan_id): + """DeleteTestPlan. + [Preview API] 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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.1-preview.1', + route_values=route_values) + + def get_test_plan_by_id(self, project, plan_id): + """GetTestPlanById. + [Preview API] Get a test plan by Id. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan 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') + response = self._send(http_method='GET', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('TestPlan', response) + + def get_test_plans(self, project, owner=None, continuation_token=None, include_plan_details=None, filter_active_plans=None): + """GetTestPlans. + [Preview API] 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 str continuation_token: If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. + :param bool include_plan_details: Get all properties of the test plan + :param bool filter_active_plans: Get just the active plans + :rtype: :class:`<[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 continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + + def update_test_plan(self, test_plan_update_params, project, plan_id): + """UpdateTestPlan. + [Preview API] Update a test plan. + :param :class:` ` test_plan_update_params: A testPlanUpdateParams object.TestPlanUpdateParams + :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(test_plan_update_params, 'TestPlanUpdateParams') + response = self._send(http_method='PATCH', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def get_suite_entries(self, project, suite_id, suite_entry_type=None): + """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. + :param str suite_entry_type: + :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') + query_parameters = {} + if suite_entry_type is not None: + query_parameters['suiteEntryType'] = self._serialize.query('suite_entry_type', suite_entry_type, 'str') + response = self._send(http_method='GET', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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 [SuiteEntryUpdateParams] suite_entries: List of SuiteEntry 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, '[SuiteEntryUpdateParams]') + response = self._send(http_method='PATCH', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def create_test_suite(self, test_suite_create_params, project, plan_id): + """CreateTestSuite. + [Preview API] Create test suite. + :param :class:` ` test_suite_create_params: Parameters for suite creation + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :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(test_suite_create_params, 'TestSuiteCreateParams') + response = self._send(http_method='POST', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', response) + + def delete_test_suite(self, project, plan_id, suite_id): + """DeleteTestSuite. + [Preview API] 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.1-preview.1', + route_values=route_values) + + def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None): + """GetTestSuiteById. + [Preview API] 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 str 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, 'str') + response = self._send(http_method='GET', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.1-preview.1', + 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, continuation_token=None, as_tree_view=None): + """GetTestSuitesForPlan. + [Preview API] 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 str expand: Include the children suites and testers details. + :param str continuation_token: If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + :param bool as_tree_view: If the suites returned should be in a tree structure. + :rtype: :class:`<[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, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + 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='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def update_test_suite(self, test_suite_update_params, project, plan_id, suite_id): + """UpdateTestSuite. + [Preview API] Update test suite. + :param :class:` ` test_suite_update_params: Parameters for suite updation + :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 parent suite. + :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(test_suite_update_params, 'TestSuiteUpdateParams') + response = self._send(http_method='PATCH', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', response) + + def get_suites_by_test_case_id(self, test_case_id): + """GetSuitesByTestCaseId. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def add_test_cases_to_suite(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """AddTestCasesToSuite. + [Preview API] Add test cases to a suite with specified configurations + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be added. + :param int suite_id: ID of the test suite to which test cases are to be added. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='POST', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case(self, project, plan_id, suite_id, test_case_id, wit_fields=None, return_identity_ref=None): + """GetTestCase. + [Preview API] Get a particular Test Case from a Suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_case_id: Test Case Id to be fetched. + :param str wit_fields: Get the list of witFields. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :rtype: [TestCase] + """ + 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_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'str') + query_parameters = {} + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case_list(self, project, plan_id, suite_id, test_ids=None, configuration_ids=None, wit_fields=None, continuation_token=None, return_identity_ref=None, expand=None, exclude_flags=None, is_recursive=None): + """GetTestCaseList. + [Preview API] Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_ids: Test Case Ids to be fetched. + :param str configuration_ids: Fetch Test Cases which contains all the configuration Ids specified. + :param str wit_fields: Get the list of witFields. + :param str continuation_token: If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :param bool expand: If set to false, will get a smaller payload containing only basic details about the suite test case object + :param str exclude_flags: Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2). + :param bool is_recursive: + :rtype: :class:`<[TestCase]> ` + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + if configuration_ids is not None: + query_parameters['configurationIds'] = self._serialize.query('configuration_ids', configuration_ids, 'str') + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'bool') + if exclude_flags is not None: + query_parameters['excludeFlags'] = self._serialize.query('exclude_flags', exclude_flags, 'str') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def remove_test_cases_from_suite(self, project, plan_id, suite_id, test_case_ids): + """RemoveTestCasesFromSuite. + [Preview API] Removes test cases from a suite based on the list of test case Ids provided. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_case_ids: Test Case Ids to be removed. + """ + 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 test_case_ids is not None: + query_parameters['testCaseIds'] = self._serialize.query('test_case_ids', test_case_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + + def remove_test_cases_list_from_suite(self, project, plan_id, suite_id, test_ids): + """RemoveTestCasesListFromSuite. + [Preview API] Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_ids: Comma separated string of Test Case Ids to be removed. + """ + 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 test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + + def update_suite_test_cases(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """UpdateSuiteTestCases. + [Preview API] Update the configurations for test cases + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: A SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be updated. + :param int suite_id: ID of the test suite to which test cases are to be updated. + :rtype: [TestCase] + """ + 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_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='PATCH', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def clone_test_case(self, clone_request_body, project): + """CloneTestCase. + [Preview API] + :param :class:` ` clone_request_body: + :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(clone_request_body, 'CloneTestCaseParams') + response = self._send(http_method='POST', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def get_test_case_clone_information(self, project, clone_operation_id): + """GetTestCaseCloneInformation. + [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 + :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') + response = self._send(http_method='GET', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.1-preview.2', + route_values=route_values) + return self._deserialize('CloneTestCaseOperationInformation', 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 be deleted. + """ + 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='29006fb5-816b-4ff7-a329-599943569229', + version='7.1-preview.1', + route_values=route_values) + + def clone_test_plan(self, clone_request_body, project, deep_clone=None): + """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 bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestPlanParams') + response = self._send(http_method='POST', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_clone_information(self, project, clone_operation_id): + """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 + :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') + response = self._send(http_method='GET', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.1-preview.2', + route_values=route_values) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_points(self, project, plan_id, suite_id, point_id, return_identity_ref=None, include_point_details=None): + """GetPoints. + [Preview API] Get a particular Test Point from a suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param str point_id: ID of test point to be fetched. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :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 point_id is not None: + query_parameters['pointId'] = self._serialize.query('point_id', point_id, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def get_points_list(self, project, plan_id, suite_id, test_point_ids=None, test_case_id=None, continuation_token=None, return_identity_ref=None, include_point_details=None, is_recursive=None): + """GetPointsList. + [Preview API] Get all the points inside a suite based on some filters + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested + :param str test_point_ids: ID of test points to fetch. + :param str test_case_id: Get Test Points for specific test case Ids. + :param str continuation_token: If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool is_recursive: If set to true, will also fetch test points belonging to child suites recursively. + :rtype: :class:`<[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 test_point_ids is not None: + query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') + if test_case_id is not None: + query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def update_test_points(self, test_point_update_params, project, plan_id, suite_id, include_point_details=None, return_identity_ref=None): + """UpdateTestPoints. + [Preview API] Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point + :param [TestPointUpdateParams] test_point_update_params: A TestPointUpdateParams Object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :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 include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + content = self._serialize.body(test_point_update_params, '[TestPointUpdateParams]') + response = self._send(http_method='PATCH', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def clone_test_suite(self, clone_request_body, project, deep_clone=None): + """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 bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestSuiteParams') + response = self._send(http_method='POST', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def get_suite_clone_information(self, project, clone_operation_id): + """GetSuiteCloneInformation. + [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 + :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') + response = self._send(http_method='GET', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.1-preview.2', + route_values=route_values) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def create_test_variable(self, test_variable_create_update_parameters, project): + """CreateTestVariable. + [Preview API] Create a test variable. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.1-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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.1-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='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('TestVariable', response) + + def get_test_variables(self, project, continuation_token=None): + """GetTestVariables. + [Preview API] Get a list of test variables. + :param str project: Project ID or project name + :param str continuation_token: If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables. + :rtype: :class:`<[TestVariable]> ` + """ + 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') + response = self._send(http_method='GET', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.1-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_create_update_parameters, project, test_variable_id): + """UpdateTestVariable. + [Preview API] Update a test variable by its ID. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :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_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + diff --git a/azure-devops/azure/devops/v7_1/test_results/__init__.py b/azure-devops/azure/devops/v7_1/test_results/__init__.py new file mode 100644 index 00000000..18ae3f7a --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_results/__init__.py @@ -0,0 +1,116 @@ +# -------------------------------------------------------------------------------------------- +# 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_results_client import TestResultsClient + +__all__ = [ + 'AggregatedDataForResultTrend', + 'AggregatedResultDetailsByOutcome', + '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', + 'NewTestResultLoggingSettings', + 'PhaseReference', + 'PipelineReference', + 'PipelineTestMetrics', + 'QueryModel', + 'ReferenceLinks', + 'ReleaseReference', + 'ResultsAnalysis', + 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', + 'RunCreateModel', + 'RunFilter', + 'RunStatistic', + 'RunSummary', + 'RunSummaryModel', + 'RunUpdateModel', + 'ShallowReference', + 'ShallowTestCaseResult', + 'SharedStepModel', + 'StageReference', + 'TeamProjectReference', + 'TestActionResultModel', + 'TestAttachment', + 'TestAttachmentReference', + 'TestAttachmentRequestModel', + 'TestCaseResult', + 'TestCaseResultAttachmentModel', + 'TestCaseResultIdentifier', + 'TestEnvironment', + 'TestFailureDetails', + 'TestFailuresAnalysis', + 'TestFailureType', + 'TestFlakyIdentifier', + 'TestHistoryQuery', + 'TestIterationDetailsModel', + 'TestLog', + 'TestLogReference', + 'TestLogStoreAttachment', + 'TestLogStoreAttachmentReference', + 'TestLogStoreEndpointDetails', + 'TestMessageLogDetails', + 'TestMethod', + 'TestOperationReference', + 'TestResolutionState', + 'TestResultDocument', + 'TestResultFailuresAnalysis', + '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' +] diff --git a/azure-devops/azure/devops/v7_1/test_results/models.py b/azure-devops/azure/devops/v7_1/test_results/models.py new file mode 100644 index 00000000..24892e11 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_results/models.py @@ -0,0 +1,3705 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 AggregatedResultDetailsByOutcome(Model): + """ + Result deatils for a particular test result outcome. + + :param count: Number of results for current outcome. + :type count: int + :param duration: Time taken by results. + :type duration: object + :param outcome: Test result outcome + :type outcome: object + :param rerun_result_count: Number of results on rerun + :type rerun_result_count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'duration': {'key': 'duration', 'type': 'object'}, + 'outcome': {'key': 'outcome', 'type': 'object'}, + 'rerun_result_count': {'key': 'rerunResultCount', 'type': 'int'} + } + + def __init__(self, count=None, duration=None, outcome=None, rerun_result_count=None): + super(AggregatedResultDetailsByOutcome, self).__init__() + self.count = count + self.duration = duration + self.outcome = outcome + self.rerun_result_count = rerun_result_count + + +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_non_impacted_tests: + :type increase_in_non_impacted_tests: 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_non_impacted_tests': {'key': 'increaseInNonImpactedTests', '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_non_impacted_tests=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_non_impacted_tests = increase_in_non_impacted_tests + 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 BuildConfiguration(Model): + """ + BuildConfiguration Details. + + :param branch_name: Branch name for which build is generated. + :type branch_name: str + :param build_definition_id: BuildDefinitionId for build. + :type build_definition_id: int + :param build_system: Build system. + :type build_system: str + :param creation_date: Build Creation Date. + :type creation_date: datetime + :param flavor: Build flavor (eg Build/Release). + :type flavor: str + :param id: BuildConfiguration Id. + :type id: int + :param number: Build Number. + :type number: str + :param platform: BuildConfiguration Platform. + :type platform: str + :param project: Project associated with this BuildConfiguration. + :type project: :class:`ShallowReference ` + :param repository_guid: Repository Guid for the Build. + :type repository_guid: str + :param repository_id: Repository Id. + :type repository_id: int + :param repository_type: Repository Type (eg. TFSGit). + :type repository_type: str + :param source_version: Source Version(/first commit) for the build was triggered. + :type source_version: str + :param target_branch_name: Target BranchName. + :type target_branch_name: str + :param uri: Build 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'}, + 'target_branch_name': {'key': 'targetBranchName', '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, target_branch_name=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.target_branch_name = target_branch_name + self.uri = uri + + +class BuildCoverage(Model): + """ + Build Coverage Detail + + :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): + """ + Reference to a build. + + :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 CodeCoverageData(Model): + """ + Represents the build configuration (platform, flavor) and coverage data for the build + + :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): + """ + Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) + + :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): + """ + Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build + + :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 ` + :param status: Uri of build against which difference in coverage is computed + :type status: object + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'ShallowReference'}, + 'coverage_data': {'key': 'coverageData', 'type': '[CodeCoverageData]'}, + 'delta_build': {'key': 'deltaBuild', 'type': 'ShallowReference'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, build=None, coverage_data=None, delta_build=None, status=None): + super(CodeCoverageSummary, self).__init__() + self.build = build + self.coverage_data = coverage_data + self.delta_build = delta_build + self.status = status + + +class CoverageStatistics(Model): + """ + :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): + """ + A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool) + + :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 DtlEnvironmentDetails(Model): + """ + This is a temporary class to provide the details for the test run environment. + + :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): + """ + Failing since information of a test result. + + :param build: Build reference since failing. + :type build: :class:`BuildReference ` + :param date: Time since failing(UTC). + :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): + """ + :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 FileCoverageRequest(Model): + """ + :param file_path: + :type file_path: str + :param pull_request_base_iteration_id: + :type pull_request_base_iteration_id: int + :param pull_request_id: + :type pull_request_id: int + :param pull_request_iteration_id: + :type pull_request_iteration_id: int + :param repo_id: + :type repo_id: str + """ + + _attribute_map = { + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'pull_request_base_iteration_id': {'key': 'pullRequestBaseIterationId', 'type': 'int'}, + 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'}, + 'pull_request_iteration_id': {'key': 'pullRequestIterationId', 'type': 'int'}, + 'repo_id': {'key': 'repoId', 'type': 'str'} + } + + def __init__(self, file_path=None, pull_request_base_iteration_id=None, pull_request_id=None, pull_request_iteration_id=None, repo_id=None): + super(FileCoverageRequest, self).__init__() + self.file_path = file_path + self.pull_request_base_iteration_id = pull_request_base_iteration_id + self.pull_request_id = pull_request_id + self.pull_request_iteration_id = pull_request_iteration_id + self.repo_id = repo_id + + +class FlakyDetection(Model): + """ + :param flaky_detection_pipelines: FlakyDetectionPipelines defines Pipelines for Detection. + :type flaky_detection_pipelines: :class:`FlakyDetectionPipelines ` + :param flaky_detection_type: FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual. + :type flaky_detection_type: object + """ + + _attribute_map = { + 'flaky_detection_pipelines': {'key': 'flakyDetectionPipelines', 'type': 'FlakyDetectionPipelines'}, + 'flaky_detection_type': {'key': 'flakyDetectionType', 'type': 'object'} + } + + def __init__(self, flaky_detection_pipelines=None, flaky_detection_type=None): + super(FlakyDetection, self).__init__() + self.flaky_detection_pipelines = flaky_detection_pipelines + self.flaky_detection_type = flaky_detection_type + + +class FlakyDetectionPipelines(Model): + """ + :param allowed_pipelines: AllowedPipelines - List All Pipelines allowed for detection. + :type allowed_pipelines: list of int + :param is_all_pipelines_allowed: IsAllPipelinesAllowed if users configure all system's pipelines. + :type is_all_pipelines_allowed: bool + """ + + _attribute_map = { + 'allowed_pipelines': {'key': 'allowedPipelines', 'type': '[int]'}, + 'is_all_pipelines_allowed': {'key': 'isAllPipelinesAllowed', 'type': 'bool'} + } + + def __init__(self, allowed_pipelines=None, is_all_pipelines_allowed=None): + super(FlakyDetectionPipelines, self).__init__() + self.allowed_pipelines = allowed_pipelines + self.is_all_pipelines_allowed = is_all_pipelines_allowed + + +class FlakySettings(Model): + """ + :param flaky_detection: FlakyDetection defines types of detection. + :type flaky_detection: :class:`FlakyDetection ` + :param flaky_in_summary_report: FlakyInSummaryReport defines flaky data should show in summary report or not. + :type flaky_in_summary_report: bool + :param is_flaky_bug_created: IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult. + :type is_flaky_bug_created: bool + :param manual_mark_unmark_flaky: ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase. + :type manual_mark_unmark_flaky: bool + """ + + _attribute_map = { + 'flaky_detection': {'key': 'flakyDetection', 'type': 'FlakyDetection'}, + 'flaky_in_summary_report': {'key': 'flakyInSummaryReport', 'type': 'bool'}, + 'is_flaky_bug_created': {'key': 'isFlakyBugCreated', 'type': 'bool'}, + 'manual_mark_unmark_flaky': {'key': 'manualMarkUnmarkFlaky', 'type': 'bool'} + } + + def __init__(self, flaky_detection=None, flaky_in_summary_report=None, is_flaky_bug_created=None, manual_mark_unmark_flaky=None): + super(FlakySettings, self).__init__() + self.flaky_detection = flaky_detection + self.flaky_in_summary_report = flaky_in_summary_report + self.is_flaky_bug_created = is_flaky_bug_created + self.manual_mark_unmark_flaky = manual_mark_unmark_flaky + + +class FunctionCoverage(Model): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param descriptor: + :type descriptor: str + :param display_name: + :type display_name: str + :param url: + :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: + :type _links: :class:`ReferenceLinks ` + :param descriptor: + :type descriptor: str + :param display_name: + :type display_name: str + :param url: + :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 JobReference(Model): + """ + Job in pipeline. This is related to matrixing in YAML. + + :param attempt: Attempt number of the job + :type attempt: int + :param job_name: Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + :type job_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'job_name': {'key': 'jobName', 'type': 'str'} + } + + def __init__(self, attempt=None, job_name=None): + super(JobReference, self).__init__() + self.attempt = attempt + self.job_name = job_name + + +class ModuleCoverage(Model): + """ + :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 NewTestResultLoggingSettings(Model): + """ + :param log_new_tests: LogNewTests defines whether or not we will record new test cases coming into the system + :type log_new_tests: bool + """ + + _attribute_map = { + 'log_new_tests': {'key': 'logNewTests', 'type': 'bool'} + } + + def __init__(self, log_new_tests=None): + super(NewTestResultLoggingSettings, self).__init__() + self.log_new_tests = log_new_tests + + +class PhaseReference(Model): + """ + Phase in pipeline + + :param attempt: Attempt number of the phase + :type attempt: int + :param phase_name: Name of the phase. Maximum supported length for name is 256 character. + :type phase_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'phase_name': {'key': 'phaseName', 'type': 'str'} + } + + def __init__(self, attempt=None, phase_name=None): + super(PhaseReference, self).__init__() + self.attempt = attempt + self.phase_name = phase_name + + +class PipelineReference(Model): + """ + Pipeline reference + + :param job_reference: Reference of the job + :type job_reference: :class:`JobReference ` + :param phase_reference: Reference of the phase. + :type phase_reference: :class:`PhaseReference ` + :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. + :type pipeline_id: int + :param stage_reference: Reference of the stage. + :type stage_reference: :class:`StageReference ` + """ + + _attribute_map = { + 'job_reference': {'key': 'jobReference', 'type': 'JobReference'}, + 'phase_reference': {'key': 'phaseReference', 'type': 'PhaseReference'}, + 'pipeline_id': {'key': 'pipelineId', 'type': 'int'}, + 'stage_reference': {'key': 'stageReference', 'type': 'StageReference'} + } + + def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, stage_reference=None): + super(PipelineReference, self).__init__() + self.job_reference = job_reference + self.phase_reference = phase_reference + self.pipeline_id = pipeline_id + self.stage_reference = stage_reference + + +class PipelineTestMetrics(Model): + """ + Test summary of a pipeline instance. + + :param current_context: Reference of Pipeline instance for which test summary is calculated. + :type current_context: :class:`PipelineReference ` + :param results_analysis: This is the return value for metric ResultsAnalysis Results insights which include failure analysis, increase/decrease in results count analysis. + :type results_analysis: :class:`ResultsAnalysis ` + :param result_summary: This is the return value for metric ResultSummary Results summary based on results outcome. + :type result_summary: :class:`ResultSummary ` + :param run_summary: This is the return value for metric RunSummary Run summary. + :type run_summary: :class:`RunSummary ` + :param summary_at_child: Summary at child node. + :type summary_at_child: list of :class:`PipelineTestMetrics ` + """ + + _attribute_map = { + 'current_context': {'key': 'currentContext', 'type': 'PipelineReference'}, + 'results_analysis': {'key': 'resultsAnalysis', 'type': 'ResultsAnalysis'}, + 'result_summary': {'key': 'resultSummary', 'type': 'ResultSummary'}, + 'run_summary': {'key': 'runSummary', 'type': 'RunSummary'}, + 'summary_at_child': {'key': 'summaryAtChild', 'type': '[PipelineTestMetrics]'} + } + + def __init__(self, current_context=None, results_analysis=None, result_summary=None, run_summary=None, summary_at_child=None): + super(PipelineTestMetrics, self).__init__() + self.current_context = current_context + self.results_analysis = results_analysis + self.result_summary = result_summary + self.run_summary = run_summary + self.summary_at_child = summary_at_child + + +class QueryModel(Model): + """ + :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): + """ + :param links: + :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(UTC). + :type creation_date: datetime + :param definition_id: Release definition ID. + :type definition_id: int + :param environment_creation_date: Environment creation Date(UTC). + :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 ResultsAnalysis(Model): + """ + Results insights for runs with state completed and NeedInvestigation. + + :param previous_context: Reference of pipeline instance from which to compare the results. + :type previous_context: :class:`PipelineReference ` + :param results_difference: Increase/Decrease in counts of results for a different outcome with respect to PreviousContext. + :type results_difference: :class:`AggregatedResultsDifference ` + :param test_failures_analysis: Failure analysis of results with respect to PreviousContext + :type test_failures_analysis: :class:`TestResultFailuresAnalysis ` + """ + + _attribute_map = { + 'previous_context': {'key': 'previousContext', 'type': 'PipelineReference'}, + 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, + 'test_failures_analysis': {'key': 'testFailuresAnalysis', 'type': 'TestResultFailuresAnalysis'} + } + + def __init__(self, previous_context=None, results_difference=None, test_failures_analysis=None): + super(ResultsAnalysis, self).__init__() + self.previous_context = previous_context + self.results_difference = results_difference + self.test_failures_analysis = test_failures_analysis + + +class ResultsFilter(Model): + """ + :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 ResultsSummaryByOutcome(Model): + """ + Result summary by the outcome of test results. + + :param aggregated_result_details_by_outcome: Aggregated result details for each test result outcome. + :type aggregated_result_details_by_outcome: dict + :param duration: Time taken by results. + :type duration: object + :param not_reported_test_count: Total number of not reported test results. + :type not_reported_test_count: int + :param total_test_count: Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage). + :type total_test_count: int + """ + + _attribute_map = { + 'aggregated_result_details_by_outcome': {'key': 'aggregatedResultDetailsByOutcome', 'type': '{AggregatedResultDetailsByOutcome}'}, + 'duration': {'key': 'duration', 'type': 'object'}, + 'not_reported_test_count': {'key': 'notReportedTestCount', 'type': 'int'}, + 'total_test_count': {'key': 'totalTestCount', 'type': 'int'} + } + + def __init__(self, aggregated_result_details_by_outcome=None, duration=None, not_reported_test_count=None, total_test_count=None): + super(ResultsSummaryByOutcome, self).__init__() + self.aggregated_result_details_by_outcome = aggregated_result_details_by_outcome + self.duration = duration + self.not_reported_test_count = not_reported_test_count + self.total_test_count = total_test_count + + +class ResultSummary(Model): + """ + Summary of results for a pipeline instance. + + :param result_summary_by_run_state: Result summary of pipeline, group by TestRun state. + :type result_summary_by_run_state: dict + """ + + _attribute_map = { + 'result_summary_by_run_state': {'key': 'resultSummaryByRunState', 'type': '{ResultsSummaryByOutcome}'} + } + + def __init__(self, result_summary_by_run_state=None): + super(ResultSummary, self).__init__() + self.result_summary_by_run_state = result_summary_by_run_state + + +class RunCreateModel(Model): + """ + Test run create details. + + :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: BuildReference of the test run. + :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: Additional properties of test Run. + :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: Filter used for discovering the Run. + :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 pipeline_reference: Reference of the pipeline to which this test run belongs. PipelineReference.PipelineId should be equal to RunCreateModel.Build.Id + :type pipeline_reference: :class:`PipelineReference ` + :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: Reference to release associated with test run. + :type release_reference: :class:`ReleaseReference ` + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param run_timeout: Timespan till the run times out. + :type run_timeout: object + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :type source_workflow: str + :param start_date: Start date time of the run. + :type start_date: str + :param state: The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting + :type state: str + :param tags: Tags to attach with the test run, maximum of 5 tags can be added to run. + :type tags: list of :class:`TestTag ` + :param test_configurations_mapping: TestConfigurationMapping of the test run. + :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 of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun) + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'run_timeout': {'key': 'runTimeout', 'type': 'object'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=None, plan=None, point_ids=None, release_environment_uri=None, release_reference=None, release_uri=None, run_summary=None, run_timeout=None, source_workflow=None, start_date=None, state=None, tags=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.pipeline_reference = pipeline_reference + 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_summary = run_summary + self.run_timeout = run_timeout + self.source_workflow = source_workflow + self.start_date = start_date + self.state = state + self.tags = tags + 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): + """ + This class is used to provide the filters used for discovery + + :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): + """ + Test run statistics per outcome. + + :param count: Test result count fo the given outcome. + :type count: int + :param outcome: Test result outcome + :type outcome: str + :param resolution_state: Test run Resolution State. + :type resolution_state: :class:`TestResolutionState ` + :param result_metadata: ResultMetadata for the given outcome/count. + :type result_metadata: object + :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'}, + 'result_metadata': {'key': 'resultMetadata', 'type': 'object'}, + 'state': {'key': 'state', 'type': 'str'} + } + + def __init__(self, count=None, outcome=None, resolution_state=None, result_metadata=None, state=None): + super(RunStatistic, self).__init__() + self.count = count + self.outcome = outcome + self.resolution_state = resolution_state + self.result_metadata = result_metadata + self.state = state + + +class RunSummary(Model): + """ + Summary of runs for a pipeline instance. + + :param duration: Total time taken by runs with state completed and NeedInvestigation. + :type duration: object + :param no_config_runs_count: NoConfig runs count. + :type no_config_runs_count: int + :param run_summary_by_outcome: Runs count by outcome for runs with state completed and NeedInvestigation runs. + :type run_summary_by_outcome: dict + :param run_summary_by_state: Runs count by state. + :type run_summary_by_state: dict + :param total_runs_count: Total runs count. + :type total_runs_count: int + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'object'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'run_summary_by_outcome': {'key': 'runSummaryByOutcome', 'type': '{int}'}, + 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{int}'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, duration=None, no_config_runs_count=None, run_summary_by_outcome=None, run_summary_by_state=None, total_runs_count=None): + super(RunSummary, self).__init__() + self.duration = duration + self.no_config_runs_count = no_config_runs_count + self.run_summary_by_outcome = run_summary_by_outcome + self.run_summary_by_state = run_summary_by_state + self.total_runs_count = total_runs_count + + +class RunSummaryModel(Model): + """ + Run summary for each output type of test. + + :param duration: Total time taken in milliseconds. + :type duration: long + :param result_count: Number of results for Outcome TestOutcome + :type result_count: int + :param test_outcome: Summary is based on outcome + :type test_outcome: object + """ + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'long'}, + 'result_count': {'key': 'resultCount', 'type': 'int'}, + 'test_outcome': {'key': 'testOutcome', 'type': 'object'} + } + + def __init__(self, duration=None, result_count=None, test_outcome=None): + super(RunSummaryModel, self).__init__() + self.duration = duration + self.result_count = result_count + self.test_outcome = test_outcome + + +class RunUpdateModel(Model): + """ + :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 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: true to delete inProgess Results , false otherwise. + :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: URI of release environment associated with the run. + :type release_environment_uri: str + :param release_uri: URI of release associated with the run. + :type release_uri: str + :param run_summary: Run summary for run Type = NoConfigRun. + :type run_summary: list of :class:`RunSummaryModel ` + :param source_workflow: SourceWorkFlow(CI/CD) of the test run. + :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: The types of sub states for test run. + :type substate: object + :param tags: Tags to attach with the test run. + :type tags: list of :class:`TestTag ` + :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 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'}, + 'run_summary': {'key': 'runSummary', 'type': '[RunSummaryModel]'}, + 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, + 'started_date': {'key': 'startedDate', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'substate': {'key': 'substate', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, run_summary=None, source_workflow=None, started_date=None, state=None, substate=None, tags=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.run_summary = run_summary + self.source_workflow = source_workflow + self.started_date = started_date + self.state = state + self.substate = substate + self.tags = tags + self.test_environment_id = test_environment_id + self.test_settings = test_settings + + +class ShallowReference(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :param automated_test_name: + :type automated_test_name: str + :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 tags: + :type tags: list of str + :param test_case_title: + :type test_case_title: str + """ + + _attribute_map = { + 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} + } + + def __init__(self, automated_test_name=None, 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, tags=None, test_case_title=None): + super(ShallowTestCaseResult, self).__init__() + self.automated_test_name = automated_test_name + 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.tags = tags + self.test_case_title = test_case_title + + +class SharedStepModel(Model): + """ + Reference to shared step workitem. + + :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 StageReference(Model): + """ + Stage in pipeline + + :param attempt: Attempt number of stage + :type attempt: int + :param stage_name: Name of the stage. Maximum supported length for name is 256 character. + :type stage_name: str + """ + + _attribute_map = { + 'attempt': {'key': 'attempt', 'type': 'int'}, + 'stage_name': {'key': 'stageName', 'type': 'str'} + } + + def __init__(self, attempt=None, stage_name=None): + super(StageReference, self).__init__() + self.attempt = attempt + self.stage_name = stage_name + + +class TeamProjectReference(Model): + """ + :param abbreviation: + :type abbreviation: str + :param default_team_image_url: + :type default_team_image_url: 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 revision: + :type revision: long + :param state: + :type state: object + :param url: + :type url: str + :param 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 TestAttachment(Model): + """ + :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): + """ + Reference to test attachment. + + :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): + """ + Test attachment request model + + :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): + """ + Represents a test result. + + :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: TypeId of automated test. + :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 with maxSize= 1000 chars. + :type comment: str + :param completed_date: Time when test execution completed(UTC). Completed date should be greater than StartedDate. + :type completed_date: datetime + :param computer_name: Machine name where test executed. + :type computer_name: str + :param configuration: Reference to test configuration. Type ShallowReference. + :type configuration: :class:`ShallowReference ` + :param created_date: Timestamp when test result created(UTC). + :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. If not provided value will be set as CompletedDate - StartedDate + :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. Valid Value= (Known Issue, New Issue, Regression, Unknown, None) + :type failure_type: str + :param id: ID of a test result. + :type id: int + :param iteration_details: Test result details of test iterations used only for Manual Testing. + :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(UTC). + :type last_updated_date: datetime + :param outcome: Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted) + :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: ResetCount. + :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 with maxSize= 1000 chars. + :type stack_trace: str + :param started_date: Time when test execution started(UTC). + :type started_date: datetime + :param state: State of test result. Type TestRunState. + :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 TestResultMetaData + :type test_case_reference_id: int + :param test_case_revision: TestCaseRevision Number. + :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): + """ + Test attachment information in a test iteration. + + :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): + """ + Reference to a test result. + + :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 TestEnvironment(Model): + """ + Test environment Detail. + + :param environment_id: Test Environment Id. + :type environment_id: str + :param environment_name: Test 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): + """ + :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): + """ + :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 TestFailureType(Model): + """ + :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(TestFailureType, self).__init__() + self.id = id + self.name = name + self.project = project + + +class TestFlakyIdentifier(Model): + """ + Test Flaky Identifier + + :param branch_name: Branch Name where Flakiness has to be Marked/Unmarked + :type branch_name: str + :param is_flaky: State for Flakiness + :type is_flaky: bool + """ + + _attribute_map = { + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'is_flaky': {'key': 'isFlaky', 'type': 'bool'} + } + + def __init__(self, branch_name=None, is_flaky=None): + super(TestFlakyIdentifier, self).__init__() + self.branch_name = branch_name + self.is_flaky = is_flaky + + +class TestHistoryQuery(Model): + """ + Filter to get TestCase result history. + + :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 BuildDefinitionId. 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 test_case_id: Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname + :type test_case_id: int + :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]'}, + 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, + '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, test_case_id=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.test_case_id = test_case_id + self.trend_days = trend_days + + +class TestIterationDetailsModel(Model): + """ + Represents a test iteration result. + + :param action_results: Test step results in an iteration. + :type action_results: list of :class:`TestActionResultModel ` + :param attachments: Reference 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(UTC). + :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(UTC). + :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 TestLog(Model): + """ + Represents Test Log Result object. + + :param log_reference: Test Log Context run, build + :type log_reference: :class:`TestLogReference ` + :param meta_data: Meta data for Log file + :type meta_data: dict + :param modified_on: LastUpdatedDate for Log file + :type modified_on: datetime + :param size: Size in Bytes for Log file + :type size: long + """ + + _attribute_map = { + 'log_reference': {'key': 'logReference', 'type': 'TestLogReference'}, + 'meta_data': {'key': 'metaData', 'type': '{str}'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'size': {'key': 'size', 'type': 'long'} + } + + def __init__(self, log_reference=None, meta_data=None, modified_on=None, size=None): + super(TestLog, self).__init__() + self.log_reference = log_reference + self.meta_data = meta_data + self.modified_on = modified_on + self.size = size + + +class TestLogReference(Model): + """ + Test Log Reference object + + :param build_id: BuildId for test log, if context is build + :type build_id: int + :param file_path: FileName for log file + :type file_path: str + :param release_env_id: ReleaseEnvId for test log, if context is Release + :type release_env_id: int + :param release_id: ReleaseId for test log, if context is Release + :type release_id: int + :param result_id: Resultid for test log, if context is run and log is related to result + :type result_id: int + :param run_id: runid for test log, if context is run + :type run_id: int + :param scope: Test Log Scope + :type scope: object + :param sub_result_id: SubResultid for test log, if context is run and log is related to subresult + :type sub_result_id: int + :param type: Log Type + :type type: object + """ + + _attribute_map = { + 'build_id': {'key': 'buildId', 'type': 'int'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'release_env_id': {'key': 'releaseEnvId', 'type': 'int'}, + 'release_id': {'key': 'releaseId', 'type': 'int'}, + 'result_id': {'key': 'resultId', 'type': 'int'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'scope': {'key': 'scope', 'type': 'object'}, + 'sub_result_id': {'key': 'subResultId', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, build_id=None, file_path=None, release_env_id=None, release_id=None, result_id=None, run_id=None, scope=None, sub_result_id=None, type=None): + super(TestLogReference, self).__init__() + self.build_id = build_id + self.file_path = file_path + self.release_env_id = release_env_id + self.release_id = release_id + self.result_id = result_id + self.run_id = run_id + self.scope = scope + self.sub_result_id = sub_result_id + self.type = type + + +class TestLogStoreAttachment(Model): + """ + Attachment metadata for test attachments from LogStore. + + :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 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'}, + 'size': {'key': 'size', 'type': 'long'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, attachment_type=None, comment=None, created_date=None, file_name=None, size=None, url=None): + super(TestLogStoreAttachment, self).__init__() + self.attachment_type = attachment_type + self.comment = comment + self.created_date = created_date + self.file_name = file_name + self.size = size + self.url = url + + +class TestLogStoreAttachmentReference(Model): + """ + Reference to test attachment. + + :param url: Url to download the attachment. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, url=None): + super(TestLogStoreAttachmentReference, self).__init__() + self.url = url + + +class TestLogStoreEndpointDetails(Model): + """ + Represents Test Log store endpoint details. + + :param endpoint_sASUri: Test log store connection Uri. + :type endpoint_sASUri: str + :param endpoint_type: Test log store endpoint type. + :type endpoint_type: object + :param status: Test log store status code + :type status: object + """ + + _attribute_map = { + 'endpoint_sASUri': {'key': 'endpointSASUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'object'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, endpoint_sASUri=None, endpoint_type=None, status=None): + super(TestLogStoreEndpointDetails, self).__init__() + self.endpoint_sASUri = endpoint_sASUri + self.endpoint_type = endpoint_type + self.status = status + + +class TestMessageLogDetails(Model): + """ + An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. + + :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): + """ + :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): + """ + Class representing a reference to an operation. + + :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 TestResolutionState(Model): + """ + Test Resolution State Details. + + :param id: Test Resolution state Id. + :type id: int + :param name: Test Resolution State 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 TestResultDocument(Model): + """ + :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 TestResultFailuresAnalysis(Model): + """ + :param existing_failures: + :type existing_failures: :class:`TestFailureDetails ` + :param fixed_tests: + :type fixed_tests: :class:`TestFailureDetails ` + :param new_failures: + :type new_failures: :class:`TestFailureDetails ` + """ + + _attribute_map = { + 'existing_failures': {'key': 'existingFailures', 'type': 'TestFailureDetails'}, + 'fixed_tests': {'key': 'fixedTests', 'type': 'TestFailureDetails'}, + 'new_failures': {'key': 'newFailures', 'type': 'TestFailureDetails'} + } + + def __init__(self, existing_failures=None, fixed_tests=None, new_failures=None): + super(TestResultFailuresAnalysis, self).__init__() + self.existing_failures = existing_failures + self.fixed_tests = fixed_tests + self.new_failures = new_failures + + +class TestResultHistory(Model): + """ + :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): + """ + :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): + """ + List of test results filtered on the basis of GroupByValue + + :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): + """ + Represents a Meta Data of a test result. + + :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 flaky_identifiers: List of Flaky Identifier for TestCaseReferenceId + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + :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'}, + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'}, + '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, flaky_identifiers=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.flaky_identifiers = flaky_identifiers + self.owner = owner + self.priority = priority + self.test_case_reference_id = test_case_reference_id + self.test_case_title = test_case_title + + +class TestResultMetaDataUpdateInput(Model): + """ + Represents a TestResultMetaData Input + + :param flaky_identifiers: List of Flaky Identifiers + :type flaky_identifiers: list of :class:`TestFlakyIdentifier ` + """ + + _attribute_map = { + 'flaky_identifiers': {'key': 'flakyIdentifiers', 'type': '[TestFlakyIdentifier]'} + } + + def __init__(self, flaky_identifiers=None): + super(TestResultMetaDataUpdateInput, self).__init__() + self.flaky_identifiers = flaky_identifiers + + +class TestResultModelBase(Model): + """ + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :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): + """ + Test parameter information in a test iteration. + + :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. Deprecated in hosted environment. + :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): + """ + :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): + """ + :param build: + :type build: :class:`BuildReference ` + :param context_type: + :type context_type: object + :param pipeline_reference: + :type pipeline_reference: :class:`PipelineReference ` + :param release: + :type release: :class:`ReleaseReference ` + """ + + _attribute_map = { + 'build': {'key': 'build', 'type': 'BuildReference'}, + 'context_type': {'key': 'contextType', 'type': 'object'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + 'release': {'key': 'release', 'type': 'ReleaseReference'} + } + + def __init__(self, build=None, context_type=None, pipeline_reference=None, release=None): + super(TestResultsContext, self).__init__() + self.build = build + self.context_type = context_type + self.pipeline_reference = pipeline_reference + self.release = release + + +class TestResultsDetails(Model): + """ + :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): + """ + :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 + :param tags: + :type tags: list of str + """ + + _attribute_map = { + 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, + 'results': {'key': 'results', 'type': '[TestCaseResult]'}, + 'results_count_by_outcome': {'key': 'resultsCountByOutcome', 'type': '{AggregatedResultsByOutcome}'}, + 'tags': {'key': 'tags', 'type': '[str]'} + } + + def __init__(self, group_by_value=None, results=None, results_count_by_outcome=None, tags=None): + super(TestResultsDetailsForGroup, self).__init__() + self.group_by_value = group_by_value + self.results = results + self.results_count_by_outcome = results_count_by_outcome + self.tags = tags + + +class TestResultsQuery(Model): + """ + :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 TestResultsSettings(Model): + """ + :param flaky_settings: IsRequired and EmitDefaultValue are passed as false as if users doesn't pass anything, should not come for serialisation and deserialisation. + :type flaky_settings: :class:`FlakySettings ` + :param new_test_result_logging_settings: + :type new_test_result_logging_settings: :class:`NewTestResultLoggingSettings ` + """ + + _attribute_map = { + 'flaky_settings': {'key': 'flakySettings', 'type': 'FlakySettings'}, + 'new_test_result_logging_settings': {'key': 'newTestResultLoggingSettings', 'type': 'NewTestResultLoggingSettings'} + } + + def __init__(self, flaky_settings=None, new_test_result_logging_settings=None): + super(TestResultsSettings, self).__init__() + self.flaky_settings = flaky_settings + self.new_test_result_logging_settings = new_test_result_logging_settings + + +class TestResultSummary(Model): + """ + :param aggregated_results_analysis: + :type aggregated_results_analysis: :class:`AggregatedResultsAnalysis ` + :param no_config_runs_count: + :type no_config_runs_count: int + :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 ` + :param total_runs_count: + :type total_runs_count: int + """ + + _attribute_map = { + 'aggregated_results_analysis': {'key': 'aggregatedResultsAnalysis', 'type': 'AggregatedResultsAnalysis'}, + 'no_config_runs_count': {'key': 'noConfigRunsCount', 'type': 'int'}, + 'team_project': {'key': 'teamProject', 'type': 'TeamProjectReference'}, + 'test_failures': {'key': 'testFailures', 'type': 'TestFailuresAnalysis'}, + 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, + 'total_runs_count': {'key': 'totalRunsCount', 'type': 'int'} + } + + def __init__(self, aggregated_results_analysis=None, no_config_runs_count=None, team_project=None, test_failures=None, test_results_context=None, total_runs_count=None): + super(TestResultSummary, self).__init__() + self.aggregated_results_analysis = aggregated_results_analysis + self.no_config_runs_count = no_config_runs_count + self.team_project = team_project + self.test_failures = test_failures + self.test_results_context = test_results_context + self.total_runs_count = total_runs_count + + +class TestResultsUpdateSettings(Model): + """ + :param flaky_settings: FlakySettings defines Flaky Settings Data. + :type flaky_settings: :class:`FlakySettings ` + :param new_test_result_logging_settings: NewTestResultLoggingSettings defines the setting for logging new test results + :type new_test_result_logging_settings: :class:`NewTestResultLoggingSettings ` + """ + + _attribute_map = { + 'flaky_settings': {'key': 'flakySettings', 'type': 'FlakySettings'}, + 'new_test_result_logging_settings': {'key': 'newTestResultLoggingSettings', 'type': 'NewTestResultLoggingSettings'} + } + + def __init__(self, flaky_settings=None, new_test_result_logging_settings=None): + super(TestResultsUpdateSettings, self).__init__() + self.flaky_settings = flaky_settings + self.new_test_result_logging_settings = new_test_result_logging_settings + + +class TestResultTrendFilter(Model): + """ + :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): + """ + Test run details. + + :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: Test Run Controller. + :type controller: str + :param created_date: Test Run CreatedDate. + :type created_date: datetime + :param custom_fields: List of Custom Fields for TestRun. + :type custom_fields: list of :class:`CustomTestField ` + :param drop_location: Drop Location for the test Run. + :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: Number of 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: Number of 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: Phase/State for the testRun. + :type phase: str + :param pipeline_reference: Reference of the pipeline to which this test run belongs. + :type pipeline_reference: :class:`PipelineReference ` + :param plan: Test plan associated with this test run. + :type plan: :class:`ShallowReference ` + :param post_process_state: Post Process State. + :type post_process_state: str + :param project: Project associated with this run. + :type project: :class:`ShallowReference ` + :param release: Release Reference for the Test Run. + :type release: :class:`ReleaseReference ` + :param release_environment_uri: Release Environment Uri for TestRun. + :type release_environment_uri: str + :param release_uri: Release Uri for TestRun. + :type release_uri: str + :param revision: + :type revision: int + :param run_statistics: RunSummary by outcome. + :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. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation + :type state: str + :param substate: TestRun Substate. + :type substate: object + :param tags: Tags attached with this test run. + :type tags: list of :class:`TestTag ` + :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: Number of failed tests in the run. + :type unanalyzed_tests: int + :param url: Url of the test run + :type url: str + :param web_access_url: Web Access Url for TestRun. + :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'}, + 'pipeline_reference': {'key': 'pipelineReference', 'type': 'PipelineReference'}, + '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'}, + 'tags': {'key': 'tags', 'type': '[TestTag]'}, + '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, pipeline_reference=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, tags=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.pipeline_reference = pipeline_reference + 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.tags = tags + 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): + """ + Test Run Code Coverage Details + + :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): + """ + Test run statistics. + + :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 TestSettings(Model): + """ + Represents the test settings of the run. Used to create test settings and fetch test settings + + :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): + """ + Represents a sub result of a test result. + + :param comment: Comment in sub result. + :type comment: str + :param completed_date: Time when test execution completed(UTC). + :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(UTC). + :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(UTC). + :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 TestSummaryForWorkItem(Model): + """ + :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 TestTag(Model): + """ + Tag attached to a run or result. + + :param name: Name of the tag, alphanumeric value less than 30 chars + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, name=None): + super(TestTag, self).__init__() + self.name = name + + +class TestTagSummary(Model): + """ + Test tag summary for build or release grouped by test run. + + :param tags_group_by_test_artifact: Dictionary which contains tags associated with a test run. + :type tags_group_by_test_artifact: dict + """ + + _attribute_map = { + 'tags_group_by_test_artifact': {'key': 'tagsGroupByTestArtifact', 'type': '{[TestTag]}'} + } + + def __init__(self, tags_group_by_test_artifact=None): + super(TestTagSummary, self).__init__() + self.tags_group_by_test_artifact = tags_group_by_test_artifact + + +class TestTagsUpdateModel(Model): + """ + Tags to update to a run or result. + + :param tags: + :type tags: list of { key: OperationType; value: [TestTag] } + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[{ key: OperationType; value: [TestTag] }]'} + } + + def __init__(self, tags=None): + super(TestTagsUpdateModel, self).__init__() + self.tags = tags + + +class TestToWorkItemLinks(Model): + """ + :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 WorkItemReference(Model): + """ + WorkItem reference Details. + + :param id: WorkItem Id. + :type id: str + :param name: WorkItem Name. + :type name: str + :param type: WorkItem Type. + :type type: str + :param url: WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case) + :type url: str + :param web_url: WorkItem WebUrl. + :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): + """ + :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): + """ + Represents a test step result. + + :param comment: Comment in result. + :type comment: str + :param completed_date: Time when execution completed(UTC). + :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(UTC). + :type started_date: datetime + :param action_path: Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step + :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. Deprecated in hosted environment. + :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', + 'AggregatedResultDetailsByOutcome', + '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', + 'NewTestResultLoggingSettings', + 'PhaseReference', + 'PipelineReference', + 'PipelineTestMetrics', + 'QueryModel', + 'ReferenceLinks', + 'ReleaseReference', + 'ResultsAnalysis', + 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', + 'RunCreateModel', + 'RunFilter', + 'RunStatistic', + 'RunSummary', + 'RunSummaryModel', + 'RunUpdateModel', + 'ShallowReference', + 'ShallowTestCaseResult', + 'SharedStepModel', + 'StageReference', + 'TeamProjectReference', + 'TestAttachment', + 'TestAttachmentReference', + 'TestAttachmentRequestModel', + 'TestCaseResult', + 'TestCaseResultAttachmentModel', + 'TestCaseResultIdentifier', + 'TestEnvironment', + 'TestFailureDetails', + 'TestFailuresAnalysis', + 'TestFailureType', + 'TestFlakyIdentifier', + 'TestHistoryQuery', + 'TestIterationDetailsModel', + 'TestLog', + 'TestLogReference', + 'TestLogStoreAttachment', + 'TestLogStoreAttachmentReference', + 'TestLogStoreEndpointDetails', + 'TestMessageLogDetails', + 'TestMethod', + 'TestOperationReference', + 'TestResolutionState', + 'TestResultDocument', + 'TestResultFailuresAnalysis', + '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', + 'TestActionResultModel', +] diff --git a/azure-devops/azure/devops/v7_1/test_results/test_results_client.py b/azure-devops/azure/devops/v7_1/test_results/test_results_client.py new file mode 100644 index 00000000..827c5930 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/test_results/test_results_client.py @@ -0,0 +1,532 @@ +# -------------------------------------------------------------------------------------------- +# 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 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 = 'c83eaf52-edf3-4034-ae11-17d38f25404c' + + def query_test_results_meta_data(self, test_case_reference_ids, project, details_to_include=None): + """QueryTestResultsMetaData. + [Preview API] Get list of test Result meta data details for corresponding testcasereferenceId + :param [str] test_case_reference_ids: TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200). + :param str project: Project ID or project name + :param str details_to_include: Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers. + :rtype: [TestResultMetaData] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if details_to_include is not None: + query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') + content = self._serialize.body(test_case_reference_ids, '[str]') + response = self._send(http_method='POST', + location_id='b72ff4c0-4341-4213-ba27-f517cf341c95', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestResultMetaData]', self._unwrap_collection(response)) + + def update_test_results_meta_data(self, test_result_meta_data_update_input, project, test_case_reference_id): + """UpdateTestResultsMetaData. + [Preview API] Update properties of test result meta data + :param :class:` ` test_result_meta_data_update_input: TestResultMetaData update input TestResultMetaDataUpdateInput + :param str project: Project ID or project name + :param int test_case_reference_id: TestCaseReference Id of Test Result to be updated. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_case_reference_id is not None: + route_values['testCaseReferenceId'] = self._serialize.url('test_case_reference_id', test_case_reference_id, 'int') + content = self._serialize.body(test_result_meta_data_update_input, 'TestResultMetaDataUpdateInput') + response = self._send(http_method='PATCH', + location_id='b72ff4c0-4341-4213-ba27-f517cf341c95', + version='7.1-preview.4', + route_values=route_values, + content=content) + return self._deserialize('TestResultMetaData', response) + + def create_build_attachment_in_log_store(self, attachment_request_model, project, build_id): + """CreateBuildAttachmentInLogStore. + [Preview API] Creates an attachment in the LogStore for the specified buildId. + :param :class:` ` attachment_request_model: Contains attachment info like stream, filename, comment, attachmentType + :param str project: Project ID or project name + :param int build_id: BuildId + """ + 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(attachment_request_model, 'TestAttachmentRequestModel') + self._send(http_method='POST', + location_id='6f747e16-18c2-435a-b4fb-fa05d6845fee', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def create_test_run_log_store_attachment(self, attachment_request_model, project, run_id): + """CreateTestRunLogStoreAttachment. + [Preview API] Creates an attachment in the LogStore for the specified runId. + :param :class:` ` attachment_request_model: Contains attachment info like stream, filename, comment, attachmentType + :param str project: Project ID or project name + :param int run_id: Test RunId + :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='1026d5de-4b0b-46ae-a31f-7c59b6af51ef', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestLogStoreAttachmentReference', response) + + def delete_test_run_log_store_attachment(self, project, run_id, filename): + """DeleteTestRunLogStoreAttachment. + [Preview API] Deletes the attachment with the specified filename for the specified runId from the LogStore. + :param str project: Project ID or project name + :param int run_id: Test RunId + :param str filename: Attachment FileName + """ + 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 filename is not None: + query_parameters['filename'] = self._serialize.query('filename', filename, 'str') + self._send(http_method='DELETE', + location_id='1026d5de-4b0b-46ae-a31f-7c59b6af51ef', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + + def get_test_run_log_store_attachment_content(self, project, run_id, filename, **kwargs): + """GetTestRunLogStoreAttachmentContent. + [Preview API] Returns the attachment with the specified filename for the specified runId from the LogStore. + :param str project: Project ID or project name + :param int run_id: Test RunId + :param str filename: Attachment FileName + :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') + query_parameters = {} + if filename is not None: + query_parameters['filename'] = self._serialize.query('filename', filename, 'str') + response = self._send(http_method='GET', + location_id='1026d5de-4b0b-46ae-a31f-7c59b6af51ef', + version='7.1-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_run_log_store_attachments(self, project, run_id): + """GetTestRunLogStoreAttachments. + [Preview API] Returns a list of attachments for the specified runId from the LogStore. + :param str project: Project ID or project name + :param int run_id: Test RunId + :rtype: [TestLogStoreAttachment] + """ + 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='1026d5de-4b0b-46ae-a31f-7c59b6af51ef', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[TestLogStoreAttachment]', self._unwrap_collection(response)) + + def get_test_run_log_store_attachment_zip(self, project, run_id, filename, **kwargs): + """GetTestRunLogStoreAttachmentZip. + [Preview API] Returns the attachment with the specified filename for the specified runId from the LogStore. + :param str project: Project ID or project name + :param int run_id: Test RunId + :param str filename: Attachment FileName + :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') + query_parameters = {} + if filename is not None: + query_parameters['filename'] = self._serialize.query('filename', filename, 'str') + response = self._send(http_method='GET', + location_id='1026d5de-4b0b-46ae-a31f-7c59b6af51ef', + version='7.1-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_failure_type(self, test_result_failure_type, project): + """CreateFailureType. + [Preview API] Creates a new test failure type + :param :class:` ` test_result_failure_type: + :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_result_failure_type, 'TestFailureType') + response = self._send(http_method='POST', + location_id='c4ac0486-830c-4a2a-9ef9-e8a1791a70fd', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TestFailureType', response) + + def delete_failure_type(self, project, failure_type_id): + """DeleteFailureType. + [Preview API] Deletes a test failure type with specified failureTypeId + :param str project: Project ID or project name + :param int failure_type_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if failure_type_id is not None: + route_values['failureTypeId'] = self._serialize.url('failure_type_id', failure_type_id, 'int') + self._send(http_method='DELETE', + location_id='c4ac0486-830c-4a2a-9ef9-e8a1791a70fd', + version='7.1-preview.1', + route_values=route_values) + + def get_failure_types(self, project): + """GetFailureTypes. + [Preview API] Returns the list of test failure types. + :param str project: Project ID or project name + :rtype: [TestFailureType] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='c4ac0486-830c-4a2a-9ef9-e8a1791a70fd', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[TestFailureType]', self._unwrap_collection(response)) + + def get_test_result_logs(self, project, run_id, result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestResultLogs. + [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 result_id: Id of the test result + :param str type: type of attachments to get + :param str directory_path: directory path of attachments to get + :param str file_name_prefix: file name prefix to filter the list of attachment + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Numbe of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_sub_result_logs(self, project, run_id, result_id, sub_result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestSubResultLogs. + [Preview API] Get list of test subresult attachments reference + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains the results + :param int result_id: Id of the test result that contains subresult + :param int sub_result_id: Id of the test subresult + :param str type: type of the attachments to get + :param str directory_path: directory path of the attachment to get + :param str file_name_prefix: file name prefix to filter the list of attachments + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Number of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_run_logs(self, project, run_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): + """GetTestRunLogs. + [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 + :param str type: type of the attachments to get + :param str directory_path: directory path for which attachments are needed + :param str file_name_prefix: file name prefix to filter the list of attachment + :param bool fetch_meta_data: Default is false, set if metadata is needed + :param int top: Number of attachments reference to return + :param String continuation_token: Header to pass the continuationToken + :rtype: :class:`<[TestLog]> ` + """ + 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 type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if directory_path is not None: + query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') + if file_name_prefix is not None: + query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') + if fetch_meta_data is not None: + query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + additional_headers = {} + if continuation_token is not None: + additional_headers['x-ms-continuationtoken'] = continuation_token + response = self._send(http_method='GET', + location_id='5b47b946-e875-4c9a-acdc-2a20996caebe', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers) + return self._deserialize('[TestLog]', self._unwrap_collection(response)) + + def get_test_log_store_endpoint_details_for_result_log(self, project, run_id, result_id, type, file_path): + """GetTestLogStoreEndpointDetailsForResultLog. + [Preview API] Get SAS Uri of a test results attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains result + :param int result_id: Id of the test result whose files need to be downloaded + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def get_test_log_store_endpoint_details_for_sub_result_log(self, project, run_id, result_id, sub_result_id, type, file_path): + """GetTestLogStoreEndpointDetailsForSubResultLog. + [Preview API] Get SAS Uri of a test subresults attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains result + :param int result_id: Id of the test result that contains subresult + :param int sub_result_id: Id of the test subresult whose file sas uri is needed + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def test_log_store_endpoint_details_for_result(self, project, run_id, result_id, sub_result_id, file_path, type): + """TestLogStoreEndpointDetailsForResult. + [Preview API] Create empty file for a result and Get Sas uri for the file + :param str project: Project ID or project name + :param int run_id: Id of the test run that contains the result + :param int result_id: Id of the test results that contains sub result + :param int sub_result_id: Id of the test sub result whose file sas uri is needed + :param str file_path: file path inside the sub result for which sas uri is needed + :param str type: Type of the file for download + :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 result_id is not None: + route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') + query_parameters = {} + if sub_result_id is not None: + query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='POST', + location_id='da630b37-1236-45b5-945e-1d7bdb673850', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def get_test_log_store_endpoint_details_for_run_log(self, project, run_id, type, file_path): + """GetTestLogStoreEndpointDetailsForRunLog. + [Preview API] Get SAS Uri of a test run attachment + :param str project: Project ID or project name + :param int run_id: Id of the test run whose file has to be downloaded + :param str type: type of the file + :param str file_path: filePath for which sas uri is needed + :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 type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + response = self._send(http_method='GET', + location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + + def test_log_store_endpoint_details_for_run(self, project, run_id, test_log_store_operation_type, file_path=None, type=None): + """TestLogStoreEndpointDetailsForRun. + [Preview API] Create empty file for a run and Get Sas uri for the file + :param str project: Project ID or project name + :param int run_id: Id of the run to get endpoint details + :param str test_log_store_operation_type: Type of operation to perform using sas uri + :param str file_path: file path to create an empty file + :param str type: Default is GeneralAttachment, type of empty file to be created + :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 test_log_store_operation_type is not None: + query_parameters['testLogStoreOperationType'] = self._serialize.query('test_log_store_operation_type', test_log_store_operation_type, 'str') + if file_path is not None: + query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='POST', + location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestLogStoreEndpointDetails', response) + diff --git a/azure-devops/azure/devops/v7_1/tfvc/__init__.py b/azure-devops/azure/devops/v7_1/tfvc/__init__.py new file mode 100644 index 00000000..84b77dc9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/tfvc/__init__.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'FileContentMetadata', + 'GitRepository', + 'GitRepositoryRef', + 'GraphSubjectBase', + 'Change', + 'CheckinNote', + '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' +] diff --git a/azure-devops/azure/devops/v7_1/tfvc/models.py b/azure-devops/azure/devops/v7_1/tfvc/models.py new file mode 100644 index 00000000..3711346c --- /dev/null +++ b/azure-devops/azure/devops/v7_1/tfvc/models.py @@ -0,0 +1,1444 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 FileContentMetadata(Model): + """ + :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): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :param is_fork: True if the repository was created as a fork. + :type is_fork: bool + :param is_in_maintenance: True if the repository is in maintenance. False otherwise. + :type is_in_maintenance: 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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + 'is_fork': {'key': 'isFork', 'type': 'bool'}, + 'is_in_maintenance': {'key': 'isInMaintenance', '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=None, is_fork=None, is_in_maintenance=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + self.is_fork = is_fork + self.is_in_maintenance = is_in_maintenance + 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 + self.web_url = web_url + + +class GitRepositoryRef(Model): + """ + :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): + """ + :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 Change(Model): + """ + :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): + """ + :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 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 ItemContent(Model): + """ + :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): + """ + :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): + """ + 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 TeamProjectCollectionReference(Model): + """ + Reference object for a TeamProjectCollection. + + :param avatar_url: Collection avatar Url. + :type avatar_url: str + :param id: Collection Id. + :type id: str + :param name: Collection Name. + :type name: str + :param url: Collection REST Url. + :type url: str + """ + + _attribute_map = { + 'avatar_url': {'key': 'avatarUrl', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, avatar_url=None, id=None, name=None, url=None): + super(TeamProjectCollectionReference, self).__init__() + self.avatar_url = avatar_url + self.id = id + self.name = name + self.url = url + + +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 TfvcBranchMapping(Model): + """ + A branch mapping. + + :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): + """ + A change. + + :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): + """ + Metadata for a changeset. + + :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 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 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 url: URL to retrieve the item. + :type url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'author': {'key': 'author', 'type': 'IdentityRef'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'}, + 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, _links=None, author=None, comment=None, comment_truncated=None, created_date=None, changeset_id=None, checked_in_by=None, url=None): + super(TfvcChangesetRef, self).__init__() + self._links = _links + self.author = author + self.comment = comment + self.comment_truncated = comment_truncated + self.created_date = created_date + self.changeset_id = changeset_id + self.checked_in_by = checked_in_by + self.url = url + + +class TfvcChangesetSearchCriteria(Model): + """ + Criteria used in a search for change lists. + + :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): + """ + Request body for Get batched changesets. + + :param comment_length: Max length of the comment. + :type comment_length: int + :param changeset_ids: List of changeset Ids. + :type changeset_ids: list of int + :param include_links: Whether to include the _links field on the shallow references + :type include_links: bool + """ + + _attribute_map = { + 'comment_length': {'key': 'commentLength', 'type': 'int'}, + 'changeset_ids': {'key': 'changesetIds', 'type': '[int]'}, + 'include_links': {'key': 'includeLinks', 'type': 'bool'} + } + + def __init__(self, comment_length=None, changeset_ids=None, include_links=None): + super(TfvcChangesetsRequestData, self).__init__() + self.comment_length = comment_length + self.changeset_ids = changeset_ids + self.include_links = include_links + + +class TfvcItem(ItemModel): + """ + Metadata for an item. + + :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 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 change_date: Item changed datetime. + :type change_date: datetime + :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'}, + 'deletion_id': {'key': 'deletionId', 'type': 'int'}, + 'encoding': {'key': 'encoding', 'type': 'int'}, + 'hash_value': {'key': 'hashValue', 'type': 'str'}, + 'change_date': {'key': 'changeDate', 'type': 'iso-8601'}, + '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, deletion_id=None, encoding=None, hash_value=None, change_date=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.deletion_id = deletion_id + self.encoding = encoding + self.hash_value = hash_value + self.change_date = change_date + self.is_branch = is_branch + self.is_pending_change = is_pending_change + self.size = size + self.version = version + + +class TfvcItemDescriptor(Model): + """ + Item path and Version descriptor properties + + :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): + """ + Request body used by Get Items Batch + + :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): + """ + Metadata for a Label. + + :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): + """ + :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): + """ + MappingFilter can be used to include or exclude specific paths. + + :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): + """ + :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): + """ + Policy failure information. + + :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): + """ + Information on the policy override. + + :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): + """ + This is the shallow branchref class. + + :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): + """ + Metadata for a shallow shelveset. + + :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): + """ + :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_comment_length: Max length of comment + :type max_comment_length: int + :param max_change_count: Max number of changes to include + :type max_change_count: 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_comment_length': {'key': 'maxCommentLength', 'type': 'int'}, + 'max_change_count': {'key': 'maxChangeCount', '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_comment_length=None, max_change_count=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_comment_length = max_comment_length + self.max_change_count = max_change_count + self.name = name + self.owner = owner + + +class TfvcStatistics(Model): + """ + :param file_count_total: Count of files at the requested scope. + :type file_count_total: long + :param changeset_id: Id of the last changeset the stats are based on. + :type changeset_id: int + """ + + _attribute_map = { + 'file_count_total': {'key': 'fileCountTotal', 'type': 'long'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'} + } + + def __init__(self, file_count_total=None, changeset_id=None): + super(TfvcStatistics, self).__init__() + self.file_count_total = file_count_total + self.changeset_id = changeset_id + + +class TfvcVersionDescriptor(Model): + """ + Version descriptor properties. + + :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): + """ + :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): + """ + :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): + """ + Metadata for a branchref. + + :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): + """ + A collection of changes. + + :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 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 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 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 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 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 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'}, + 'comment': {'key': 'comment', 'type': 'str'}, + 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'changeset_id': {'key': 'changesetId', 'type': 'int'}, + 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, + 'url': {'key': 'url', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'collection_id': {'key': 'collectionId', 'type': 'str'}, + 'has_more_changes': {'key': 'hasMoreChanges', 'type': 'bool'}, + 'changes': {'key': 'changes', 'type': '[TfvcChange]'}, + 'checkin_notes': {'key': 'checkinNotes', 'type': '[CheckinNote]'}, + '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, comment=None, comment_truncated=None, created_date=None, changeset_id=None, checked_in_by=None, url=None, account_id=None, collection_id=None, has_more_changes=None, changes=None, checkin_notes=None, policy_override=None, team_project_ids=None, work_items=None): + super(TfvcChangeset, self).__init__(_links=_links, author=author, comment=comment, comment_truncated=comment_truncated, created_date=created_date, changeset_id=changeset_id, checked_in_by=checked_in_by, url=url) + self.account_id = account_id + self.collection_id = collection_id + self.has_more_changes = has_more_changes + self.changes = changes + self.checkin_notes = checkin_notes + self.policy_override = policy_override + self.team_project_ids = team_project_ids + self.work_items = work_items + + +class TfvcLabel(TfvcLabelRef): + """ + Metadata for a label. + + :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): + """ + Metadata for a shelveset. + + :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): + """ + Class representing a branch object. + + :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', + 'FileContentMetadata', + 'GitRepository', + 'GitRepositoryRef', + 'GraphSubjectBase', + 'Change', + 'CheckinNote', + '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', +] diff --git a/azure-devops/azure/devops/v7_1/tfvc/tfvc_client.py b/azure-devops/azure/devops/v7_1/tfvc/tfvc_client.py new file mode 100644 index 00000000..da56901d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/tfvc/tfvc_client.py @@ -0,0 +1,750 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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:`<[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') + 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) + + def create_changeset(self, changeset, project=None): + """CreateChangeset. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.1', + content=content) + return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) + + def get_changeset_work_items(self, id=None): + """GetChangesetWorkItems. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) + + def get_items_batch(self, item_request_data, project=None): + """GetItemsBatch. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-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_items(self, project=None, scope_path=None, recursion_level=None, include_links=None, version_descriptor=None): + """GetItems. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.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 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. + [Preview API] 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='7.1-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 get_label_items(self, label_id, top=None, skip=None): + """GetLabelItems. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.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. + [Preview API] 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, defaults to 100 when undefined + :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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) + + def get_shelveset(self, shelveset_id, request_data=None): + """GetShelveset. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('TfvcShelveset', response) + + def get_shelvesets(self, request_data=None, top=None, skip=None): + """GetShelvesets. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[TfvcShelvesetRef]', self._unwrap_collection(response)) + + def get_shelveset_work_items(self, shelveset_id): + """GetShelvesetWorkItems. + [Preview API] 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/token_admin/__init__.py b/azure-devops/azure/devops/v7_1/token_admin/__init__.py new file mode 100644 index 00000000..69575947 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/token_admin/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'SessionTokenResult', + 'TokenAdminPagedSessionTokens', + 'TokenAdminRevocation', + 'TokenAdminRevocationRule', + 'TokenAdminClient' +] diff --git a/azure-devops/azure/devops/v7_1/token_admin/models.py b/azure-devops/azure/devops/v7_1/token_admin/models.py new file mode 100644 index 00000000..a14cd5fb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/token_admin/models.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Represents a session token used to access Azure DevOps resources + + :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 claims: + :type claims: dict + :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'}, + 'claims': {'key': 'claims', '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, claims=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.claims = claims + 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 SessionTokenResult(Model): + """ + :param has_error: + :type has_error: bool + :param session_token: + :type session_token: :class:`SessionToken ` + :param session_token_error: + :type session_token_error: object + """ + + _attribute_map = { + 'has_error': {'key': 'hasError', 'type': 'bool'}, + 'session_token': {'key': 'sessionToken', 'type': 'SessionToken'}, + 'session_token_error': {'key': 'sessionTokenError', 'type': 'object'} + } + + def __init__(self, has_error=None, session_token=None, session_token_error=None): + super(SessionTokenResult, self).__init__() + self.has_error = has_error + self.session_token = session_token + self.session_token_error = session_token_error + + +class TokenAdminPagedSessionTokens(Model): + """ + A paginated list of session tokens. Session tokens correspond to OAuth credentials such as personal access tokens (PATs) and other OAuth authorizations. + + :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): + """ + A request to revoke a particular delegated authorization. + + :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): + """ + A rule which is applied to disable any incoming delegated authorization which matches the given properties. + + :param created_before: A datetime cutoff. Tokens created before this time will be rejected. This is an optional parameter. 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 Azure DevOps, see: https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#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', + 'SessionTokenResult', + 'TokenAdminPagedSessionTokens', + 'TokenAdminRevocation', + 'TokenAdminRevocationRule', +] diff --git a/azure-devops/azure/devops/v7_1/token_admin/token_admin_client.py b/azure-devops/azure/devops/v7_1/token_admin/token_admin_client.py new file mode 100644 index 00000000..705874cc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/token_admin/token_admin_client.py @@ -0,0 +1,80 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-preview.1', + query_parameters=query_parameters, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/upack_api/__init__.py b/azure-devops/azure/devops/v7_1/upack_api/__init__.py new file mode 100644 index 00000000..5a9801e6 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_api/__init__.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/upack_api/models.py b/azure-devops/azure/devops/v7_1/upack_api/models.py new file mode 100644 index 00000000..4ec449cb --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_api/models.py @@ -0,0 +1,219 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data. + + """ + + _attribute_map = { + } + + def __init__(self): + super(BatchOperationData, self).__init__() + + +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 MinimalPackageDetails(Model): + """ + Minimal package details required to identify a package within a protocol. + + :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 version metadata for a Universal 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): + """ + :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): + """ + 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 UPackPackagesBatchRequest(Model): + """ + A batch of operations to apply to package versions. + + :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): + """ + Deletion state of a Universal package. + + :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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/upack_api/upack_api_client.py b/azure-devops/azure/devops/v7_1/upack_api/upack_api_client.py new file mode 100644 index 00000000..cd969875 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_api/upack_api_client.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# 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 update_package_versions(self, batch_request, feed_id, project=None): + """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. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'UPackPackagesBatchRequest') + self._send(http_method='POST', + location_id='c17e81ae-4caa-4d8b-a431-6b329e890281', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def update_recycle_bin_package_versions(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackageVersions. + [Preview API] Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. Operation must be PermanentDelete or RestoreToFeed + :param str feed_id: Feed which contains the packages to update. + :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 feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'UPackPackagesBatchRequest') + self._send(http_method='POST', + location_id='12f73313-0937-4114-bb9f-4e9e720fdc78', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_package_version(self, feed_id, package_name, package_version, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Package', response) + + def get_package_version(self, feed_id, package_name, package_version, project=None, 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 str project: Project ID or project name + :param bool show_deleted: True to show information for deleted versions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """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. + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + diff --git a/azure-devops/azure/devops/v7_1/upack_packaging/__init__.py b/azure-devops/azure/devops/v7_1/upack_packaging/__init__.py new file mode 100644 index 00000000..b1e72abc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_packaging/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/upack_packaging/models.py b/azure-devops/azure/devops/v7_1/upack_packaging/models.py new file mode 100644 index 00000000..a8fd9ecd --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_packaging/models.py @@ -0,0 +1,141 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param description: + :type description: str + :param version: + :type version: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, description=None, version=None): + super(UPackLimitedPackageMetadata, self).__init__() + self.description = description + self.version = version + + +class UPackLimitedPackageMetadataListResponse(Model): + """ + :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): + """ + :param description: + :type description: str + :param manifest_id: + :type manifest_id: str + :param package_size: + :type package_size: long + :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'}, + 'package_size': {'key': 'packageSize', 'type': 'long'}, + 'super_root_id': {'key': 'superRootId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'} + } + + def __init__(self, description=None, manifest_id=None, package_size=None, super_root_id=None, version=None): + super(UPackPackageMetadata, self).__init__() + self.description = description + self.manifest_id = manifest_id + self.package_size = package_size + self.super_root_id = super_root_id + self.version = version + + +class UPackPackagePushMetadata(Model): + """ + Contains the parameters for adding a new Universal Package to the feed, except for name and version which are transmitted in the URL + + :param description: + :type description: str + :param manifest_id: + :type manifest_id: str + :param proof_nodes: + :type proof_nodes: list of str + :param super_root_id: + :type super_root_id: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'manifest_id': {'key': 'manifestId', 'type': 'str'}, + 'proof_nodes': {'key': 'proofNodes', 'type': '[str]'}, + 'super_root_id': {'key': 'superRootId', 'type': 'str'} + } + + def __init__(self, description=None, manifest_id=None, proof_nodes=None, super_root_id=None): + super(UPackPackagePushMetadata, self).__init__() + self.description = description + self.manifest_id = manifest_id + self.proof_nodes = proof_nodes + self.super_root_id = super_root_id + + +class UPackPackageVersionDeletionState(Model): + """ + Deletion state of a Universal package. + + :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', +] diff --git a/azure-devops/azure/devops/v7_1/upack_packaging/upack_packaging_client.py b/azure-devops/azure/devops/v7_1/upack_packaging/upack_packaging_client.py new file mode 100644 index 00000000..929f89dc --- /dev/null +++ b/azure-devops/azure/devops/v7_1/upack_packaging/upack_packaging_client.py @@ -0,0 +1,102 @@ +# -------------------------------------------------------------------------------------------- +# 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, project=None): + """AddPackage. + [Preview API] + :param :class:` ` metadata: + :param str feed_id: + :param str package_name: + :param str package_version: + :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 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='7.1-preview.1', + route_values=route_values, + content=content) + + def get_package_metadata(self, feed_id, package_name, package_version, project=None, intent=None): + """GetPackageMetadata. + [Preview API] + :param str feed_id: + :param str package_name: + :param str package_version: + :param str project: Project ID or project name + :param str intent: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='7.1-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, project=None): + """GetPackageVersionsMetadata. + [Preview API] + :param str feed_id: + :param str package_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 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('UPackLimitedPackageMetadataListResponse', response) + diff --git a/azure-devops/azure/devops/v7_1/wiki/__init__.py b/azure-devops/azure/devops/v7_1/wiki/__init__.py new file mode 100644 index 00000000..fa52900d --- /dev/null +++ b/azure-devops/azure/devops/v7_1/wiki/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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__ = [ + 'Comment', + 'CommentAttachment', + 'CommentCreateParameters', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentResourceReference', + 'CommentUpdateParameters', + 'GitRepository', + 'GitRepositoryRef', + 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WikiAttachment', + 'WikiAttachmentResponse', + 'WikiCreateBaseParameters', + 'WikiCreateParametersV2', + 'WikiPage', + 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', + 'WikiPageMove', + 'WikiPageMoveParameters', + 'WikiPageMoveResponse', + 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', + 'WikiPageViewStats', + 'WikiUpdateParameters', + 'WikiV2', + 'WikiClient' +] diff --git a/azure-devops/azure/devops/v7_1/wiki/models.py b/azure-devops/azure/devops/v7_1/wiki/models.py new file mode 100644 index 00000000..118b261e --- /dev/null +++ b/azure-devops/azure/devops/v7_1/wiki/models.py @@ -0,0 +1,1064 @@ +# -------------------------------------------------------------------------------------------- +# 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 CommentCreateParameters(Model): + """ + Represents a request to create a work item comment. + + :param parent_id: Optional CommentId of the parent in order to add a reply for an existing comment + :type parent_id: int + :param text: + :type text: str + """ + + _attribute_map = { + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, parent_id=None, text=None): + super(CommentCreateParameters, self).__init__() + self.parent_id = parent_id + self.text = text + + +class CommentResourceReference(Model): + """ + Base class for comment resource references + + :param url: + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, url=None): + super(CommentResourceReference, self).__init__() + self.url = url + + +class CommentUpdateParameters(Model): + """ + Represents a request to update a comment. + + :param state: Set the current state of the comment + :type state: object + :param text: The updated text of the comment + :type text: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'object'}, + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, state=None, text=None): + super(CommentUpdateParameters, self).__init__() + self.state = state + self.text = text + + +class GitRepository(Model): + """ + :param _links: + :type _links: :class:`ReferenceLinks ` + :param default_branch: + :type default_branch: str + :param id: + :type id: str + :param is_disabled: True if the repository is disabled. False otherwise. + :type is_disabled: bool + :param is_fork: True if the repository was created as a fork. + :type is_fork: bool + :param is_in_maintenance: True if the repository is in maintenance. False otherwise. + :type is_in_maintenance: 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 + :param web_url: + :type web_url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + 'is_fork': {'key': 'isFork', 'type': 'bool'}, + 'is_in_maintenance': {'key': 'isInMaintenance', '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]'}, + 'web_url': {'key': 'webUrl', 'type': 'str'} + } + + def __init__(self, _links=None, default_branch=None, id=None, is_disabled=None, is_fork=None, is_in_maintenance=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None, web_url=None): + super(GitRepository, self).__init__() + self._links = _links + self.default_branch = default_branch + self.id = id + self.is_disabled = is_disabled + self.is_fork = is_fork + self.is_in_maintenance = is_in_maintenance + 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 + self.web_url = web_url + + +class GitRepositoryRef(Model): + """ + :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 GitVersionDescriptor(Model): + """ + :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 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 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 TeamProjectCollectionReference(Model): + """ + :param avatar_url: + :type avatar_url: str + :param id: + :type id: str + :param name: + :type name: str + :param url: + :type url: str + """ + + _attribute_map = { + 'avatar_url': {'key': 'avatarUrl', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, avatar_url=None, id=None, name=None, url=None): + super(TeamProjectCollectionReference, self).__init__() + self.avatar_url = avatar_url + self.id = id + self.name = name + self.url = url + + +class TeamProjectReference(Model): + """ + :param abbreviation: + :type abbreviation: str + :param default_team_image_url: + :type default_team_image_url: 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 revision: + :type revision: long + :param state: + :type state: object + :param url: + :type url: str + :param 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 WikiAttachment(Model): + """ + Defines properties for wiki attachment file. + + :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): + """ + Response contract for the Wiki Attachments API + + :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): + """ + Base wiki creation parameters. + + :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): + """ + Wiki creation parameters. + + :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): + """ + Contract encapsulating parameters for the page create or update operations. + + :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 WikiPageDetail(Model): + """ + Defines a page with its metedata in a wiki. + + :param id: When present, permanent identifier for the wiki page + :type id: int + :param path: Path of the wiki page. + :type path: str + :param view_stats: Path of the wiki page. + :type view_stats: list of :class:`WikiPageStat ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + 'view_stats': {'key': 'viewStats', 'type': '[WikiPageStat]'} + } + + def __init__(self, id=None, path=None, view_stats=None): + super(WikiPageDetail, self).__init__() + self.id = id + self.path = path + self.view_stats = view_stats + + +class WikiPageMoveParameters(Model): + """ + Contract encapsulating parameters for the page move operation. + + :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): + """ + Response contract for the Wiki Page Move API. + + :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): + """ + Response contract for the Wiki Pages PUT, PATCH and DELETE APIs. + + :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 WikiPagesBatchRequest(Model): + """ + Contract encapsulating parameters for the pages batch. + + :param continuation_token: If the list of page data returned is not complete, a continuation token to query next batch of pages is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of Wiki Page Data. + :type continuation_token: str + :param page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :type page_views_for_days: int + :param top: Total count of pages on a wiki to return. + :type top: int + """ + + _attribute_map = { + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'page_views_for_days': {'key': 'pageViewsForDays', 'type': 'int'}, + 'top': {'key': 'top', 'type': 'int'} + } + + def __init__(self, continuation_token=None, page_views_for_days=None, top=None): + super(WikiPagesBatchRequest, self).__init__() + self.continuation_token = continuation_token + self.page_views_for_days = page_views_for_days + self.top = top + + +class WikiPageStat(Model): + """ + Defines properties for wiki page stat. + + :param count: the count of the stat for the Day + :type count: int + :param day: Day of the stat + :type day: datetime + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'iso-8601'} + } + + def __init__(self, count=None, day=None): + super(WikiPageStat, self).__init__() + self.count = count + self.day = day + + +class WikiPageViewStats(Model): + """ + Defines properties for wiki page view stats. + + :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): + """ + Wiki update parameters. + + :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): + """ + Defines a wiki resource. + + :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 is_disabled: Is wiki repository disabled + :type is_disabled: bool + :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'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + '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, is_disabled=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.is_disabled = is_disabled + self.properties = properties + self.remote_url = remote_url + self.url = url + self.versions = versions + + +class Comment(CommentResourceReference): + """ + Comment on an artifact like Work Item or Wiki, etc. + + :param url: + :type url: str + :param artifact_id: The id of the artifact this comment belongs to + :type artifact_id: str + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted. + :type is_deleted: bool + :param mentions: The mentions of the comment. + :type mentions: list of :class:`CommentMention ` + :param modified_by: IdentityRef of the user who last modified the comment. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The last modification date of the comment. + :type modified_date: datetime + :param parent_id: The comment id of the parent comment, if any + :type parent_id: int + :param reactions: The reactions on the comment. + :type reactions: list of :class:`CommentReaction ` + :param rendered_text: The rendered text of the comment + :type rendered_text: str + :param replies: Replies for this comment + :type replies: :class:`CommentList ` + :param state: Indicates the current state of the comment + :type state: object + :param text: The plaintext/markdown version of the comment + :type text: str + :param version: The current version of the comment + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'mentions': {'key': 'mentions', 'type': '[CommentMention]'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'reactions': {'key': 'reactions', 'type': '[CommentReaction]'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + 'replies': {'key': 'replies', 'type': 'CommentList'}, + 'state': {'key': 'state', 'type': 'object'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, artifact_id=None, created_by=None, created_date=None, id=None, is_deleted=None, mentions=None, modified_by=None, modified_date=None, parent_id=None, reactions=None, rendered_text=None, replies=None, state=None, text=None, version=None): + super(Comment, self).__init__(url=url) + self.artifact_id = artifact_id + self.created_by = created_by + self.created_date = created_date + self.id = id + self.is_deleted = is_deleted + self.mentions = mentions + self.modified_by = modified_by + self.modified_date = modified_date + self.parent_id = parent_id + self.reactions = reactions + self.rendered_text = rendered_text + self.replies = replies + self.state = state + self.text = text + self.version = version + + +class CommentAttachment(CommentResourceReference): + """ + Represents an attachment to a comment. + + :param url: + :type url: str + :param created_by: IdentityRef of the creator of the attachment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the attachment. + :type created_date: datetime + :param id: Unique Id of the attachment. + :type id: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, url=None, created_by=None, created_date=None, id=None): + super(CommentAttachment, self).__init__(url=url) + self.created_by = created_by + self.created_date = created_date + self.id = id + + +class CommentList(CommentResourceReference): + """ + Represents a list of comments. + + :param url: + :type url: str + :param comments: List of comments in the current batch. + :type comments: list of :class:`Comment ` + :param continuation_token: A string token that can be used to retrieving next page of comments if available. Otherwise null. + :type continuation_token: str + :param count: The count of comments in the current batch. + :type count: int + :param next_page: Uri to the next page of comments if it is available. Otherwise null. + :type next_page: str + :param total_count: Total count of comments on a work item. + :type total_count: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comments': {'key': 'comments', 'type': '[Comment]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'next_page': {'key': 'nextPage', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, url=None, comments=None, continuation_token=None, count=None, next_page=None, total_count=None): + super(CommentList, self).__init__(url=url) + self.comments = comments + self.continuation_token = continuation_token + self.count = count + self.next_page = next_page + self.total_count = total_count + + +class CommentMention(CommentResourceReference): + """ + Contains information about various artifacts mentioned in the comment + + :param url: + :type url: str + :param artifact_id: Id of the artifact this mention belongs to + :type artifact_id: str + :param comment_id: Id of the comment associated with this mention. Nullable to support legacy mentions which can potentially have null commentId + :type comment_id: int + :param mentioned_artifact: Value of the mentioned artifact. Expected Value varies by CommentMentionType: Person: VSID associated with the identity Work Item: ID of the work item Pull Request: ID of the Pull Request + :type mentioned_artifact: str + :param type: The context which represent where this mentioned was parsed from + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'mentioned_artifact': {'key': 'mentionedArtifact', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, artifact_id=None, comment_id=None, mentioned_artifact=None, type=None): + super(CommentMention, self).__init__(url=url) + self.artifact_id = artifact_id + self.comment_id = comment_id + self.mentioned_artifact = mentioned_artifact + self.type = type + + +class CommentReaction(CommentResourceReference): + """ + Contains information about comment reaction for a particular reaction type. + + :param url: + :type url: str + :param comment_id: The id of the comment this reaction belongs to. + :type comment_id: int + :param count: Total number of reactions for the CommentReactionType. + :type count: int + :param is_current_user_engaged: Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment). + :type is_current_user_engaged: bool + :param type: Type of the reaction. + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'is_current_user_engaged': {'key': 'isCurrentUserEngaged', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, comment_id=None, count=None, is_current_user_engaged=None, type=None): + super(CommentReaction, self).__init__(url=url) + self.comment_id = comment_id + self.count = count + self.is_current_user_engaged = is_current_user_engaged + self.type = type + + +class WikiPage(WikiPageCreateOrUpdateParameters): + """ + Defines a page in a wiki. + + :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 id: When present, permanent identifier for the wiki page + :type id: int + :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'}, + 'id': {'key': 'id', 'type': 'int'}, + '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, id=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.id = id + 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): + """ + Request contract for Wiki Page Move. + + :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__ = [ + 'CommentCreateParameters', + 'CommentResourceReference', + 'CommentUpdateParameters', + 'GitRepository', + 'GitRepositoryRef', + 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TeamProjectCollectionReference', + 'TeamProjectReference', + 'WikiAttachment', + 'WikiAttachmentResponse', + 'WikiCreateBaseParameters', + 'WikiCreateParametersV2', + 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', + 'WikiPageMoveParameters', + 'WikiPageMoveResponse', + 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', + 'WikiPageViewStats', + 'WikiUpdateParameters', + 'WikiV2', + 'Comment', + 'CommentAttachment', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'WikiPage', + 'WikiPageMove', +] diff --git a/azure-devops/azure/devops/v7_1/wiki/wiki_client.py b/azure-devops/azure/devops/v7_1/wiki/wiki_client.py new file mode 100644 index 00000000..7474156a --- /dev/null +++ b/azure-devops/azure/devops/v7_1/wiki/wiki_client.py @@ -0,0 +1,625 @@ +# -------------------------------------------------------------------------------------------- +# 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, version_descriptor=None, **kwargs): + """CreateAttachment. + [Preview API] 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 wiki 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='7.1-preview.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. + [Preview API] 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 wiki 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='7.1-preview.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. + [Preview API] 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 wiki 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='7.1-preview.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. + [Preview API] Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki 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='7.1-preview.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. + [Preview API] 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 wiki 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='7.1-preview.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. + [Preview API] 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 wiki 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='7.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 get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): + """GetPageZip. + [Preview API] 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 wiki 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='7.1-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 delete_page_by_id(self, project, wiki_identifier, id, comment=None): + """DeletePageById. + [Preview API] Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + response = self._send(http_method='DELETE', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.1-preview.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_by_id(self, project, wiki_identifier, id, recursion_level=None, include_content=None): + """GetPageById. + [Preview API] Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.1-preview.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_by_id_text(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdText. + [Preview API] Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.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 get_page_by_id_zip(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdZip. + [Preview API] Gets metadata or content of the wiki page for the provided page id. 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 wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + 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='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.1-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 update_page_by_id(self, parameters, project, wiki_identifier, id, version, comment=None): + """UpdatePageById. + [Preview API] Edits a wiki page. + :param :class:` ` parameters: Wiki update operation parameters. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :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') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + 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='PATCH', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.1-preview.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 get_pages_batch(self, pages_batch_request, project, wiki_identifier, version_descriptor=None): + """GetPagesBatch. + [Preview API] Returns pageable list of Wiki Pages + :param :class:` ` pages_batch_request: Wiki batch page request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:`<[WikiPageDetail]> ` + """ + 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 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(pages_batch_request, 'WikiPagesBatchRequest') + response = self._send(http_method='POST', + location_id='71323c46-2592-4398-8771-ced73dd87207', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[WikiPageDetail]', self._unwrap_collection(response)) + + def get_page_data(self, project, wiki_identifier, page_id, page_views_for_days=None): + """GetPageData. + [Preview API] Returns page detail corresponding to Page ID. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int page_id: Wiki page ID. + :param int page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :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') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'int') + query_parameters = {} + if page_views_for_days is not None: + query_parameters['pageViewsForDays'] = self._serialize.query('page_views_for_days', page_views_for_days, 'int') + response = self._send(http_method='GET', + location_id='81c4e0fe-7663-4d62-ad46-6ab78459f274', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WikiPageDetail', response) + + def create_wiki(self, wiki_create_params, project=None): + """CreateWiki. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('WikiV2', response) + + def delete_wiki(self, wiki_identifier, project=None): + """DeleteWiki. + [Preview API] Deletes the wiki corresponding to the wiki ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WikiV2', response) + + def get_all_wikis(self, project=None): + """GetAllWikis. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('[WikiV2]', self._unwrap_collection(response)) + + def get_wiki(self, wiki_identifier, project=None): + """GetWiki. + [Preview API] Gets the wiki corresponding to the wiki ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WikiV2', response) + + def update_wiki(self, update_parameters, wiki_identifier, project=None): + """UpdateWiki. + [Preview API] Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters. + :param :class:` ` update_parameters: Update parameters. + :param str wiki_identifier: Wiki ID or wiki 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 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('WikiV2', response) + diff --git a/azure-devops/azure/devops/v7_1/work/__init__.py b/azure-devops/azure/devops/v7_1/work/__init__.py new file mode 100644 index 00000000..38efd362 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work/__init__.py @@ -0,0 +1,95 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'BoardBadge', + 'BoardCardRuleSettings', + 'BoardCardSettings', + 'BoardColumn', + 'BoardFields', + 'BoardChart', + 'BoardChartReference', + 'BoardReference', + 'BoardRow', + 'BoardSuggestedValue', + 'BoardUserSettings', + 'CapacityContractBase', + 'CapacityPatch', + 'CategoryConfiguration', + 'CreatePlan', + 'DateRange', + 'DeliveryViewData', + 'FieldReference', + 'FilterClause', + 'GraphSubjectBase', + 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', + 'IterationWorkItems', + 'Link', + 'Member', + 'ParentChildWIMap', + 'Plan', + 'PlanViewData', + 'PredefinedQuery', + 'ProcessConfiguration', + 'ReferenceLinks', + 'ReorderOperation', + 'ReorderResult', + 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', + 'TeamContext', + 'TeamFieldValue', + 'TeamFieldValues', + 'TeamFieldValuesPatch', + 'TeamIterationAttributes', + 'TeamMemberCapacity', + 'TeamMemberCapacityIdentityRef', + 'TeamSetting', + 'TeamSettingsDataContractBase', + 'TeamSettingsDaysOff', + 'TeamSettingsDaysOffPatch', + 'TeamSettingsIteration', + 'TeamSettingsPatch', + 'TimelineCriteriaStatus', + 'TimelineIterationStatus', + 'TimelineTeamData', + 'TimelineTeamIteration', + 'TimelineTeamStatus', + 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', + 'WorkItem', + 'WorkItemColor', + 'WorkItemCommentVersionRef', + 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeReference', + 'WorkItemTypeStateInfo', + 'WorkClient' +] diff --git a/azure-devops/azure/devops/v7_1/work/models.py b/azure-devops/azure/devops/v7_1/work/models.py new file mode 100644 index 00000000..7b9ec87f --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work/models.py @@ -0,0 +1,2340 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :param capacity_per_day: + :type capacity_per_day: float + :param name: + :type name: str + """ + + _attribute_map = { + 'capacity_per_day': {'key': 'capacityPerDay', 'type': 'float'}, + '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): + """ + :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): + """ + :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 is_bugs_behavior_configured: Is BugsBehavior Configured in the process + :type is_bugs_behavior_configured: bool + :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]'}, + 'is_bugs_behavior_configured': {'key': 'isBugsBehaviorConfigured', 'type': 'bool'}, + '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, is_bugs_behavior_configured=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.is_bugs_behavior_configured = is_bugs_behavior_configured + 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): + """ + :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): + """ + Contract representing a backlog level + + :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): + """ + :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: Default 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): + """ + Represents work items in a backlog level + + :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 BoardBadge(Model): + """ + Represents a board badge. + + :param board_id: The ID of the board represented by this badge. + :type board_id: str + :param image_url: A link to the SVG resource. + :type image_url: str + """ + + _attribute_map = { + 'board_id': {'key': 'boardId', 'type': 'str'}, + 'image_url': {'key': 'imageUrl', 'type': 'str'} + } + + def __init__(self, board_id=None, image_url=None): + super(BoardBadge, self).__init__() + self.board_id = board_id + self.image_url = image_url + + +class BoardCardRuleSettings(Model): + """ + :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): + """ + :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 BoardColumn(Model): + """ + :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): + """ + :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 BoardChartReference(Model): + """ + :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 BoardReference(Model): + """ + :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): + """ + :param color: + :type color: str + :param id: + :type id: str + :param name: + :type name: str + """ + + _attribute_map = { + 'color': {'key': 'color', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, color=None, id=None, name=None): + super(BoardRow, self).__init__() + self.color = color + self.id = id + self.name = name + + +class BoardSuggestedValue(Model): + """ + :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): + """ + :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): + """ + Expected data from PATCH + + :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): + """ + Details about a given backlog category + + :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): + """ + :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): + """ + :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): + """ + An abstracted reference to a field + + :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): + """ + :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): + """ + :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 ITaskboardColumnMapping(Model): + """ + :param state: + :type state: str + :param work_item_type: + :type work_item_type: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_type': {'key': 'workItemType', 'type': 'str'} + } + + def __init__(self, state=None, work_item_type=None): + super(ITaskboardColumnMapping, self).__init__() + self.state = state + self.work_item_type = work_item_type + + +class IterationCapacity(Model): + """ + Capacity and teams for all teams in an iteration + + :param teams: + :type teams: list of :class:`TeamCapacityTotals ` + :param total_iteration_capacity_per_day: + :type total_iteration_capacity_per_day: float + :param total_iteration_days_off: + :type total_iteration_days_off: int + """ + + _attribute_map = { + 'teams': {'key': 'teams', 'type': '[TeamCapacityTotals]'}, + 'total_iteration_capacity_per_day': {'key': 'totalIterationCapacityPerDay', 'type': 'float'}, + 'total_iteration_days_off': {'key': 'totalIterationDaysOff', 'type': 'int'} + } + + def __init__(self, teams=None, total_iteration_capacity_per_day=None, total_iteration_days_off=None): + super(IterationCapacity, self).__init__() + self.teams = teams + self.total_iteration_capacity_per_day = total_iteration_capacity_per_day + self.total_iteration_days_off = total_iteration_days_off + + +class Link(Model): + """ + Link description. + + :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): + """ + :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): + """ + :param child_work_item_ids: + :type child_work_item_ids: list of int + :param id: + :type id: int + :param title: + :type title: str + :param work_item_type_name: + :type work_item_type_name: str + """ + + _attribute_map = { + 'child_work_item_ids': {'key': 'childWorkItemIds', 'type': '[int]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} + } + + def __init__(self, child_work_item_ids=None, id=None, title=None, work_item_type_name=None): + super(ParentChildWIMap, self).__init__() + self.child_work_item_ids = child_work_item_ids + self.id = id + self.title = title + self.work_item_type_name = work_item_type_name + + +class Plan(Model): + """ + Data contract for the plan definition + + :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 last_accessed: Date when the plan was last accessed. Default is null. + :type last_accessed: datetime + :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'}, + 'last_accessed': {'key': 'lastAccessed', 'type': 'iso-8601'}, + '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, last_accessed=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.last_accessed = last_accessed + 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): + """ + Base class for plan view data contracts. Anything common goes here. + + :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): + """ + Represents a single pre-defined query. + + :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): + """ + Process Configurations for the project + + :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): + """ + 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 ReorderOperation(Model): + """ + Represents a reorder request for one or more work items. + + :param ids: IDs of the work items to be reordered. Must be valid WorkItem Ids. + :type ids: list of int + :param iteration_path: IterationPath for reorder operation. This is only used when we reorder from the Iteration Backlog + :type iteration_path: str + :param next_id: ID of the work item that should be after the reordered items. Can use 0 to specify the end of the list. + :type next_id: int + :param parent_id: Parent ID for all of the work items involved in this operation. Can use 0 to indicate the items don't have a parent. + :type parent_id: int + :param previous_id: ID of the work item that should be before the reordered items. Can use 0 to specify the beginning of the list. + :type previous_id: int + """ + + _attribute_map = { + 'ids': {'key': 'ids', 'type': '[int]'}, + 'iteration_path': {'key': 'iterationPath', 'type': 'str'}, + 'next_id': {'key': 'nextId', 'type': 'int'}, + 'parent_id': {'key': 'parentId', 'type': 'int'}, + 'previous_id': {'key': 'previousId', 'type': 'int'} + } + + def __init__(self, ids=None, iteration_path=None, next_id=None, parent_id=None, previous_id=None): + super(ReorderOperation, self).__init__() + self.ids = ids + self.iteration_path = iteration_path + self.next_id = next_id + self.parent_id = parent_id + self.previous_id = previous_id + + +class ReorderResult(Model): + """ + Represents a reorder result for a work item. + + :param id: The ID of the work item that was reordered. + :type id: int + :param order: The updated order value of the work item that was reordered. + :type order: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'order': {'key': 'order', 'type': 'float'} + } + + def __init__(self, id=None, order=None): + super(ReorderResult, self).__init__() + self.id = id + self.order = order + + +class Rule(Model): + """ + :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 TaskboardColumn(Model): + """ + Represents the taskbord column + + :param id: Column ID + :type id: str + :param mappings: Work item type states mapped to this column to support auto state update when column is updated. + :type mappings: list of :class:`ITaskboardColumnMapping ` + :param name: Column name + :type name: str + :param order: Column position relative to other columns in the same board + :type order: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mappings': {'key': 'mappings', 'type': '[ITaskboardColumnMapping]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'} + } + + def __init__(self, id=None, mappings=None, name=None, order=None): + super(TaskboardColumn, self).__init__() + self.id = id + self.mappings = mappings + self.name = name + self.order = order + + +class TaskboardColumnMapping(Model): + """ + Represents the state to column mapping per work item type This allows auto state update when the column changes + + :param state: State of the work item type mapped to the column + :type state: str + :param work_item_type: Work Item Type name who's state is mapped to the column + :type work_item_type: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_type': {'key': 'workItemType', 'type': 'str'} + } + + def __init__(self, state=None, work_item_type=None): + super(TaskboardColumnMapping, self).__init__() + self.state = state + self.work_item_type = work_item_type + + +class TaskboardColumns(Model): + """ + :param columns: + :type columns: list of :class:`TaskboardColumn ` + :param is_customized: Are the columns cutomized for this team + :type is_customized: bool + :param is_valid: Specifies if the referenced WIT and State is valid + :type is_valid: bool + :param validation_messsage: Details of validation failure if the state to column mapping is invalid + :type validation_messsage: str + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[TaskboardColumn]'}, + 'is_customized': {'key': 'isCustomized', 'type': 'bool'}, + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'validation_messsage': {'key': 'validationMesssage', 'type': 'str'} + } + + def __init__(self, columns=None, is_customized=None, is_valid=None, validation_messsage=None): + super(TaskboardColumns, self).__init__() + self.columns = columns + self.is_customized = is_customized + self.is_valid = is_valid + self.validation_messsage = validation_messsage + + +class TaskboardWorkItemColumn(Model): + """ + Column value of a work item in the taskboard + + :param column: Work item column value in the taskboard + :type column: str + :param column_id: Work item column id in the taskboard + :type column_id: str + :param state: Work Item state value + :type state: str + :param work_item_id: Work item id + :type work_item_id: int + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'column_id': {'key': 'columnId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'work_item_id': {'key': 'workItemId', 'type': 'int'} + } + + def __init__(self, column=None, column_id=None, state=None, work_item_id=None): + super(TaskboardWorkItemColumn, self).__init__() + self.column = column + self.column_id = column_id + self.state = state + self.work_item_id = work_item_id + + +class TeamCapacity(Model): + """ + Represents team member capacity with totals aggregated + + :param team_members: + :type team_members: list of :class:`TeamMemberCapacityIdentityRef ` + :param total_capacity_per_day: + :type total_capacity_per_day: float + :param total_days_off: + :type total_days_off: int + """ + + _attribute_map = { + 'team_members': {'key': 'teamMembers', 'type': '[TeamMemberCapacityIdentityRef]'}, + 'total_capacity_per_day': {'key': 'totalCapacityPerDay', 'type': 'float'}, + 'total_days_off': {'key': 'totalDaysOff', 'type': 'int'} + } + + def __init__(self, team_members=None, total_capacity_per_day=None, total_days_off=None): + super(TeamCapacity, self).__init__() + self.team_members = team_members + self.total_capacity_per_day = total_capacity_per_day + self.total_days_off = total_days_off + + +class TeamCapacityTotals(Model): + """ + Team information with total capacity and days off + + :param team_capacity_per_day: + :type team_capacity_per_day: float + :param team_id: + :type team_id: str + :param team_total_days_off: + :type team_total_days_off: int + """ + + _attribute_map = { + 'team_capacity_per_day': {'key': 'teamCapacityPerDay', 'type': 'float'}, + 'team_id': {'key': 'teamId', 'type': 'str'}, + 'team_total_days_off': {'key': 'teamTotalDaysOff', 'type': 'int'} + } + + def __init__(self, team_capacity_per_day=None, team_id=None, team_total_days_off=None): + super(TeamCapacityTotals, self).__init__() + self.team_capacity_per_day = team_capacity_per_day + self.team_id = team_id + self.team_total_days_off = team_total_days_off + + +class TeamContext(Model): + """ + The Team Context for an operation. + + :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): + """ + Represents a single 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): + """ + Expected data from PATCH + + :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): + """ + :param finish_date: Finish date of the iteration. Date-only, correct unadjusted at midnight in UTC. + :type finish_date: datetime + :param start_date: Start date of the iteration. Date-only, correct unadjusted at midnight in UTC. + :type start_date: datetime + :param time_frame: Time frame of the iteration, such as past, current or future. + :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): + """ + Base class for TeamSettings data contracts. Anything common goes here. + + :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): + """ + :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): + """ + :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): + """ + Represents a shallow ref for a single iteration. + + :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 of the iteration such as start and end date. + :type attributes: :class:`TeamIterationAttributes ` + :param id: Id of the iteration. + :type id: str + :param name: Name of the iteration. + :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): + """ + Data contract for what we expect to receive when PATCH + + :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): + """ + :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): + """ + :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): + """ + :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 partially_paged_work_items: + :type partially_paged_work_items: list of [object] + :param project_id: The project id the team belongs team + :type project_id: str + :param rollup_work_item_types: Work item types for which we will collect roll up data on the client side + :type rollup_work_item_types: list of 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_items: Work items associated with the team that are not under any of the team's iterations + :type work_items: list of [object] + :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]'}, + 'partially_paged_work_items': {'key': 'partiallyPagedWorkItems', 'type': '[[object]]'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'rollup_work_item_types': {'key': 'rollupWorkItemTypes', '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_items': {'key': 'workItems', 'type': '[[object]]'}, + '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, partially_paged_work_items=None, project_id=None, rollup_work_item_types=None, status=None, team_field_default_value=None, team_field_name=None, team_field_values=None, work_items=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.partially_paged_work_items = partially_paged_work_items + self.project_id = project_id + self.rollup_work_item_types = rollup_work_item_types + 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_items = work_items + self.work_item_type_colors = work_item_type_colors + + +class TimelineTeamIteration(Model): + """ + :param css_node_id: The iteration CSS Node Id + :type css_node_id: str + :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 = { + 'css_node_id': {'key': 'cssNodeId', 'type': 'str'}, + '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, css_node_id=None, 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.css_node_id = css_node_id + 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): + """ + :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): + """ + :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 UpdateTaskboardColumn(Model): + """ + :param id: Column ID, keep it null for new column + :type id: str + :param mappings: Work item type states mapped to this column to support auto state update when column is updated. + :type mappings: list of :class:`TaskboardColumnMapping ` + :param name: Column name is required + :type name: str + :param order: Column position relative to other columns in the same board + :type order: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mappings': {'key': 'mappings', 'type': '[TaskboardColumnMapping]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'} + } + + def __init__(self, id=None, mappings=None, name=None, order=None): + super(UpdateTaskboardColumn, self).__init__() + self.id = id + self.mappings = mappings + self.name = name + self.order = order + + +class UpdateTaskboardWorkItemColumn(Model): + """ + :param new_column: + :type new_column: str + """ + + _attribute_map = { + 'new_column': {'key': 'newColumn', 'type': 'str'} + } + + def __init__(self, new_column=None): + super(UpdateTaskboardWorkItemColumn, self).__init__() + self.new_column = new_column + + +class WorkItemColor(Model): + """ + Work item color and icon. + + :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): + """ + Reference to a field in a work item + + :param name: The friendly 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): + """ + A link between two work items. + + :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): + """ + Contains reference to a work item. + + :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): + """ + :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): + """ + Base class for work item tracking resource references. + + :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): + """ + Reference to a work item type. + + :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): + """ + :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): + """ + :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): + """ + :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 CapacityContractBase(TeamSettingsDataContractBase): + """ + :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 ` + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'url': {'key': 'url', 'type': 'str'}, + 'activities': {'key': 'activities', 'type': '[Activity]'}, + 'days_off': {'key': 'daysOff', 'type': '[DateRange]'} + } + + def __init__(self, _links=None, url=None, activities=None, days_off=None): + super(CapacityContractBase, self).__init__(_links=_links, url=url) + self.activities = activities + self.days_off = days_off + + +class DeliveryViewData(PlanViewData): + """ + Data contract for Data of Delivery View + + :param id: + :type id: str + :param revision: + :type revision: int + :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 child_id_to_parent_id_map: Work item child id to parent id map + :type child_id_to_parent_id_map: dict + :param max_expanded_teams: Max number of teams that can be configured for a delivery plan + :type max_expanded_teams: int + :param parent_item_maps: Mapping between parent id, title and all the child work item ids + :type parent_item_maps: list of :class:`ParentChildWIMap ` + :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 ` + :param work_item_dependencies: List of all work item ids that have a dependency but not a violation + :type work_item_dependencies: list of int + :param work_item_violations: List of all work item ids that have a violation + :type work_item_violations: list of int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'criteria_status': {'key': 'criteriaStatus', 'type': 'TimelineCriteriaStatus'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'child_id_to_parent_id_map': {'key': 'childIdToParentIdMap', 'type': '{int}'}, + 'max_expanded_teams': {'key': 'maxExpandedTeams', 'type': 'int'}, + 'parent_item_maps': {'key': 'parentItemMaps', 'type': '[ParentChildWIMap]'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'teams': {'key': 'teams', 'type': '[TimelineTeamData]'}, + 'work_item_dependencies': {'key': 'workItemDependencies', 'type': '[int]'}, + 'work_item_violations': {'key': 'workItemViolations', 'type': '[int]'} + } + + def __init__(self, id=None, revision=None, criteria_status=None, end_date=None, child_id_to_parent_id_map=None, max_expanded_teams=None, parent_item_maps=None, start_date=None, teams=None, work_item_dependencies=None, work_item_violations=None): + super(DeliveryViewData, self).__init__(id=id, revision=revision) + self.criteria_status = criteria_status + self.end_date = end_date + self.child_id_to_parent_id_map = child_id_to_parent_id_map + self.max_expanded_teams = max_expanded_teams + self.parent_item_maps = parent_item_maps + self.start_date = start_date + self.teams = teams + self.work_item_dependencies = work_item_dependencies + self.work_item_violations = work_item_violations + + +class IterationWorkItems(TeamSettingsDataContractBase): + """ + Represents work items in an iteration backlog + + :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): + """ + Essentially a collection of team field values + + :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(CapacityContractBase): + """ + Represents capacity for a specific team member + + :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, activities=activities, days_off=days_off) + self.team_member = team_member + + +class TeamMemberCapacityIdentityRef(CapacityContractBase): + """ + Represents capacity for a specific team member + + :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: Identity ref of the associated team member + :type team_member: :class:`IdentityRef ` + """ + + _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': 'IdentityRef'} + } + + def __init__(self, _links=None, url=None, activities=None, days_off=None, team_member=None): + super(TeamMemberCapacityIdentityRef, self).__init__(_links=_links, url=url, activities=activities, days_off=days_off) + self.team_member = team_member + + +class TeamSetting(TeamSettingsDataContractBase): + """ + Data contract for TeamSettings + + :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 WorkItemCommentVersionRef(WorkItemTrackingResourceReference): + """ + Represents the reference to a specific version of a comment on a Work Item. + + :param url: + :type url: str + :param comment_id: The id assigned to the comment. + :type comment_id: int + :param created_in_revision: [Internal] The work item revision where this comment was originally added. + :type created_in_revision: int + :param is_deleted: [Internal] Specifies whether comment was deleted. + :type is_deleted: bool + :param text: [Internal] The text of the comment. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'created_in_revision': {'key': 'createdInRevision', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, comment_id=None, created_in_revision=None, is_deleted=None, text=None, version=None): + super(WorkItemCommentVersionRef, self).__init__(url=url) + self.comment_id = comment_id + self.created_in_revision = created_in_revision + self.is_deleted = is_deleted + self.text = text + self.version = version + + +class WorkItemTrackingResource(WorkItemTrackingResourceReference): + """ + Base class for WIT REST resources. + + :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): + """ + Describes a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_version_ref: Reference to a specific version of the comment added/edited/deleted in this revision. + :type comment_version_ref: :class:`WorkItemCommentVersionRef ` + :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'}, + 'comment_version_ref': {'key': 'commentVersionRef', 'type': 'WorkItemCommentVersionRef'}, + '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, comment_version_ref=None, fields=None, id=None, relations=None, rev=None): + super(WorkItem, self).__init__(url=url, _links=_links) + self.comment_version_ref = comment_version_ref + self.fields = fields + self.id = id + self.relations = relations + self.rev = rev + + +__all__ = [ + 'Activity', + 'BacklogColumn', + 'BacklogConfiguration', + 'BacklogFields', + 'BacklogLevel', + 'BacklogLevelConfiguration', + 'BacklogLevelWorkItems', + 'BoardBadge', + 'BoardCardRuleSettings', + 'BoardCardSettings', + 'BoardColumn', + 'BoardFields', + 'BoardChartReference', + 'BoardReference', + 'BoardRow', + 'BoardSuggestedValue', + 'BoardUserSettings', + 'CapacityPatch', + 'CategoryConfiguration', + 'CreatePlan', + 'DateRange', + 'FieldReference', + 'FilterClause', + 'GraphSubjectBase', + 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', + 'Link', + 'Member', + 'ParentChildWIMap', + 'Plan', + 'PlanViewData', + 'PredefinedQuery', + 'ProcessConfiguration', + 'ReferenceLinks', + 'ReorderOperation', + 'ReorderResult', + 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', + 'TeamContext', + 'TeamFieldValue', + 'TeamFieldValuesPatch', + 'TeamIterationAttributes', + 'TeamSettingsDataContractBase', + 'TeamSettingsDaysOff', + 'TeamSettingsDaysOffPatch', + 'TeamSettingsIteration', + 'TeamSettingsPatch', + 'TimelineCriteriaStatus', + 'TimelineIterationStatus', + 'TimelineTeamData', + 'TimelineTeamIteration', + 'TimelineTeamStatus', + 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', + 'WorkItemColor', + 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeReference', + 'WorkItemTypeStateInfo', + 'Board', + 'BoardChart', + 'CapacityContractBase', + 'DeliveryViewData', + 'IterationWorkItems', + 'TeamFieldValues', + 'TeamMemberCapacity', + 'TeamMemberCapacityIdentityRef', + 'TeamSetting', + 'WorkItemCommentVersionRef', + 'WorkItemTrackingResource', + 'WorkItem', +] diff --git a/azure-devops/azure/devops/v7_1/work/work_client.py b/azure-devops/azure/devops/v7_1/work/work_client.py new file mode 100644 index 00000000..d1a12d37 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work/work_client.py @@ -0,0 +1,1648 @@ +# -------------------------------------------------------------------------------------------- +# 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. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BacklogLevelConfiguration]', self._unwrap_collection(response)) + + def get_column_suggested_values(self, project=None): + """GetColumnSuggestedValues. + [Preview API] 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='7.1-preview.1', + 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='7.1-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. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) + + def get_board(self, team_context, id): + """GetBoard. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Board', response) + + def get_boards(self, team_context): + """GetBoards. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BoardReference]', self._unwrap_collection(response)) + + def set_board_options(self, options, team_context, id): + """SetBoardOptions. + [Preview API] 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='7.1-preview.1', + 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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('BoardUserSettings', response) + + def get_capacities_with_identity_ref_and_totals(self, team_context, iteration_id): + """GetCapacitiesWithIdentityRefAndTotals. + [Preview API] Get a team's capacity including total capacity and days off + :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='74412d15-8c1a-4352-a48d-ef1ed5587d57', + version='7.1-preview.3', + route_values=route_values) + return self._deserialize('TeamCapacity', response) + + def get_capacity_with_identity_ref(self, team_context, iteration_id, team_member_id): + """GetCapacityWithIdentityRef. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('TeamMemberCapacityIdentityRef', response) + + def replace_capacities_with_identity_ref(self, capacities, team_context, iteration_id): + """ReplaceCapacitiesWithIdentityRef. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('TeamMemberCapacityIdentityRef', response) + + def get_board_card_rule_settings(self, team_context, board): + """GetBoardCardRuleSettings. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('BoardCardRuleSettings', response) + + def update_board_card_rule_settings(self, board_card_rule_settings, team_context, board): + """UpdateBoardCardRuleSettings. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('BoardCardRuleSettings', response) + + def update_taskboard_card_rule_settings(self, board_card_rule_settings, team_context): + """UpdateTaskboardCardRuleSettings. + [Preview API] Update taskboard card Rule settings + :param :class:` ` board_card_rule_settings: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_rule_settings, 'BoardCardRuleSettings') + self._send(http_method='PATCH', + location_id='3f84a8d1-1aab-423e-a94b-6dcbdcca511f', + version='7.1-preview.2', + route_values=route_values, + content=content) + + def get_board_card_settings(self, team_context, board): + """GetBoardCardSettings. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('BoardCardSettings', response) + + def update_board_card_settings(self, board_card_settings_to_save, team_context, board): + """UpdateBoardCardSettings. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('BoardCardSettings', response) + + def update_taskboard_card_settings(self, board_card_settings_to_save, team_context): + """UpdateTaskboardCardSettings. + [Preview API] Update taskboard card settings + :param :class:` ` board_card_settings_to_save: + :param :class:` ` team_context: The team context for the operation + """ + 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(board_card_settings_to_save, 'BoardCardSettings') + self._send(http_method='PUT', + location_id='0d63745f-31f3-4cf3-9056-2a064e567637', + version='7.1-preview.2', + route_values=route_values, + content=content) + + def get_board_columns(self, team_context, board): + """GetBoardColumns. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) + + def update_board_columns(self, board_columns, team_context, board): + """UpdateBoardColumns. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeliveryViewData', response) + + def get_board_chart(self, team_context, board, name): + """GetBoardChart. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('BoardChart', response) + + def get_board_charts(self, team_context, board): + """GetBoardCharts. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BoardChartReference]', self._unwrap_collection(response)) + + def update_board_chart(self, chart, team_context, board, name): + """UpdateBoardChart. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('BoardChart', response) + + def get_total_iteration_capacities(self, project, iteration_id): + """GetTotalIterationCapacities. + [Preview API] Get an iteration's capacity for all teams in iteration + :param str project: Project ID or project name + :param str iteration_id: ID of the iteration + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + 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='1e385ce0-396b-4273-8171-d64562c18d37', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('IterationCapacity', response) + + def delete_team_iteration(self, team_context, id): + """DeleteTeamIteration. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_team_iteration(self, team_context, id): + """GetTeamIteration. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('TeamSettingsIteration', response) + + def get_team_iterations(self, team_context, timeframe=None): + """GetTeamIterations. + [Preview API] 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='7.1-preview.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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TeamSettingsIteration', response) + + def create_plan(self, posted_plan, project): + """CreatePlan. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Plan', response) + + def delete_plan(self, project, id): + """DeletePlan. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + + def get_plan(self, project, id): + """GetPlan. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('Plan', response) + + def get_plans(self, project): + """GetPlans. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Plan]', self._unwrap_collection(response)) + + def update_plan(self, updated_plan, project, id): + """UpdatePlan. + [Preview API] 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='7.1-preview.1', + 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('ProcessConfiguration', response) + + def get_board_rows(self, team_context, board): + """GetBoardRows. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[BoardRow]', self._unwrap_collection(response)) + + def update_board_rows(self, board_rows, team_context, board): + """UpdateBoardRows. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[BoardRow]', self._unwrap_collection(response)) + + def get_columns(self, team_context): + """GetColumns. + [Preview API] + :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='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('TaskboardColumns', response) + + def update_columns(self, update_columns, team_context): + """UpdateColumns. + [Preview API] + :param [UpdateTaskboardColumn] update_columns: + :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(update_columns, '[UpdateTaskboardColumn]') + response = self._send(http_method='PUT', + location_id='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TaskboardColumns', response) + + def get_work_item_columns(self, team_context, iteration_id): + """GetWorkItemColumns. + [Preview API] + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :rtype: [TaskboardWorkItemColumn] + """ + 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='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[TaskboardWorkItemColumn]', self._unwrap_collection(response)) + + def update_work_item_column(self, update_column, team_context, iteration_id, work_item_id): + """UpdateWorkItemColumn. + [Preview API] + :param :class:` ` update_column: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :param int work_item_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 iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(update_column, 'UpdateTaskboardWorkItemColumn') + self._send(http_method='PATCH', + location_id='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def get_team_days_off(self, team_context, iteration_id): + """GetTeamDaysOff. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('TeamSettingsDaysOff', response) + + def update_team_days_off(self, days_off_patch, team_context, iteration_id): + """UpdateTeamDaysOff. + [Preview API] Set a team's days off for an iteration + :param :class:` ` days_off_patch: Team's days off patch containing 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TeamSettingsDaysOff', response) + + def get_team_field_values(self, team_context): + """GetTeamFieldValues. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('TeamFieldValues', response) + + def update_team_field_values(self, patch, team_context): + """UpdateTeamFieldValues. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TeamFieldValues', response) + + def get_team_settings(self, team_context): + """GetTeamSettings. + [Preview API] 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('TeamSetting', response) + + def update_team_settings(self, team_settings_patch, team_context): + """UpdateTeamSettings. + [Preview API] 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='7.1-preview.1', + 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('IterationWorkItems', response) + + def reorder_backlog_work_items(self, operation, team_context): + """ReorderBacklogWorkItems. + [Preview API] Reorder Product Backlog/Boards Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='1c22b714-e7e4-41b9-85e0-56ee13ef55ed', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + + def reorder_iteration_work_items(self, operation, team_context, iteration_id): + """ReorderIterationWorkItems. + [Preview API] Reorder Sprint Backlog/Taskboard Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: The id of the iteration + :rtype: [ReorderResult] + """ + 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(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='47755db2-d7eb-405a-8c25-675401525fc9', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking/__init__.py b/azure-devops/azure/devops/v7_1/work_item_tracking/__init__.py new file mode 100644 index 00000000..dcea97a0 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking/__init__.py @@ -0,0 +1,113 @@ +# -------------------------------------------------------------------------------------------- +# 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', + 'AccountRecentActivityWorkItemModel2', + 'AccountRecentActivityWorkItemModelBase', + 'AccountRecentMentionWorkItemModel', + 'AccountWorkWorkItemModel', + 'ArtifactUriQuery', + 'ArtifactUriQueryResult', + 'AttachmentReference', + 'Comment', + 'CommentCreate', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentUpdate', + 'CommentVersion', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', + 'FieldDependentRule', + 'FieldUpdate', + 'GitHubConnectionModel', + 'GitHubConnectionRepoModel', + 'GitHubConnectionReposBatchRequest', + 'GraphSubjectBase', + 'IdentityRef', + 'IdentityReference', + 'JsonPatchOperation', + 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', + 'ProjectWorkItemStateColors', + 'ProvisioningResult', + 'QueryBatchGetRequest', + 'QueryHierarchyItem', + 'QueryHierarchyItemsResult', + 'ReferenceLinks', + 'ReportingWorkItemLinksBatch', + 'ReportingWorkItemRevisionsBatch', + 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', + 'StreamedBatch', + 'TeamContext', + 'TemporaryQueryRequestModel', + 'TemporaryQueryResponseModel', + 'UpdateWorkItemField', + 'Wiql', + 'WorkArtifactLink', + 'WorkItem', + 'WorkItemBatchGetRequest', + 'WorkItemClassificationNode', + 'WorkItemComment', + 'WorkItemComments', + 'WorkItemCommentVersionRef', + 'WorkItemDelete', + 'WorkItemDeleteBatch', + 'WorkItemDeleteBatchRequest', + 'WorkItemDeleteReference', + 'WorkItemDeleteShallowReference', + 'WorkItemDeleteUpdate', + 'WorkItemField', + 'WorkItemField2', + 'WorkItemFieldAllowedValues', + 'WorkItemFieldOperation', + 'WorkItemFieldReference', + 'WorkItemFieldUpdate', + 'WorkItemHistory', + 'WorkItemIcon', + 'WorkItemLink', + 'WorkItemNextStateOnTransition', + 'WorkItemQueryClause', + 'WorkItemQueryResult', + 'WorkItemQuerySortColumn', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemRelationType', + 'WorkItemRelationUpdates', + 'WorkItemStateColor', + 'WorkItemStateTransition', + 'WorkItemTagDefinition', + 'WorkItemTemplate', + 'WorkItemTemplateReference', + 'WorkItemTrackingReference', + 'WorkItemTrackingResource', + 'WorkItemTrackingResourceReference', + 'WorkItemType', + 'WorkItemTypeCategory', + 'WorkItemTypeColor', + 'WorkItemTypeColorAndIcon', + 'WorkItemTypeFieldInstance', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', + 'WorkItemTypeReference', + 'WorkItemTypeStateColors', + 'WorkItemTypeTemplate', + 'WorkItemTypeTemplateUpdateModel', + 'WorkItemUpdate', + 'WorkItemTrackingClient' +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking/models.py b/azure-devops/azure/devops/v7_1/work_item_tracking/models.py new file mode 100644 index 00000000..9b93b301 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking/models.py @@ -0,0 +1,3237 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + :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 AccountRecentActivityWorkItemModelBase(Model): + """ + Represents Work Item Recent Activity + + :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 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'}, + '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, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None): + super(AccountRecentActivityWorkItemModelBase, self).__init__() + self.activity_date = activity_date + self.activity_type = activity_type + 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): + """ + Represents Recent Mention Work Item + + :param assigned_to: Assigned To + :type assigned_to: str + :param id: Work Item Id + :type id: int + :param mentioned_date_field: Latest 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): + """ + :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): + """ + Contains criteria for querying work items based on artifact URI. + + :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): + """ + Defines result of artifact URI query on work items. Contains mapping of work item IDs to artifact URI. + + :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): + """ + :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 CommentCreate(Model): + """ + Represents a request to create a work item comment. + + :param text: The text of the comment. + :type text: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, text=None): + super(CommentCreate, self).__init__() + self.text = text + + +class CommentUpdate(Model): + """ + Represents a request to update a work item comment. + + :param text: The updated text of the comment. + :type text: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'} + } + + def __init__(self, text=None): + super(CommentUpdate, self).__init__() + self.text = text + + +class EmailRecipients(Model): + """ + :param email_addresses: Plaintext email addresses. + :type email_addresses: list of str + :param tf_ids: TfIds + :type tf_ids: list of str + :param unresolved_entity_ids: Unresolved entity ids + :type unresolved_entity_ids: list of str + """ + + _attribute_map = { + 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, + 'tf_ids': {'key': 'tfIds', 'type': '[str]'}, + 'unresolved_entity_ids': {'key': 'unresolvedEntityIds', 'type': '[str]'} + } + + def __init__(self, email_addresses=None, tf_ids=None, unresolved_entity_ids=None): + super(EmailRecipients, self).__init__() + self.email_addresses = email_addresses + self.tf_ids = tf_ids + self.unresolved_entity_ids = unresolved_entity_ids + + +class ExternalDeployment(Model): + """ + :param artifact_id: + :type artifact_id: str + :param created_by: + :type created_by: str + :param description: + :type description: str + :param display_name: + :type display_name: str + :param environment: + :type environment: :class:`ExternalEnvironment ` + :param group: + :type group: str + :param pipeline: + :type pipeline: :class:`ExternalPipeline ` + :param related_work_item_ids: + :type related_work_item_ids: list of int + :param run_id: + :type run_id: int + :param sequence_number: + :type sequence_number: int + :param status: + :type status: str + :param status_date: + :type status_date: datetime + :param url: + :type url: str + """ + + _attribute_map = { + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'environment': {'key': 'environment', 'type': 'ExternalEnvironment'}, + 'group': {'key': 'group', 'type': 'str'}, + 'pipeline': {'key': 'pipeline', 'type': 'ExternalPipeline'}, + 'related_work_item_ids': {'key': 'relatedWorkItemIds', 'type': '[int]'}, + 'run_id': {'key': 'runId', 'type': 'int'}, + 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, artifact_id=None, created_by=None, description=None, display_name=None, environment=None, group=None, pipeline=None, related_work_item_ids=None, run_id=None, sequence_number=None, status=None, status_date=None, url=None): + super(ExternalDeployment, self).__init__() + self.artifact_id = artifact_id + self.created_by = created_by + self.description = description + self.display_name = display_name + self.environment = environment + self.group = group + self.pipeline = pipeline + self.related_work_item_ids = related_work_item_ids + self.run_id = run_id + self.sequence_number = sequence_number + self.status = status + self.status_date = status_date + self.url = url + + +class ExternalEnvironment(Model): + """ + :param display_name: + :type display_name: str + :param id: + :type id: int + :param type: + :type type: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, display_name=None, id=None, type=None): + super(ExternalEnvironment, self).__init__() + self.display_name = display_name + self.id = id + self.type = type + + +class ExternalPipeline(Model): + """ + :param display_name: + :type display_name: str + :param id: + :type id: int + :param url: + :type url: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'int'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, display_name=None, id=None, url=None): + super(ExternalPipeline, self).__init__() + self.display_name = display_name + self.id = id + self.url = url + + +class FieldUpdate(Model): + """ + Describes an update request for a work item field. + + :param is_deleted: Indicates whether the user wants to restore the field. + :type is_deleted: bool + :param is_locked: Indicates whether the user wants to lock the field. + :type is_locked: bool + """ + + _attribute_map = { + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'is_locked': {'key': 'isLocked', 'type': 'bool'} + } + + def __init__(self, is_deleted=None, is_locked=None): + super(FieldUpdate, self).__init__() + self.is_deleted = is_deleted + self.is_locked = is_locked + + +class GitHubConnectionModel(Model): + """ + Describes Github connection. + + :param authorization_type: Github connection authorization type (f. e. PAT, OAuth) + :type authorization_type: str + :param created_by: Github connection created by + :type created_by: :class:`IdentityRef ` + :param id: Github connection id + :type id: str + :param is_connection_valid: Whether current Github connection is valid or not + :type is_connection_valid: bool + :param name: Github connection name (should contain organization/user name) + :type name: str + """ + + _attribute_map = { + 'authorization_type': {'key': 'authorizationType', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'str'}, + 'is_connection_valid': {'key': 'isConnectionValid', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, authorization_type=None, created_by=None, id=None, is_connection_valid=None, name=None): + super(GitHubConnectionModel, self).__init__() + self.authorization_type = authorization_type + self.created_by = created_by + self.id = id + self.is_connection_valid = is_connection_valid + self.name = name + + +class GitHubConnectionRepoModel(Model): + """ + Describes Github connection's repo. + + :param error_message: Error message + :type error_message: str + :param git_hub_repository_url: Repository web url + :type git_hub_repository_url: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'git_hub_repository_url': {'key': 'gitHubRepositoryUrl', 'type': 'str'} + } + + def __init__(self, error_message=None, git_hub_repository_url=None): + super(GitHubConnectionRepoModel, self).__init__() + self.error_message = error_message + self.git_hub_repository_url = git_hub_repository_url + + +class GitHubConnectionReposBatchRequest(Model): + """ + Describes Github connection's repo bulk request + + :param git_hub_repository_urls: Requested repos urls + :type git_hub_repository_urls: list of :class:`GitHubConnectionRepoModel ` + :param operation_type: Operation type (f. e. add, remove) + :type operation_type: str + """ + + _attribute_map = { + 'git_hub_repository_urls': {'key': 'gitHubRepositoryUrls', 'type': '[GitHubConnectionRepoModel]'}, + 'operation_type': {'key': 'operationType', 'type': 'str'} + } + + def __init__(self, git_hub_repository_urls=None, operation_type=None): + super(GitHubConnectionReposBatchRequest, self).__init__() + self.git_hub_repository_urls = git_hub_repository_urls + self.operation_type = operation_type + + +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 IdentityReference(IdentityRef): + """ + Describes a reference to an identity. + + :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 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 + :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): + """ + 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 Link(Model): + """ + Link description. + + :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 MailMessage(Model): + """ + :param body: The mail body in HTML format. + :type body: str + :param cc: CC recipients. + :type cc: :class:`EmailRecipients ` + :param in_reply_to: The in-reply-to header value + :type in_reply_to: str + :param message_id: The Message Id value + :type message_id: str + :param reply_to: Reply To recipients. + :type reply_to: :class:`EmailRecipients ` + :param subject: The mail subject. + :type subject: str + :param to: To recipients + :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_to': {'key': 'replyTo', 'type': 'EmailRecipients'}, + '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_to=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_to = reply_to + self.subject = subject + self.to = to + + +class ProcessIdModel(Model): + """ + Stores process ID. + + :param type_id: The ID of the process. + :type type_id: str + """ + + _attribute_map = { + 'type_id': {'key': 'typeId', 'type': 'str'} + } + + def __init__(self, type_id=None): + super(ProcessIdModel, self).__init__() + self.type_id = type_id + + +class ProcessMigrationResultModel(Model): + """ + Stores project ID and its process ID. + + :param process_id: The ID of the process. + :type process_id: str + :param project_id: The ID of the project. + :type project_id: str + """ + + _attribute_map = { + 'process_id': {'key': 'processId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'} + } + + def __init__(self, process_id=None, project_id=None): + super(ProcessMigrationResultModel, self).__init__() + self.process_id = process_id + self.project_id = project_id + + +class ProjectWorkItemStateColors(Model): + """ + Project work item type state colors + + :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): + """ + Result of an update work item type XML update operation. + + :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): + """ + Describes a request to get a list of queries + + :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): + """ + :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): + """ + 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 ReportingWorkItemRevisionsFilter(Model): + """ + The class represents the reporting work item revision filer. + + :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 SendMailBody(Model): + """ + :param fields: + :type fields: list of str + :param ids: + :type ids: list of int + :param message: + :type message: :class:`MailMessage ` + :param persistence_id: + :type persistence_id: str + :param project_id: + :type project_id: str + :param sort_fields: + :type sort_fields: list of str + :param temp_query_id: + :type temp_query_id: str + :param wiql: + :type wiql: str + """ + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[str]'}, + 'ids': {'key': 'ids', 'type': '[int]'}, + 'message': {'key': 'message', 'type': 'MailMessage'}, + 'persistence_id': {'key': 'persistenceId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'sort_fields': {'key': 'sortFields', 'type': '[str]'}, + 'temp_query_id': {'key': 'tempQueryId', 'type': 'str'}, + 'wiql': {'key': 'wiql', 'type': 'str'} + } + + def __init__(self, fields=None, ids=None, message=None, persistence_id=None, project_id=None, sort_fields=None, temp_query_id=None, wiql=None): + super(SendMailBody, self).__init__() + self.fields = fields + self.ids = ids + self.message = message + self.persistence_id = persistence_id + self.project_id = project_id + self.sort_fields = sort_fields + self.temp_query_id = temp_query_id + self.wiql = wiql + + +class StreamedBatch(Model): + """ + The class describes reporting work item revision batch. + + :param continuation_token: ContinuationToken acts as a waterMark. Used while querying large results. + :type continuation_token: str + :param is_last_batch: Returns 'true' if it's last batch, 'false' otherwise. + :type is_last_batch: bool + :param next_link: The next link for the work item. + :type next_link: str + :param values: Values such as rel, sourceId, TargetId, ChangedDate, isActive. + :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): + """ + The Team Context for an operation. + + :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 TemporaryQueryResponseModel(Model): + """ + The result of a temporary query creation. + + :param id: The id of the temporary query item. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'} + } + + def __init__(self, id=None): + super(TemporaryQueryResponseModel, self).__init__() + self.id = id + + +class UpdateWorkItemField(Model): + """ + Describes an update request for a work item field. + + :param is_deleted: Indicates whether the user wants to restore the field. + :type is_deleted: bool + """ + + _attribute_map = { + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'} + } + + def __init__(self, is_deleted=None): + super(UpdateWorkItemField, self).__init__() + self.is_deleted = is_deleted + + +class Wiql(Model): + """ + A WIQL query + + :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): + """ + A work artifact link describes an outbound artifact link type. + + :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): + """ + Describes a request to get a set of work items + + :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 WorkItemDeleteBatch(Model): + """ + Describes response to delete a set of work items. + + :param results: List of results for each work item + :type results: list of :class:`WorkItemDelete ` + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[WorkItemDelete]'} + } + + def __init__(self, results=None): + super(WorkItemDeleteBatch, self).__init__() + self.results = results + + +class WorkItemDeleteBatchRequest(Model): + """ + Describes a request to delete a set of work items + + :param destroy: Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. + :type destroy: bool + :param ids: The requested work item ids + :type ids: list of int + :param skip_notifications: Optional parameter, if set to true, notifications will be disabled. + :type skip_notifications: bool + """ + + _attribute_map = { + 'destroy': {'key': 'destroy', 'type': 'bool'}, + 'ids': {'key': 'ids', 'type': '[int]'}, + 'skip_notifications': {'key': 'skipNotifications', 'type': 'bool'} + } + + def __init__(self, destroy=None, ids=None, skip_notifications=None): + super(WorkItemDeleteBatchRequest, self).__init__() + self.destroy = destroy + self.ids = ids + self.skip_notifications = skip_notifications + + +class WorkItemDeleteReference(Model): + """ + Reference to a deleted work item. + + :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): + """ + Shallow Reference to a deleted work item. + + :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): + """ + Describes an update request for a deleted work item. + + :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 WorkItemFieldAllowedValues(Model): + """ + Describes the list of allowed values of the field. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :param field_name: Name of the field. + :type field_name: str + """ + + _attribute_map = { + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + 'field_name': {'key': 'fieldName', 'type': 'str'} + } + + def __init__(self, allowed_values=None, field_name=None): + super(WorkItemFieldAllowedValues, self).__init__() + self.allowed_values = allowed_values + self.field_name = field_name + + +class WorkItemFieldOperation(Model): + """ + Describes a work item field operation. + + :param name: Friendly 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): + """ + Reference to a field in a work item + + :param name: The friendly 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): + """ + Describes an update to a work item field. + + :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): + """ + Reference to a work item icon. + + :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): + """ + A link between two work items. + + :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): + """ + Describes the next state for a work item. + + :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): + """ + Represents a clause in a work item query. This shows the structure of a work item query. + + :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): + """ + The result of a work item query. + + :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): + """ + A sort column. + + :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): + """ + Contains reference to a work item. + + :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): + """ + :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): + """ + Describes updates to a work item's relations. + + :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): + """ + Work item type state name, color and state category + + :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): + """ + Describes a state transition in a work item. + + :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 WorkItemTagDefinition(Model): + """ + :param id: + :type id: str + :param last_updated: + :type last_updated: datetime + :param name: + :type name: str + :param url: + :type url: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, id=None, last_updated=None, name=None, url=None): + super(WorkItemTagDefinition, self).__init__() + self.id = id + self.last_updated = last_updated + self.name = name + self.url = url + + +class WorkItemTrackingResourceReference(Model): + """ + Base class for work item tracking resource references. + + :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): + """ + Describes a work item type's colors. + + :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): + """ + Describes work item type name, its icon and color. + + :param color: The color of the work item type in hex format. + :type color: str + :param icon: The work item type icon. + :type icon: str + :param is_disabled: Indicates if the work item is disabled in the process. + :type is_disabled: bool + :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'}, + 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, + 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} + } + + def __init__(self, color=None, icon=None, is_disabled=None, work_item_type_name=None): + super(WorkItemTypeColorAndIcon, self).__init__() + self.color = color + self.icon = icon + self.is_disabled = is_disabled + self.work_item_type_name = work_item_type_name + + +class WorkItemTypeFieldInstanceBase(WorkItemFieldReference): + """ + Base field instance for workItemType fields. + + :param name: The friendly 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): + """ + Field Instance of a workItemype with detailed references. + + :param name: The friendly 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): + """ + Reference to a work item type. + + :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): + """ + State colors for a work item type + + :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): + """ + Describes a work item type template. + + :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): + """ + Describes a update work item type template request body. + + :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 AccountRecentActivityWorkItemModel(AccountRecentActivityWorkItemModelBase): + """ + Represents Work Item Recent Activity + + :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 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 + :param assigned_to: Assigned To + :type assigned_to: str + """ + + _attribute_map = { + 'activity_date': {'key': 'activityDate', 'type': 'iso-8601'}, + 'activity_type': {'key': 'activityType', 'type': 'object'}, + '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'}, + 'assigned_to': {'key': 'assignedTo', 'type': 'str'} + } + + def __init__(self, activity_date=None, activity_type=None, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None, assigned_to=None): + super(AccountRecentActivityWorkItemModel, self).__init__(activity_date=activity_date, activity_type=activity_type, changed_date=changed_date, id=id, identity_id=identity_id, state=state, team_project=team_project, title=title, work_item_type=work_item_type) + self.assigned_to = assigned_to + + +class AccountRecentActivityWorkItemModel2(AccountRecentActivityWorkItemModelBase): + """ + Represents Work Item Recent Activity + + :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 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 + :param assigned_to: Assigned To + :type assigned_to: :class:`IdentityRef ` + """ + + _attribute_map = { + 'activity_date': {'key': 'activityDate', 'type': 'iso-8601'}, + 'activity_type': {'key': 'activityType', 'type': 'object'}, + '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'}, + 'assigned_to': {'key': 'assignedTo', 'type': 'IdentityRef'} + } + + def __init__(self, activity_date=None, activity_type=None, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None, assigned_to=None): + super(AccountRecentActivityWorkItemModel2, self).__init__(activity_date=activity_date, activity_type=activity_type, changed_date=changed_date, id=id, identity_id=identity_id, state=state, team_project=team_project, title=title, work_item_type=work_item_type) + self.assigned_to = assigned_to + + +class ReportingWorkItemLinksBatch(StreamedBatch): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(ReportingWorkItemLinksBatch, self).__init__() + + +class ReportingWorkItemRevisionsBatch(StreamedBatch): + """ + """ + + _attribute_map = { + } + + def __init__(self): + super(ReportingWorkItemRevisionsBatch, self).__init__() + + +class WorkItemCommentVersionRef(WorkItemTrackingResourceReference): + """ + Represents the reference to a specific version of a comment on a Work Item. + + :param url: + :type url: str + :param comment_id: The id assigned to the comment. + :type comment_id: int + :param created_in_revision: [Internal] The work item revision where this comment was originally added. + :type created_in_revision: int + :param is_deleted: [Internal] Specifies whether comment was deleted. + :type is_deleted: bool + :param text: [Internal] The text of the comment. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'created_in_revision': {'key': 'createdInRevision', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, comment_id=None, created_in_revision=None, is_deleted=None, text=None, version=None): + super(WorkItemCommentVersionRef, self).__init__(url=url) + self.comment_id = comment_id + self.created_in_revision = created_in_revision + self.is_deleted = is_deleted + self.text = text + self.version = version + + +class WorkItemDelete(WorkItemDeleteReference): + """ + Full deleted work item object. Includes the work item itself. + + :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): + """ + Base class for WIT REST resources. + + :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): + """ + Describes a work item type. + + :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): + """ + Describes a work item type category. + + :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 belong 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): + """ + Field instance of a work item type. + + :param name: The friendly 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): + """ + Describes an update to a work item. + + :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 Comment(WorkItemTrackingResource): + """ + Comment on a Work Item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param created_on_behalf_date: Effective Date/time value for adding the comment. Can be optionally different from CreatedDate. + :type created_on_behalf_date: datetime + :param created_on_behalf_of: Identity on whose behalf this comment has been added. Can be optionally different from CreatedBy. + :type created_on_behalf_of: :class:`IdentityRef ` + :param format: Represents the possible types for the comment format. + :type format: object + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted. + :type is_deleted: bool + :param mentions: The mentions of the comment. + :type mentions: list of :class:`CommentMention ` + :param modified_by: IdentityRef of the user who last modified the comment. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The last modification date of the comment. + :type modified_date: datetime + :param reactions: The reactions of the comment. + :type reactions: list of :class:`CommentReaction ` + :param rendered_text: The text of the comment in HTML format. + :type rendered_text: str + :param text: The text of the comment. + :type text: str + :param version: The current version of the comment. + :type version: int + :param work_item_id: The id of the work item this comment belongs to. + :type work_item_id: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'created_on_behalf_date': {'key': 'createdOnBehalfDate', 'type': 'iso-8601'}, + 'created_on_behalf_of': {'key': 'createdOnBehalfOf', 'type': 'IdentityRef'}, + 'format': {'key': 'format', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'mentions': {'key': 'mentions', 'type': '[CommentMention]'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'reactions': {'key': 'reactions', 'type': '[CommentReaction]'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + 'work_item_id': {'key': 'workItemId', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, created_by=None, created_date=None, created_on_behalf_date=None, created_on_behalf_of=None, format=None, id=None, is_deleted=None, mentions=None, modified_by=None, modified_date=None, reactions=None, rendered_text=None, text=None, version=None, work_item_id=None): + super(Comment, self).__init__(url=url, _links=_links) + self.created_by = created_by + self.created_date = created_date + self.created_on_behalf_date = created_on_behalf_date + self.created_on_behalf_of = created_on_behalf_of + self.format = format + self.id = id + self.is_deleted = is_deleted + self.mentions = mentions + self.modified_by = modified_by + self.modified_date = modified_date + self.reactions = reactions + self.rendered_text = rendered_text + self.text = text + self.version = version + self.work_item_id = work_item_id + + +class CommentList(WorkItemTrackingResource): + """ + Represents a list of work item comments. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comments: List of comments in the current batch. + :type comments: list of :class:`Comment ` + :param continuation_token: A string token that can be used to retrieving next page of comments if available. Otherwise null. + :type continuation_token: str + :param count: The count of comments in the current batch. + :type count: int + :param next_page: Uri to the next page of comments if it is available. Otherwise null. + :type next_page: str + :param total_count: Total count of comments on a work item. + :type total_count: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'comments': {'key': 'comments', 'type': '[Comment]'}, + 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'next_page': {'key': 'nextPage', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, comments=None, continuation_token=None, count=None, next_page=None, total_count=None): + super(CommentList, self).__init__(url=url, _links=_links) + self.comments = comments + self.continuation_token = continuation_token + self.count = count + self.next_page = next_page + self.total_count = total_count + + +class CommentMention(WorkItemTrackingResource): + """ + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param artifact_id: The artifact portion of the parsed text. (i.e. the work item's id) + :type artifact_id: str + :param artifact_type: The type the parser assigned to the mention. (i.e. person, work item, etc) + :type artifact_type: str + :param comment_id: The comment id of the mention. + :type comment_id: int + :param target_id: The resolved target of the mention. An example of this could be a user's tfid + :type target_id: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'artifact_id': {'key': 'artifactId', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'target_id': {'key': 'targetId', 'type': 'str'} + } + + def __init__(self, url=None, _links=None, artifact_id=None, artifact_type=None, comment_id=None, target_id=None): + super(CommentMention, self).__init__(url=url, _links=_links) + self.artifact_id = artifact_id + self.artifact_type = artifact_type + self.comment_id = comment_id + self.target_id = target_id + + +class CommentReaction(WorkItemTrackingResource): + """ + Contains information about work item comment reaction for a particular reaction type. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_id: The id of the comment this reaction belongs to. + :type comment_id: int + :param count: Total number of reactions for the CommentReactionType. + :type count: int + :param is_current_user_engaged: Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment). + :type is_current_user_engaged: bool + :param type: Type of the reaction. + :type type: object + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'comment_id': {'key': 'commentId', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'is_current_user_engaged': {'key': 'isCurrentUserEngaged', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'object'} + } + + def __init__(self, url=None, _links=None, comment_id=None, count=None, is_current_user_engaged=None, type=None): + super(CommentReaction, self).__init__(url=url, _links=_links) + self.comment_id = comment_id + self.count = count + self.is_current_user_engaged = is_current_user_engaged + self.type = type + + +class CommentVersion(WorkItemTrackingResource): + """ + Represents a specific version of a comment on a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param created_by: IdentityRef of the creator of the comment. + :type created_by: :class:`IdentityRef ` + :param created_date: The creation date of the comment. + :type created_date: datetime + :param created_on_behalf_date: Effective Date/time value for adding the comment. Can be optionally different from CreatedDate. + :type created_on_behalf_date: datetime + :param created_on_behalf_of: Identity on whose behalf this comment has been added. Can be optionally different from CreatedBy. + :type created_on_behalf_of: :class:`IdentityRef ` + :param id: The id assigned to the comment. + :type id: int + :param is_deleted: Indicates if the comment has been deleted at this version. + :type is_deleted: bool + :param modified_by: IdentityRef of the user who modified the comment at this version. + :type modified_by: :class:`IdentityRef ` + :param modified_date: The modification date of the comment for this version. + :type modified_date: datetime + :param rendered_text: The rendered content of the comment at this version. + :type rendered_text: str + :param text: The text of the comment at this version. + :type text: str + :param version: The version number. + :type version: int + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'created_on_behalf_date': {'key': 'createdOnBehalfDate', 'type': 'iso-8601'}, + 'created_on_behalf_of': {'key': 'createdOnBehalfOf', 'type': 'IdentityRef'}, + 'id': {'key': 'id', 'type': 'int'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, + 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'} + } + + def __init__(self, url=None, _links=None, created_by=None, created_date=None, created_on_behalf_date=None, created_on_behalf_of=None, id=None, is_deleted=None, modified_by=None, modified_date=None, rendered_text=None, text=None, version=None): + super(CommentVersion, self).__init__(url=url, _links=_links) + self.created_by = created_by + self.created_date = created_date + self.created_on_behalf_date = created_on_behalf_date + self.created_on_behalf_of = created_on_behalf_of + self.id = id + self.is_deleted = is_deleted + self.modified_by = modified_by + self.modified_date = modified_date + self.rendered_text = rendered_text + self.text = text + self.version = version + + +class FieldDependentRule(WorkItemTrackingResource): + """ + Describes a list of dependent fields for a rule. + + :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): + """ + Represents an item in the work item query hierarchy. This can be either a query or a folder. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :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 children: The child query items inside a query folder. + :type children: list of :class:`QueryHierarchyItem ` + :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'}, + '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'}, + 'children': {'key': 'children', 'type': '[QueryHierarchyItem]'}, + '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, clauses=None, columns=None, created_by=None, created_date=None, filter_options=None, has_children=None, 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.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.children = 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 TemporaryQueryRequestModel(WorkItemTrackingResource): + """ + Describes a request to create a temporary query + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param wiql: The WIQL text of the temporary query + :type wiql: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'wiql': {'key': 'wiql', 'type': 'str'} + } + + def __init__(self, url=None, _links=None, wiql=None): + super(TemporaryQueryRequestModel, self).__init__(url=url, _links=_links) + self.wiql = wiql + + +class WorkItem(WorkItemTrackingResource): + """ + Describes a work item. + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param comment_version_ref: Reference to a specific version of the comment added/edited/deleted in this revision. + :type comment_version_ref: :class:`WorkItemCommentVersionRef ` + :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'}, + 'comment_version_ref': {'key': 'commentVersionRef', 'type': 'WorkItemCommentVersionRef'}, + '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, comment_version_ref=None, fields=None, id=None, relations=None, rev=None): + super(WorkItem, self).__init__(url=url, _links=_links) + self.comment_version_ref = comment_version_ref + self.fields = fields + self.id = id + self.relations = relations + self.rev = rev + + +class WorkItemClassificationNode(WorkItemTrackingResource): + """ + Defines a classification node for work item tracking. + + :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 has_children: Flag that indicates if the classification node has any child nodes. + :type has_children: bool + :param children: List of child nodes fetched. + :type children: list of :class:`WorkItemClassificationNode ` + :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 path: Path of the classification node. + :type path: 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}'}, + 'has_children': {'key': 'hasChildren', 'type': 'bool'}, + 'children': {'key': 'children', 'type': '[WorkItemClassificationNode]'}, + 'id': {'key': 'id', 'type': 'int'}, + 'identifier': {'key': 'identifier', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'structure_type': {'key': 'structureType', 'type': 'object'} + } + + def __init__(self, url=None, _links=None, attributes=None, has_children=None, children=None, id=None, identifier=None, name=None, path=None, structure_type=None): + super(WorkItemClassificationNode, self).__init__(url=url, _links=_links) + self.attributes = attributes + self.has_children = has_children + self.children = children + self.id = id + self.identifier = identifier + self.name = name + self.path = path + self.structure_type = structure_type + + +class WorkItemComment(WorkItemTrackingResource): + """ + Comment on Work Item + + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` + :param format: Represents the possible types for the comment format. + :type format: object + :param rendered_text: The text of the comment in HTML format. + :type rendered_text: str + :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'}, + 'format': {'key': 'format', 'type': 'object'}, + 'rendered_text': {'key': 'renderedText', 'type': 'str'}, + '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, format=None, rendered_text=None, revised_by=None, revised_date=None, revision=None, text=None): + super(WorkItemComment, self).__init__(url=url, _links=_links) + self.format = format + self.rendered_text = rendered_text + self.revised_by = revised_by + self.revised_date = revised_date + self.revision = revision + self.text = text + + +class WorkItemComments(WorkItemTrackingResource): + """ + Collection of comments. + + :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): + """ + Describes a field on a work item and it's properties specific to that work item type. + + :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_deleted: Indicates whether this field is deleted. + :type is_deleted: bool + :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_deleted': {'key': 'isDeleted', 'type': 'bool'}, + '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_deleted=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_deleted = is_deleted + 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 WorkItemField2(WorkItemField): + """ + Describes a field on a work item and it's properties specific to that work item type. + + :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_deleted: Indicates whether this field is deleted. + :type is_deleted: bool + :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 + :param is_locked: Indicates whether this field is marked as locked for editing. + :type is_locked: bool + """ + + _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_deleted': {'key': 'isDeleted', 'type': 'bool'}, + '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'}, + 'is_locked': {'key': 'isLocked', 'type': 'bool'} + } + + def __init__(self, url=None, _links=None, can_sort_by=None, description=None, is_deleted=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, is_locked=None): + super(WorkItemField2, self).__init__(url=url, _links=_links, can_sort_by=can_sort_by, description=description, is_deleted=is_deleted, is_identity=is_identity, is_picklist=is_picklist, is_picklist_suggested=is_picklist_suggested, is_queryable=is_queryable, name=name, picklist_id=picklist_id, read_only=read_only, reference_name=reference_name, supported_operations=supported_operations, type=type, usage=usage) + self.is_locked = is_locked + + +class WorkItemHistory(WorkItemTrackingResource): + """ + :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): + """ + Describes a shallow reference to a work item template. + + :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): + """ + :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): + """ + Represents the work item type relation type. + + :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): + """ + Describes a work item template. + + :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', + 'AccountRecentActivityWorkItemModelBase', + 'AccountRecentMentionWorkItemModel', + 'AccountWorkWorkItemModel', + 'ArtifactUriQuery', + 'ArtifactUriQueryResult', + 'AttachmentReference', + 'CommentCreate', + 'CommentUpdate', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', + 'FieldUpdate', + 'GitHubConnectionModel', + 'GitHubConnectionRepoModel', + 'GitHubConnectionReposBatchRequest', + 'GraphSubjectBase', + 'IdentityRef', + 'IdentityReference', + 'JsonPatchOperation', + 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', + 'ProjectWorkItemStateColors', + 'ProvisioningResult', + 'QueryBatchGetRequest', + 'QueryHierarchyItemsResult', + 'ReferenceLinks', + 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', + 'StreamedBatch', + 'TeamContext', + 'TemporaryQueryResponseModel', + 'UpdateWorkItemField', + 'Wiql', + 'WorkArtifactLink', + 'WorkItemBatchGetRequest', + 'WorkItemDeleteBatch', + 'WorkItemDeleteBatchRequest', + 'WorkItemDeleteReference', + 'WorkItemDeleteShallowReference', + 'WorkItemDeleteUpdate', + 'WorkItemFieldAllowedValues', + 'WorkItemFieldOperation', + 'WorkItemFieldReference', + 'WorkItemFieldUpdate', + 'WorkItemIcon', + 'WorkItemLink', + 'WorkItemNextStateOnTransition', + 'WorkItemQueryClause', + 'WorkItemQueryResult', + 'WorkItemQuerySortColumn', + 'WorkItemReference', + 'WorkItemRelation', + 'WorkItemRelationUpdates', + 'WorkItemStateColor', + 'WorkItemStateTransition', + 'WorkItemTagDefinition', + 'WorkItemTrackingResourceReference', + 'WorkItemTypeColor', + 'WorkItemTypeColorAndIcon', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', + 'WorkItemTypeReference', + 'WorkItemTypeStateColors', + 'WorkItemTypeTemplate', + 'WorkItemTypeTemplateUpdateModel', + 'AccountRecentActivityWorkItemModel', + 'AccountRecentActivityWorkItemModel2', + 'ReportingWorkItemLinksBatch', + 'ReportingWorkItemRevisionsBatch', + 'WorkItemCommentVersionRef', + 'WorkItemDelete', + 'WorkItemTrackingResource', + 'WorkItemType', + 'WorkItemTypeCategory', + 'WorkItemTypeFieldInstance', + 'WorkItemUpdate', + 'Comment', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentVersion', + 'FieldDependentRule', + 'QueryHierarchyItem', + 'TemporaryQueryRequestModel', + 'WorkItem', + 'WorkItemClassificationNode', + 'WorkItemComment', + 'WorkItemComments', + 'WorkItemField', + 'WorkItemField2', + 'WorkItemHistory', + 'WorkItemTemplateReference', + 'WorkItemTrackingReference', + 'WorkItemRelationType', + 'WorkItemTemplate', +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking/work_item_tracking_client.py b/azure-devops/azure/devops/v7_1/work_item_tracking/work_item_tracking_client.py new file mode 100644 index 00000000..43b5eab9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking/work_item_tracking_client.py @@ -0,0 +1,2208 @@ +# -------------------------------------------------------------------------------------------- +# 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_recent_activity_data(self): + """GetRecentActivityData. + [Preview API] Gets recent work item activities + :rtype: [AccountRecentActivityWorkItemModel2] + """ + response = self._send(http_method='GET', + location_id='1bc988f4-c15f-4072-ad35-497c87e3a909', + version='7.1-preview.2') + return self._deserialize('[AccountRecentActivityWorkItemModel2]', self._unwrap_collection(response)) + + 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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + + def get_classification_node(self, project, structure_group, path=None, depth=None): + """GetClassificationNode. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('WorkItemClassificationNode', response) + + def get_engaged_users(self, project, work_item_id, comment_id, reaction_type, top=None, skip=None): + """GetEngagedUsers. + [Preview API] Get users who reacted on the comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID. + :param int comment_id: Comment ID. + :param CommentReactionType reaction_type: Type of the reaction. + :param int top: + :param int skip: + :rtype: [IdentityRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + 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='e33ca5e0-2349-4285-af3d-d72d86781c35', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[IdentityRef]', self._unwrap_collection(response)) + + def add_comment(self, request, project, work_item_id): + """AddComment. + [Preview API] Add a comment on a work item. + :param :class:` ` request: Comment create request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(request, 'CommentCreate') + response = self._send(http_method='POST', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + content=content) + return self._deserialize('Comment', response) + + def add_work_item_comment(self, request, project, work_item_id, format): + """AddWorkItemComment. + [Preview API] Add a comment on a work item. + :param :class:` ` request: Comment create request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param str format: Format of a work item comment (Markdown or Html). + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + query_parameters = {} + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + content = self._serialize.body(request, 'CommentCreate') + response = self._send(http_method='POST', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Comment', response) + + def delete_comment(self, project, work_item_id, comment_id): + """DeleteComment. + [Preview API] Delete a comment on a work item. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param int comment_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values) + + def get_comment(self, project, work_item_id, comment_id, include_deleted=None, expand=None): + """GetComment. + [Preview API] Returns a work item comment. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get the comment. + :param int comment_id: Id of the comment to return. + :param bool include_deleted: Specify if the deleted comment should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + query_parameters = {} + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Comment', response) + + def get_comments(self, project, work_item_id, top=None, continuation_token=None, include_deleted=None, expand=None, order=None): + """GetComments. + [Preview API] Returns a list of work item comments, pageable. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get comments for. + :param int top: Max number of comments to return. + :param str continuation_token: Used to query for the next page of comments. + :param bool include_deleted: Specify if the deleted comments should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :param str order: Order in which the comments should be returned. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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') + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + if order is not None: + query_parameters['order'] = self._serialize.query('order', order, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CommentList', response) + + def get_comments_batch(self, project, work_item_id, ids, include_deleted=None, expand=None): + """GetCommentsBatch. + [Preview API] Returns a list of work item comments by ids. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item to get comments for. + :param [int] ids: Comma-separated list of comment ids to return. + :param bool include_deleted: Specify if the deleted comments should be retrieved. + :param str expand: Specifies the additional data retrieval options for work item comments. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + query_parameters = {} + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + if include_deleted is not None: + query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('CommentList', response) + + def update_comment(self, request, project, work_item_id, comment_id): + """UpdateComment. + [Preview API] Update a comment on a work item. + :param :class:` ` request: Comment update request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param int comment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + content = self._serialize.body(request, 'CommentUpdate') + response = self._send(http_method='PATCH', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + content=content) + return self._deserialize('Comment', response) + + def update_work_item_comment(self, request, project, work_item_id, comment_id, format): + """UpdateWorkItemComment. + [Preview API] Update a comment on a work item. + :param :class:` ` request: Comment update request. + :param str project: Project ID or project name + :param int work_item_id: Id of a work item. + :param int comment_id: + :param str format: Format of a work item comment (Markdown or Html). + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + query_parameters = {} + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + content = self._serialize.body(request, 'CommentUpdate') + response = self._send(http_method='PATCH', + location_id='608aac0a-32e1-4493-a863-b9cf4566d257', + version='7.1-preview.4', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Comment', response) + + def create_comment_reaction(self, project, work_item_id, comment_id, reaction_type): + """CreateCommentReaction. + [Preview API] Adds a new reaction to a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :param CommentReactionType reaction_type: Type of the reaction + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + response = self._send(http_method='PUT', + location_id='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('CommentReaction', response) + + def delete_comment_reaction(self, project, work_item_id, comment_id, reaction_type): + """DeleteCommentReaction. + [Preview API] Deletes an existing reaction on a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :param CommentReactionType reaction_type: Type of the reaction + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if reaction_type is not None: + route_values['reactionType'] = self._serialize.url('reaction_type', reaction_type, 'CommentReactionType') + response = self._send(http_method='DELETE', + location_id='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('CommentReaction', response) + + def get_comment_reactions(self, project, work_item_id, comment_id): + """GetCommentReactions. + [Preview API] Gets reactions of a comment. + :param str project: Project ID or project name + :param int work_item_id: WorkItem ID + :param int comment_id: Comment ID + :rtype: [CommentReaction] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='f6cb3f27-1028-4851-af96-887e570dc21f', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[CommentReaction]', self._unwrap_collection(response)) + + def get_comment_version(self, project, work_item_id, comment_id, version): + """GetCommentVersion. + [Preview API] + :param str project: Project ID or project name + :param int work_item_id: + :param int comment_id: + :param int version: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + if version is not None: + route_values['version'] = self._serialize.url('version', version, 'int') + response = self._send(http_method='GET', + location_id='49e03b34-3be0-42e3-8a5d-e8dfb88ac954', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('CommentVersion', response) + + def get_comment_versions(self, project, work_item_id, comment_id): + """GetCommentVersions. + [Preview API] + :param str project: Project ID or project name + :param int work_item_id: + :param int comment_id: + :rtype: [CommentVersion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_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='49e03b34-3be0-42e3-8a5d-e8dfb88ac954', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[CommentVersion]', self._unwrap_collection(response)) + + def create_work_item_field(self, work_item_field, project=None): + """CreateWorkItemField. + [Preview API] 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, 'WorkItemField2') + response = self._send(http_method='POST', + location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', + version='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('WorkItemField2', response) + + def delete_work_item_field(self, field_name_or_ref_name, project=None): + """DeleteWorkItemField. + [Preview API] Deletes the field. To undelete a filed, see "Update Field" API. + :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='7.1-preview.3', + route_values=route_values) + + def get_work_item_field(self, field_name_or_ref_name, project=None): + """GetWorkItemField. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('WorkItemField2', response) + + def get_work_item_fields(self, project=None, expand=None): + """GetWorkItemFields. + [Preview API] Returns information for all fields. The project ID/name parameter is optional. + :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: [WorkItemField2] + """ + 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItemField2]', self._unwrap_collection(response)) + + def update_work_item_field(self, payload, field_name_or_ref_name, project=None): + """UpdateWorkItemField. + [Preview API] Update a field. + :param :class:` ` payload: Payload contains desired value of the field's properties + :param str field_name_or_ref_name: Name/reference name of the field 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') + 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') + content = self._serialize.body(payload, 'FieldUpdate') + response = self._send(http_method='PATCH', + location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', + version='7.1-preview.3', + route_values=route_values, + content=content) + return self._deserialize('WorkItemField2', response) + + def get_github_connection_repositories(self, project, connection_id): + """GetGithubConnectionRepositories. + [Preview API] Gets a list of repos within specified github connection. + :param str project: Project ID or project name + :param str connection_id: + :rtype: [GitHubConnectionRepoModel] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if connection_id is not None: + route_values['connectionId'] = self._serialize.url('connection_id', connection_id, 'str') + response = self._send(http_method='GET', + location_id='0b3a5212-f65b-2102-0d80-1dd77ce4c700', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[GitHubConnectionRepoModel]', self._unwrap_collection(response)) + + def update_github_connection_repos(self, repos_operation_data, project, connection_id): + """UpdateGithubConnectionRepos. + [Preview API] Add/remove list of repos within specified github connection. + :param :class:` ` repos_operation_data: + :param str project: Project ID or project name + :param str connection_id: + :rtype: [GitHubConnectionRepoModel] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if connection_id is not None: + route_values['connectionId'] = self._serialize.url('connection_id', connection_id, 'str') + content = self._serialize.body(repos_operation_data, 'GitHubConnectionReposBatchRequest') + response = self._send(http_method='POST', + location_id='15b19676-8d9e-e224-d795-ca4d1a18024d', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[GitHubConnectionRepoModel]', self._unwrap_collection(response)) + + def get_github_connections(self, project): + """GetGithubConnections. + [Preview API] Gets a list of github connections + :param str project: Project ID or project name + :rtype: [GitHubConnectionModel] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='0cf95f86-6ce1-f410-ccf6-3d8c92b3a1ef', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[GitHubConnectionModel]', self._unwrap_collection(response)) + + def migrate_projects_process(self, new_process, project): + """MigrateProjectsProcess. + [Preview API] Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + :param :class:` ` new_process: + :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(new_process, 'ProcessIdModel') + response = self._send(http_method='POST', + location_id='19801631-d4e5-47e9-8166-0330de0ff1e6', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('ProcessMigrationResultModel', response) + + def create_query(self, posted_query, project, query, validate_wiql_only=None): + """CreateQuery. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('QueryHierarchyItem', response) + + def delete_query(self, project, query): + """DeleteQuery. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + + def get_queries(self, project, expand=None, depth=None, include_deleted=None): + """GetQueries. + [Preview API] 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='7.1-preview.2', + 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, use_iso_date_format=None): + """GetQuery. + [Preview API] 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 + :param bool use_iso_date_format: DateTime query clauses will be formatted using a ISO 8601 compliant format + :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') + if use_iso_date_format is not None: + query_parameters['$useIsoDateFormat'] = self._serialize.query('use_iso_date_format', use_iso_date_format, 'bool') + response = self._send(http_method='GET', + location_id='a67d190c-c41f-424b-814d-0e906f659301', + version='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) + + def destroy_work_item(self, id, project=None): + """DestroyWorkItem. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + + def get_deleted_work_item(self, id, project=None): + """GetDeletedWorkItem. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WorkItemDelete', response) + + def get_deleted_work_items(self, ids, project=None): + """GetDeletedWorkItems. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('[WorkItemDeleteShallowReference]', self._unwrap_collection(response)) + + def restore_work_item(self, payload, id, project=None): + """RestoreWorkItem. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + content=content) + return self._deserialize('WorkItemDelete', response) + + def get_revision(self, id, revision_number, project=None, expand=None): + """GetRevision. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + + def send_mail(self, body, project=None): + """SendMail. + [Preview API] RESTful method to send mail for selected/queried work items. + :param :class:` ` body: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(body, 'SendMailBody') + self._send(http_method='POST', + location_id='12438500-2f84-4fa7-9f1a-c31871b4959d', + version='7.1-preview.1', + route_values=route_values, + content=content) + + def delete_tag(self, project, tag_id_or_name): + """DeleteTag. + [Preview API] + :param str project: Project ID or project name + :param str tag_id_or_name: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + self._send(http_method='DELETE', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.1-preview.1', + route_values=route_values) + + def get_tag(self, project, tag_id_or_name): + """GetTag. + [Preview API] + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('WorkItemTagDefinition', response) + + def get_tags(self, project): + """GetTags. + [Preview API] + :param str project: Project ID or project name + :rtype: [WorkItemTagDefinition] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[WorkItemTagDefinition]', self._unwrap_collection(response)) + + def update_tag(self, tag_data, project, tag_id_or_name): + """UpdateTag. + [Preview API] + :param :class:` ` tag_data: + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + content = self._serialize.body(tag_data, 'WorkItemTagDefinition') + response = self._send(http_method='PATCH', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTagDefinition', 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTemplate', response) + + def create_temp_query(self, posted_query, project): + """CreateTempQuery. + [Preview API] Creates a temporary query + :param :class:` ` posted_query: The temporary query 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(posted_query, 'TemporaryQueryRequestModel') + response = self._send(http_method='POST', + location_id='9f614388-a9f0-4952-ad6c-89756bd8e388', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('TemporaryQueryResponseModel', response) + + def get_update(self, id, update_number, project=None): + """GetUpdate. + [Preview API] 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='7.1-preview.3', + route_values=route_values) + return self._deserialize('WorkItemUpdate', response) + + def get_updates(self, id, project=None, top=None, skip=None): + """GetUpdates. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + 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='7.1-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='7.1-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='7.1-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='7.1-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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReportingWorkItemLinksBatch', response) + + def get_relation_type(self, relation): + """GetRelationType. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WorkItemRelationType', response) + + def get_relation_types(self): + """GetRelationTypes. + [Preview API] Gets the work item relation types. + :rtype: [WorkItemRelationType] + """ + response = self._send(http_method='GET', + location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', + version='7.1-preview.2') + 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. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ReportingWorkItemRevisionsBatch', response) + + def read_reporting_discussions(self, project=None, continuation_token=None, max_page_size=None): + """ReadReportingDiscussions. + [Preview API] + :param str project: Project ID or project name + :param str continuation_token: + :param int max_page_size: + :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 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='4a644469-90c5-4fcc-9a9f-be0827d369ec', + version='7.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WorkItem', response) + + def delete_work_item(self, id, project=None, destroy=None): + """DeleteWorkItem. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + + def delete_work_items(self, delete_request, project=None): + """DeleteWorkItems. + [Preview API] Deletes specified work items and sends them 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. + :param :class:` ` delete_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(delete_request, 'WorkItemDeleteBatchRequest') + response = self._send(http_method='POST', + location_id='8bc57545-27e5-420d-b709-f6e3ebcc1fc1', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemDeleteBatch', 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='7.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('[WorkItemNextStateOnTransition]', self._unwrap_collection(response)) + + def get_work_item_type_categories(self, project): + """GetWorkItemTypeCategories. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('[WorkItemTypeCategory]', self._unwrap_collection(response)) + + def get_work_item_type_category(self, project, category): + """GetWorkItemTypeCategory. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WorkItemTypeCategory', response) + + def get_work_item_type(self, project, type): + """GetWorkItemType. + [Preview API] 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='7.1-preview.2', + route_values=route_values) + return self._deserialize('WorkItemType', response) + + def get_work_item_types(self, project): + """GetWorkItemTypes. + [Preview API] 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='7.1-preview.2', + 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. + [Preview API] 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='7.1-preview.3', + 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. + [Preview API] 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='7.1-preview.3', + 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='7.1-preview.1', + route_values=route_values) + return self._deserialize('[WorkItemStateColor]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process/__init__.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process/__init__.py new file mode 100644 index 00000000..a9e87fd4 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process/models.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process/models.py new file mode 100644 index 00000000..99437553 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process/models.py @@ -0,0 +1,1540 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Class that describes a request to add a field in a work item type. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + '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, allowed_values=None, allow_groups=None, default_value=None, read_only=None, reference_name=None, required=None): + super(AddProcessWorkItemTypeFieldRequest, self).__init__() + self.allowed_values = allowed_values + 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): + """ + Represent a control in the form. + + :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): + """ + Describes a process being created. + + :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 process being created. If not specified, server will assign a unique reference name + :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): + """ + Request object/class for creating a rule on a work item type. + + :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): + """ + Class for create work item type request + + :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): + """ + Represents the extensions part of the layout + + :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): + """ + :param description: + :type description: str + :param id: + :type id: str + :param is_identity: + :type is_identity: bool + :param is_locked: + :type is_locked: 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'}, + 'is_locked': {'key': 'isLocked', '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, is_locked=None, name=None, type=None, url=None): + super(FieldModel, self).__init__() + self.description = description + self.id = id + self.is_identity = is_identity + self.is_locked = is_locked + self.name = name + self.type = type + self.url = url + + +class FieldRuleModel(Model): + """ + :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): + """ + Describes the layout of a work item type + + :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): + """ + Represent a group in the form that holds controls in it. + + :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): + """ + Class that describes the work item state is hidden. + + :param hidden: Returns 'true', if workitem state is hidden, 'false' otherwise. + :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): + """ + Describes a page in the work item form layout + + :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): + """ + Metadata for 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 + """ + + _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): + """ + Process Behavior Model. + + :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 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): + """ + Process Behavior Create Payload. + + :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): + """ + Process Behavior Field. + + :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): + """ + Process behavior Reference. + + :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): + """ + Process Behavior Replace Payload. + + :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): + """ + Process. + + :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): + """ + :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): + """ + Properties of the process. + + :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): + """ + Process Rule Response. + + :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): + """ + Class that describes a work item type object + + :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): + """ + Class that describes a field in a work item type and its properties. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of object + :param allow_groups: Allow setting field value to a group identity. Only applies to identity fields. + :type allow_groups: bool + :param customization: Indicates the type of customization on this work item. + :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 is_locked: Information about field definition being locked for editing + :type is_locked: bool + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[object]'}, + 'allow_groups': {'key': 'allowGroups', 'type': 'bool'}, + 'customization': {'key': 'customization', 'type': 'object'}, + 'default_value': {'key': 'defaultValue', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_locked': {'key': 'isLocked', 'type': 'bool'}, + '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, allowed_values=None, allow_groups=None, customization=None, default_value=None, description=None, is_locked=None, name=None, read_only=None, reference_name=None, required=None, type=None, url=None): + super(ProcessWorkItemTypeField, self).__init__() + self.allowed_values = allowed_values + self.allow_groups = allow_groups + self.customization = customization + self.default_value = default_value + self.description = description + self.is_locked = is_locked + 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): + """ + Defines the project reference class. + + :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): + """ + Action to take when the rule is triggered. + + :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): + """ + Action to take when the rule is triggered. + + :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): + """ + Defines a condition on a field when the rule should be triggered. + + :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): + """ + :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): + """ + Defines a section of the work item form layout + + :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): + """ + Describes a request to update a process + + :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): + """ + Request class/object to update the rule. + + :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): + """ + Class to describe a request that updates a field's properties in a work item type. + + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :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 = { + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + '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, allowed_values=None, allow_groups=None, default_value=None, read_only=None, required=None): + super(UpdateProcessWorkItemTypeFieldRequest, self).__init__() + self.allowed_values = allowed_values + self.allow_groups = allow_groups + self.default_value = default_value + self.read_only = read_only + self.required = required + + +class UpdateProcessWorkItemTypeRequest(Model): + """ + Class for update request on a work item type + + :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): + """ + Properties of a work item form contribution + + :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): + """ + :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): + """ + :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): + """ + Reference to the behavior of a work item type. + + :param id: The ID of the reference behavior. + :type id: str + :param url: The url of the reference behavior. + :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): + """ + Class That represents a work item state input. + + :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): + """ + Class that represents a work item state result. + + :param color: Work item state color. + :type color: str + :param customization_type: Work item state customization type. + :type customization_type: object + :param hidden: If the Work item state is hidden. + :type hidden: bool + :param id: Id of the Workitemstate. + :type id: str + :param name: Work item state name. + :type name: str + :param order: Work item state order. + :type order: int + :param state_category: Work item state statecategory. + :type state_category: str + :param url: Work item state 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): + """ + Association between a work item type and it's behavior + + :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 is_legacy_default: If true the work item type is the default work item type in the parent behavior + :type is_legacy_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'}, + 'is_legacy_default': {'key': 'isLegacyDefault', 'type': 'bool'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, behavior=None, is_default=None, is_legacy_default=None, url=None): + super(WorkItemTypeBehavior, self).__init__() + self.behavior = behavior + self.is_default = is_default + self.is_legacy_default = is_legacy_default + self.url = url + + +class WorkItemTypeModel(Model): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process/work_item_tracking_process_client.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process/work_item_tracking_process_client.py new file mode 100644 index 00000000..27c2a068 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process/work_item_tracking_process_client.py @@ -0,0 +1,1211 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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, expand=None): + """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. + :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 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.1-preview.2', + route_values=route_values, + query_parameters=query_parameters) + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_system_control(self, process_id, wit_ref_name, control_id): + """DeleteSystemControl. + [Preview API] Deletes a system control modification on 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 control_id: The ID of the control. + :rtype: [Control] + """ + 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 control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + response = self._send(http_method='DELETE', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def get_system_controls(self, process_id, wit_ref_name): + """GetSystemControls. + [Preview API] Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: [Control] + """ + 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.1-preview.1', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def update_system_control(self, control, process_id, wit_ref_name, control_id): + """UpdateSystemControl. + [Preview API] Updates/adds a system control on the work item form. + :param :class:` ` 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 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 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='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('Control', 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='7.1-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 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. + """ + 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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-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='7.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTypeBehavior', response) + diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/__init__.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/__init__.py new file mode 100644 index 00000000..5d045cd8 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/__init__.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# 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' +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/models.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/models.py new file mode 100644 index 00000000..8c306fe9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/models.py @@ -0,0 +1,231 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """ + Describes an admin behavior for a process. + + :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): + """ + Describes an admin behavior field. + + :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): + """ + Describes result of a check template existence request. + + :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): + """ + Describes the result of a Process Import request. + + :param help_url: Help URL. + :type help_url: str + :param check_existence_result: Check template existence result. + :type check_existence_result: :class:`CheckTemplateExistenceResult ` + :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'}, + 'check_existence_result': {'key': 'checkExistenceResult', 'type': 'CheckTemplateExistenceResult'}, + '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, check_existence_result=None, id=None, is_new=None, promote_job_id=None, validation_results=None): + super(ProcessImportResult, self).__init__() + self.help_url = help_url + self.check_existence_result = check_existence_result + self.id = id + self.is_new = is_new + self.promote_job_id = promote_job_id + self.validation_results = validation_results + + +class ProcessPromoteStatus(Model): + """ + Describes result of process operation promote. + + :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 associated 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 in progress 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): + """ + :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', +] diff --git a/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/work_item_tracking_process_template_client.py b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/work_item_tracking_process_template_client.py new file mode 100644 index 00000000..473aadc9 --- /dev/null +++ b/azure-devops/azure/devops/v7_1/work_item_tracking_process_template/work_item_tracking_process_template_client.py @@ -0,0 +1,128 @@ +# -------------------------------------------------------------------------------------------- +# 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='7.1-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='7.1-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='7.1-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, replace_existing_template=None, **kwargs): + """ImportProcessTemplate. + [Preview API] Imports a process from zip file. + :param object upload_stream: Stream to upload + :param bool ignore_warnings: Ignores validation warnings. Default value is false. + :param bool replace_existing_template: Replaces the existing template. Default value is true. + :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 replace_existing_template is not None: + query_parameters['replaceExistingTemplate'] = self._serialize.query('replace_existing_template', replace_existing_template, '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='7.1-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='7.1-preview.1', + route_values=route_values) + return self._deserialize('ProcessPromoteStatus', response) + diff --git a/vsts/vsts/version.py b/azure-devops/azure/devops/version.py similarity index 94% rename from vsts/vsts/version.py rename to azure-devops/azure/devops/version.py index f8340f47..dd168d57 100644 --- a/vsts/vsts/version.py +++ b/azure-devops/azure/devops/version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -VERSION = "0.1.0b0" +VERSION = "7.1.0b4" diff --git a/azure-devops/setup.py b/azure-devops/setup.py new file mode 100644 index 00000000..ad66d697 --- /dev/null +++ b/azure-devops/setup.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from setuptools import setup, find_namespace_packages + +NAME = "azure-devops" +VERSION = "7.1.0b4" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "msrest>=0.7.1,<0.8.0" +] + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'License :: OSI Approved :: MIT License', +] + +setup( + name=NAME, + version=VERSION, + license='MIT', + description="Python wrapper around the Azure DevOps 7.x APIs", + author="Microsoft Corporation", + url="https://github.com/microsoft/azure-devops-python-api", + keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs", "AzureDevOps", "DevOps"], + install_requires=REQUIRES, + classifiers=CLASSIFIERS, + packages=find_namespace_packages(), + include_package_data=True, + python_requires=">=3.7", + long_description="Azure DevOps Python clients" +) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 7de8049b..25e5300b 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -10,9 +10,6 @@ import os from subprocess import check_call, CalledProcessError -root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..')) - - def exec_command(command): try: print('Executing: ' + command) @@ -23,25 +20,20 @@ def exec_command(command): sys.exit(1) -packages = [os.path.dirname(p) for p in glob.glob('vsts*/setup.py')] - -# Extract nspkg and sort nspkg by number of "-" -nspkg_packages = [p for p in packages if "nspkg" in p] -nspkg_packages.sort(key=lambda x: len([c for c in x if c == '-'])) - -content_packages = [p for p in packages if p not in nspkg_packages] - print('Running dev setup...') + +root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..')) print('Root directory \'{}\'\n'.format(root_dir)) +exec_command('python -m pip install --upgrade pip') +exec_command('python -m pip install --upgrade wheel') + # install general requirements if os.path.isfile('./requirements.txt'): exec_command('pip install -r requirements.txt') -# install packages -for package_list in [nspkg_packages, content_packages]: - for package_name in package_list: - exec_command('pip install -e {}'.format(package_name)) +# install dev packages +exec_command('pip install -e azure-devops') # install packaging requirements if os.path.isfile('./scripts/packaging_requirements.txt'): diff --git a/scripts/windows/init.cmd b/scripts/windows/init.cmd index e93f1434..02fbb49d 100644 --- a/scripts/windows/init.cmd +++ b/scripts/windows/init.cmd @@ -12,7 +12,7 @@ REM Add the scripts directory to the path SET PATH=%SCRIPTSDIR%\windows;%SCRIPTSDIR%;%PATH% REM set title -TITLE VSTS PYTHON API (in %BUILDDIR%) +TITLE Azure DevOps Python v5.x (in %BUILDDIR%) REM setup common aliases REM NOTE: macros in macros.txt work in *BOTH* cmd and powershell. Keep it that way. diff --git a/vsts/README.md b/vsts/README.md deleted file mode 100644 index 014e8167..00000000 --- a/vsts/README.md +++ /dev/null @@ -1,20 +0,0 @@ -#Introduction -TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project. - -#Getting Started -TODO: Guide users through getting your code up and running on their own system. In this section you can talk about: -1. Installation process -2. Software dependencies -3. Latest releases -4. API references - -#Build and Test -TODO: Describe and show how to build your code and run the tests. - -#Contribute -TODO: Explain how other users and developers can contribute to make your code better. - -If you want to learn more about creating good readme files then refer the following [guidelines](https://www.visualstudio.com/en-us/docs/git/create-a-readme). You can also seek inspiration from the below readme files: -- [ASP.NET Core](https://github.com/aspnet/Home) -- [Visual Studio Code](https://github.com/Microsoft/vscode) -- [Chakra Core](https://github.com/Microsoft/ChakraCore) \ No newline at end of file diff --git a/vsts/README.rst b/vsts/README.rst deleted file mode 100644 index 85d40bf3..00000000 --- a/vsts/README.rst +++ /dev/null @@ -1,21 +0,0 @@ -Visual Studio Team Services API -======================================================= - -This project provides access to Visual Studio Team Services APIs. - -Contribute Code -=============== - -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. - -Packaging -========= - -The released packages for this code can be found here https://pypi.python.org/pypi/vsts-python-api. -Use the standard PYPI packaging flow to push a new release. Make sure to increment the version number appropriately. - -*Example* -:: - python setup.py sdist - python -m twine upload dist/* -:: diff --git a/vsts/setup.py b/vsts/setup.py deleted file mode 100644 index 322e750d..00000000 --- a/vsts/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from setuptools import setup, find_packages - -NAME = "vsts" -VERSION = "0.1.0b0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "msrest>=0.4.5" -] - -CLASSIFIERS = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'License :: OSI Approved :: MIT License', -] - -setup( - name=NAME, - version=VERSION, - description="Python wrapper around the VSTS APIs", - author="Microsoft Corporation", - author_email="vstscli@microsoft.com", - url="https://github.com/Microsoft/vsts-python-api ", - keywords=["Microsoft", "VSTS", "Team Services", "SDK", "AzureTfs"], - install_requires=REQUIRES, - classifiers=CLASSIFIERS, - packages=find_packages(), - include_package_data=True, - long_description="""\ - """ -) diff --git a/vsts/vsts/__init__.py b/vsts/vsts/__init__.py deleted file mode 100644 index 73baee1e..00000000 --- a/vsts/vsts/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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__) diff --git a/vsts/vsts/build/__init__.py b/vsts/vsts/build/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/build/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/build/v4_0/__init__.py b/vsts/vsts/build/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/build/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/build/v4_0/build_client.py b/vsts/vsts/build/v4_0/build_client.py deleted file mode 100644 index bd62ce88..00000000 --- a/vsts/vsts/build/v4_0/build_client.py +++ /dev/null @@ -1,1429 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class BuildClient(VssClient): - """Build - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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, build_id, project=None): - """CreateArtifact. - Associates an artifact with a build - :param :class:` ` artifact: - :param int build_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 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='4.0', - route_values=route_values, - content=content) - return self._deserialize('BuildArtifact', response) - - def get_artifact(self, build_id, artifact_name, project=None): - """GetArtifact. - Gets a specific artifact for a build - :param int build_id: - :param str artifact_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 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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('BuildArtifact', response) - - def get_artifact_content_zip(self, build_id, artifact_name, project=None): - """GetArtifactContentZip. - Gets a specific artifact for a build - :param int build_id: - :param str artifact_name: - :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 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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_artifacts(self, build_id, project=None): - """GetArtifacts. - Gets all artifacts for a build - :param int build_id: - :param str project: Project ID or project name - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildArtifact]', response) - - def get_badge(self, project, definition_id, branch_name=None): - """GetBadge. - :param str project: - :param int definition_id: - :param str branch_name: - :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 branch_name is not None: - query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') - response = self._send(http_method='GET', - location_id='de6a4df8-22cd-44ee-af2d-39f6aa7a4261', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): - """GetBuildBadge. - [Preview API] - :param str project: Project ID or project name - :param str repo_type: - :param str repo_id: - :param str 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='4.0-preview.1', - 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] - :param str project: Project ID or project name - :param str repo_type: - :param str repo_id: - :param str 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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def delete_build(self, build_id, project=None): - """DeleteBuild. - Deletes a build - :param int build_id: - :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 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='4.0', - route_values=route_values) - - def get_build(self, build_id, project=None, property_filters=None): - """GetBuild. - Gets a build - :param int build_id: - :param str project: Project ID or project name - :param str property_filters: A comma-delimited list of properties to include in the results - :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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Build', response) - - def get_builds(self, project=None, definitions=None, queues=None, build_number=None, min_finish_time=None, max_finish_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 builds - :param str project: Project ID or project name - :param [int] definitions: A comma-delimited list of definition ids - :param [int] queues: A comma-delimited list of queue ids - :param str build_number: - :param datetime min_finish_time: - :param datetime max_finish_time: - :param str requested_for: - :param BuildReason reason_filter: - :param BuildStatus status_filter: - :param BuildResult result_filter: - :param [str] tag_filters: A comma-delimited list of tags - :param [str] properties: A comma-delimited list of properties to include in the results - :param int top: The maximum number of builds to retrieve - :param str continuation_token: - :param int max_builds_per_definition: - :param QueryDeletedOption deleted_filter: - :param BuildQueryOrder query_order: - :param str branch_name: - :param [int] build_ids: - :param str repository_id: - :param str repository_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_finish_time is not None: - query_parameters['minFinishTime'] = self._serialize.query('min_finish_time', min_finish_time, 'iso-8601') - if max_finish_time is not None: - query_parameters['maxFinishTime'] = self._serialize.query('max_finish_time', max_finish_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, 'BuildReason') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'BuildStatus') - if result_filter is not None: - query_parameters['resultFilter'] = self._serialize.query('result_filter', result_filter, 'BuildResult') - 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, 'QueryDeletedOption') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'BuildQueryOrder') - 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Build]', response) - - def queue_build(self, build, project=None, ignore_warnings=None, check_in_ticket=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: - :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') - content = self._serialize.body(build, 'Build') - response = self._send(http_method='POST', - location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('Build', response) - - def update_build(self, build, build_id, project=None): - """UpdateBuild. - Updates a build - :param :class:` ` build: - :param int build_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 build_id is not None: - route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') - content = self._serialize.body(build, 'Build') - response = self._send(http_method='PATCH', - location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.0', - route_values=route_values, - content=content) - return self._deserialize('Build', response) - - def update_builds(self, builds, project=None): - """UpdateBuilds. - Update a batch of builds - :param [Build] builds: - :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='4.0', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[Build]', 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Change]', response) - - def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): - """GetChangesBetweenBuilds. - [Preview API] Gets the changes associated between given builds - :param str project: Project ID or project name - :param int from_build_id: - :param int to_build_id: - :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='4.0-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Change]', 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='4.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='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildController]', response) - - def create_definition(self, definition, project=None, definition_to_clone_id=None, definition_to_clone_revision=None): - """CreateDefinition. - Creates a new definition - :param :class:` ` 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('BuildDefinition', response) - - def delete_definition(self, definition_id, project=None): - """DeleteDefinition. - Deletes a definition and all associated builds - :param int definition_id: - :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 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='4.0', - route_values=route_values) - - def get_definition(self, definition_id, project=None, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): - """GetDefinition. - Gets a definition, optionally at a specific revision - :param int definition_id: - :param str project: Project ID or project name - :param int revision: - :param datetime min_metrics_time: - :param [str] property_filters: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('BuildDefinition', response) - - def get_definitions(self, project=None, 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): - """GetDefinitions. - Gets definitions, optionally filtered by name - :param str project: Project ID or project name - :param str name: - :param str repository_id: - :param str repository_type: - :param DefinitionQueryOrder query_order: - :param int top: - :param str continuation_token: - :param datetime min_metrics_time: - :param [int] definition_ids: - :param str path: - :param datetime built_after: - :param datetime not_built_after: - :param bool include_all_properties: - :param bool include_latest_builds: - :param str task_id_filter: - :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, 'DefinitionQueryOrder') - 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') - response = self._send(http_method='GET', - location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildDefinitionReference]', response) - - def update_definition(self, definition, definition_id, project=None, secrets_source_definition_id=None, secrets_source_definition_revision=None): - """UpdateDefinition. - Updates an existing definition - :param :class:` ` definition: - :param int definition_id: - :param str project: Project ID or project name - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('BuildDefinition', response) - - def create_folder(self, folder, project, path): - """CreateFolder. - [Preview API] Creates a new folder - :param :class:` ` folder: - :param str project: Project ID or project name - :param str path: - :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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('Folder', response) - - def delete_folder(self, project, path): - """DeleteFolder. - [Preview API] Deletes a definition folder for given folder name and path and all it's existing definitions and it's corresponding builds - :param str project: Project ID or project name - :param str path: - """ - 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='4.0-preview.1', - route_values=route_values) - - def get_folders(self, project, path=None, query_order=None): - """GetFolders. - [Preview API] Gets folders - :param str project: Project ID or project name - :param str path: - :param FolderQueryOrder query_order: - :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, 'FolderQueryOrder') - response = self._send(http_method='GET', - location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Folder]', response) - - def update_folder(self, folder, project, path): - """UpdateFolder. - [Preview API] Updates an existing folder at given existing path - :param :class:` ` folder: - :param str project: Project ID or project name - :param str path: - :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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('Folder', response) - - def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None): - """GetBuildLog. - Gets a log - :param str project: Project ID or project name - :param int build_id: - :param int log_id: - :param long start_line: - :param long 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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): - """GetBuildLogLines. - Gets a log - :param str project: Project ID or project name - :param int build_id: - :param int log_id: - :param long start_line: - :param long 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_build_logs(self, project, build_id): - """GetBuildLogs. - Gets logs for a build - :param str project: Project ID or project name - :param int build_id: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildLog]', response) - - def get_build_logs_zip(self, project, build_id): - """GetBuildLogsZip. - Gets logs for a build - :param str project: Project ID or project name - :param int build_id: - :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='4.0', - route_values=route_values) - return self._deserialize('object', response) - - def get_project_metrics(self, project, metric_aggregation_type=None, min_metrics_time=None): - """GetProjectMetrics. - [Preview API] Gets metrics of a project - :param str project: Project ID or project name - :param str metric_aggregation_type: - :param datetime min_metrics_time: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildMetric]', response) - - def get_definition_metrics(self, project, definition_id, min_metrics_time=None): - """GetDefinitionMetrics. - [Preview API] Gets metrics of a definition - :param str project: Project ID or project name - :param int definition_id: - :param datetime min_metrics_time: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildMetric]', response) - - def get_build_option_definitions(self, project=None): - """GetBuildOptionDefinitions. - Gets all build option definitions - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildOptionDefinition]', 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 build id. - :param [str] filter: Filter to specific properties. Defaults to all 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='4.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: - :param str project: Project ID or project name - :param int build_id: The build 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') - content = self._serialize.body(document, '[JsonPatchOperation]') - response = self._send(http_method='PATCH', - location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', - version='4.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 definition id. - :param [str] filter: Filter to specific properties. Defaults to all 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='4.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: - :param str project: Project ID or project name - :param int definition_id: The definition id. - :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='4.0-preview.1', - route_values=route_values, - content=content, - media_type='application/json-patch+json') - return self._deserialize('object', response) - - def get_build_report(self, project, build_id, type=None): - """GetBuildReport. - [Preview API] Gets report for a build - :param str project: Project ID or project name - :param int build_id: - :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='4.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): - """GetBuildReportHtmlContent. - [Preview API] Gets report for a build - :param str project: Project ID or project name - :param int build_id: - :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='4.0-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_resource_usage(self): - """GetResourceUsage. - [Preview API] - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='3813d06c-9e36-4ea1-aac3-61a485d60e3d', - version='4.0-preview.2') - return self._deserialize('BuildResourceUsage', response) - - def get_definition_revisions(self, project, definition_id): - """GetDefinitionRevisions. - Gets revisions of a definition - :param str project: Project ID or project name - :param int definition_id: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildDefinitionRevision]', response) - - def get_build_settings(self): - """GetBuildSettings. - Gets the build settings - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='4.0') - return self._deserialize('BuildSettings', response) - - def update_build_settings(self, settings): - """UpdateBuildSettings. - Updates the build settings - :param :class:` ` settings: - :rtype: :class:` ` - """ - content = self._serialize.body(settings, 'BuildSettings') - response = self._send(http_method='PATCH', - location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='4.0', - 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: - :param str tag: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def add_build_tags(self, tags, project, build_id): - """AddBuildTags. - Adds tag to a build - :param [str] tags: - :param str project: Project ID or project name - :param int build_id: - :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='4.0', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[str]', response) - - def delete_build_tag(self, project, build_id, tag): - """DeleteBuildTag. - Deletes a tag from a build - :param str project: Project ID or project name - :param int build_id: - :param str tag: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_tags(self, project): - """GetTags. - Gets a list of 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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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: - :param str tag: - :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='4.0-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def add_definition_tags(self, tags, project, definition_id): - """AddDefinitionTags. - [Preview API] Adds multiple tags to a definition - :param [str] tags: - :param str project: Project ID or project name - :param int definition_id: - :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='4.0-preview.2', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[str]', response) - - def delete_definition_tag(self, project, definition_id, tag): - """DeleteDefinitionTag. - [Preview API] Deletes a tag from a definition - :param str project: Project ID or project name - :param int definition_id: - :param str tag: - :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='4.0-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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: - :param int revision: - :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='4.0-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def delete_template(self, project, template_id): - """DeleteTemplate. - Deletes a definition template - :param str project: Project ID or project name - :param str template_id: - """ - 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='4.0', - route_values=route_values) - - def get_template(self, project, template_id): - """GetTemplate. - Gets definition template filtered by id - :param str project: Project ID or project name - :param str template_id: 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='4.0', - route_values=route_values) - return self._deserialize('BuildDefinitionTemplate', response) - - def get_templates(self, project): - """GetTemplates. - Gets 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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildDefinitionTemplate]', response) - - def save_template(self, template, project, template_id): - """SaveTemplate. - Saves a definition template - :param :class:` ` template: - :param str project: Project ID or project name - :param str template_id: - :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='4.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='4.0', - 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 item ids associated with a build - :param str project: Project ID or project name - :param int build_id: - :param int top: The maximum number of workitems 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ResourceRef]', response) - - def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, top=None): - """GetBuildWorkItemsRefsFromCommits. - Gets the work item ids associated with build commits - :param [str] commit_ids: - :param str project: Project ID or project name - :param int build_id: - :param int top: The maximum number of workitems to return, also number of commits to consider if commitids are not sent - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[ResourceRef]', response) - - def get_work_items_between_builds(self, project, from_build_id, to_build_id, top=None): - """GetWorkItemsBetweenBuilds. - [Preview API] Gets all the work item ids inbetween fromBuildId to toBuildId - :param str project: Project ID or project name - :param int from_build_id: - :param int to_build_id: - :param int top: The maximum number of workitems 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='4.0-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ResourceRef]', response) - diff --git a/vsts/vsts/build/v4_0/models/__init__.py b/vsts/vsts/build/v4_0/models/__init__.py deleted file mode 100644 index 749323cf..00000000 --- a/vsts/vsts/build/v4_0/models/__init__.py +++ /dev/null @@ -1,123 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .agent_pool_queue import AgentPoolQueue -from .artifact_resource import ArtifactResource -from .build import Build -from .build_artifact import BuildArtifact -from .build_badge import BuildBadge -from .build_controller import BuildController -from .build_definition import BuildDefinition -from .build_definition3_2 import BuildDefinition3_2 -from .build_definition_reference import BuildDefinitionReference -from .build_definition_revision import BuildDefinitionRevision -from .build_definition_step import BuildDefinitionStep -from .build_definition_template import BuildDefinitionTemplate -from .build_definition_template3_2 import BuildDefinitionTemplate3_2 -from .build_definition_variable import BuildDefinitionVariable -from .build_log import BuildLog -from .build_log_reference import BuildLogReference -from .build_metric import BuildMetric -from .build_option import BuildOption -from .build_option_definition import BuildOptionDefinition -from .build_option_definition_reference import BuildOptionDefinitionReference -from .build_option_group_definition import BuildOptionGroupDefinition -from .build_option_input_definition import BuildOptionInputDefinition -from .build_process import BuildProcess -from .build_report_metadata import BuildReportMetadata -from .build_repository import BuildRepository -from .build_request_validation_result import BuildRequestValidationResult -from .build_resource_usage import BuildResourceUsage -from .build_settings import BuildSettings -from .build_trigger import BuildTrigger -from .change import Change -from .data_source_binding_base import DataSourceBindingBase -from .definition_reference import DefinitionReference -from .deployment import Deployment -from .folder import Folder -from .identity_ref import IdentityRef -from .issue import Issue -from .json_patch_operation import JsonPatchOperation -from .process_parameters import ProcessParameters -from .reference_links import ReferenceLinks -from .resource_ref import ResourceRef -from .retention_policy import RetentionPolicy -from .task_agent_pool_reference import TaskAgentPoolReference -from .task_definition_reference import TaskDefinitionReference -from .task_input_definition_base import TaskInputDefinitionBase -from .task_input_validation import TaskInputValidation -from .task_orchestration_plan_reference import TaskOrchestrationPlanReference -from .task_reference import TaskReference -from .task_source_definition_base import TaskSourceDefinitionBase -from .team_project_reference import TeamProjectReference -from .timeline import Timeline -from .timeline_record import TimelineRecord -from .timeline_reference import TimelineReference -from .variable_group import VariableGroup -from .variable_group_reference import VariableGroupReference -from .web_api_connected_service_ref import WebApiConnectedServiceRef -from .xaml_build_controller_reference import XamlBuildControllerReference - -__all__ = [ - 'AgentPoolQueue', - 'ArtifactResource', - 'Build', - 'BuildArtifact', - 'BuildBadge', - 'BuildController', - 'BuildDefinition', - 'BuildDefinition3_2', - 'BuildDefinitionReference', - 'BuildDefinitionRevision', - 'BuildDefinitionStep', - 'BuildDefinitionTemplate', - 'BuildDefinitionTemplate3_2', - 'BuildDefinitionVariable', - 'BuildLog', - 'BuildLogReference', - 'BuildMetric', - 'BuildOption', - 'BuildOptionDefinition', - 'BuildOptionDefinitionReference', - 'BuildOptionGroupDefinition', - 'BuildOptionInputDefinition', - 'BuildProcess', - 'BuildReportMetadata', - 'BuildRepository', - 'BuildRequestValidationResult', - 'BuildResourceUsage', - 'BuildSettings', - 'BuildTrigger', - 'Change', - 'DataSourceBindingBase', - 'DefinitionReference', - 'Deployment', - 'Folder', - 'IdentityRef', - 'Issue', - 'JsonPatchOperation', - 'ProcessParameters', - 'ReferenceLinks', - 'ResourceRef', - 'RetentionPolicy', - 'TaskAgentPoolReference', - 'TaskDefinitionReference', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskOrchestrationPlanReference', - 'TaskReference', - 'TaskSourceDefinitionBase', - 'TeamProjectReference', - 'Timeline', - 'TimelineRecord', - 'TimelineReference', - 'VariableGroup', - 'VariableGroupReference', - 'WebApiConnectedServiceRef', - 'XamlBuildControllerReference', -] diff --git a/vsts/vsts/build/v4_0/models/agent_pool_queue.py b/vsts/vsts/build/v4_0/models/agent_pool_queue.py deleted file mode 100644 index 2b27ddfa..00000000 --- a/vsts/vsts/build/v4_0/models/agent_pool_queue.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: Id of the resource - :type id: int - :param name: Name of the linked resource (definition name, controller name, etc.) - :type name: str - :param pool: The pool used by this queue. - :type pool: :class:`TaskAgentPoolReference ` - :param url: 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 diff --git a/vsts/vsts/build/v4_0/models/artifact_resource.py b/vsts/vsts/build/v4_0/models/artifact_resource.py deleted file mode 100644 index f51d3b19..00000000 --- a/vsts/vsts/build/v4_0/models/artifact_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ArtifactResource(Model): - """ArtifactResource. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param data: The type-specific resource data. For example, "#/10002/5/drop", "$/drops/5", "\\myshare\myfolder\mydrops\5" - :type data: str - :param download_url: Link to the resource. This might include things like query parameters to download as a zip file - :type download_url: str - :param properties: Properties of Artifact Resource - :type properties: dict - :param type: The type of the resource: File container, version control folder, UNC path, etc. - :type type: str - :param url: 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 diff --git a/vsts/vsts/build/v4_0/models/build.py b/vsts/vsts/build/v4_0/models/build.py deleted file mode 100644 index d53da81f..00000000 --- a/vsts/vsts/build/v4_0/models/build.py +++ /dev/null @@ -1,189 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Build(Model): - """Build. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param build_number: Build number/name of the build - :type build_number: str - :param build_number_revision: Build number revision - :type build_number_revision: int - :param controller: The build controller. This should only be 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: Process or person that deleted the build - :type deleted_by: :class:`IdentityRef ` - :param deleted_date: Date the build was deleted - :type deleted_date: datetime - :param deleted_reason: Description of how the build was deleted - :type deleted_reason: str - :param demands: Demands - :type demands: list of :class:`object ` - :param finish_time: Time that the build was completed - :type finish_time: datetime - :param id: Id of the build - :type id: int - :param keep_forever: - :type keep_forever: bool - :param last_changed_by: Process or person that last changed the build - :type last_changed_by: :class:`IdentityRef ` - :param last_changed_date: Date the build was last changed - :type last_changed_date: datetime - :param logs: Log location of the build - :type logs: :class:`BuildLogReference ` - :param orchestration_plan: Orchestration plan for the build - :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` - :param parameters: 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: Quality of the xaml build (good, bad, etc.) - :type quality: str - :param queue: The queue. This should only be set if the definition type is Build. - :type queue: :class:`AgentPoolQueue ` - :param queue_options: Queue option of 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: Time that the build was queued - :type queue_time: datetime - :param reason: 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: Specifies if Build should be retained by Release - :type retained_by_release: bool - :param source_branch: Source branch - :type source_branch: str - :param source_version: Source version - :type source_version: str - :param start_time: Time that the build was started - :type start_time: datetime - :param status: Status of the build - :type status: object - :param tags: - :type tags: list of str - :param trigger_info: Sourceprovider-specific information about what triggered the build - :type trigger_info: dict - :param uri: Uri of the build - :type uri: str - :param url: 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]'}, - '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, 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.trigger_info = trigger_info - self.uri = uri - self.url = url - self.validation_results = validation_results diff --git a/vsts/vsts/build/v4_0/models/build_artifact.py b/vsts/vsts/build/v4_0/models/build_artifact.py deleted file mode 100644 index 75e3e0f1..00000000 --- a/vsts/vsts/build/v4_0/models/build_artifact.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/build_badge.py b/vsts/vsts/build/v4_0/models/build_badge.py deleted file mode 100644 index e060e97a..00000000 --- a/vsts/vsts/build/v4_0/models/build_badge.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildBadge(Model): - """BuildBadge. - - :param build_id: Build id, if exists that this badge corresponds to - :type build_id: int - :param image_url: Self Url that generates SVG - :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 diff --git a/vsts/vsts/build/v4_0/models/build_controller.py b/vsts/vsts/build/v4_0/models/build_controller.py deleted file mode 100644 index 5d5d2b83..00000000 --- a/vsts/vsts/build/v4_0/models/build_controller.py +++ /dev/null @@ -1,58 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .xaml_build_controller_reference import XamlBuildControllerReference - - -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 diff --git a/vsts/vsts/build/v4_0/models/build_definition.py b/vsts/vsts/build/v4_0/models/build_definition.py deleted file mode 100644 index 423f0ef5..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition.py +++ /dev/null @@ -1,153 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_definition_reference import BuildDefinitionReference - - -class BuildDefinition(BuildDefinitionReference): - """BuildDefinition. - - :param created_date: The date the definition was created - :type created_date: datetime - :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 path: The path this definitions belongs to - :type path: str - :param project: The project. - :type project: :class:`TeamProjectReference ` - :param queue_status: If builds can be queued from 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 Uri of the definition - :type uri: str - :param url: Full http link to the resource - :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: If this is a draft definition, it might have a parent - :type draft_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 which should be used for requests. - :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: 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: Gets or sets the job authorization scope for builds which are queued against this definition - :type job_authorization_scope: object - :param job_cancel_timeout_in_minutes: Gets or sets 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: Gets or sets 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: The build process. - :type process: :class:`BuildProcess ` - :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:`BuildTrigger ` - :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'}, - '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'}, - 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, - 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, - 'options': {'key': 'options', 'type': '[BuildOption]'}, - 'process': {'key': 'process', 'type': 'BuildProcess'}, - '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': '[BuildTrigger]'}, - '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, 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, latest_build=None, latest_completed_build=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, 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.latest_build = latest_build - self.latest_completed_build = latest_completed_build - 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 diff --git a/vsts/vsts/build/v4_0/models/build_definition3_2.py b/vsts/vsts/build/v4_0/models/build_definition3_2.py deleted file mode 100644 index 9e66a81a..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition3_2.py +++ /dev/null @@ -1,149 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_definition_reference import BuildDefinitionReference - - -class BuildDefinition3_2(BuildDefinitionReference): - """BuildDefinition3_2. - - :param created_date: The date the definition was created - :type created_date: datetime - :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 path: The path this definitions belongs to - :type path: str - :param project: The project. - :type project: :class:`TeamProjectReference ` - :param queue_status: If builds can be queued from 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 Uri of the definition - :type uri: str - :param url: Full http link to the resource - :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: If this is a draft definition, it might have a parent - :type draft_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 which should be used for requests. - :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: Gets or sets the job authorization scope for builds which are queued against this definition - :type job_authorization_scope: object - :param job_cancel_timeout_in_minutes: Gets or sets 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: Gets or sets 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:`BuildTrigger ` - :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'}, - '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': '[BuildTrigger]'}, - '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, 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, 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 diff --git a/vsts/vsts/build/v4_0/models/build_definition_reference.py b/vsts/vsts/build/v4_0/models/build_definition_reference.py deleted file mode 100644 index 6720e46d..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_reference.py +++ /dev/null @@ -1,75 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .definition_reference import DefinitionReference - - -class BuildDefinitionReference(DefinitionReference): - """BuildDefinitionReference. - - :param created_date: The date the definition was created - :type created_date: datetime - :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 path: The path this definitions belongs to - :type path: str - :param project: The project. - :type project: :class:`TeamProjectReference ` - :param queue_status: If builds can be queued from 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 Uri of the definition - :type uri: str - :param url: Full http link to the resource - :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: If this is a draft definition, it might have a parent - :type draft_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 which should be used for requests. - :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'}, - '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, 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.metrics = metrics - self.quality = quality - self.queue = queue diff --git a/vsts/vsts/build/v4_0/models/build_definition_revision.py b/vsts/vsts/build/v4_0/models/build_definition_revision.py deleted file mode 100644 index f981fc05..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_revision.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionRevision(Model): - """BuildDefinitionRevision. - - :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 definition_url: - :type definition_url: str - :param name: - :type name: str - :param revision: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_definition_step.py b/vsts/vsts/build/v4_0/models/build_definition_step.py deleted file mode 100644 index 0b60623c..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_step.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionStep(Model): - """BuildDefinitionStep. - - :param always_run: - :type always_run: bool - :param condition: - :type condition: str - :param continue_on_error: - :type continue_on_error: bool - :param display_name: - :type display_name: str - :param enabled: - :type enabled: bool - :param environment: - :type environment: dict - :param inputs: - :type inputs: dict - :param ref_name: - :type ref_name: str - :param task: - :type task: :class:`TaskDefinitionReference ` - :param timeout_in_minutes: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_definition_template.py b/vsts/vsts/build/v4_0/models/build_definition_template.py deleted file mode 100644 index 0cfa0171..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_template.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionTemplate(Model): - """BuildDefinitionTemplate. - - :param can_delete: - :type can_delete: bool - :param category: - :type category: 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:`BuildDefinition ` - """ - - _attribute_map = { - 'can_delete': {'key': 'canDelete', 'type': 'bool'}, - 'category': {'key': 'category', '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, 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.description = description - self.icons = icons - self.icon_task_id = icon_task_id - self.id = id - self.name = name - self.template = template diff --git a/vsts/vsts/build/v4_0/models/build_definition_template3_2.py b/vsts/vsts/build/v4_0/models/build_definition_template3_2.py deleted file mode 100644 index 65c8f131..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_template3_2.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionTemplate3_2(Model): - """BuildDefinitionTemplate3_2. - - :param can_delete: - :type can_delete: bool - :param category: - :type category: 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'}, - '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, 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.description = description - self.icons = icons - self.icon_task_id = icon_task_id - self.id = id - self.name = name - self.template = template diff --git a/vsts/vsts/build/v4_0/models/build_definition_variable.py b/vsts/vsts/build/v4_0/models/build_definition_variable.py deleted file mode 100644 index c43a3d6b..00000000 --- a/vsts/vsts/build/v4_0/models/build_definition_variable.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionVariable(Model): - """BuildDefinitionVariable. - - :param allow_override: - :type allow_override: bool - :param is_secret: - :type is_secret: bool - :param value: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_log.py b/vsts/vsts/build/v4_0/models/build_log.py deleted file mode 100644 index 7f3e149b..00000000 --- a/vsts/vsts/build/v4_0/models/build_log.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_log_reference import BuildLogReference - - -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: Full link to the log resource. - :type url: str - :param created_on: The date the log was created. - :type created_on: datetime - :param last_changed_on: The date 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 diff --git a/vsts/vsts/build/v4_0/models/build_log_reference.py b/vsts/vsts/build/v4_0/models/build_log_reference.py deleted file mode 100644 index d98859af..00000000 --- a/vsts/vsts/build/v4_0/models/build_log_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: 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 diff --git a/vsts/vsts/build/v4_0/models/build_metric.py b/vsts/vsts/build/v4_0/models/build_metric.py deleted file mode 100644 index fc084d0c..00000000 --- a/vsts/vsts/build/v4_0/models/build_metric.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildMetric(Model): - """BuildMetric. - - :param date: Scoped date of the metric - :type date: datetime - :param int_value: The int value of the metric - :type int_value: int - :param name: The name of the metric - :type name: str - :param scope: The scope of the metric - :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 diff --git a/vsts/vsts/build/v4_0/models/build_option.py b/vsts/vsts/build/v4_0/models/build_option.py deleted file mode 100644 index 0a1c813d..00000000 --- a/vsts/vsts/build/v4_0/models/build_option.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildOption(Model): - """BuildOption. - - :param definition: - :type definition: :class:`BuildOptionDefinitionReference ` - :param 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 diff --git a/vsts/vsts/build/v4_0/models/build_option_definition.py b/vsts/vsts/build/v4_0/models/build_option_definition.py deleted file mode 100644 index b22e348a..00000000 --- a/vsts/vsts/build/v4_0/models/build_option_definition.py +++ /dev/null @@ -1,44 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_option_definition_reference import BuildOptionDefinitionReference - - -class BuildOptionDefinition(BuildOptionDefinitionReference): - """BuildOptionDefinition. - - :param id: - :type id: str - :param description: - :type description: str - :param groups: - :type groups: list of :class:`BuildOptionGroupDefinition ` - :param inputs: - :type inputs: list of :class:`BuildOptionInputDefinition ` - :param name: - :type name: str - :param ordinal: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_option_definition_reference.py b/vsts/vsts/build/v4_0/models/build_option_definition_reference.py deleted file mode 100644 index 02fb2a13..00000000 --- a/vsts/vsts/build/v4_0/models/build_option_definition_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildOptionDefinitionReference(Model): - """BuildOptionDefinitionReference. - - :param id: - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'} - } - - def __init__(self, id=None): - super(BuildOptionDefinitionReference, self).__init__() - self.id = id diff --git a/vsts/vsts/build/v4_0/models/build_option_group_definition.py b/vsts/vsts/build/v4_0/models/build_option_group_definition.py deleted file mode 100644 index b4840fc7..00000000 --- a/vsts/vsts/build/v4_0/models/build_option_group_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildOptionGroupDefinition(Model): - """BuildOptionGroupDefinition. - - :param display_name: - :type display_name: str - :param is_expanded: - :type is_expanded: bool - :param name: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_option_input_definition.py b/vsts/vsts/build/v4_0/models/build_option_input_definition.py deleted file mode 100644 index 491cb33e..00000000 --- a/vsts/vsts/build/v4_0/models/build_option_input_definition.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildOptionInputDefinition(Model): - """BuildOptionInputDefinition. - - :param default_value: - :type default_value: str - :param group_name: - :type group_name: str - :param help: - :type help: dict - :param label: - :type label: str - :param name: - :type name: str - :param options: - :type options: dict - :param required: - :type required: bool - :param type: - :type type: object - :param visible_rule: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_process.py b/vsts/vsts/build/v4_0/models/build_process.py deleted file mode 100644 index 32205962..00000000 --- a/vsts/vsts/build/v4_0/models/build_process.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildProcess(Model): - """BuildProcess. - - :param repositories: - :type repositories: dict - :param type: - :type type: int - """ - - _attribute_map = { - 'repositories': {'key': 'repositories', 'type': '{BuildRepository}'}, - 'type': {'key': 'type', 'type': 'int'} - } - - def __init__(self, repositories=None, type=None): - super(BuildProcess, self).__init__() - self.repositories = repositories - self.type = type diff --git a/vsts/vsts/build/v4_0/models/build_report_metadata.py b/vsts/vsts/build/v4_0/models/build_report_metadata.py deleted file mode 100644 index ba9771eb..00000000 --- a/vsts/vsts/build/v4_0/models/build_report_metadata.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildReportMetadata(Model): - """BuildReportMetadata. - - :param build_id: - :type build_id: int - :param content: - :type content: str - :param type: - :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 diff --git a/vsts/vsts/build/v4_0/models/build_repository.py b/vsts/vsts/build/v4_0/models/build_repository.py deleted file mode 100644 index a1d4e03b..00000000 --- a/vsts/vsts/build/v4_0/models/build_repository.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildRepository(Model): - """BuildRepository. - - :param checkout_submodules: - :type checkout_submodules: bool - :param clean: Indicates whether to clean the target folder when getting code from the repository. This is a String so that it can reference variables. - :type clean: str - :param default_branch: Gets or sets the name of the default branch. - :type default_branch: str - :param id: - :type id: str - :param name: Gets or sets the friendly name of the repository. - :type name: str - :param properties: - :type properties: dict - :param root_folder: Gets or sets the root folder. - :type root_folder: str - :param type: Gets or sets the type of the repository. - :type type: str - :param url: Gets or sets 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 diff --git a/vsts/vsts/build/v4_0/models/build_request_validation_result.py b/vsts/vsts/build/v4_0/models/build_request_validation_result.py deleted file mode 100644 index b06d0826..00000000 --- a/vsts/vsts/build/v4_0/models/build_request_validation_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildRequestValidationResult(Model): - """BuildRequestValidationResult. - - :param message: - :type message: str - :param 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 diff --git a/vsts/vsts/build/v4_0/models/build_resource_usage.py b/vsts/vsts/build/v4_0/models/build_resource_usage.py deleted file mode 100644 index 5026d93f..00000000 --- a/vsts/vsts/build/v4_0/models/build_resource_usage.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildResourceUsage(Model): - """BuildResourceUsage. - - :param distributed_task_agents: - :type distributed_task_agents: int - :param paid_private_agent_slots: - :type paid_private_agent_slots: int - :param total_usage: - :type total_usage: int - :param 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 diff --git a/vsts/vsts/build/v4_0/models/build_settings.py b/vsts/vsts/build/v4_0/models/build_settings.py deleted file mode 100644 index 999e4a51..00000000 --- a/vsts/vsts/build/v4_0/models/build_settings.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildSettings(Model): - """BuildSettings. - - :param days_to_keep_deleted_builds_before_destroy: - :type days_to_keep_deleted_builds_before_destroy: int - :param default_retention_policy: - :type default_retention_policy: :class:`RetentionPolicy ` - :param 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 diff --git a/vsts/vsts/build/v4_0/models/build_trigger.py b/vsts/vsts/build/v4_0/models/build_trigger.py deleted file mode 100644 index a9261d0a..00000000 --- a/vsts/vsts/build/v4_0/models/build_trigger.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildTrigger(Model): - """BuildTrigger. - - :param trigger_type: - :type trigger_type: object - """ - - _attribute_map = { - 'trigger_type': {'key': 'triggerType', 'type': 'object'} - } - - def __init__(self, trigger_type=None): - super(BuildTrigger, self).__init__() - self.trigger_type = trigger_type diff --git a/vsts/vsts/build/v4_0/models/change.py b/vsts/vsts/build/v4_0/models/change.py deleted file mode 100644 index 018dadad..00000000 --- a/vsts/vsts/build/v4_0/models/change.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: 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 message_truncated: Indicates whether the message was truncated - :type message_truncated: bool - :param timestamp: A 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'}, - '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, 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.timestamp = timestamp - self.type = type diff --git a/vsts/vsts/build/v4_0/models/data_source_binding_base.py b/vsts/vsts/build/v4_0/models/data_source_binding_base.py deleted file mode 100644 index e2c6e8d5..00000000 --- a/vsts/vsts/build/v4_0/models/data_source_binding_base.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 DataSourceBindingBase(Model): - """DataSourceBindingBase. - - :param data_source_name: - :type data_source_name: str - :param endpoint_id: - :type endpoint_id: str - :param endpoint_url: - :type endpoint_url: str - :param parameters: - :type parameters: dict - :param result_selector: - :type result_selector: str - :param result_template: - :type result_template: str - :param target: - :type target: str - """ - - _attribute_map = { - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, - 'endpoint_url': {'key': 'endpointUrl', '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, data_source_name=None, endpoint_id=None, endpoint_url=None, parameters=None, result_selector=None, result_template=None, target=None): - super(DataSourceBindingBase, self).__init__() - self.data_source_name = data_source_name - self.endpoint_id = endpoint_id - self.endpoint_url = endpoint_url - self.parameters = parameters - self.result_selector = result_selector - self.result_template = result_template - self.target = target diff --git a/vsts/vsts/build/v4_0/models/definition_reference.py b/vsts/vsts/build/v4_0/models/definition_reference.py deleted file mode 100644 index 05f4cf68..00000000 --- a/vsts/vsts/build/v4_0/models/definition_reference.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 DefinitionReference(Model): - """DefinitionReference. - - :param created_date: The date the definition was created - :type created_date: datetime - :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 path: The path this definitions belongs to - :type path: str - :param project: The project. - :type project: :class:`TeamProjectReference ` - :param queue_status: If builds can be queued from 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 Uri of the definition - :type uri: str - :param url: Full http link to the resource - :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 diff --git a/vsts/vsts/build/v4_0/models/deployment.py b/vsts/vsts/build/v4_0/models/deployment.py deleted file mode 100644 index b73b0a27..00000000 --- a/vsts/vsts/build/v4_0/models/deployment.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/folder.py b/vsts/vsts/build/v4_0/models/folder.py deleted file mode 100644 index 64b2cbe2..00000000 --- a/vsts/vsts/build/v4_0/models/folder.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Folder(Model): - """Folder. - - :param created_by: Process or person who created the folder - :type created_by: :class:`IdentityRef ` - :param created_on: Creation date of the folder - :type created_on: datetime - :param description: The description of the folder - :type description: str - :param last_changed_by: Process or person that last changed the folder - :type last_changed_by: :class:`IdentityRef ` - :param last_changed_date: Date the folder was last changed - :type last_changed_date: datetime - :param path: The path of the folder - :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 diff --git a/vsts/vsts/build/v4_0/models/identity_ref.py b/vsts/vsts/build/v4_0/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/build/v4_0/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/build/v4_0/models/issue.py b/vsts/vsts/build/v4_0/models/issue.py deleted file mode 100644 index 02b96b6e..00000000 --- a/vsts/vsts/build/v4_0/models/issue.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/build/v4_0/models/json_patch_operation.py b/vsts/vsts/build/v4_0/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/build/v4_0/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/process_parameters.py b/vsts/vsts/build/v4_0/models/process_parameters.py deleted file mode 100644 index f6903143..00000000 --- a/vsts/vsts/build/v4_0/models/process_parameters.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/reference_links.py b/vsts/vsts/build/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/build/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/resource_ref.py b/vsts/vsts/build/v4_0/models/resource_ref.py deleted file mode 100644 index 903e57ee..00000000 --- a/vsts/vsts/build/v4_0/models/resource_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/retention_policy.py b/vsts/vsts/build/v4_0/models/retention_policy.py deleted file mode 100644 index 59623d75..00000000 --- a/vsts/vsts/build/v4_0/models/retention_policy.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: - :type days_to_keep: int - :param delete_build_record: - :type delete_build_record: bool - :param delete_test_results: - :type delete_test_results: bool - :param minimum_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 diff --git a/vsts/vsts/build/v4_0/models/task_agent_pool_reference.py b/vsts/vsts/build/v4_0/models/task_agent_pool_reference.py deleted file mode 100644 index ea2fa7b0..00000000 --- a/vsts/vsts/build/v4_0/models/task_agent_pool_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _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 diff --git a/vsts/vsts/build/v4_0/models/task_definition_reference.py b/vsts/vsts/build/v4_0/models/task_definition_reference.py deleted file mode 100644 index 8b393e85..00000000 --- a/vsts/vsts/build/v4_0/models/task_definition_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TaskDefinitionReference(Model): - """TaskDefinitionReference. - - :param definition_type: - :type definition_type: str - :param id: - :type id: str - :param version_spec: - :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 diff --git a/vsts/vsts/build/v4_0/models/task_input_definition_base.py b/vsts/vsts/build/v4_0/models/task_input_definition_base.py deleted file mode 100644 index 1f33183e..00000000 --- a/vsts/vsts/build/v4_0/models/task_input_definition_base.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TaskInputDefinitionBase(Model): - """TaskInputDefinitionBase. - - :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 = { - '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, 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.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 diff --git a/vsts/vsts/build/v4_0/models/task_input_validation.py b/vsts/vsts/build/v4_0/models/task_input_validation.py deleted file mode 100644 index 42524013..00000000 --- a/vsts/vsts/build/v4_0/models/task_input_validation.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/task_orchestration_plan_reference.py b/vsts/vsts/build/v4_0/models/task_orchestration_plan_reference.py deleted file mode 100644 index e6e96313..00000000 --- a/vsts/vsts/build/v4_0/models/task_orchestration_plan_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TaskOrchestrationPlanReference(Model): - """TaskOrchestrationPlanReference. - - :param orchestration_type: Orchestration Type for Build (build, cleanup etc.) - :type orchestration_type: int - :param plan_id: - :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 diff --git a/vsts/vsts/build/v4_0/models/task_reference.py b/vsts/vsts/build/v4_0/models/task_reference.py deleted file mode 100644 index 57c25971..00000000 --- a/vsts/vsts/build/v4_0/models/task_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TaskReference(Model): - """TaskReference. - - :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(TaskReference, self).__init__() - self.id = id - self.name = name - self.version = version diff --git a/vsts/vsts/build/v4_0/models/task_source_definition_base.py b/vsts/vsts/build/v4_0/models/task_source_definition_base.py deleted file mode 100644 index c8a6b6d6..00000000 --- a/vsts/vsts/build/v4_0/models/task_source_definition_base.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/team_project_reference.py b/vsts/vsts/build/v4_0/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/build/v4_0/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/build/v4_0/models/timeline.py b/vsts/vsts/build/v4_0/models/timeline.py deleted file mode 100644 index 02e0d15b..00000000 --- a/vsts/vsts/build/v4_0/models/timeline.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .timeline_reference import TimelineReference - - -class Timeline(TimelineReference): - """Timeline. - - :param change_id: - :type change_id: int - :param id: - :type id: str - :param url: - :type url: 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'}, - '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 diff --git a/vsts/vsts/build/v4_0/models/timeline_record.py b/vsts/vsts/build/v4_0/models/timeline_record.py deleted file mode 100644 index b02e7921..00000000 --- a/vsts/vsts/build/v4_0/models/timeline_record.py +++ /dev/null @@ -1,113 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TimelineRecord(Model): - """TimelineRecord. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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 issues: - :type issues: list of :class:`Issue ` - :param last_modified: - :type last_modified: datetime - :param log: - :type log: :class:`BuildLogReference ` - :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 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 url: - :type url: str - :param warning_count: - :type warning_count: int - :param worker_name: - :type worker_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - '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'}, - '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, 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, 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.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.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 diff --git a/vsts/vsts/build/v4_0/models/timeline_reference.py b/vsts/vsts/build/v4_0/models/timeline_reference.py deleted file mode 100644 index 79adb430..00000000 --- a/vsts/vsts/build/v4_0/models/timeline_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TimelineReference(Model): - """TimelineReference. - - :param change_id: - :type change_id: int - :param id: - :type id: str - :param url: - :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 diff --git a/vsts/vsts/build/v4_0/models/variable_group.py b/vsts/vsts/build/v4_0/models/variable_group.py deleted file mode 100644 index 15d91fab..00000000 --- a/vsts/vsts/build/v4_0/models/variable_group.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .variable_group_reference import VariableGroupReference - - -class VariableGroup(VariableGroupReference): - """VariableGroup. - - :param id: - :type id: int - :param description: - :type description: str - :param name: - :type name: str - :param type: - :type type: str - :param variables: - :type variables: dict - """ - - _attribute_map = { - '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, id=None, description=None, name=None, type=None, variables=None): - super(VariableGroup, self).__init__(id=id) - self.description = description - self.name = name - self.type = type - self.variables = variables diff --git a/vsts/vsts/build/v4_0/models/variable_group_reference.py b/vsts/vsts/build/v4_0/models/variable_group_reference.py deleted file mode 100644 index b5249a12..00000000 --- a/vsts/vsts/build/v4_0/models/variable_group_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 VariableGroupReference(Model): - """VariableGroupReference. - - :param id: - :type id: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, id=None): - super(VariableGroupReference, self).__init__() - self.id = id diff --git a/vsts/vsts/build/v4_0/models/web_api_connected_service_ref.py b/vsts/vsts/build/v4_0/models/web_api_connected_service_ref.py deleted file mode 100644 index 4a0e1863..00000000 --- a/vsts/vsts/build/v4_0/models/web_api_connected_service_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_0/models/xaml_build_controller_reference.py b/vsts/vsts/build/v4_0/models/xaml_build_controller_reference.py deleted file mode 100644 index 52177b53..00000000 --- a/vsts/vsts/build/v4_0/models/xaml_build_controller_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/__init__.py b/vsts/vsts/build/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/build/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/build/v4_1/build_client.py b/vsts/vsts/build/v4_1/build_client.py deleted file mode 100644 index a160e903..00000000 --- a/vsts/vsts/build/v4_1/build_client.py +++ /dev/null @@ -1,1430 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class BuildClient(VssClient): - """Build - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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, build_id, project=None): - """CreateArtifact. - [Preview API] Associates an artifact with a build. - :param :class:` ` artifact: The artifact. - :param int build_id: The ID of the build. - :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 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='4.1-preview.3', - route_values=route_values, - content=content) - return self._deserialize('BuildArtifact', response) - - def get_artifact(self, build_id, artifact_name, project=None): - """GetArtifact. - [Preview API] Gets a specific artifact for a build. - :param int build_id: The ID of the build. - :param str artifact_name: The name of the artifact. - :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 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='4.1-preview.3', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('BuildArtifact', response) - - def get_artifact_content_zip(self, build_id, artifact_name, project=None): - """GetArtifactContentZip. - [Preview API] Gets a specific artifact for a build. - :param int build_id: The ID of the build. - :param str artifact_name: The name of the artifact. - :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 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='4.1-preview.3', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_artifacts(self, build_id, project=None): - """GetArtifacts. - [Preview API] Gets all artifacts for a build. - :param int build_id: The ID of the build. - :param str project: Project ID or project name - :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='4.1-preview.3', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildArtifact]', response) - - def get_badge(self, project, definition_id, branch_name=None): - """GetBadge. - [Preview API] Gets a badge that indicates the status of the most recent build for a definition. - :param str project: The project ID or name. - :param int definition_id: The ID of the definition. - :param str branch_name: The name of the branch. - :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 branch_name is not None: - query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') - response = self._send(http_method='GET', - location_id='de6a4df8-22cd-44ee-af2d-39f6aa7a4261', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', 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='4.1-preview.1', - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def delete_build(self, build_id, project=None): - """DeleteBuild. - [Preview API] Deletes a build. - :param int build_id: The ID of the build. - :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 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='4.1-preview.3', - route_values=route_values) - - def get_build(self, build_id, project=None, property_filters=None): - """GetBuild. - [Preview API] Gets a build. - :param int build_id: The ID of the build. - :param str project: Project ID or project name - :param str property_filters: A comma-delimited list of properties to include in the results. - :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='4.1-preview.3', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Build', response) - - def get_builds(self, project=None, definitions=None, queues=None, build_number=None, min_finish_time=None, max_finish_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. - [Preview API] 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_finish_time: If specified, filters to builds that finished after this date. - :param datetime max_finish_time: If specified, filters to builds that finished before this date. - :param str requested_for: If specified, filters to builds requested for the specified user. - :param BuildReason reason_filter: If specified, filters to builds that match this reason. - :param BuildStatus status_filter: If specified, filters to builds that match this status. - :param BuildResult 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 QueryDeletedOption deleted_filter: Indicates whether to exclude, include, or only return deleted builds. - :param BuildQueryOrder 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_finish_time is not None: - query_parameters['minFinishTime'] = self._serialize.query('min_finish_time', min_finish_time, 'iso-8601') - if max_finish_time is not None: - query_parameters['maxFinishTime'] = self._serialize.query('max_finish_time', max_finish_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, 'BuildReason') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'BuildStatus') - if result_filter is not None: - query_parameters['resultFilter'] = self._serialize.query('result_filter', result_filter, 'BuildResult') - 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, 'QueryDeletedOption') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'BuildQueryOrder') - 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='4.1-preview.3', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Build]', response) - - def queue_build(self, build, project=None, ignore_warnings=None, check_in_ticket=None): - """QueueBuild. - [Preview API] Queues a build - :param :class:` ` build: - :param str project: Project ID or project name - :param bool ignore_warnings: - :param str check_in_ticket: - :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') - content = self._serialize.body(build, 'Build') - response = self._send(http_method='POST', - location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('Build', response) - - def update_build(self, build, build_id, project=None): - """UpdateBuild. - [Preview API] Updates a build. - :param :class:` ` build: The build. - :param int build_id: The ID of the build. - :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 build_id is not None: - route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') - content = self._serialize.body(build, 'Build') - response = self._send(http_method='PATCH', - location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', - route_values=route_values, - content=content) - return self._deserialize('Build', response) - - def update_builds(self, builds, project=None): - """UpdateBuilds. - [Preview API] 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='4.1-preview.3', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[Build]', response) - - def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): - """GetBuildChanges. - [Preview API] Gets the changes associated with a build. - :param str project: Project ID or project name - :param int build_id: The 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Change]', 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Change]', response) - - def get_build_controller(self, controller_id): - """GetBuildController. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('BuildController', response) - - def get_build_controllers(self, name=None): - """GetBuildControllers. - [Preview API] 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='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildController]', response) - - def create_definition(self, definition, project=None, definition_to_clone_id=None, definition_to_clone_revision=None): - """CreateDefinition. - [Preview API] 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='4.1-preview.6', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('BuildDefinition', response) - - def delete_definition(self, definition_id, project=None): - """DeleteDefinition. - [Preview API] Deletes a definition and all associated builds. - :param int definition_id: The ID of the definition. - :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 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='4.1-preview.6', - route_values=route_values) - - def get_definition(self, definition_id, project=None, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): - """GetDefinition. - [Preview API] Gets a definition, optionally at a specific revision. - :param int definition_id: The ID of the definition. - :param str project: Project ID or project name - :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='4.1-preview.6', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('BuildDefinition', response) - - def get_definitions(self, project=None, 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): - """GetDefinitions. - [Preview API] 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 DefinitionQueryOrder 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. - :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, 'DefinitionQueryOrder') - 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') - response = self._send(http_method='GET', - location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='4.1-preview.6', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildDefinitionReference]', response) - - def update_definition(self, definition, definition_id, project=None, secrets_source_definition_id=None, secrets_source_definition_revision=None): - """UpdateDefinition. - [Preview API] Updates an existing definition. - :param :class:` ` definition: The new version of the defintion. - :param int definition_id: The ID of the definition. - :param str project: Project ID or project name - :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='4.1-preview.6', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('BuildDefinition', response) - - 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='4.1-preview.1', - 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='4.1-preview.1', - 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 FolderQueryOrder 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, 'FolderQueryOrder') - response = self._send(http_method='GET', - location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Folder]', 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='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('Folder', response) - - def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None): - """GetBuildLog. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): - """GetBuildLogLines. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_build_logs(self, project, build_id): - """GetBuildLogs. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildLog]', response) - - def get_build_logs_zip(self, project, build_id): - """GetBuildLogsZip. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('object', response) - - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildMetric]', 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[BuildMetric]', response) - - def get_build_option_definitions(self, project=None): - """GetBuildOptionDefinitions. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildOptionDefinition]', 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='4.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='4.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='4.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='4.1-preview.1', - route_values=route_values, - content=content, - media_type='application/json-patch+json') - return self._deserialize('object', 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='4.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): - """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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', 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='4.1-preview.2') - return self._deserialize('BuildResourceUsage', response) - - def get_definition_revisions(self, project, definition_id): - """GetDefinitionRevisions. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildDefinitionRevision]', response) - - def get_build_settings(self): - """GetBuildSettings. - [Preview API] Gets the build settings. - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='4.1-preview.1') - return self._deserialize('BuildSettings', response) - - def update_build_settings(self, settings): - """UpdateBuildSettings. - [Preview API] Updates the build settings. - :param :class:` ` settings: The new settings. - :rtype: :class:` ` - """ - content = self._serialize.body(settings, 'BuildSettings') - response = self._send(http_method='PATCH', - location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='4.1-preview.1', - content=content) - return self._deserialize('BuildSettings', response) - - def add_build_tag(self, project, build_id, tag): - """AddBuildTag. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def add_build_tags(self, tags, project, build_id): - """AddBuildTags. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[str]', response) - - def delete_build_tag(self, project, build_id, tag): - """DeleteBuildTag. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_build_tags(self, project, build_id): - """GetBuildTags. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-preview.2', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_tags(self, project): - """GetTags. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[str]', response) - - def delete_template(self, project, template_id): - """DeleteTemplate. - [Preview API] 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='4.1-preview.3', - route_values=route_values) - - def get_template(self, project, template_id): - """GetTemplate. - [Preview API] 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='4.1-preview.3', - route_values=route_values) - return self._deserialize('BuildDefinitionTemplate', response) - - def get_templates(self, project): - """GetTemplates. - [Preview API] 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='4.1-preview.3', - route_values=route_values, - returns_collection=True) - return self._deserialize('[BuildDefinitionTemplate]', response) - - def save_template(self, template, project, template_id): - """SaveTemplate. - [Preview API] 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='4.1-preview.3', - 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. - [Preview API] Gets a timeline for a build. - :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. If not specified, uses the main timeline for the plan. - :param int change_id: - :param str plan_id: The ID of the plan. If not specified, uses the primary plan for 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') - 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='4.1-preview.2', - 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. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ResourceRef]', response) - - def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, top=None): - """GetBuildWorkItemsRefsFromCommits. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[ResourceRef]', 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ResourceRef]', response) - diff --git a/vsts/vsts/build/v4_1/models/__init__.py b/vsts/vsts/build/v4_1/models/__init__.py deleted file mode 100644 index 990a3465..00000000 --- a/vsts/vsts/build/v4_1/models/__init__.py +++ /dev/null @@ -1,125 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .agent_pool_queue import AgentPoolQueue -from .artifact_resource import ArtifactResource -from .authorization_header import AuthorizationHeader -from .build import Build -from .build_artifact import BuildArtifact -from .build_badge import BuildBadge -from .build_controller import BuildController -from .build_definition import BuildDefinition -from .build_definition3_2 import BuildDefinition3_2 -from .build_definition_reference import BuildDefinitionReference -from .build_definition_revision import BuildDefinitionRevision -from .build_definition_step import BuildDefinitionStep -from .build_definition_template import BuildDefinitionTemplate -from .build_definition_template3_2 import BuildDefinitionTemplate3_2 -from .build_definition_variable import BuildDefinitionVariable -from .build_log import BuildLog -from .build_log_reference import BuildLogReference -from .build_metric import BuildMetric -from .build_option import BuildOption -from .build_option_definition import BuildOptionDefinition -from .build_option_definition_reference import BuildOptionDefinitionReference -from .build_option_group_definition import BuildOptionGroupDefinition -from .build_option_input_definition import BuildOptionInputDefinition -from .build_process import BuildProcess -from .build_report_metadata import BuildReportMetadata -from .build_repository import BuildRepository -from .build_request_validation_result import BuildRequestValidationResult -from .build_resource_usage import BuildResourceUsage -from .build_settings import BuildSettings -from .build_trigger import BuildTrigger -from .change import Change -from .data_source_binding_base import DataSourceBindingBase -from .definition_reference import DefinitionReference -from .deployment import Deployment -from .folder import Folder -from .identity_ref import IdentityRef -from .issue import Issue -from .json_patch_operation import JsonPatchOperation -from .process_parameters import ProcessParameters -from .reference_links import ReferenceLinks -from .resource_ref import ResourceRef -from .retention_policy import RetentionPolicy -from .task_agent_pool_reference import TaskAgentPoolReference -from .task_definition_reference import TaskDefinitionReference -from .task_input_definition_base import TaskInputDefinitionBase -from .task_input_validation import TaskInputValidation -from .task_orchestration_plan_reference import TaskOrchestrationPlanReference -from .task_reference import TaskReference -from .task_source_definition_base import TaskSourceDefinitionBase -from .team_project_reference import TeamProjectReference -from .timeline import Timeline -from .timeline_record import TimelineRecord -from .timeline_reference import TimelineReference -from .variable_group import VariableGroup -from .variable_group_reference import VariableGroupReference -from .web_api_connected_service_ref import WebApiConnectedServiceRef -from .xaml_build_controller_reference import XamlBuildControllerReference - -__all__ = [ - 'AgentPoolQueue', - 'ArtifactResource', - 'AuthorizationHeader', - 'Build', - 'BuildArtifact', - 'BuildBadge', - 'BuildController', - 'BuildDefinition', - 'BuildDefinition3_2', - 'BuildDefinitionReference', - 'BuildDefinitionRevision', - 'BuildDefinitionStep', - 'BuildDefinitionTemplate', - 'BuildDefinitionTemplate3_2', - 'BuildDefinitionVariable', - 'BuildLog', - 'BuildLogReference', - 'BuildMetric', - 'BuildOption', - 'BuildOptionDefinition', - 'BuildOptionDefinitionReference', - 'BuildOptionGroupDefinition', - 'BuildOptionInputDefinition', - 'BuildProcess', - 'BuildReportMetadata', - 'BuildRepository', - 'BuildRequestValidationResult', - 'BuildResourceUsage', - 'BuildSettings', - 'BuildTrigger', - 'Change', - 'DataSourceBindingBase', - 'DefinitionReference', - 'Deployment', - 'Folder', - 'IdentityRef', - 'Issue', - 'JsonPatchOperation', - 'ProcessParameters', - 'ReferenceLinks', - 'ResourceRef', - 'RetentionPolicy', - 'TaskAgentPoolReference', - 'TaskDefinitionReference', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskOrchestrationPlanReference', - 'TaskReference', - 'TaskSourceDefinitionBase', - 'TeamProjectReference', - 'Timeline', - 'TimelineRecord', - 'TimelineReference', - 'VariableGroup', - 'VariableGroupReference', - 'WebApiConnectedServiceRef', - 'XamlBuildControllerReference', -] diff --git a/vsts/vsts/build/v4_1/models/agent_pool_queue.py b/vsts/vsts/build/v4_1/models/agent_pool_queue.py deleted file mode 100644 index 67b3db03..00000000 --- a/vsts/vsts/build/v4_1/models/agent_pool_queue.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/build/v4_1/models/artifact_resource.py b/vsts/vsts/build/v4_1/models/artifact_resource.py deleted file mode 100644 index 49e52950..00000000 --- a/vsts/vsts/build/v4_1/models/artifact_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/authorization_header.py b/vsts/vsts/build/v4_1/models/authorization_header.py deleted file mode 100644 index 015e6775..00000000 --- a/vsts/vsts/build/v4_1/models/authorization_header.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build.py b/vsts/vsts/build/v4_1/models/build.py deleted file mode 100644 index f7eada17..00000000 --- a/vsts/vsts/build/v4_1/models/build.py +++ /dev/null @@ -1,189 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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]'}, - '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, 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.trigger_info = trigger_info - self.uri = uri - self.url = url - self.validation_results = validation_results diff --git a/vsts/vsts/build/v4_1/models/build_artifact.py b/vsts/vsts/build/v4_1/models/build_artifact.py deleted file mode 100644 index 29a3276d..00000000 --- a/vsts/vsts/build/v4_1/models/build_artifact.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_badge.py b/vsts/vsts/build/v4_1/models/build_badge.py deleted file mode 100644 index eb3a4f10..00000000 --- a/vsts/vsts/build/v4_1/models/build_badge.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_controller.py b/vsts/vsts/build/v4_1/models/build_controller.py deleted file mode 100644 index 4628f94f..00000000 --- a/vsts/vsts/build/v4_1/models/build_controller.py +++ /dev/null @@ -1,58 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .xaml_build_controller_reference import XamlBuildControllerReference - - -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 diff --git a/vsts/vsts/build/v4_1/models/build_definition.py b/vsts/vsts/build/v4_1/models/build_definition.py deleted file mode 100644 index 5b5b89b1..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition.py +++ /dev/null @@ -1,156 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_definition_reference import BuildDefinitionReference - - -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 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 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: The build process. - :type process: :class:`BuildProcess ` - :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:`BuildTrigger ` - :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]'}, - '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'}, - 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, - 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, - 'options': {'key': 'options', 'type': '[BuildOption]'}, - 'process': {'key': 'process', 'type': 'BuildProcess'}, - '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': '[BuildTrigger]'}, - '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, 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, latest_build=None, latest_completed_build=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, 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.latest_build = latest_build - self.latest_completed_build = latest_completed_build - 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 diff --git a/vsts/vsts/build/v4_1/models/build_definition3_2.py b/vsts/vsts/build/v4_1/models/build_definition3_2.py deleted file mode 100644 index e356d7c0..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition3_2.py +++ /dev/null @@ -1,152 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_definition_reference import BuildDefinitionReference - - -class BuildDefinition3_2(BuildDefinitionReference): - """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:`BuildTrigger ` - :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': '[BuildTrigger]'}, - '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 diff --git a/vsts/vsts/build/v4_1/models/build_definition_reference.py b/vsts/vsts/build/v4_1/models/build_definition_reference.py deleted file mode 100644 index 64264ea2..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_reference.py +++ /dev/null @@ -1,79 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .definition_reference import DefinitionReference - - -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 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(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.metrics = metrics - self.quality = quality - self.queue = queue diff --git a/vsts/vsts/build/v4_1/models/build_definition_revision.py b/vsts/vsts/build/v4_1/models/build_definition_revision.py deleted file mode 100644 index 77d2b57d..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_revision.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_definition_step.py b/vsts/vsts/build/v4_1/models/build_definition_step.py deleted file mode 100644 index 2b2a0a63..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_step.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_definition_template.py b/vsts/vsts/build/v4_1/models/build_definition_template.py deleted file mode 100644 index bcd59370..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_template.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.description = description - self.icons = icons - self.icon_task_id = icon_task_id - self.id = id - self.name = name - self.template = template diff --git a/vsts/vsts/build/v4_1/models/build_definition_template3_2.py b/vsts/vsts/build/v4_1/models/build_definition_template3_2.py deleted file mode 100644 index 8bd0c687..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_template3_2.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildDefinitionTemplate3_2(Model): - """BuildDefinitionTemplate3_2. - - :param can_delete: - :type can_delete: bool - :param category: - :type category: 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'}, - '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, 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.description = description - self.icons = icons - self.icon_task_id = icon_task_id - self.id = id - self.name = name - self.template = template diff --git a/vsts/vsts/build/v4_1/models/build_definition_variable.py b/vsts/vsts/build/v4_1/models/build_definition_variable.py deleted file mode 100644 index ebdb3921..00000000 --- a/vsts/vsts/build/v4_1/models/build_definition_variable.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_log.py b/vsts/vsts/build/v4_1/models/build_log.py deleted file mode 100644 index 96219ff7..00000000 --- a/vsts/vsts/build/v4_1/models/build_log.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_log_reference import BuildLogReference - - -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 diff --git a/vsts/vsts/build/v4_1/models/build_log_reference.py b/vsts/vsts/build/v4_1/models/build_log_reference.py deleted file mode 100644 index 53f8a83d..00000000 --- a/vsts/vsts/build/v4_1/models/build_log_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_metric.py b/vsts/vsts/build/v4_1/models/build_metric.py deleted file mode 100644 index 2e7fbeb6..00000000 --- a/vsts/vsts/build/v4_1/models/build_metric.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_option.py b/vsts/vsts/build/v4_1/models/build_option.py deleted file mode 100644 index bc4ab6ff..00000000 --- a/vsts/vsts/build/v4_1/models/build_option.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_option_definition.py b/vsts/vsts/build/v4_1/models/build_option_definition.py deleted file mode 100644 index 26bfc3bb..00000000 --- a/vsts/vsts/build/v4_1/models/build_option_definition.py +++ /dev/null @@ -1,44 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .build_option_definition_reference import BuildOptionDefinitionReference - - -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 diff --git a/vsts/vsts/build/v4_1/models/build_option_definition_reference.py b/vsts/vsts/build/v4_1/models/build_option_definition_reference.py deleted file mode 100644 index fe99add1..00000000 --- a/vsts/vsts/build/v4_1/models/build_option_definition_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_option_group_definition.py b/vsts/vsts/build/v4_1/models/build_option_group_definition.py deleted file mode 100644 index 7899211c..00000000 --- a/vsts/vsts/build/v4_1/models/build_option_group_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_option_input_definition.py b/vsts/vsts/build/v4_1/models/build_option_input_definition.py deleted file mode 100644 index 33408674..00000000 --- a/vsts/vsts/build/v4_1/models/build_option_input_definition.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_process.py b/vsts/vsts/build/v4_1/models/build_process.py deleted file mode 100644 index 19a2aeb9..00000000 --- a/vsts/vsts/build/v4_1/models/build_process.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildProcess(Model): - """BuildProcess. - - :param type: The type of the process. - :type type: int - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'int'} - } - - def __init__(self, type=None): - super(BuildProcess, self).__init__() - self.type = type diff --git a/vsts/vsts/build/v4_1/models/build_report_metadata.py b/vsts/vsts/build/v4_1/models/build_report_metadata.py deleted file mode 100644 index d14733e5..00000000 --- a/vsts/vsts/build/v4_1/models/build_report_metadata.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_repository.py b/vsts/vsts/build/v4_1/models/build_repository.py deleted file mode 100644 index cd6f8fb0..00000000 --- a/vsts/vsts/build/v4_1/models/build_repository.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_request_validation_result.py b/vsts/vsts/build/v4_1/models/build_request_validation_result.py deleted file mode 100644 index e9f327da..00000000 --- a/vsts/vsts/build/v4_1/models/build_request_validation_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_resource_usage.py b/vsts/vsts/build/v4_1/models/build_resource_usage.py deleted file mode 100644 index 75bc46c6..00000000 --- a/vsts/vsts/build/v4_1/models/build_resource_usage.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_settings.py b/vsts/vsts/build/v4_1/models/build_settings.py deleted file mode 100644 index a36007ba..00000000 --- a/vsts/vsts/build/v4_1/models/build_settings.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/build_trigger.py b/vsts/vsts/build/v4_1/models/build_trigger.py deleted file mode 100644 index 0039a9db..00000000 --- a/vsts/vsts/build/v4_1/models/build_trigger.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 BuildTrigger(Model): - """BuildTrigger. - - :param trigger_type: The type of the trigger. - :type trigger_type: object - """ - - _attribute_map = { - 'trigger_type': {'key': 'triggerType', 'type': 'object'} - } - - def __init__(self, trigger_type=None): - super(BuildTrigger, self).__init__() - self.trigger_type = trigger_type diff --git a/vsts/vsts/build/v4_1/models/change.py b/vsts/vsts/build/v4_1/models/change.py deleted file mode 100644 index 5d1d81a8..00000000 --- a/vsts/vsts/build/v4_1/models/change.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/data_source_binding_base.py b/vsts/vsts/build/v4_1/models/data_source_binding_base.py deleted file mode 100644 index fe92a446..00000000 --- a/vsts/vsts/build/v4_1/models/data_source_binding_base.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 DataSourceBindingBase(Model): - """DataSourceBindingBase. - - :param data_source_name: - :type data_source_name: str - :param endpoint_id: - :type endpoint_id: str - :param endpoint_url: - :type endpoint_url: str - :param headers: - :type headers: list of :class:`AuthorizationHeader ` - :param parameters: - :type parameters: dict - :param result_selector: - :type result_selector: str - :param result_template: - :type result_template: str - :param target: - :type target: str - """ - - _attribute_map = { - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, - '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, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, parameters=None, result_selector=None, result_template=None, target=None): - super(DataSourceBindingBase, self).__init__() - self.data_source_name = data_source_name - self.endpoint_id = endpoint_id - self.endpoint_url = endpoint_url - self.headers = headers - self.parameters = parameters - self.result_selector = result_selector - self.result_template = result_template - self.target = target diff --git a/vsts/vsts/build/v4_1/models/definition_reference.py b/vsts/vsts/build/v4_1/models/definition_reference.py deleted file mode 100644 index 5b5acbdb..00000000 --- a/vsts/vsts/build/v4_1/models/definition_reference.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/deployment.py b/vsts/vsts/build/v4_1/models/deployment.py deleted file mode 100644 index b73b0a27..00000000 --- a/vsts/vsts/build/v4_1/models/deployment.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/folder.py b/vsts/vsts/build/v4_1/models/folder.py deleted file mode 100644 index b43e6a4d..00000000 --- a/vsts/vsts/build/v4_1/models/folder.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/identity_ref.py b/vsts/vsts/build/v4_1/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/build/v4_1/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/build/v4_1/models/issue.py b/vsts/vsts/build/v4_1/models/issue.py deleted file mode 100644 index 79a4c6bc..00000000 --- a/vsts/vsts/build/v4_1/models/issue.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: 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 diff --git a/vsts/vsts/build/v4_1/models/json_patch_operation.py b/vsts/vsts/build/v4_1/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/build/v4_1/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/process_parameters.py b/vsts/vsts/build/v4_1/models/process_parameters.py deleted file mode 100644 index 657d9485..00000000 --- a/vsts/vsts/build/v4_1/models/process_parameters.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/reference_links.py b/vsts/vsts/build/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/build/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/resource_ref.py b/vsts/vsts/build/v4_1/models/resource_ref.py deleted file mode 100644 index 903e57ee..00000000 --- a/vsts/vsts/build/v4_1/models/resource_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/retention_policy.py b/vsts/vsts/build/v4_1/models/retention_policy.py deleted file mode 100644 index 82418707..00000000 --- a/vsts/vsts/build/v4_1/models/retention_policy.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_agent_pool_reference.py b/vsts/vsts/build/v4_1/models/task_agent_pool_reference.py deleted file mode 100644 index 785ea490..00000000 --- a/vsts/vsts/build/v4_1/models/task_agent_pool_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_definition_reference.py b/vsts/vsts/build/v4_1/models/task_definition_reference.py deleted file mode 100644 index 7e55102f..00000000 --- a/vsts/vsts/build/v4_1/models/task_definition_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_input_definition_base.py b/vsts/vsts/build/v4_1/models/task_input_definition_base.py deleted file mode 100644 index 1b4e68ff..00000000 --- a/vsts/vsts/build/v4_1/models/task_input_definition_base.py +++ /dev/null @@ -1,69 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_input_validation.py b/vsts/vsts/build/v4_1/models/task_input_validation.py deleted file mode 100644 index 42524013..00000000 --- a/vsts/vsts/build/v4_1/models/task_input_validation.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_orchestration_plan_reference.py b/vsts/vsts/build/v4_1/models/task_orchestration_plan_reference.py deleted file mode 100644 index fabce7a3..00000000 --- a/vsts/vsts/build/v4_1/models/task_orchestration_plan_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_reference.py b/vsts/vsts/build/v4_1/models/task_reference.py deleted file mode 100644 index b3214760..00000000 --- a/vsts/vsts/build/v4_1/models/task_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/task_source_definition_base.py b/vsts/vsts/build/v4_1/models/task_source_definition_base.py deleted file mode 100644 index c8a6b6d6..00000000 --- a/vsts/vsts/build/v4_1/models/task_source_definition_base.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/team_project_reference.py b/vsts/vsts/build/v4_1/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/build/v4_1/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/build/v4_1/models/timeline.py b/vsts/vsts/build/v4_1/models/timeline.py deleted file mode 100644 index a4622a6e..00000000 --- a/vsts/vsts/build/v4_1/models/timeline.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .timeline_reference import TimelineReference - - -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 diff --git a/vsts/vsts/build/v4_1/models/timeline_record.py b/vsts/vsts/build/v4_1/models/timeline_record.py deleted file mode 100644 index 4c4d6a1b..00000000 --- a/vsts/vsts/build/v4_1/models/timeline_record.py +++ /dev/null @@ -1,113 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TimelineRecord(Model): - """TimelineRecord. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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 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'}, - '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'}, - '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, 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, 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.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.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 diff --git a/vsts/vsts/build/v4_1/models/timeline_reference.py b/vsts/vsts/build/v4_1/models/timeline_reference.py deleted file mode 100644 index 038bfcde..00000000 --- a/vsts/vsts/build/v4_1/models/timeline_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/variable_group.py b/vsts/vsts/build/v4_1/models/variable_group.py deleted file mode 100644 index b684e629..00000000 --- a/vsts/vsts/build/v4_1/models/variable_group.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .variable_group_reference import VariableGroupReference - - -class VariableGroup(VariableGroupReference): - """VariableGroup. - - :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 = { - '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, id=None, description=None, name=None, type=None, variables=None): - super(VariableGroup, self).__init__(id=id) - self.description = description - self.name = name - self.type = type - self.variables = variables diff --git a/vsts/vsts/build/v4_1/models/variable_group_reference.py b/vsts/vsts/build/v4_1/models/variable_group_reference.py deleted file mode 100644 index ce959d97..00000000 --- a/vsts/vsts/build/v4_1/models/variable_group_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 VariableGroupReference(Model): - """VariableGroupReference. - - :param id: The ID of the variable group. - :type id: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, id=None): - super(VariableGroupReference, self).__init__() - self.id = id diff --git a/vsts/vsts/build/v4_1/models/web_api_connected_service_ref.py b/vsts/vsts/build/v4_1/models/web_api_connected_service_ref.py deleted file mode 100644 index 4a0e1863..00000000 --- a/vsts/vsts/build/v4_1/models/web_api_connected_service_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/build/v4_1/models/xaml_build_controller_reference.py b/vsts/vsts/build/v4_1/models/xaml_build_controller_reference.py deleted file mode 100644 index 52177b53..00000000 --- a/vsts/vsts/build/v4_1/models/xaml_build_controller_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/__init__.py b/vsts/vsts/core/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/core/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/core/v4_0/__init__.py b/vsts/vsts/core/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/core/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/core/v4_0/core_client.py b/vsts/vsts/core/v4_0/core_client.py deleted file mode 100644 index 4a5b084b..00000000 --- a/vsts/vsts/core/v4_0/core_client.py +++ /dev/null @@ -1,508 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class CoreClient(VssClient): - """Core - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.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='4.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 ConnectedServiceKind 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, 'ConnectedServiceKind') - response = self._send(http_method='GET', - location_id='b4f70219-e18b-42c5-abe3-98b07d35525e', - version='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiConnectedService]', response) - - def create_identity_mru(self, mru_data, mru_name): - """CreateIdentityMru. - [Preview API] - :param :class:` ` mru_data: - :param str mru_name: - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - content = self._serialize.body(mru_data, 'IdentityData') - self._send(http_method='POST', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.0-preview.1', - route_values=route_values, - content=content) - - def get_identity_mru(self, mru_name): - """GetIdentityMru. - [Preview API] - :param str mru_name: - :rtype: [IdentityRef] - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - response = self._send(http_method='GET', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRef]', response) - - def update_identity_mru(self, mru_data, mru_name): - """UpdateIdentityMru. - [Preview API] - :param :class:` ` mru_data: - :param str mru_name: - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - content = self._serialize.body(mru_data, 'IdentityData') - self._send(http_method='PATCH', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.0-preview.1', - route_values=route_values, - content=content) - - def get_team_members(self, project_id, team_id, top=None, skip=None): - """GetTeamMembers. - :param str project_id: - :param str team_id: - :param int top: - :param int skip: - :rtype: [IdentityRef] - """ - 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[IdentityRef]', response) - - def get_process_by_id(self, process_id): - """GetProcessById. - Retrieve process by id - :param str process_id: - :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='4.0', - route_values=route_values) - return self._deserialize('Process', response) - - def get_processes(self): - """GetProcesses. - Retrieve all processes - :rtype: [Process] - """ - response = self._send(http_method='GET', - location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', - version='4.0', - returns_collection=True) - return self._deserialize('[Process]', 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='4.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='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TeamProjectCollectionReference]', response) - - def get_project_history_entries(self, min_revision=None): - """GetProjectHistoryEntries. - [Preview API] - :param long min_revision: - :rtype: [ProjectInfo] - """ - query_parameters = {} - if min_revision is not None: - query_parameters['minRevision'] = self._serialize.query('min_revision', min_revision, 'long') - response = self._send(http_method='GET', - location_id='6488a877-4749-4954-82ea-7340d36be9f2', - version='4.0-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ProjectInfo]', 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='4.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): - """GetProjects. - Get project references with the specified state - :param object state_filter: Filter on team projects in a specific team project state (default: WellFormed). - :param int top: - :param int skip: - :param str continuation_token: - :rtype: [TeamProjectReference] - """ - query_parameters = {} - if state_filter is not None: - query_parameters['stateFilter'] = self._serialize.query('state_filter', state_filter, 'object') - 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') - response = self._send(http_method='GET', - location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TeamProjectReference]', response) - - def queue_create_project(self, project_to_create): - """QueueCreateProject. - Queue a project creation. - :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='4.0', - content=content) - return self._deserialize('OperationReference', response) - - def queue_delete_project(self, project_id): - """QueueDeleteProject. - Queue a project deletion. - :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='4.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='4.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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ProjectProperty]', 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='4.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='4.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='4.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='4.0-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Proxy]', response) - - def create_team(self, team, project_id): - """CreateTeam. - Creates a team - :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='4.0', - route_values=route_values, - content=content) - return self._deserialize('WebApiTeam', response) - - def delete_team(self, project_id, team_id): - """DeleteTeam. - Deletes 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='4.0', - route_values=route_values) - - def get_team(self, project_id, team_id): - """GetTeam. - Gets a team - :param str project_id: - :param str team_id: - :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='4.0', - route_values=route_values) - return self._deserialize('WebApiTeam', response) - - def get_teams(self, project_id, top=None, skip=None): - """GetTeams. - :param str project_id: - :param int top: - :param int 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 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiTeam]', response) - - def update_team(self, team_data, project_id, team_id): - """UpdateTeam. - Updates 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='4.0', - route_values=route_values, - content=content) - return self._deserialize('WebApiTeam', response) - diff --git a/vsts/vsts/core/v4_0/models/__init__.py b/vsts/vsts/core/v4_0/models/__init__.py deleted file mode 100644 index ccdda076..00000000 --- a/vsts/vsts/core/v4_0/models/__init__.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_data import IdentityData -from .identity_ref import IdentityRef -from .json_patch_operation import JsonPatchOperation -from .operation_reference import OperationReference -from .process import Process -from .process_reference import ProcessReference -from .project_info import ProjectInfo -from .project_property import ProjectProperty -from .proxy import Proxy -from .proxy_authorization import ProxyAuthorization -from .public_key import PublicKey -from .reference_links import ReferenceLinks -from .team_project import TeamProject -from .team_project_collection import TeamProjectCollection -from .team_project_collection_reference import TeamProjectCollectionReference -from .team_project_reference import TeamProjectReference -from .web_api_connected_service import WebApiConnectedService -from .web_api_connected_service_details import WebApiConnectedServiceDetails -from .web_api_connected_service_ref import WebApiConnectedServiceRef -from .web_api_team import WebApiTeam -from .web_api_team_ref import WebApiTeamRef - -__all__ = [ - 'IdentityData', - 'IdentityRef', - 'JsonPatchOperation', - 'OperationReference', - 'Process', - 'ProcessReference', - 'ProjectInfo', - 'ProjectProperty', - 'Proxy', - 'ProxyAuthorization', - 'PublicKey', - 'ReferenceLinks', - 'TeamProject', - 'TeamProjectCollection', - 'TeamProjectCollectionReference', - 'TeamProjectReference', - 'WebApiConnectedService', - 'WebApiConnectedServiceDetails', - 'WebApiConnectedServiceRef', - 'WebApiTeam', - 'WebApiTeamRef', -] diff --git a/vsts/vsts/core/v4_0/models/identity_data.py b/vsts/vsts/core/v4_0/models/identity_data.py deleted file mode 100644 index 160e8308..00000000 --- a/vsts/vsts/core/v4_0/models/identity_data.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/identity_ref.py b/vsts/vsts/core/v4_0/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/core/v4_0/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/core/v4_0/models/json_patch_operation.py b/vsts/vsts/core/v4_0/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/core/v4_0/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/operation_reference.py b/vsts/vsts/core/v4_0/models/operation_reference.py deleted file mode 100644 index fb73a6c6..00000000 --- a/vsts/vsts/core/v4_0/models/operation_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, id=None, status=None, url=None): - super(OperationReference, self).__init__() - self.id = id - self.status = status - self.url = url diff --git a/vsts/vsts/core/v4_0/models/process.py b/vsts/vsts/core/v4_0/models/process.py deleted file mode 100644 index 4c755858..00000000 --- a/vsts/vsts/core/v4_0/models/process.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .process_reference import ProcessReference - - -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 diff --git a/vsts/vsts/core/v4_0/models/process_reference.py b/vsts/vsts/core/v4_0/models/process_reference.py deleted file mode 100644 index 897afb57..00000000 --- a/vsts/vsts/core/v4_0/models/process_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/project_info.py b/vsts/vsts/core/v4_0/models/project_info.py deleted file mode 100644 index 61d5a1df..00000000 --- a/vsts/vsts/core/v4_0/models/project_info.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/project_property.py b/vsts/vsts/core/v4_0/models/project_property.py deleted file mode 100644 index 6bebcd11..00000000 --- a/vsts/vsts/core/v4_0/models/project_property.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/proxy.py b/vsts/vsts/core/v4_0/models/proxy.py deleted file mode 100644 index cfbba6c7..00000000 --- a/vsts/vsts/core/v4_0/models/proxy.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/proxy_authorization.py b/vsts/vsts/core/v4_0/models/proxy_authorization.py deleted file mode 100644 index 887e2371..00000000 --- a/vsts/vsts/core/v4_0/models/proxy_authorization.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/public_key.py b/vsts/vsts/core/v4_0/models/public_key.py deleted file mode 100644 index 878b6731..00000000 --- a/vsts/vsts/core/v4_0/models/public_key.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 PublicKey(Model): - """PublicKey. - - :param exponent: Gets or sets the exponent for the public key. - :type exponent: list of number - :param modulus: Gets or sets the modulus for the public key. - :type modulus: list of number - """ - - _attribute_map = { - 'exponent': {'key': 'exponent', 'type': '[number]'}, - 'modulus': {'key': 'modulus', 'type': '[number]'} - } - - def __init__(self, exponent=None, modulus=None): - super(PublicKey, self).__init__() - self.exponent = exponent - self.modulus = modulus diff --git a/vsts/vsts/core/v4_0/models/reference_links.py b/vsts/vsts/core/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/core/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/team_project.py b/vsts/vsts/core/v4_0/models/team_project.py deleted file mode 100644 index 34ea4471..00000000 --- a/vsts/vsts/core/v4_0/models/team_project.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .team_project_reference import TeamProjectReference - - -class TeamProject(TeamProjectReference): - """TeamProject. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, 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, 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 diff --git a/vsts/vsts/core/v4_0/models/team_project_collection.py b/vsts/vsts/core/v4_0/models/team_project_collection.py deleted file mode 100644 index 0d5d11c0..00000000 --- a/vsts/vsts/core/v4_0/models/team_project_collection.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .team_project_collection_reference import TeamProjectCollectionReference - - -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 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'}, - 'state': {'key': 'state', 'type': 'str'} - } - - def __init__(self, id=None, name=None, url=None, _links=None, description=None, state=None): - super(TeamProjectCollection, self).__init__(id=id, name=name, url=url) - self._links = _links - self.description = description - self.state = state diff --git a/vsts/vsts/core/v4_0/models/team_project_collection_reference.py b/vsts/vsts/core/v4_0/models/team_project_collection_reference.py deleted file mode 100644 index 6f4a596a..00000000 --- a/vsts/vsts/core/v4_0/models/team_project_collection_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/team_project_reference.py b/vsts/vsts/core/v4_0/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/core/v4_0/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/core/v4_0/models/web_api_connected_service.py b/vsts/vsts/core/v4_0/models/web_api_connected_service.py deleted file mode 100644 index 06303cea..00000000 --- a/vsts/vsts/core/v4_0/models/web_api_connected_service.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_connected_service_ref import WebApiConnectedServiceRef - - -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 diff --git a/vsts/vsts/core/v4_0/models/web_api_connected_service_details.py b/vsts/vsts/core/v4_0/models/web_api_connected_service_details.py deleted file mode 100644 index 1a5dee7f..00000000 --- a/vsts/vsts/core/v4_0/models/web_api_connected_service_details.py +++ /dev/null @@ -1,39 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_connected_service_ref import WebApiConnectedServiceRef - - -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 diff --git a/vsts/vsts/core/v4_0/models/web_api_connected_service_ref.py b/vsts/vsts/core/v4_0/models/web_api_connected_service_ref.py deleted file mode 100644 index 4a0e1863..00000000 --- a/vsts/vsts/core/v4_0/models/web_api_connected_service_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_0/models/web_api_team.py b/vsts/vsts/core/v4_0/models/web_api_team.py deleted file mode 100644 index 872de4a1..00000000 --- a/vsts/vsts/core/v4_0/models/web_api_team.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_team_ref import WebApiTeamRef - - -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 - """ - - _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'} - } - - def __init__(self, id=None, name=None, url=None, description=None, identity_url=None): - super(WebApiTeam, self).__init__(id=id, name=name, url=url) - self.description = description - self.identity_url = identity_url diff --git a/vsts/vsts/core/v4_0/models/web_api_team_ref.py b/vsts/vsts/core/v4_0/models/web_api_team_ref.py deleted file mode 100644 index fba42b04..00000000 --- a/vsts/vsts/core/v4_0/models/web_api_team_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/__init__.py b/vsts/vsts/core/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/core/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/core/v4_1/core_client.py b/vsts/vsts/core/v4_1/core_client.py deleted file mode 100644 index aec44172..00000000 --- a/vsts/vsts/core/v4_1/core_client.py +++ /dev/null @@ -1,535 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class CoreClient(VssClient): - """Core - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.1-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='4.1-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 ConnectedServiceKind 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, 'ConnectedServiceKind') - response = self._send(http_method='GET', - location_id='b4f70219-e18b-42c5-abe3-98b07d35525e', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiConnectedService]', response) - - def create_identity_mru(self, mru_data, mru_name): - """CreateIdentityMru. - [Preview API] - :param :class:` ` mru_data: - :param str mru_name: - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - content = self._serialize.body(mru_data, 'IdentityData') - self._send(http_method='POST', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.1-preview.1', - route_values=route_values, - content=content) - - def get_identity_mru(self, mru_name): - """GetIdentityMru. - [Preview API] - :param str mru_name: - :rtype: [IdentityRef] - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - response = self._send(http_method='GET', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRef]', response) - - def update_identity_mru(self, mru_data, mru_name): - """UpdateIdentityMru. - [Preview API] - :param :class:` ` mru_data: - :param str mru_name: - """ - route_values = {} - if mru_name is not None: - route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str') - content = self._serialize.body(mru_data, 'IdentityData') - self._send(http_method='PATCH', - location_id='5ead0b70-2572-4697-97e9-f341069a783a', - version='4.1-preview.1', - route_values=route_values, - content=content) - - def get_team_members_with_extended_properties(self, project_id, team_id, top=None, skip=None): - """GetTeamMembersWithExtendedProperties. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TeamMember]', response) - - def get_process_by_id(self, process_id): - """GetProcessById. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('Process', response) - - def get_processes(self): - """GetProcesses. - [Preview API] Get a list of processes. - :rtype: [Process] - """ - response = self._send(http_method='GET', - location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', - version='4.1-preview.1', - returns_collection=True) - return self._deserialize('[Process]', response) - - def get_project_collection(self, collection_id): - """GetProjectCollection. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('TeamProjectCollection', response) - - def get_project_collections(self, top=None, skip=None): - """GetProjectCollections. - [Preview API] 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='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TeamProjectCollectionReference]', response) - - def get_project_history_entries(self, min_revision=None): - """GetProjectHistoryEntries. - [Preview API] - :param long min_revision: - :rtype: [ProjectInfo] - """ - query_parameters = {} - if min_revision is not None: - query_parameters['minRevision'] = self._serialize.query('min_revision', min_revision, 'long') - response = self._send(http_method='GET', - location_id='6488a877-4749-4954-82ea-7340d36be9f2', - version='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ProjectInfo]', response) - - def get_project(self, project_id, include_capabilities=None, include_history=None): - """GetProject. - [Preview API] 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='4.1-preview.3', - 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): - """GetProjects. - [Preview API] Get project references with the specified state - :param object state_filter: Filter on team projects in a specific team project state (default: WellFormed). - :param int top: - :param int skip: - :param str continuation_token: - :rtype: [TeamProjectReference] - """ - query_parameters = {} - if state_filter is not None: - query_parameters['stateFilter'] = self._serialize.query('state_filter', state_filter, 'object') - 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') - response = self._send(http_method='GET', - location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='4.1-preview.3', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TeamProjectReference]', response) - - def queue_create_project(self, project_to_create): - """QueueCreateProject. - [Preview API] Queue a project creation. - :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='4.1-preview.3', - content=content) - return self._deserialize('OperationReference', response) - - def queue_delete_project(self, project_id): - """QueueDeleteProject. - [Preview API] Queue a project deletion. - :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='4.1-preview.3', - route_values=route_values) - return self._deserialize('OperationReference', response) - - def update_project(self, project_update, project_id): - """UpdateProject. - [Preview API] 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='4.1-preview.3', - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ProjectProperty]', 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='4.1-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='4.1-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='4.1-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='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Proxy]', 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='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiTeam]', response) - - def create_team(self, team, project_id): - """CreateTeam. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('WebApiTeam', response) - - def delete_team(self, project_id, team_id): - """DeleteTeam. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - - def get_team(self, project_id, team_id): - """GetTeam. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WebApiTeam', response) - - def get_teams(self, project_id, mine=None, top=None, skip=None): - """GetTeams. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiTeam]', response) - - def update_team(self, team_data, project_id, team_id): - """UpdateTeam. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('WebApiTeam', response) - diff --git a/vsts/vsts/core/v4_1/models/__init__.py b/vsts/vsts/core/v4_1/models/__init__.py deleted file mode 100644 index a6c2908e..00000000 --- a/vsts/vsts/core/v4_1/models/__init__.py +++ /dev/null @@ -1,55 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_data import IdentityData -from .identity_ref import IdentityRef -from .json_patch_operation import JsonPatchOperation -from .operation_reference import OperationReference -from .process import Process -from .process_reference import ProcessReference -from .project_info import ProjectInfo -from .project_property import ProjectProperty -from .proxy import Proxy -from .proxy_authorization import ProxyAuthorization -from .public_key import PublicKey -from .reference_links import ReferenceLinks -from .team_member import TeamMember -from .team_project import TeamProject -from .team_project_collection import TeamProjectCollection -from .team_project_collection_reference import TeamProjectCollectionReference -from .team_project_reference import TeamProjectReference -from .web_api_connected_service import WebApiConnectedService -from .web_api_connected_service_details import WebApiConnectedServiceDetails -from .web_api_connected_service_ref import WebApiConnectedServiceRef -from .web_api_team import WebApiTeam -from .web_api_team_ref import WebApiTeamRef - -__all__ = [ - 'IdentityData', - 'IdentityRef', - 'JsonPatchOperation', - 'OperationReference', - 'Process', - 'ProcessReference', - 'ProjectInfo', - 'ProjectProperty', - 'Proxy', - 'ProxyAuthorization', - 'PublicKey', - 'ReferenceLinks', - 'TeamMember', - 'TeamProject', - 'TeamProjectCollection', - 'TeamProjectCollectionReference', - 'TeamProjectReference', - 'WebApiConnectedService', - 'WebApiConnectedServiceDetails', - 'WebApiConnectedServiceRef', - 'WebApiTeam', - 'WebApiTeamRef', -] diff --git a/vsts/vsts/core/v4_1/models/identity_data.py b/vsts/vsts/core/v4_1/models/identity_data.py deleted file mode 100644 index 160e8308..00000000 --- a/vsts/vsts/core/v4_1/models/identity_data.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/identity_ref.py b/vsts/vsts/core/v4_1/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/core/v4_1/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/core/v4_1/models/json_patch_operation.py b/vsts/vsts/core/v4_1/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/core/v4_1/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/operation_reference.py b/vsts/vsts/core/v4_1/models/operation_reference.py deleted file mode 100644 index cdbef013..00000000 --- a/vsts/vsts/core/v4_1/models/operation_reference.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/core/v4_1/models/process.py b/vsts/vsts/core/v4_1/models/process.py deleted file mode 100644 index bcbb35ba..00000000 --- a/vsts/vsts/core/v4_1/models/process.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .process_reference import ProcessReference - - -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 diff --git a/vsts/vsts/core/v4_1/models/process_reference.py b/vsts/vsts/core/v4_1/models/process_reference.py deleted file mode 100644 index 897afb57..00000000 --- a/vsts/vsts/core/v4_1/models/process_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/project_info.py b/vsts/vsts/core/v4_1/models/project_info.py deleted file mode 100644 index db391e77..00000000 --- a/vsts/vsts/core/v4_1/models/project_info.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/project_property.py b/vsts/vsts/core/v4_1/models/project_property.py deleted file mode 100644 index 6bebcd11..00000000 --- a/vsts/vsts/core/v4_1/models/project_property.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/proxy.py b/vsts/vsts/core/v4_1/models/proxy.py deleted file mode 100644 index ec17a518..00000000 --- a/vsts/vsts/core/v4_1/models/proxy.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/proxy_authorization.py b/vsts/vsts/core/v4_1/models/proxy_authorization.py deleted file mode 100644 index 8b4178a1..00000000 --- a/vsts/vsts/core/v4_1/models/proxy_authorization.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/public_key.py b/vsts/vsts/core/v4_1/models/public_key.py deleted file mode 100644 index 878b6731..00000000 --- a/vsts/vsts/core/v4_1/models/public_key.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 PublicKey(Model): - """PublicKey. - - :param exponent: Gets or sets the exponent for the public key. - :type exponent: list of number - :param modulus: Gets or sets the modulus for the public key. - :type modulus: list of number - """ - - _attribute_map = { - 'exponent': {'key': 'exponent', 'type': '[number]'}, - 'modulus': {'key': 'modulus', 'type': '[number]'} - } - - def __init__(self, exponent=None, modulus=None): - super(PublicKey, self).__init__() - self.exponent = exponent - self.modulus = modulus diff --git a/vsts/vsts/core/v4_1/models/reference_links.py b/vsts/vsts/core/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/core/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/team_member.py b/vsts/vsts/core/v4_1/models/team_member.py deleted file mode 100644 index 1f316f88..00000000 --- a/vsts/vsts/core/v4_1/models/team_member.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/team_project.py b/vsts/vsts/core/v4_1/models/team_project.py deleted file mode 100644 index b6a2db7e..00000000 --- a/vsts/vsts/core/v4_1/models/team_project.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .team_project_reference import TeamProjectReference - - -class TeamProject(TeamProjectReference): - """TeamProject. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, 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, 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 diff --git a/vsts/vsts/core/v4_1/models/team_project_collection.py b/vsts/vsts/core/v4_1/models/team_project_collection.py deleted file mode 100644 index 29ba3fbf..00000000 --- a/vsts/vsts/core/v4_1/models/team_project_collection.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .team_project_collection_reference import TeamProjectCollectionReference - - -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 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'}, - 'state': {'key': 'state', 'type': 'str'} - } - - def __init__(self, id=None, name=None, url=None, _links=None, description=None, state=None): - super(TeamProjectCollection, self).__init__(id=id, name=name, url=url) - self._links = _links - self.description = description - self.state = state diff --git a/vsts/vsts/core/v4_1/models/team_project_collection_reference.py b/vsts/vsts/core/v4_1/models/team_project_collection_reference.py deleted file mode 100644 index 6f4a596a..00000000 --- a/vsts/vsts/core/v4_1/models/team_project_collection_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/team_project_reference.py b/vsts/vsts/core/v4_1/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/core/v4_1/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/core/v4_1/models/web_api_connected_service.py b/vsts/vsts/core/v4_1/models/web_api_connected_service.py deleted file mode 100644 index 59e2fdd9..00000000 --- a/vsts/vsts/core/v4_1/models/web_api_connected_service.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_connected_service_ref import WebApiConnectedServiceRef - - -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 diff --git a/vsts/vsts/core/v4_1/models/web_api_connected_service_details.py b/vsts/vsts/core/v4_1/models/web_api_connected_service_details.py deleted file mode 100644 index a9729b37..00000000 --- a/vsts/vsts/core/v4_1/models/web_api_connected_service_details.py +++ /dev/null @@ -1,39 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_connected_service_ref import WebApiConnectedServiceRef - - -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 diff --git a/vsts/vsts/core/v4_1/models/web_api_connected_service_ref.py b/vsts/vsts/core/v4_1/models/web_api_connected_service_ref.py deleted file mode 100644 index 4a0e1863..00000000 --- a/vsts/vsts/core/v4_1/models/web_api_connected_service_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/core/v4_1/models/web_api_team.py b/vsts/vsts/core/v4_1/models/web_api_team.py deleted file mode 100644 index 872de4a1..00000000 --- a/vsts/vsts/core/v4_1/models/web_api_team.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .web_api_team_ref import WebApiTeamRef - - -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 - """ - - _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'} - } - - def __init__(self, id=None, name=None, url=None, description=None, identity_url=None): - super(WebApiTeam, self).__init__(id=id, name=name, url=url) - self.description = description - self.identity_url = identity_url diff --git a/vsts/vsts/core/v4_1/models/web_api_team_ref.py b/vsts/vsts/core/v4_1/models/web_api_team_ref.py deleted file mode 100644 index fba42b04..00000000 --- a/vsts/vsts/core/v4_1/models/web_api_team_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/customer_intelligence/__init__.py b/vsts/vsts/customer_intelligence/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/customer_intelligence/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/customer_intelligence/customer_intelligence_client.py b/vsts/vsts/customer_intelligence/customer_intelligence_client.py deleted file mode 100644 index 23c6b922..00000000 --- a/vsts/vsts/customer_intelligence/customer_intelligence_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ..vss_client import VssClient -from . import models - - -class CustomerIntelligenceClient(VssClient): - """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='4.1-preview.1', - content=content) - diff --git a/vsts/vsts/customer_intelligence/v4_0/__init__.py b/vsts/vsts/customer_intelligence/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/customer_intelligence/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/customer_intelligence/v4_0/customer_intelligence_client.py b/vsts/vsts/customer_intelligence/v4_0/customer_intelligence_client.py deleted file mode 100644 index 931ada1c..00000000 --- a/vsts/vsts/customer_intelligence/v4_0/customer_intelligence_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class CustomerIntelligenceClient(VssClient): - """CustomerIntelligence - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.0-preview.1', - content=content) - diff --git a/vsts/vsts/customer_intelligence/v4_0/models/__init__.py b/vsts/vsts/customer_intelligence/v4_0/models/__init__.py deleted file mode 100644 index 53e67765..00000000 --- a/vsts/vsts/customer_intelligence/v4_0/models/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .customer_intelligence_event import CustomerIntelligenceEvent - -__all__ = [ - 'CustomerIntelligenceEvent', -] diff --git a/vsts/vsts/customer_intelligence/v4_0/models/customer_intelligence_event.py b/vsts/vsts/customer_intelligence/v4_0/models/customer_intelligence_event.py deleted file mode 100644 index c0cb660c..00000000 --- a/vsts/vsts/customer_intelligence/v4_0/models/customer_intelligence_event.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/customer_intelligence/v4_1/__init__.py b/vsts/vsts/customer_intelligence/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/customer_intelligence/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/customer_intelligence/v4_1/customer_intelligence_client.py b/vsts/vsts/customer_intelligence/v4_1/customer_intelligence_client.py deleted file mode 100644 index 22387c81..00000000 --- a/vsts/vsts/customer_intelligence/v4_1/customer_intelligence_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class CustomerIntelligenceClient(VssClient): - """CustomerIntelligence - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.1-preview.1', - content=content) - diff --git a/vsts/vsts/customer_intelligence/v4_1/models/__init__.py b/vsts/vsts/customer_intelligence/v4_1/models/__init__.py deleted file mode 100644 index 53e67765..00000000 --- a/vsts/vsts/customer_intelligence/v4_1/models/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .customer_intelligence_event import CustomerIntelligenceEvent - -__all__ = [ - 'CustomerIntelligenceEvent', -] diff --git a/vsts/vsts/customer_intelligence/v4_1/models/customer_intelligence_event.py b/vsts/vsts/customer_intelligence/v4_1/models/customer_intelligence_event.py deleted file mode 100644 index c0cb660c..00000000 --- a/vsts/vsts/customer_intelligence/v4_1/models/customer_intelligence_event.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/exceptions.py b/vsts/vsts/exceptions.py deleted file mode 100644 index 90be8fc5..00000000 --- a/vsts/vsts/exceptions.py +++ /dev/null @@ -1,46 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from .models.wrapped_exception import WrappedException -from msrest.exceptions import ( - ClientException, - SerializationError, - DeserializationError, - TokenExpiredError, - ClientRequestError, - AuthenticationError, - HttpOperationError, - ValidationError, -) - - -class VstsClientError(ClientException): - pass - - -class VstsAuthenticationError(AuthenticationError): - pass - - -class VstsClientRequestError(ClientRequestError): - pass - - -class VstsServiceError(VstsClientRequestError): - """VstsServiceError. - """ - - def __init__(self, wrapped_exception): - self.inner_exception = None - if wrapped_exception.inner_exception is not None: - self.inner_exception = VstsServiceError(wrapped_exception.inner_exception) - super(VstsServiceError, 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 diff --git a/vsts/vsts/git/__init__.py b/vsts/vsts/git/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/git/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/git/v4_0/__init__.py b/vsts/vsts/git/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/git/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/git/v4_0/git_client.py b/vsts/vsts/git/v4_0/git_client.py deleted file mode 100644 index 57d0e0a7..00000000 --- a/vsts/vsts/git/v4_0/git_client.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - - -from msrest.pipeline 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): - GitClientBase.__init__(self, base_url, creds) - - def get_vsts_info(self, relative_remote_url): - request = ClientRequest() - request.url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') - request.method = 'GET' - headers = {'Accept': 'application/json'} - if self._suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - 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): - request = ClientRequest() - request.url = remote_url.rstrip('/') + '/vsts/info' - request.method = 'GET' - headers = {'Accept': 'application/json'} - if suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - git_client = GitClient(base_url=remote_url, creds=credentials) - response = git_client._send_request(request, headers) - return git_client._deserialize('VstsInfo', response) - diff --git a/vsts/vsts/git/v4_0/git_client_base.py b/vsts/vsts/git/v4_0/git_client_base.py deleted file mode 100644 index ad4c3bad..00000000 --- a/vsts/vsts/git/v4_0/git_client_base.py +++ /dev/null @@ -1,2829 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class GitClientBase(VssClient): - """Git - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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: Friendly name or guid of 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='4.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: - :param str object_id: Sha1 of annotated tag to be returned - :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='4.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): - """GetBlob. - Gets a single blob. - :param str repository_id: - :param str sha1: - :param str project: Project ID or project name - :param bool download: - :param str file_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 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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.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): - """GetBlobContent. - Gets a single blob. - :param str repository_id: - :param str sha1: - :param str project: Project ID or project name - :param bool download: - :param str file_name: - :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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_blobs_zip(self, blob_ids, repository_id, project=None, filename=None): - """GetBlobsZip. - Gets one or more blobs in a zip file download. - :param [str] blob_ids: - :param str repository_id: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('object', response) - - def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_name=None): - """GetBlobZip. - Gets a single blob. - :param str repository_id: - :param str sha1: - :param str project: Project ID or project name - :param bool download: - :param str file_name: - :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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_branch(self, repository_id, name, project=None, base_version_descriptor=None): - """GetBranch. - Retrieve statistics about a single branch. - :param str repository_id: Friendly name or guid of repository - :param str name: Name of the branch - :param str project: Project ID or project name - :param :class:` ` base_version_descriptor: - :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='4.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: Friendly name or guid of repository - :param str project: Project ID or project name - :param :class:` ` base_version_descriptor: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitBranchStats]', response) - - def get_branch_stats_batch(self, search_criteria, repository_id, project=None): - """GetBranchStatsBatch. - Retrieve statistics for multiple commits - :param :class:` ` search_criteria: - :param str repository_id: Friendly name or guid of repository - :param str project: Project ID or project name - :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') - content = self._serialize.body(search_criteria, 'GitQueryBranchStatsCriteria') - response = self._send(http_method='POST', - location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', - version='4.0', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[GitBranchStats]', 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='4.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] - :param :class:` ` cherry_pick_to_create: - :param str project: Project ID or project name - :param str repository_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') - content = self._serialize.body(cherry_pick_to_create, 'GitAsyncRefOperationParameters') - response = self._send(http_method='POST', - location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', - version='4.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] - :param str project: Project ID or project name - :param int cherry_pick_id: - :param str repository_id: - :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='4.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] - :param str project: Project ID or project name - :param str repository_id: - :param str ref_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 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='4.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. - Get differences in committed items between two commits. - :param str repository_id: Friendly name or guid of repository - :param str project: Project ID or project name - :param bool diff_common_commit: - :param int top: Maximum number of changes to return - :param int skip: Number of changes to skip - :param :class:` ` base_version_descriptor: - :param :class:` ` target_version_descriptor: - :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['baseVersionDescriptor.baseVersionType'] = base_version_descriptor.base_version_type - if base_version_descriptor.base_version is not None: - query_parameters['baseVersionDescriptor.baseVersion'] = base_version_descriptor.base_version - if base_version_descriptor.base_version_options is not None: - query_parameters['baseVersionDescriptor.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['targetVersionDescriptor.targetVersionType'] = target_version_descriptor.target_version_type - if target_version_descriptor.target_version is not None: - query_parameters['targetVersionDescriptor.targetVersion'] = target_version_descriptor.target_version - if target_version_descriptor.target_version_options is not None: - query_parameters['targetVersionDescriptor.targetVersionOptions'] = target_version_descriptor.target_version_options - response = self._send(http_method='GET', - location_id='615588d5-c0c7-4b88-88f8-e625306446e8', - version='4.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='4.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['search_criteria.item_version.VersionType'] = search_criteria.item_version.version_type - if search_criteria.item_version.version is not None: - query_parameters['search_criteria.item_version.Version'] = search_criteria.item_version.version - if search_criteria.item_version.version_options is not None: - query_parameters['search_criteria.item_version.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['search_criteria.compare_version.VersionType'] = search_criteria.compare_version.version_type - if search_criteria.compare_version.version is not None: - query_parameters['search_criteria.compare_version.Version'] = search_criteria.compare_version.version - if search_criteria.compare_version.version_options is not None: - query_parameters['search_criteria.compare_version.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.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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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 - :param :class:` ` search_criteria: Search options - :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 skip: - :param int top: - :param bool include_statuses: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitDeletedRepository]', 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: ID or name of the repository. - :param str collection_id: Team project collection ID. - :param str project: Project ID or project name - :param bool 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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRepositoryRef]', 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: ID or name 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='4.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: ID or name 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='4.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: ID or name 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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitForkSyncRequest]', response) - - def create_import_request(self, import_request, project, repository_id): - """CreateImportRequest. - [Preview API] Create an import request - :param :class:` ` import_request: - :param str project: Project ID or project name - :param str repository_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') - content = self._serialize.body(import_request, 'GitImportRequest') - response = self._send(http_method='POST', - location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', - version='4.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: - :param int import_request_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 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='4.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: - :param bool include_abandoned: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitImportRequest]', response) - - def update_import_request(self, import_request_to_update, project, repository_id, import_request_id): - """UpdateImportRequest. - [Preview API] Update an import request - :param :class:` ` import_request_to_update: - :param str project: Project ID or project name - :param str repository_id: - :param int import_request_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 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='4.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): - """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: - :param str path: - :param str project: Project ID or project name - :param str scope_path: - :param VersionControlRecursionType recursion_level: - :param bool include_content_metadata: - :param bool latest_processed_change: - :param bool download: - :param :class:` ` version_descriptor: - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.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): - """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: - :param str path: - :param str project: Project ID or project name - :param str scope_path: - :param VersionControlRecursionType recursion_level: - :param bool include_content_metadata: - :param bool latest_processed_change: - :param bool download: - :param :class:` ` version_descriptor: - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - 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: - :param str project: Project ID or project name - :param str scope_path: - :param VersionControlRecursionType recursion_level: - :param bool include_content_metadata: - :param bool latest_processed_change: - :param bool download: - :param bool include_links: - :param :class:` ` version_descriptor: - :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, 'VersionControlRecursionType') - 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitItem]', 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): - """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: - :param str path: - :param str project: Project ID or project name - :param str scope_path: - :param VersionControlRecursionType recursion_level: - :param bool include_content_metadata: - :param bool latest_processed_change: - :param bool download: - :param :class:` ` version_descriptor: - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - 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): - """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: - :param str path: - :param str project: Project ID or project name - :param str scope_path: - :param VersionControlRecursionType recursion_level: - :param bool include_content_metadata: - :param bool latest_processed_change: - :param bool download: - :param :class:` ` version_descriptor: - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - 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: - :param str repository_id: - :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='4.0', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[[GitItem]]', response) - - def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None): - """CreateAttachment. - [Preview API] Create a new attachment - :param object upload_stream: Stream to upload - :param str file_name: - :param str repository_id: - :param int pull_request_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 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') - content = self._serialize.body(upload_stream, 'object') - response = self._send(http_method='POST', - location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', - version='4.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] - :param str file_name: - :param str repository_id: - :param int pull_request_id: - :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='4.0-preview.1', - route_values=route_values) - - def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None): - """GetAttachmentContent. - [Preview API] - :param str file_name: - :param str repository_id: - :param int pull_request_id: - :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='4.0-preview.1', - route_values=route_values) - return self._deserialize('object', response) - - def get_attachments(self, repository_id, pull_request_id, project=None): - """GetAttachments. - [Preview API] - :param str repository_id: - :param int pull_request_id: - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[Attachment]', response) - - def get_attachment_zip(self, file_name, repository_id, pull_request_id, project=None): - """GetAttachmentZip. - [Preview API] - :param str file_name: - :param str repository_id: - :param int pull_request_id: - :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='4.0-preview.1', - route_values=route_values) - return self._deserialize('object', response) - - 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: - :param int pull_request_id: - :param int thread_id: - :param int comment_id: - :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='4.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: - :param int pull_request_id: - :param int thread_id: - :param int comment_id: - :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='4.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: - :param int pull_request_id: - :param int thread_id: - :param int comment_id: - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRef]', response) - - def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None): - """GetPullRequestIterationCommits. - Get the commits for an iteration. - :param str repository_id: - :param int pull_request_id: - :param int iteration_id: Iteration to retrieve commits for - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitCommitRef]', response) - - def get_pull_request_commits(self, repository_id, pull_request_id, project=None): - """GetPullRequestCommits. - Retrieve pull request's commits - :param str repository_id: - :param int pull_request_id: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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. - :param str repository_id: - :param int pull_request_id: - :param int iteration_id: - :param str project: Project ID or project name - :param int top: - :param int skip: - :param int compare_to: - :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='4.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. - :param str repository_id: - :param int pull_request_id: - :param int iteration_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 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='4.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. - :param str repository_id: - :param int pull_request_id: - :param str project: Project ID or project name - :param bool include_commits: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequestIteration]', 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 method will have the same result as CreatePullRequestStatus with specified iterationId in the request body. - :param :class:` ` status: Pull request status to create. - :param str repository_id: ID of the repository the pull request belongs to. - :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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('GitPullRequestStatus', response) - - 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: ID of the repository the pull request belongs to. - :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='4.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: ID of the repository the pull request belongs to. - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitPullRequestStatus]', response) - - def create_pull_request_label(self, label, repository_id, pull_request_id, project=None, project_id=None): - """CreatePullRequestLabel. - [Preview API] - :param :class:` ` label: - :param str repository_id: - :param int pull_request_id: - :param str project: Project ID or project name - :param str project_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 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='4.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] - :param str repository_id: - :param int pull_request_id: - :param str label_id_or_name: - :param str project: Project ID or project name - :param str project_id: - """ - 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='4.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] - :param str repository_id: - :param int pull_request_id: - :param str label_id_or_name: - :param str project: Project ID or project name - :param str project_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 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='4.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] Retrieve a pull request's Labels - :param str repository_id: - :param int pull_request_id: - :param str project: Project ID or project name - :param str project_id: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiTagDefinition]', response) - - def get_pull_request_query(self, queries, repository_id, project=None): - """GetPullRequestQuery. - Query for pull requests - :param :class:` ` queries: - :param str repository_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 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='4.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. - Adds a reviewer to a git pull request - :param :class:` ` reviewer: - :param str repository_id: - :param int pull_request_id: - :param str reviewer_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 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='4.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. - Adds reviewers to a git pull request - :param [IdentityRef] reviewers: - :param str repository_id: - :param int pull_request_id: - :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='4.0', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[IdentityRefWithVote]', response) - - def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): - """DeletePullRequestReviewer. - Removes a reviewer from a git pull request - :param str repository_id: - :param int pull_request_id: - :param str reviewer_id: - :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='4.0', - route_values=route_values) - - def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): - """GetPullRequestReviewer. - Retrieve a reviewer from a pull request - :param str repository_id: - :param int pull_request_id: - :param str reviewer_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 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='4.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 a pull request reviewers - :param str repository_id: - :param int pull_request_id: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRefWithVote]', response) - - def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): - """UpdatePullRequestReviewers. - Resets multiple reviewer votes in a batch - :param [IdentityRefWithVote] patch_votes: - :param str repository_id: - :param int pull_request_id: - :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='4.0', - route_values=route_values, - content=content) - - def get_pull_request_by_id(self, pull_request_id): - """GetPullRequestById. - Get a pull request using its ID - :param int pull_request_id: the Id of the pull request - :rtype: :class:` ` - """ - route_values = {} - 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='4.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. - Query pull requests by project - :param str project: Project ID or project name - :param :class:` ` search_criteria: - :param int max_comment_length: - :param int skip: - :param int top: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequest]', response) - - def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None): - """CreatePullRequest. - Create a git pull request - :param :class:` ` git_pull_request_to_create: - :param str repository_id: - :param str project: Project ID or project name - :param bool supports_iterations: - :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='4.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: - :param int pull_request_id: - :param str project: Project ID or project name - :param int max_comment_length: - :param int skip: - :param int top: - :param bool include_commits: - :param bool include_work_item_refs: - :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='4.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. - Query for pull requests - :param str repository_id: - :param :class:` ` search_criteria: - :param str project: Project ID or project name - :param int max_comment_length: - :param int skip: - :param int top: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequest]', response) - - def update_pull_request(self, git_pull_request_to_update, repository_id, pull_request_id, project=None): - """UpdatePullRequest. - Updates a pull request - :param :class:` ` git_pull_request_to_update: - :param str repository_id: - :param int pull_request_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 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='4.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] - :param :class:` ` user_message: - :param str repository_id: - :param int pull_request_id: - :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='4.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: ID of the repository the pull request belongs to. - :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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('GitPullRequestStatus', response) - - 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: ID of the repository the pull request belongs to. - :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='4.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: ID of the repository the pull request belongs to. - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitPullRequestStatus]', response) - - def create_comment(self, comment, repository_id, pull_request_id, thread_id, project=None): - """CreateComment. - Create a pull request review comment - :param :class:` ` comment: - :param str repository_id: - :param int pull_request_id: - :param int thread_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 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='4.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 pull request comment by id for a pull request - :param str repository_id: - :param int pull_request_id: - :param int thread_id: - :param int comment_id: - :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='4.0', - route_values=route_values) - - def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): - """GetComment. - Get a pull request comment by id for a pull request - :param str repository_id: - :param int pull_request_id: - :param int thread_id: - :param int comment_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 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='4.0', - route_values=route_values) - return self._deserialize('Comment', response) - - def get_comments(self, repository_id, pull_request_id, thread_id, project=None): - """GetComments. - Get all pull request comments in a thread. - :param str repository_id: - :param int pull_request_id: - :param int thread_id: - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[Comment]', response) - - def update_comment(self, comment, repository_id, pull_request_id, thread_id, comment_id, project=None): - """UpdateComment. - Update a pull request review comment thread - :param :class:` ` comment: - :param str repository_id: - :param int pull_request_id: - :param int thread_id: - :param int comment_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 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='4.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 pull request review comment thread - :param :class:` ` comment_thread: - :param str repository_id: - :param int pull_request_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 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='4.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. - Get a pull request comment thread by id for a pull request - :param str repository_id: - :param int pull_request_id: - :param int thread_id: - :param str project: Project ID or project name - :param int iteration: - :param int base_iteration: - :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='4.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. - Get all pull request comment threads. - :param str repository_id: - :param int pull_request_id: - :param str project: Project ID or project name - :param int iteration: - :param int base_iteration: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequestCommentThread]', response) - - def update_thread(self, comment_thread, repository_id, pull_request_id, thread_id, project=None): - """UpdateThread. - Update a pull request review comment thread - :param :class:` ` comment_thread: - :param str repository_id: - :param int pull_request_id: - :param int thread_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 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='4.0', - route_values=route_values, - content=content) - return self._deserialize('GitPullRequestCommentThread', response) - - def get_pull_request_work_items(self, repository_id, pull_request_id, project=None): - """GetPullRequestWorkItems. - Retrieve a pull request work items - :param str repository_id: - :param int pull_request_id: - :param str project: Project ID or project name - :rtype: [AssociatedWorkItem] - """ - 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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[AssociatedWorkItem]', response) - - def create_push(self, push, repository_id, project=None): - """CreatePush. - Push changes to the repository. - :param :class:` ` push: - :param str repository_id: The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. - :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='4.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. - Retrieve 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 include_commits: The number of commits to include in the result. - :param bool include_ref_updates: - :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='4.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 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 skip: - :param int top: - :param :class:` ` search_criteria: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPush]', response) - - def get_refs(self, repository_id, project=None, filter=None, include_links=None, latest_statuses_only=None): - """GetRefs. - Queries the provided repository for its refs and returns them. - :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 str filter: [optional] A filter to apply to the refs. - :param bool include_links: [optional] Specifies if referenceLinks should be included in the result. default is false. - :param bool latest_statuses_only: - :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 latest_statuses_only is not None: - query_parameters['latestStatusesOnly'] = self._serialize.query('latest_statuses_only', latest_statuses_only, 'bool') - response = self._send(http_method='GET', - location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRef]', response) - - def update_ref(self, new_ref_info, repository_id, filter, project=None, project_id=None): - """UpdateRef. - :param :class:` ` new_ref_info: - :param str repository_id: - :param str filter: - :param str project: Project ID or project name - :param str project_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') - 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='4.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. - Creates or updates refs with the given information - :param [GitRefUpdate] ref_updates: List of ref updates to attempt to perform - :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 str project_id: The id of the project. - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[GitRefUpdateResult]', response) - - def create_favorite(self, favorite, project): - """CreateFavorite. - [Preview API] Creates a ref favorite - :param :class:` ` favorite: - :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='4.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] - :param str project: Project ID or project name - :param int favorite_id: - """ - 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='4.0-preview.1', - route_values=route_values) - - def get_ref_favorite(self, project, favorite_id): - """GetRefFavorite. - [Preview API] - :param str project: Project ID or project name - :param int favorite_id: - :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='4.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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRefFavorite]', response) - - def create_repository(self, git_repository_to_create, project=None, source_ref=None): - """CreateRepository. - Create a git repository - :param :class:` ` git_repository_to_create: - :param str project: Project ID or project name - :param str source_ref: - :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='4.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: - :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='4.0', - route_values=route_values) - - def get_repositories(self, project=None, include_links=None, include_all_urls=None): - """GetRepositories. - Retrieve git repositories. - :param str project: Project ID or project name - :param bool include_links: - :param bool include_all_urls: - :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') - response = self._send(http_method='GET', - location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRepository]', response) - - def get_repository(self, repository_id, project=None, include_parent=None): - """GetRepository. - :param str repository_id: - :param str project: Project ID or project name - :param bool include_parent: - :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='4.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 the single populated change in the specified repository information. - :param :class:` ` new_repository_info: - :param str repository_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 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='4.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] - :param :class:` ` revert_to_create: - :param str project: Project ID or project name - :param str repository_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') - content = self._serialize.body(revert_to_create, 'GitAsyncRefOperationParameters') - response = self._send(http_method='POST', - location_id='bc866058-5449-4715-9cf1-a510b6ff193c', - version='4.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] - :param str project: Project ID or project name - :param int revert_id: - :param str repository_id: - :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='4.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] - :param str project: Project ID or project name - :param str repository_id: - :param str ref_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 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='4.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. - :param :class:` ` git_commit_status_to_create: - :param str commit_id: - :param str repository_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 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='4.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. - :param str commit_id: - :param str repository_id: - :param str project: Project ID or project name - :param int top: - :param int skip: - :param bool latest_only: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitStatus]', response) - - def get_suggestions(self, repository_id, project=None): - """GetSuggestions. - [Preview API] Retrieve a set of suggestions (including a pull request suggestion). - :param str repository_id: - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitSuggestion]', response) - - def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None): - """GetTree. - :param str repository_id: - :param str sha1: - :param str project: Project ID or project name - :param str project_id: - :param bool recursive: - :param str file_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 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='4.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): - """GetTreeZip. - :param str repository_id: - :param str sha1: - :param str project: Project ID or project name - :param str project_id: - :param bool recursive: - :param str file_name: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - diff --git a/vsts/vsts/git/v4_0/models/__init__.py b/vsts/vsts/git/v4_0/models/__init__.py deleted file mode 100644 index 1c26a7c2..00000000 --- a/vsts/vsts/git/v4_0/models/__init__.py +++ /dev/null @@ -1,199 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .associated_work_item import AssociatedWorkItem -from .attachment import Attachment -from .change import Change -from .change_count_dictionary import ChangeCountDictionary -from .comment import Comment -from .comment_iteration_context import CommentIterationContext -from .comment_position import CommentPosition -from .comment_thread import CommentThread -from .comment_thread_context import CommentThreadContext -from .comment_tracking_criteria import CommentTrackingCriteria -from .file_content_metadata import FileContentMetadata -from .git_annotated_tag import GitAnnotatedTag -from .git_async_ref_operation import GitAsyncRefOperation -from .git_async_ref_operation_detail import GitAsyncRefOperationDetail -from .git_async_ref_operation_parameters import GitAsyncRefOperationParameters -from .git_async_ref_operation_source import GitAsyncRefOperationSource -from .git_base_version_descriptor import GitBaseVersionDescriptor -from .git_blob_ref import GitBlobRef -from .git_branch_stats import GitBranchStats -from .git_change import GitChange -from .git_cherry_pick import GitCherryPick -from .git_commit import GitCommit -from .git_commit_changes import GitCommitChanges -from .git_commit_diffs import GitCommitDiffs -from .git_commit_ref import GitCommitRef -from .git_conflict import GitConflict -from .git_deleted_repository import GitDeletedRepository -from .git_file_paths_collection import GitFilePathsCollection -from .git_fork_operation_status_detail import GitForkOperationStatusDetail -from .git_fork_ref import GitForkRef -from .git_fork_sync_request import GitForkSyncRequest -from .git_fork_sync_request_parameters import GitForkSyncRequestParameters -from .git_import_git_source import GitImportGitSource -from .git_import_request import GitImportRequest -from .git_import_request_parameters import GitImportRequestParameters -from .git_import_status_detail import GitImportStatusDetail -from .git_import_tfvc_source import GitImportTfvcSource -from .git_item import GitItem -from .git_item_descriptor import GitItemDescriptor -from .git_item_request_data import GitItemRequestData -from .git_merge_origin_ref import GitMergeOriginRef -from .git_object import GitObject -from .git_pull_request import GitPullRequest -from .git_pull_request_change import GitPullRequestChange -from .git_pull_request_comment_thread import GitPullRequestCommentThread -from .git_pull_request_comment_thread_context import GitPullRequestCommentThreadContext -from .git_pull_request_completion_options import GitPullRequestCompletionOptions -from .git_pull_request_iteration import GitPullRequestIteration -from .git_pull_request_iteration_changes import GitPullRequestIterationChanges -from .git_pull_request_merge_options import GitPullRequestMergeOptions -from .git_pull_request_query import GitPullRequestQuery -from .git_pull_request_query_input import GitPullRequestQueryInput -from .git_pull_request_search_criteria import GitPullRequestSearchCriteria -from .git_pull_request_status import GitPullRequestStatus -from .git_push import GitPush -from .git_push_ref import GitPushRef -from .git_push_search_criteria import GitPushSearchCriteria -from .git_query_branch_stats_criteria import GitQueryBranchStatsCriteria -from .git_query_commits_criteria import GitQueryCommitsCriteria -from .git_ref import GitRef -from .git_ref_favorite import GitRefFavorite -from .git_ref_update import GitRefUpdate -from .git_ref_update_result import GitRefUpdateResult -from .git_repository import GitRepository -from .git_repository_create_options import GitRepositoryCreateOptions -from .git_repository_ref import GitRepositoryRef -from .git_repository_stats import GitRepositoryStats -from .git_revert import GitRevert -from .git_status import GitStatus -from .git_status_context import GitStatusContext -from .git_suggestion import GitSuggestion -from .git_target_version_descriptor import GitTargetVersionDescriptor -from .git_template import GitTemplate -from .git_tree_diff import GitTreeDiff -from .git_tree_diff_entry import GitTreeDiffEntry -from .git_tree_diff_response import GitTreeDiffResponse -from .git_tree_entry_ref import GitTreeEntryRef -from .git_tree_ref import GitTreeRef -from .git_user_date import GitUserDate -from .git_version_descriptor import GitVersionDescriptor -from .global_git_repository_key import GlobalGitRepositoryKey -from .identity_ref import IdentityRef -from .identity_ref_with_vote import IdentityRefWithVote -from .import_repository_validation import ImportRepositoryValidation -from .item_model import ItemModel -from .reference_links import ReferenceLinks -from .resource_ref import ResourceRef -from .share_notification_context import ShareNotificationContext -from .source_to_target_ref import SourceToTargetRef -from .team_project_collection_reference import TeamProjectCollectionReference -from .team_project_reference import TeamProjectReference -from .vsts_info import VstsInfo -from .web_api_create_tag_request_data import WebApiCreateTagRequestData -from .web_api_tag_definition import WebApiTagDefinition - -__all__ = [ - 'AssociatedWorkItem', - 'Attachment', - 'Change', - 'ChangeCountDictionary', - 'Comment', - 'CommentIterationContext', - 'CommentPosition', - 'CommentThread', - 'CommentThreadContext', - 'CommentTrackingCriteria', - 'FileContentMetadata', - 'GitAnnotatedTag', - 'GitAsyncRefOperation', - 'GitAsyncRefOperationDetail', - 'GitAsyncRefOperationParameters', - 'GitAsyncRefOperationSource', - 'GitBaseVersionDescriptor', - 'GitBlobRef', - 'GitBranchStats', - 'GitChange', - 'GitCherryPick', - 'GitCommit', - 'GitCommitChanges', - 'GitCommitDiffs', - 'GitCommitRef', - 'GitConflict', - 'GitDeletedRepository', - 'GitFilePathsCollection', - 'GitForkOperationStatusDetail', - 'GitForkRef', - 'GitForkSyncRequest', - 'GitForkSyncRequestParameters', - 'GitImportGitSource', - 'GitImportRequest', - 'GitImportRequestParameters', - 'GitImportStatusDetail', - 'GitImportTfvcSource', - 'GitItem', - 'GitItemDescriptor', - 'GitItemRequestData', - 'GitMergeOriginRef', - 'GitObject', - 'GitPullRequest', - 'GitPullRequestChange', - 'GitPullRequestCommentThread', - 'GitPullRequestCommentThreadContext', - 'GitPullRequestCompletionOptions', - 'GitPullRequestIteration', - 'GitPullRequestIterationChanges', - 'GitPullRequestMergeOptions', - 'GitPullRequestQuery', - 'GitPullRequestQueryInput', - 'GitPullRequestSearchCriteria', - 'GitPullRequestStatus', - 'GitPush', - 'GitPushRef', - 'GitPushSearchCriteria', - 'GitQueryBranchStatsCriteria', - 'GitQueryCommitsCriteria', - 'GitRef', - 'GitRefFavorite', - 'GitRefUpdate', - 'GitRefUpdateResult', - 'GitRepository', - 'GitRepositoryCreateOptions', - 'GitRepositoryRef', - 'GitRepositoryStats', - 'GitRevert', - 'GitStatus', - 'GitStatusContext', - 'GitSuggestion', - 'GitTargetVersionDescriptor', - 'GitTemplate', - 'GitTreeDiff', - 'GitTreeDiffEntry', - 'GitTreeDiffResponse', - 'GitTreeEntryRef', - 'GitTreeRef', - 'GitUserDate', - 'GitVersionDescriptor', - 'GlobalGitRepositoryKey', - 'IdentityRef', - 'IdentityRefWithVote', - 'ImportRepositoryValidation', - 'ItemModel', - 'ReferenceLinks', - 'ResourceRef', - 'ShareNotificationContext', - 'SourceToTargetRef', - 'TeamProjectCollectionReference', - 'TeamProjectReference', - 'VstsInfo', - 'WebApiCreateTagRequestData', - 'WebApiTagDefinition', -] diff --git a/vsts/vsts/git/v4_0/models/associated_work_item.py b/vsts/vsts/git/v4_0/models/associated_work_item.py deleted file mode 100644 index c34ac428..00000000 --- a/vsts/vsts/git/v4_0/models/associated_work_item.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: - :type id: int - :param state: - :type state: str - :param title: - :type title: str - :param url: REST url - :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 diff --git a/vsts/vsts/git/v4_0/models/attachment.py b/vsts/vsts/git/v4_0/models/attachment.py deleted file mode 100644 index 519408af..00000000 --- a/vsts/vsts/git/v4_0/models/attachment.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: - :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, can be null. - :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 code review attachment - :type id: int - :param 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 diff --git a/vsts/vsts/git/v4_0/models/change.py b/vsts/vsts/git/v4_0/models/change.py deleted file mode 100644 index cd0aa11d..00000000 --- a/vsts/vsts/git/v4_0/models/change.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Change(Model): - """Change. - - :param change_type: - :type change_type: object - :param item: - :type item: object - :param new_content: - :type new_content: :class:`ItemContent ` - :param source_server_item: - :type source_server_item: str - :param url: - :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 diff --git a/vsts/vsts/git/v4_0/models/change_count_dictionary.py b/vsts/vsts/git/v4_0/models/change_count_dictionary.py deleted file mode 100644 index 1c8e29bc..00000000 --- a/vsts/vsts/git/v4_0/models/change_count_dictionary.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ChangeCountDictionary(dict): - """ChangeCountDictionary. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ChangeCountDictionary, self).__init__() diff --git a/vsts/vsts/git/v4_0/models/comment.py b/vsts/vsts/git/v4_0/models/comment.py deleted file mode 100644 index b516cc6c..00000000 --- a/vsts/vsts/git/v4_0/models/comment.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Comment(Model): - """Comment. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param author: The author of the pull request comment. - :type author: :class:`IdentityRef ` - :param comment_type: Determines what kind of comment when it was created. - :type comment_type: object - :param content: The comment's content. - :type content: str - :param id: The pull request comment id. It always starts from 1. - :type id: int - :param is_deleted: Marks if this comment was soft-deleted. - :type is_deleted: bool - :param last_content_updated_date: The date a comment content was last updated. - :type last_content_updated_date: datetime - :param last_updated_date: The date a comment was last updated. - :type last_updated_date: datetime - :param parent_comment_id: The pull request comment id of the parent comment. This is used for replies - :type parent_comment_id: int - :param published_date: The date a comment was first published. - :type published_date: datetime - :param users_liked: A list of the users who've 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 diff --git a/vsts/vsts/git/v4_0/models/comment_iteration_context.py b/vsts/vsts/git/v4_0/models/comment_iteration_context.py deleted file mode 100644 index 674d3c5a..00000000 --- a/vsts/vsts/git/v4_0/models/comment_iteration_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CommentIterationContext(Model): - """CommentIterationContext. - - :param first_comparing_iteration: First comparing iteration Id. Minimum value is 1. - :type first_comparing_iteration: int - :param second_comparing_iteration: Second comparing iteration Id. Minimum value is 1. - :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 diff --git a/vsts/vsts/git/v4_0/models/comment_position.py b/vsts/vsts/git/v4_0/models/comment_position.py deleted file mode 100644 index a8e38acd..00000000 --- a/vsts/vsts/git/v4_0/models/comment_position.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CommentPosition(Model): - """CommentPosition. - - :param line: Position line starting with one. - :type line: int - :param offset: Position offset starting with zero. - :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 diff --git a/vsts/vsts/git/v4_0/models/comment_thread.py b/vsts/vsts/git/v4_0/models/comment_thread.py deleted file mode 100644 index f3ab99d9..00000000 --- a/vsts/vsts/git/v4_0/models/comment_thread.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CommentThread(Model): - """CommentThread. - - :param _links: - :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 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: A list of (optional) thread properties. - :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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_0/models/comment_thread_context.py b/vsts/vsts/git/v4_0/models/comment_thread_context.py deleted file mode 100644 index cb264f7e..00000000 --- a/vsts/vsts/git/v4_0/models/comment_thread_context.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 comment in left file. - :type left_file_end: :class:`CommentPosition ` - :param left_file_start: Position of first character of the comment in left file. - :type left_file_start: :class:`CommentPosition ` - :param right_file_end: Position of last character of the comment in right file. - :type right_file_end: :class:`CommentPosition ` - :param right_file_start: Position of first character of the comment 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 diff --git a/vsts/vsts/git/v4_0/models/comment_tracking_criteria.py b/vsts/vsts/git/v4_0/models/comment_tracking_criteria.py deleted file mode 100644 index e9407863..00000000 --- a/vsts/vsts/git/v4_0/models/comment_tracking_criteria.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CommentTrackingCriteria(Model): - """CommentTrackingCriteria. - - :param first_comparing_iteration: The first comparing iteration being viewed. Threads will be tracked if this is greater than 0. - :type first_comparing_iteration: int - :param orig_left_file_end: Original position of last character of the comment in left file. - :type orig_left_file_end: :class:`CommentPosition ` - :param orig_left_file_start: Original position of first character of the comment in left file. - :type orig_left_file_start: :class:`CommentPosition ` - :param orig_right_file_end: Original position of last character of the comment in right file. - :type orig_right_file_end: :class:`CommentPosition ` - :param orig_right_file_start: Original position of first character of the comment in right file. - :type orig_right_file_start: :class:`CommentPosition ` - :param second_comparing_iteration: The second comparing iteration being viewed. Threads will be tracked if this is greater than 0. - :type second_comparing_iteration: int - """ - - _attribute_map = { - 'first_comparing_iteration': {'key': 'firstComparingIteration', 'type': 'int'}, - '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_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_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 diff --git a/vsts/vsts/git/v4_0/models/file_content_metadata.py b/vsts/vsts/git/v4_0/models/file_content_metadata.py deleted file mode 100644 index d2d6667d..00000000 --- a/vsts/vsts/git/v4_0/models/file_content_metadata.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_annotated_tag.py b/vsts/vsts/git/v4_0/models/git_annotated_tag.py deleted file mode 100644 index 6a9aaf45..00000000 --- a/vsts/vsts/git/v4_0/models/git_annotated_tag.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitAnnotatedTag(Model): - """GitAnnotatedTag. - - :param message: Tagging Message - :type message: str - :param name: - :type name: str - :param object_id: - :type object_id: str - :param tagged_by: User name, Email 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 diff --git a/vsts/vsts/git/v4_0/models/git_async_ref_operation.py b/vsts/vsts/git/v4_0/models/git_async_ref_operation.py deleted file mode 100644 index f9763339..00000000 --- a/vsts/vsts/git/v4_0/models/git_async_ref_operation.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_async_ref_operation_detail.py b/vsts/vsts/git/v4_0/models/git_async_ref_operation_detail.py deleted file mode 100644 index 37335a44..00000000 --- a/vsts/vsts/git/v4_0/models/git_async_ref_operation_detail.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitAsyncRefOperationDetail(Model): - """GitAsyncRefOperationDetail. - - :param conflict: - :type conflict: bool - :param current_commit_id: - :type current_commit_id: str - :param failure_message: - :type failure_message: str - :param progress: - :type progress: number - :param status: - :type status: object - :param timedout: - :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': 'number'}, - '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 diff --git a/vsts/vsts/git/v4_0/models/git_async_ref_operation_parameters.py b/vsts/vsts/git/v4_0/models/git_async_ref_operation_parameters.py deleted file mode 100644 index bc98c96f..00000000 --- a/vsts/vsts/git/v4_0/models/git_async_ref_operation_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitAsyncRefOperationParameters(Model): - """GitAsyncRefOperationParameters. - - :param generated_ref_name: - :type generated_ref_name: str - :param onto_ref_name: - :type onto_ref_name: str - :param repository: - :type repository: :class:`GitRepository ` - :param source: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_async_ref_operation_source.py b/vsts/vsts/git/v4_0/models/git_async_ref_operation_source.py deleted file mode 100644 index 46831949..00000000 --- a/vsts/vsts/git/v4_0/models/git_async_ref_operation_source.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitAsyncRefOperationSource(Model): - """GitAsyncRefOperationSource. - - :param commit_list: - :type commit_list: list of :class:`GitCommitRef ` - :param pull_request_id: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_base_version_descriptor.py b/vsts/vsts/git/v4_0/models/git_base_version_descriptor.py deleted file mode 100644 index d922e638..00000000 --- a/vsts/vsts/git/v4_0/models/git_base_version_descriptor.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_version_descriptor import GitVersionDescriptor - - -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 diff --git a/vsts/vsts/git/v4_0/models/git_blob_ref.py b/vsts/vsts/git/v4_0/models/git_blob_ref.py deleted file mode 100644 index 81c546c6..00000000 --- a/vsts/vsts/git/v4_0/models/git_blob_ref.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_branch_stats.py b/vsts/vsts/git/v4_0/models/git_branch_stats.py deleted file mode 100644 index 88629a1b..00000000 --- a/vsts/vsts/git/v4_0/models/git_branch_stats.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitBranchStats(Model): - """GitBranchStats. - - :param ahead_count: - :type ahead_count: int - :param behind_count: - :type behind_count: int - :param commit: - :type commit: :class:`GitCommitRef ` - :param is_base_version: - :type is_base_version: bool - :param name: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_change.py b/vsts/vsts/git/v4_0/models/git_change.py deleted file mode 100644 index c7a25411..00000000 --- a/vsts/vsts/git/v4_0/models/git_change.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .change import Change - - -class GitChange(Change): - """GitChange. - - :param change_id: Id of the change within the group. For example, within the iteration - :type change_id: int - :param new_content_template: New Content template to be used - :type new_content_template: :class:`GitTemplate ` - :param original_path: Original path of item if different from current path - :type original_path: str - """ - - _attribute_map = { - 'change_id': {'key': 'changeId', 'type': 'int'}, - 'new_content_template': {'key': 'newContentTemplate', 'type': 'GitTemplate'}, - 'original_path': {'key': 'originalPath', 'type': 'str'} - } - - def __init__(self, change_id=None, new_content_template=None, original_path=None): - super(GitChange, self).__init__() - self.change_id = change_id - self.new_content_template = new_content_template - self.original_path = original_path diff --git a/vsts/vsts/git/v4_0/models/git_cherry_pick.py b/vsts/vsts/git/v4_0/models/git_cherry_pick.py deleted file mode 100644 index c211ad1f..00000000 --- a/vsts/vsts/git/v4_0/models/git_cherry_pick.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_async_ref_operation import GitAsyncRefOperation - - -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: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_commit.py b/vsts/vsts/git/v4_0/models/git_commit.py deleted file mode 100644 index 545a3965..00000000 --- a/vsts/vsts/git/v4_0/models/git_commit.py +++ /dev/null @@ -1,68 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_commit_ref import GitCommitRef - - -class GitCommit(GitCommitRef): - """GitCommit. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param author: - :type author: :class:`GitUserDate ` - :param change_counts: - :type change_counts: :class:`ChangeCountDictionary ` - :param changes: - :type changes: list of :class:`GitChange ` - :param comment: - :type comment: str - :param comment_truncated: - :type comment_truncated: bool - :param commit_id: - :type commit_id: str - :param committer: - :type committer: :class:`GitUserDate ` - :param parents: - :type parents: list of str - :param remote_url: - :type remote_url: str - :param statuses: - :type statuses: list of :class:`GitStatus ` - :param url: - :type url: str - :param work_items: - :type work_items: list of :class:`ResourceRef ` - :param push: - :type push: :class:`GitPushRef ` - :param tree_id: - :type tree_id: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'author': {'key': 'author', 'type': 'GitUserDate'}, - 'change_counts': {'key': 'changeCounts', 'type': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'}, - '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]'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, - 'url': {'key': 'url', 'type': 'str'}, - 'work_items': {'key': 'workItems', 'type': '[ResourceRef]'}, - 'push': {'key': 'push', 'type': 'GitPushRef'}, - '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, remote_url=None, statuses=None, url=None, work_items=None, push=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, remote_url=remote_url, statuses=statuses, url=url, work_items=work_items) - self.push = push - self.tree_id = tree_id diff --git a/vsts/vsts/git/v4_0/models/git_commit_changes.py b/vsts/vsts/git/v4_0/models/git_commit_changes.py deleted file mode 100644 index ef3e3789..00000000 --- a/vsts/vsts/git/v4_0/models/git_commit_changes.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitCommitChanges(Model): - """GitCommitChanges. - - :param change_counts: - :type change_counts: :class:`ChangeCountDictionary ` - :param changes: - :type changes: list of :class:`GitChange ` - """ - - _attribute_map = { - 'change_counts': {'key': 'changeCounts', 'type': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'} - } - - def __init__(self, change_counts=None, changes=None): - super(GitCommitChanges, self).__init__() - self.change_counts = change_counts - self.changes = changes diff --git a/vsts/vsts/git/v4_0/models/git_commit_diffs.py b/vsts/vsts/git/v4_0/models/git_commit_diffs.py deleted file mode 100644 index 5e1e57b8..00000000 --- a/vsts/vsts/git/v4_0/models/git_commit_diffs.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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:`GitChange ` - :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': '[GitChange]'}, - '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 diff --git a/vsts/vsts/git/v4_0/models/git_commit_ref.py b/vsts/vsts/git/v4_0/models/git_commit_ref.py deleted file mode 100644 index bbe06483..00000000 --- a/vsts/vsts/git/v4_0/models/git_commit_ref.py +++ /dev/null @@ -1,73 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitCommitRef(Model): - """GitCommitRef. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param author: - :type author: :class:`GitUserDate ` - :param change_counts: - :type change_counts: :class:`ChangeCountDictionary ` - :param changes: - :type changes: list of :class:`GitChange ` - :param comment: - :type comment: str - :param comment_truncated: - :type comment_truncated: bool - :param commit_id: - :type commit_id: str - :param committer: - :type committer: :class:`GitUserDate ` - :param parents: - :type parents: list of str - :param remote_url: - :type remote_url: str - :param statuses: - :type statuses: list of :class:`GitStatus ` - :param url: - :type url: str - :param work_items: - :type work_items: list of :class:`ResourceRef ` - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'author': {'key': 'author', 'type': 'GitUserDate'}, - 'change_counts': {'key': 'changeCounts', 'type': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'}, - '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]'}, - '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, 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.remote_url = remote_url - self.statuses = statuses - self.url = url - self.work_items = work_items diff --git a/vsts/vsts/git/v4_0/models/git_conflict.py b/vsts/vsts/git/v4_0/models/git_conflict.py deleted file mode 100644 index 79766c04..00000000 --- a/vsts/vsts/git/v4_0/models/git_conflict.py +++ /dev/null @@ -1,73 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_deleted_repository.py b/vsts/vsts/git/v4_0/models/git_deleted_repository.py deleted file mode 100644 index a51bb682..00000000 --- a/vsts/vsts/git/v4_0/models/git_deleted_repository.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_file_paths_collection.py b/vsts/vsts/git/v4_0/models/git_file_paths_collection.py deleted file mode 100644 index 9d0863d6..00000000 --- a/vsts/vsts/git/v4_0/models/git_file_paths_collection.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_fork_operation_status_detail.py b/vsts/vsts/git/v4_0/models/git_fork_operation_status_detail.py deleted file mode 100644 index ce438967..00000000 --- a/vsts/vsts/git/v4_0/models/git_fork_operation_status_detail.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_fork_ref.py b/vsts/vsts/git/v4_0/models/git_fork_ref.py deleted file mode 100644 index ac966f79..00000000 --- a/vsts/vsts/git/v4_0/models/git_fork_ref.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_ref import GitRef - - -class GitForkRef(GitRef): - """GitForkRef. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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: - :type repository: :class:`GitRepository ` - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - '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, 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, 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 diff --git a/vsts/vsts/git/v4_0/models/git_fork_sync_request.py b/vsts/vsts/git/v4_0/models/git_fork_sync_request.py deleted file mode 100644 index 82d11ed3..00000000 --- a/vsts/vsts/git/v4_0/models/git_fork_sync_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_fork_sync_request_parameters.py b/vsts/vsts/git/v4_0/models/git_fork_sync_request_parameters.py deleted file mode 100644 index 25c51324..00000000 --- a/vsts/vsts/git/v4_0/models/git_fork_sync_request_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_import_git_source.py b/vsts/vsts/git/v4_0/models/git_import_git_source.py deleted file mode 100644 index bc20b2b8..00000000 --- a/vsts/vsts/git/v4_0/models/git_import_git_source.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_import_request.py b/vsts/vsts/git/v4_0/models/git_import_request.py deleted file mode 100644 index b68fb658..00000000 --- a/vsts/vsts/git/v4_0/models/git_import_request.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitImportRequest(Model): - """GitImportRequest. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param detailed_status: - :type detailed_status: :class:`GitImportStatusDetail ` - :param import_request_id: - :type import_request_id: int - :param parameters: Parameters for creating an import request - :type parameters: :class:`GitImportRequestParameters ` - :param repository: - :type repository: :class:`GitRepository ` - :param status: - :type status: object - :param url: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_import_request_parameters.py b/vsts/vsts/git/v4_0/models/git_import_request_parameters.py deleted file mode 100644 index f03b5016..00000000 --- a/vsts/vsts/git/v4_0/models/git_import_request_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_import_status_detail.py b/vsts/vsts/git/v4_0/models/git_import_status_detail.py deleted file mode 100644 index 00589c5d..00000000 --- a/vsts/vsts/git/v4_0/models/git_import_status_detail.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitImportStatusDetail(Model): - """GitImportStatusDetail. - - :param all_steps: - :type all_steps: list of str - :param current_step: - :type current_step: int - :param error_message: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_import_tfvc_source.py b/vsts/vsts/git/v4_0/models/git_import_tfvc_source.py deleted file mode 100644 index 57f185fc..00000000 --- a/vsts/vsts/git/v4_0/models/git_import_tfvc_source.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_item.py b/vsts/vsts/git/v4_0/models/git_item.py deleted file mode 100644 index 0af3c7a8..00000000 --- a/vsts/vsts/git/v4_0/models/git_item.py +++ /dev/null @@ -1,59 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .item_model import ItemModel - - -class GitItem(ItemModel): - """GitItem. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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_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_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_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 diff --git a/vsts/vsts/git/v4_0/models/git_item_descriptor.py b/vsts/vsts/git/v4_0/models/git_item_descriptor.py deleted file mode 100644 index 3995a564..00000000 --- a/vsts/vsts/git/v4_0/models/git_item_descriptor.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_item_request_data.py b/vsts/vsts/git/v4_0/models/git_item_request_data.py deleted file mode 100644 index 4e2f4341..00000000 --- a/vsts/vsts/git/v4_0/models/git_item_request_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_merge_origin_ref.py b/vsts/vsts/git/v4_0/models/git_merge_origin_ref.py deleted file mode 100644 index de5b7b63..00000000 --- a/vsts/vsts/git/v4_0/models/git_merge_origin_ref.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_object.py b/vsts/vsts/git/v4_0/models/git_object.py deleted file mode 100644 index 7521188c..00000000 --- a/vsts/vsts/git/v4_0/models/git_object.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitObject(Model): - """GitObject. - - :param object_id: Git object id - :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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request.py b/vsts/vsts/git/v4_0/models/git_pull_request.py deleted file mode 100644 index baafdfe2..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request.py +++ /dev/null @@ -1,153 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequest(Model): - """GitPullRequest. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param artifact_id: - :type artifact_id: str - :param auto_complete_set_by: - :type auto_complete_set_by: :class:`IdentityRef ` - :param closed_by: - :type closed_by: :class:`IdentityRef ` - :param closed_date: - :type closed_date: datetime - :param code_review_id: - :type code_review_id: int - :param commits: - :type commits: list of :class:`GitCommitRef ` - :param completion_options: - :type completion_options: :class:`GitPullRequestCompletionOptions ` - :param completion_queue_time: - :type completion_queue_time: datetime - :param created_by: - :type created_by: :class:`IdentityRef ` - :param creation_date: - :type creation_date: datetime - :param description: - :type description: str - :param fork_source: - :type fork_source: :class:`GitForkRef ` - :param labels: - :type labels: list of :class:`WebApiTagDefinition ` - :param last_merge_commit: - :type last_merge_commit: :class:`GitCommitRef ` - :param last_merge_source_commit: - :type last_merge_source_commit: :class:`GitCommitRef ` - :param last_merge_target_commit: - :type last_merge_target_commit: :class:`GitCommitRef ` - :param merge_failure_message: - :type merge_failure_message: str - :param merge_failure_type: - :type merge_failure_type: object - :param merge_id: - :type merge_id: str - :param merge_options: - :type merge_options: :class:`GitPullRequestMergeOptions ` - :param merge_status: - :type merge_status: object - :param pull_request_id: - :type pull_request_id: int - :param remote_url: - :type remote_url: str - :param repository: - :type repository: :class:`GitRepository ` - :param reviewers: - :type reviewers: list of :class:`IdentityRefWithVote ` - :param source_ref_name: - :type source_ref_name: str - :param status: - :type status: object - :param supports_iterations: - :type supports_iterations: bool - :param target_ref_name: - :type target_ref_name: str - :param title: - :type title: str - :param url: - :type url: str - :param work_item_refs: - :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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_change.py b/vsts/vsts/git/v4_0/models/git_pull_request_change.py deleted file mode 100644 index 65b85a40..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_change.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_change import GitChange - - -class GitPullRequestChange(GitChange): - """GitPullRequestChange. - - :param change_id: Id of the change within the group. For example, within the iteration - :type change_id: int - :param new_content_template: New Content template to be used - :type new_content_template: :class:`GitTemplate ` - :param original_path: Original path of item if different from current path - :type original_path: str - :param change_tracking_id: Id used to track files through multiple changes - :type change_tracking_id: int - """ - - _attribute_map = { - 'change_id': {'key': 'changeId', 'type': 'int'}, - 'new_content_template': {'key': 'newContentTemplate', 'type': 'GitTemplate'}, - 'original_path': {'key': 'originalPath', 'type': 'str'}, - 'change_tracking_id': {'key': 'changeTrackingId', 'type': 'int'} - } - - def __init__(self, change_id=None, new_content_template=None, original_path=None, change_tracking_id=None): - super(GitPullRequestChange, self).__init__(change_id=change_id, new_content_template=new_content_template, original_path=original_path) - self.change_tracking_id = change_tracking_id diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread.py b/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread.py deleted file mode 100644 index b6cc3580..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .comment_thread import CommentThread - - -class GitPullRequestCommentThread(CommentThread): - """GitPullRequestCommentThread. - - :param _links: - :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 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: A list of (optional) thread properties. - :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'}, - '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, 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, 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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread_context.py b/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread_context.py deleted file mode 100644 index 62f9c749..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_comment_thread_context.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: Specify comparing iteration Ids when a comment thread is added while comparing 2 iterations. - :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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_completion_options.py b/vsts/vsts/git/v4_0/models/git_pull_request_completion_options.py deleted file mode 100644 index 1d1c2f6c..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_completion_options.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestCompletionOptions(Model): - """GitPullRequestCompletionOptions. - - :param bypass_policy: - :type bypass_policy: bool - :param bypass_reason: - :type bypass_reason: str - :param delete_source_branch: - :type delete_source_branch: bool - :param merge_commit_message: - :type merge_commit_message: str - :param squash_merge: - :type squash_merge: bool - :param transition_work_items: - :type transition_work_items: 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'} - } - - def __init__(self, bypass_policy=None, bypass_reason=None, delete_source_branch=None, merge_commit_message=None, squash_merge=None, transition_work_items=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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_iteration.py b/vsts/vsts/git/v4_0/models/git_pull_request_iteration.py deleted file mode 100644 index 91c67038..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_iteration.py +++ /dev/null @@ -1,77 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestIteration(Model): - """GitPullRequestIteration. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param author: - :type author: :class:`IdentityRef ` - :param change_list: - :type change_list: list of :class:`GitPullRequestChange ` - :param commits: - :type commits: list of :class:`GitCommitRef ` - :param common_ref_commit: - :type common_ref_commit: :class:`GitCommitRef ` - :param created_date: - :type created_date: datetime - :param description: - :type description: str - :param has_more_commits: - :type has_more_commits: bool - :param id: - :type id: int - :param push: - :type push: :class:`GitPushRef ` - :param reason: - :type reason: object - :param source_ref_commit: - :type source_ref_commit: :class:`GitCommitRef ` - :param target_ref_commit: - :type target_ref_commit: :class:`GitCommitRef ` - :param updated_date: - :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'}, - '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, 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.push = push - self.reason = reason - self.source_ref_commit = source_ref_commit - self.target_ref_commit = target_ref_commit - self.updated_date = updated_date diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_iteration_changes.py b/vsts/vsts/git/v4_0/models/git_pull_request_iteration_changes.py deleted file mode 100644 index f815be81..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_iteration_changes.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestIterationChanges(Model): - """GitPullRequestIterationChanges. - - :param change_entries: - :type change_entries: list of :class:`GitPullRequestChange ` - :param next_skip: - :type next_skip: int - :param next_top: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_merge_options.py b/vsts/vsts/git/v4_0/models/git_pull_request_merge_options.py deleted file mode 100644 index f3fa8aa2..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_merge_options.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestMergeOptions(Model): - """GitPullRequestMergeOptions. - - :param disable_renames: - :type disable_renames: bool - """ - - _attribute_map = { - 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} - } - - def __init__(self, disable_renames=None): - super(GitPullRequestMergeOptions, self).__init__() - self.disable_renames = disable_renames diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_query.py b/vsts/vsts/git/v4_0/models/git_pull_request_query.py deleted file mode 100644 index 8210f2dd..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_query.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestQuery(Model): - """GitPullRequestQuery. - - :param queries: The query to perform - :type queries: list of :class:`GitPullRequestQueryInput ` - :param results: The results of the query - :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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_query_input.py b/vsts/vsts/git/v4_0/models/git_pull_request_query_input.py deleted file mode 100644 index 8e25bc93..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_query_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestQueryInput(Model): - """GitPullRequestQueryInput. - - :param items: The list 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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_search_criteria.py b/vsts/vsts/git/v4_0/models/git_pull_request_search_criteria.py deleted file mode 100644 index 79e0edb0..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_search_criteria.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestSearchCriteria(Model): - """GitPullRequestSearchCriteria. - - :param creator_id: - :type creator_id: str - :param include_links: Whether to include the _links field on the shallow references - :type include_links: bool - :param repository_id: - :type repository_id: str - :param reviewer_id: - :type reviewer_id: str - :param source_ref_name: - :type source_ref_name: str - :param source_repository_id: - :type source_repository_id: str - :param status: - :type status: object - :param target_ref_name: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_pull_request_status.py b/vsts/vsts/git/v4_0/models/git_pull_request_status.py deleted file mode 100644 index 72b44879..00000000 --- a/vsts/vsts/git/v4_0/models/git_pull_request_status.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_status import GitStatus - - -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 - """ - - _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'} - } - - 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): - 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 diff --git a/vsts/vsts/git/v4_0/models/git_push.py b/vsts/vsts/git/v4_0/models/git_push.py deleted file mode 100644 index 5eba60c9..00000000 --- a/vsts/vsts/git/v4_0/models/git_push.py +++ /dev/null @@ -1,51 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_push_ref import GitPushRef - - -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 diff --git a/vsts/vsts/git/v4_0/models/git_push_ref.py b/vsts/vsts/git/v4_0/models/git_push_ref.py deleted file mode 100644 index 39019790..00000000 --- a/vsts/vsts/git/v4_0/models/git_push_ref.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_push_search_criteria.py b/vsts/vsts/git/v4_0/models/git_push_search_criteria.py deleted file mode 100644 index db9526a5..00000000 --- a/vsts/vsts/git/v4_0/models/git_push_search_criteria.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_query_branch_stats_criteria.py b/vsts/vsts/git/v4_0/models/git_query_branch_stats_criteria.py deleted file mode 100644 index eabfdfdd..00000000 --- a/vsts/vsts/git/v4_0/models/git_query_branch_stats_criteria.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_query_commits_criteria.py b/vsts/vsts/git/v4_0/models/git_query_commits_criteria.py deleted file mode 100644 index 7f3a5a17..00000000 --- a/vsts/vsts/git/v4_0/models/git_query_commits_criteria.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: If provided, the earliest commit in the graph to search - :type compare_version: :class:`GitVersionDescriptor ` - :param exclude_deletes: If true, don't include delete history entries - :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. - :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_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_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_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_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 diff --git a/vsts/vsts/git/v4_0/models/git_ref.py b/vsts/vsts/git/v4_0/models/git_ref.py deleted file mode 100644 index 2d4b53d6..00000000 --- a/vsts/vsts/git/v4_0/models/git_ref.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitRef(Model): - """GitRef. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_0/models/git_ref_favorite.py b/vsts/vsts/git/v4_0/models/git_ref_favorite.py deleted file mode 100644 index d1f2d359..00000000 --- a/vsts/vsts/git/v4_0/models/git_ref_favorite.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_ref_update.py b/vsts/vsts/git/v4_0/models/git_ref_update.py deleted file mode 100644 index 6c10c600..00000000 --- a/vsts/vsts/git/v4_0/models/git_ref_update.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_ref_update_result.py b/vsts/vsts/git/v4_0/models/git_ref_update_result.py deleted file mode 100644 index d4b42d8d..00000000 --- a/vsts/vsts/git/v4_0/models/git_ref_update_result.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_repository.py b/vsts/vsts/git/v4_0/models/git_repository.py deleted file mode 100644 index ba0da3b5..00000000 --- a/vsts/vsts/git/v4_0/models/git_repository.py +++ /dev/null @@ -1,73 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: :class:`ReferenceLinks ` - :param created_by_forking: True if the repository was created as a fork - :type created_by_forking: bool - :param default_branch: - :type default_branch: str - :param fork_options: If set, options for creating this repo as a fork of another one. If unset, this repo is unrelated to any existing forks. - :type fork_options: :class:`GitForkSyncRequestParameters ` - :param fork_parent: Only set when querying repositories. If set, the "parent" fork of this repository. - :type fork_parent: :class:`GlobalGitRepositoryKey ` - :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 url: - :type url: str - :param valid_remote_urls: - :type valid_remote_urls: list of str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'created_by_forking': {'key': 'createdByForking', 'type': 'bool'}, - 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, - 'fork_options': {'key': 'forkOptions', 'type': 'GitForkSyncRequestParameters'}, - 'fork_parent': {'key': 'forkParent', 'type': 'GlobalGitRepositoryKey'}, - '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'}, - 'url': {'key': 'url', 'type': 'str'}, - 'valid_remote_urls': {'key': 'validRemoteUrls', 'type': '[str]'} - } - - def __init__(self, _links=None, created_by_forking=None, default_branch=None, fork_options=None, fork_parent=None, id=None, is_fork=None, name=None, parent_repository=None, project=None, remote_url=None, url=None, valid_remote_urls=None): - super(GitRepository, self).__init__() - self._links = _links - self.created_by_forking = created_by_forking - self.default_branch = default_branch - self.fork_options = fork_options - self.fork_parent = fork_parent - 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.url = url - self.valid_remote_urls = valid_remote_urls diff --git a/vsts/vsts/git/v4_0/models/git_repository_create_options.py b/vsts/vsts/git/v4_0/models/git_repository_create_options.py deleted file mode 100644 index d27f3971..00000000 --- a/vsts/vsts/git/v4_0/models/git_repository_create_options.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitRepositoryCreateOptions(Model): - """GitRepositoryCreateOptions. - - :param fork_options: If set, options for creating this repo as a fork of another one. If unset, this repo is unrelated to any existing forks. - :type fork_options: :class:`GitForkSyncRequestParameters ` - :param name: - :type name: str - :param parent_repository: - :type parent_repository: :class:`GitRepositoryRef ` - :param project: - :type project: :class:`TeamProjectReference ` - """ - - _attribute_map = { - 'fork_options': {'key': 'forkOptions', 'type': 'GitForkSyncRequestParameters'}, - 'name': {'key': 'name', 'type': 'str'}, - 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, - 'project': {'key': 'project', 'type': 'TeamProjectReference'} - } - - def __init__(self, fork_options=None, name=None, parent_repository=None, project=None): - super(GitRepositoryCreateOptions, self).__init__() - self.fork_options = fork_options - self.name = name - self.parent_repository = parent_repository - self.project = project diff --git a/vsts/vsts/git/v4_0/models/git_repository_ref.py b/vsts/vsts/git/v4_0/models/git_repository_ref.py deleted file mode 100644 index 9eb0911b..00000000 --- a/vsts/vsts/git/v4_0/models/git_repository_ref.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitRepositoryRef(Model): - """GitRepositoryRef. - - :param collection: Team Project Collection where this Fork resides - :type collection: :class:`TeamProjectCollectionReference ` - :param id: - :type id: str - :param name: - :type name: str - :param project: - :type project: :class:`TeamProjectReference ` - :param remote_url: - :type remote_url: str - :param url: - :type url: str - """ - - _attribute_map = { - 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'TeamProjectReference'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, collection=None, id=None, name=None, project=None, remote_url=None, url=None): - super(GitRepositoryRef, self).__init__() - self.collection = collection - self.id = id - self.name = name - self.project = project - self.remote_url = remote_url - self.url = url diff --git a/vsts/vsts/git/v4_0/models/git_repository_stats.py b/vsts/vsts/git/v4_0/models/git_repository_stats.py deleted file mode 100644 index 0ea95e41..00000000 --- a/vsts/vsts/git/v4_0/models/git_repository_stats.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_revert.py b/vsts/vsts/git/v4_0/models/git_revert.py deleted file mode 100644 index 8d3c0cc6..00000000 --- a/vsts/vsts/git/v4_0/models/git_revert.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_async_ref_operation import GitAsyncRefOperation - - -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: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_status.py b/vsts/vsts/git/v4_0/models/git_status.py deleted file mode 100644 index 0d283da7..00000000 --- a/vsts/vsts/git/v4_0/models/git_status.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_status_context.py b/vsts/vsts/git/v4_0/models/git_status_context.py deleted file mode 100644 index cf40205f..00000000 --- a/vsts/vsts/git/v4_0/models/git_status_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_suggestion.py b/vsts/vsts/git/v4_0/models/git_suggestion.py deleted file mode 100644 index 8ef8ed46..00000000 --- a/vsts/vsts/git/v4_0/models/git_suggestion.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitSuggestion(Model): - """GitSuggestion. - - :param properties: - :type properties: dict - :param type: - :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 diff --git a/vsts/vsts/git/v4_0/models/git_target_version_descriptor.py b/vsts/vsts/git/v4_0/models/git_target_version_descriptor.py deleted file mode 100644 index 61bc2e33..00000000 --- a/vsts/vsts/git/v4_0/models/git_target_version_descriptor.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_version_descriptor import GitVersionDescriptor - - -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 diff --git a/vsts/vsts/git/v4_0/models/git_template.py b/vsts/vsts/git/v4_0/models/git_template.py deleted file mode 100644 index fbe26c8a..00000000 --- a/vsts/vsts/git/v4_0/models/git_template.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_tree_diff.py b/vsts/vsts/git/v4_0/models/git_tree_diff.py deleted file mode 100644 index ece6ac5b..00000000 --- a/vsts/vsts/git/v4_0/models/git_tree_diff.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_tree_diff_entry.py b/vsts/vsts/git/v4_0/models/git_tree_diff_entry.py deleted file mode 100644 index b75431e3..00000000 --- a/vsts/vsts/git/v4_0/models/git_tree_diff_entry.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_tree_diff_response.py b/vsts/vsts/git/v4_0/models/git_tree_diff_response.py deleted file mode 100644 index e8cd9a18..00000000 --- a/vsts/vsts/git/v4_0/models/git_tree_diff_response.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_tree_entry_ref.py b/vsts/vsts/git/v4_0/models/git_tree_entry_ref.py deleted file mode 100644 index 0440423c..00000000 --- a/vsts/vsts/git/v4_0/models/git_tree_entry_ref.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_tree_ref.py b/vsts/vsts/git/v4_0/models/git_tree_ref.py deleted file mode 100644 index b6d0612c..00000000 --- a/vsts/vsts/git/v4_0/models/git_tree_ref.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/git_user_date.py b/vsts/vsts/git/v4_0/models/git_user_date.py deleted file mode 100644 index 9199afd0..00000000 --- a/vsts/vsts/git/v4_0/models/git_user_date.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitUserDate(Model): - """GitUserDate. - - :param date: - :type date: datetime - :param email: - :type email: str - :param name: - :type name: str - """ - - _attribute_map = { - 'date': {'key': 'date', 'type': 'iso-8601'}, - 'email': {'key': 'email', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, date=None, email=None, name=None): - super(GitUserDate, self).__init__() - self.date = date - self.email = email - self.name = name diff --git a/vsts/vsts/git/v4_0/models/git_version_descriptor.py b/vsts/vsts/git/v4_0/models/git_version_descriptor.py deleted file mode 100644 index 919fc237..00000000 --- a/vsts/vsts/git/v4_0/models/git_version_descriptor.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/global_git_repository_key.py b/vsts/vsts/git/v4_0/models/global_git_repository_key.py deleted file mode 100644 index 8e466ace..00000000 --- a/vsts/vsts/git/v4_0/models/global_git_repository_key.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GlobalGitRepositoryKey(Model): - """GlobalGitRepositoryKey. - - :param collection_id: - :type collection_id: str - :param project_id: - :type project_id: str - :param repository_id: - :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 diff --git a/vsts/vsts/git/v4_0/models/identity_ref.py b/vsts/vsts/git/v4_0/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/git/v4_0/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/git/v4_0/models/identity_ref_with_vote.py b/vsts/vsts/git/v4_0/models/identity_ref_with_vote.py deleted file mode 100644 index e990e4cc..00000000 --- a/vsts/vsts/git/v4_0/models/identity_ref_with_vote.py +++ /dev/null @@ -1,67 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef - - -class IdentityRefWithVote(IdentityRef): - """IdentityRefWithVote. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - :param is_required: - :type is_required: bool - :param reviewer_url: - :type reviewer_url: str - :param vote: - :type vote: int - :param voted_for: - :type voted_for: list of :class:`IdentityRefWithVote ` - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', '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, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, is_required=None, reviewer_url=None, vote=None, voted_for=None): - super(IdentityRefWithVote, self).__init__(directory_alias=directory_alias, display_name=display_name, id=id, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) - self.is_required = is_required - self.reviewer_url = reviewer_url - self.vote = vote - self.voted_for = voted_for diff --git a/vsts/vsts/git/v4_0/models/import_repository_validation.py b/vsts/vsts/git/v4_0/models/import_repository_validation.py deleted file mode 100644 index 82d46ab6..00000000 --- a/vsts/vsts/git/v4_0/models/import_repository_validation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/item_model.py b/vsts/vsts/git/v4_0/models/item_model.py deleted file mode 100644 index 447b8b3d..00000000 --- a/vsts/vsts/git/v4_0/models/item_model.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ItemModel(Model): - """ItemModel. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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_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_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): - super(ItemModel, self).__init__() - self._links = _links - self.content_metadata = content_metadata - self.is_folder = is_folder - self.is_sym_link = is_sym_link - self.path = path - self.url = url diff --git a/vsts/vsts/git/v4_0/models/reference_links.py b/vsts/vsts/git/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/git/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/resource_ref.py b/vsts/vsts/git/v4_0/models/resource_ref.py deleted file mode 100644 index 903e57ee..00000000 --- a/vsts/vsts/git/v4_0/models/resource_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/share_notification_context.py b/vsts/vsts/git/v4_0/models/share_notification_context.py deleted file mode 100644 index d71ee9e9..00000000 --- a/vsts/vsts/git/v4_0/models/share_notification_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/source_to_target_ref.py b/vsts/vsts/git/v4_0/models/source_to_target_ref.py deleted file mode 100644 index f2364a3f..00000000 --- a/vsts/vsts/git/v4_0/models/source_to_target_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/team_project_collection_reference.py b/vsts/vsts/git/v4_0/models/team_project_collection_reference.py deleted file mode 100644 index 6f4a596a..00000000 --- a/vsts/vsts/git/v4_0/models/team_project_collection_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/team_project_reference.py b/vsts/vsts/git/v4_0/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/git/v4_0/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/git/v4_0/models/vsts_info.py b/vsts/vsts/git/v4_0/models/vsts_info.py deleted file mode 100644 index d0a8d627..00000000 --- a/vsts/vsts/git/v4_0/models/vsts_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_0/models/web_api_create_tag_request_data.py b/vsts/vsts/git/v4_0/models/web_api_create_tag_request_data.py deleted file mode 100644 index 0e05b51f..00000000 --- a/vsts/vsts/git/v4_0/models/web_api_create_tag_request_data.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WebApiCreateTagRequestData(Model): - """WebApiCreateTagRequestData. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, name=None): - super(WebApiCreateTagRequestData, self).__init__() - self.name = name diff --git a/vsts/vsts/git/v4_0/models/web_api_tag_definition.py b/vsts/vsts/git/v4_0/models/web_api_tag_definition.py deleted file mode 100644 index 8abca484..00000000 --- a/vsts/vsts/git/v4_0/models/web_api_tag_definition.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WebApiTagDefinition(Model): - """WebApiTagDefinition. - - :param active: - :type active: bool - :param id: - :type id: str - :param name: - :type name: str - :param url: - :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 diff --git a/vsts/vsts/git/v4_1/__init__.py b/vsts/vsts/git/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/git/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/git/v4_1/git_client.py b/vsts/vsts/git/v4_1/git_client.py deleted file mode 100644 index 7b739675..00000000 --- a/vsts/vsts/git/v4_1/git_client.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - - -from msrest.pipeline 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): - request = ClientRequest() - request.url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') - request.method = 'GET' - headers = {'Accept': 'application/json'} - if self._suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - response = self._send_request(request, headers) - return self._deserialize('VstsInfo', response) - diff --git a/vsts/vsts/git/v4_1/git_client_base.py b/vsts/vsts/git/v4_1/git_client_base.py deleted file mode 100644 index bdec765b..00000000 --- a/vsts/vsts/git/v4_1/git_client_base.py +++ /dev/null @@ -1,2994 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class GitClientBase(VssClient): - """Git - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.1-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='4.1-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): - """GetBlob. - [Preview API] 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. - :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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.1-preview.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): - """GetBlobContent. - [Preview API] 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. - :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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_blobs_zip(self, blob_ids, repository_id, project=None, filename=None): - """GetBlobsZip. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('object', response) - - def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_name=None): - """GetBlobZip. - [Preview API] 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. - :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') - response = self._send(http_method='GET', - location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_branch(self, repository_id, name, project=None, base_version_descriptor=None): - """GetBranch. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitBranchStats]', response) - - def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): - """GetChanges. - [Preview API] 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='4.1-preview.1', - 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='4.1-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='4.1-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='4.1-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. - [Preview API] Get a list of differences between two 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: - :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: Base item version. Compared against target item version to find changes in between. - :param :class:` ` target_version_descriptor: Target item version to use for finding the diffs. Compared against base item version to find changes in between. - :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['baseVersionDescriptor.baseVersionType'] = base_version_descriptor.base_version_type - if base_version_descriptor.base_version is not None: - query_parameters['baseVersionDescriptor.baseVersion'] = base_version_descriptor.base_version - if base_version_descriptor.base_version_options is not None: - query_parameters['baseVersionDescriptor.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['targetVersionDescriptor.targetVersionType'] = target_version_descriptor.target_version_type - if target_version_descriptor.target_version is not None: - query_parameters['targetVersionDescriptor.targetVersion'] = target_version_descriptor.target_version - if target_version_descriptor.target_version_options is not None: - query_parameters['targetVersionDescriptor.targetVersionOptions'] = target_version_descriptor.target_version_options - response = self._send(http_method='GET', - location_id='615588d5-c0c7-4b88-88f8-e625306446e8', - version='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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['search_criteria.item_version.VersionType'] = search_criteria.item_version.version_type - if search_criteria.item_version.version is not None: - query_parameters['search_criteria.item_version.Version'] = search_criteria.item_version.version - if search_criteria.item_version.version_options is not None: - query_parameters['search_criteria.item_version.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['search_criteria.compare_version.VersionType'] = search_criteria.compare_version.version_type - if search_criteria.compare_version.version is not None: - query_parameters['search_criteria.compare_version.Version'] = search_criteria.compare_version.version - if search_criteria.compare_version.version_options is not None: - query_parameters['search_criteria.compare_version.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.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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitCommitRef]', response) - - def get_push_commits(self, repository_id, push_id, project=None, top=None, skip=None, include_links=None): - """GetPushCommits. - [Preview API] 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: - :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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitCommitRef]', response) - - def get_commits_batch(self, search_criteria, repository_id, project=None, skip=None, top=None, include_statuses=None): - """GetCommitsBatch. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitDeletedRepository]', 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRepositoryRef]', 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitForkSyncRequest]', 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitImportRequest]', 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='4.1-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): - """GetItem. - [Preview API] 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 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 VersionControlRecursionType 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. - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.1-preview.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): - """GetItemContent. - [Preview API] 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 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 VersionControlRecursionType 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. - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - 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. - [Preview API] 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 Id of the repository. - :param str project: Project ID or project name - :param str scope_path: The path scope. The default is null. - :param VersionControlRecursionType 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, 'VersionControlRecursionType') - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitItem]', 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): - """GetItemText. - [Preview API] 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 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 VersionControlRecursionType 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. - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - 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): - """GetItemZip. - [Preview API] 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 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 VersionControlRecursionType 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. - :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, 'VersionControlRecursionType') - 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 - response = self._send(http_method='GET', - location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_items_batch(self, request_data, repository_id, project=None): - """GetItemsBatch. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[[GitItem]]', 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitCommitRef]', response) - - def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None): - """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') - content = self._serialize.body(upload_stream, 'object') - response = self._send(http_method='POST', - location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', - version='4.1-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='4.1-preview.1', - route_values=route_values) - - def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None): - """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='4.1-preview.1', - route_values=route_values) - return self._deserialize('object', response) - - 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[Attachment]', response) - - def get_attachment_zip(self, file_name, repository_id, pull_request_id, project=None): - """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='4.1-preview.1', - route_values=route_values) - return self._deserialize('object', response) - - 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRef]', response) - - def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None): - """GetPullRequestIterationCommits. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitCommitRef]', response) - - def get_pull_request_commits(self, repository_id, pull_request_id, project=None): - """GetPullRequestCommits. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitCommitRef]', 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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequestIteration]', 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='4.1-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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitPullRequestStatus]', 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='4.1-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='4.1-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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WebApiTagDefinition]', 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='4.1-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='4.1-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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[IdentityRefWithVote]', response) - - def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): - """DeletePullRequestReviewer. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - - def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): - """GetPullRequestReviewer. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('IdentityRefWithVote', response) - - def get_pull_request_reviewers(self, repository_id, pull_request_id, project=None): - """GetPullRequestReviewers. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IdentityRefWithVote]', response) - - def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): - """UpdatePullRequestReviewers. - [Preview API] Reset the votes of multiple reviewers on a pull request. - :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='4.1-preview.1', - route_values=route_values, - content=content) - - def get_pull_request_by_id(self, pull_request_id): - """GetPullRequestById. - [Preview API] Retrieve a pull request. - :param int pull_request_id: The ID of the pull request to retrieve. - :rtype: :class:` ` - """ - route_values = {} - 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequest]', response) - - def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None): - """CreatePullRequest. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequest]', response) - - def update_pull_request(self, git_pull_request_to_update, repository_id, pull_request_id, project=None): - """UpdatePullRequest. - [Preview API] 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='4.1-preview.1', - 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='4.1-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='4.1-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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitPullRequestStatus]', 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='4.1-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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - - def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): - """GetComment. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('Comment', response) - - def get_comments(self, repository_id, pull_request_id, thread_id, project=None): - """GetComments. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[Comment]', response) - - def update_comment(self, comment, repository_id, pull_request_id, thread_id, comment_id, project=None): - """UpdateComment. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPullRequestCommentThread]', response) - - def update_thread(self, comment_thread, repository_id, pull_request_id, thread_id, project=None): - """UpdateThread. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('GitPullRequestCommentThread', response) - - def get_pull_request_work_items(self, repository_id, pull_request_id, project=None): - """GetPullRequestWorkItems. - [Preview API] 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: [AssociatedWorkItem] - """ - 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[AssociatedWorkItem]', response) - - def create_push(self, push, repository_id, project=None): - """CreatePush. - [Preview API] 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='4.1-preview.2', - 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. - [Preview API] 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='4.1-preview.2', - 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. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitPush]', response) - - def get_refs(self, repository_id, project=None, filter=None, include_links=None, latest_statuses_only=None): - """GetRefs. - [Preview API] 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. - :param bool include_links: [optional] Specifies if referenceLinks should be included in the result. default is false. - :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. - :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 latest_statuses_only is not None: - query_parameters['latestStatusesOnly'] = self._serialize.query('latest_statuses_only', latest_statuses_only, 'bool') - response = self._send(http_method='GET', - location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRef]', response) - - def update_ref(self, new_ref_info, repository_id, filter, project=None, project_id=None): - """UpdateRef. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[GitRefUpdateResult]', 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='4.1-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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRefFavorite]', response) - - def create_repository(self, git_repository_to_create, project=None, source_ref=None): - """CreateRepository. - [Preview API] Create a git repository in a team project. - :param :class:` ` git_repository_to_create: Specify the repo name, team project and/or parent repository - :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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - - def get_repositories(self, project=None, include_links=None, include_all_urls=None, include_hidden=None): - """GetRepositories. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitRepository]', response) - - def get_repository(self, repository_id, project=None, include_parent=None): - """GetRepository. - [Preview API] Retrieve a git repository. - :param str repository_id: The name or ID of the repository. - :param str project: Project ID or project name - :param bool include_parent: [optional] True to include parent repository. The default value 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 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - 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='4.1-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='4.1-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='4.1-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. - [Preview API] 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='4.1-preview.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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[GitStatus]', 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[GitSuggestion]', response) - - def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None): - """GetTree. - [Preview API] 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='4.1-preview.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): - """GetTreeZip. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - diff --git a/vsts/vsts/git/v4_1/models/__init__.py b/vsts/vsts/git/v4_1/models/__init__.py deleted file mode 100644 index 4ec1fdab..00000000 --- a/vsts/vsts/git/v4_1/models/__init__.py +++ /dev/null @@ -1,203 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .associated_work_item import AssociatedWorkItem -from .attachment import Attachment -from .change import Change -from .change_count_dictionary import ChangeCountDictionary -from .comment import Comment -from .comment_iteration_context import CommentIterationContext -from .comment_position import CommentPosition -from .comment_thread import CommentThread -from .comment_thread_context import CommentThreadContext -from .comment_tracking_criteria import CommentTrackingCriteria -from .file_content_metadata import FileContentMetadata -from .git_annotated_tag import GitAnnotatedTag -from .git_async_ref_operation import GitAsyncRefOperation -from .git_async_ref_operation_detail import GitAsyncRefOperationDetail -from .git_async_ref_operation_parameters import GitAsyncRefOperationParameters -from .git_async_ref_operation_source import GitAsyncRefOperationSource -from .git_base_version_descriptor import GitBaseVersionDescriptor -from .git_blob_ref import GitBlobRef -from .git_branch_stats import GitBranchStats -from .git_change import GitChange -from .git_cherry_pick import GitCherryPick -from .git_commit import GitCommit -from .git_commit_changes import GitCommitChanges -from .git_commit_diffs import GitCommitDiffs -from .git_commit_ref import GitCommitRef -from .git_conflict import GitConflict -from .git_conflict_update_result import GitConflictUpdateResult -from .git_deleted_repository import GitDeletedRepository -from .git_file_paths_collection import GitFilePathsCollection -from .git_fork_operation_status_detail import GitForkOperationStatusDetail -from .git_fork_ref import GitForkRef -from .git_fork_sync_request import GitForkSyncRequest -from .git_fork_sync_request_parameters import GitForkSyncRequestParameters -from .git_import_git_source import GitImportGitSource -from .git_import_request import GitImportRequest -from .git_import_request_parameters import GitImportRequestParameters -from .git_import_status_detail import GitImportStatusDetail -from .git_import_tfvc_source import GitImportTfvcSource -from .git_item import GitItem -from .git_item_descriptor import GitItemDescriptor -from .git_item_request_data import GitItemRequestData -from .git_merge_origin_ref import GitMergeOriginRef -from .git_object import GitObject -from .git_pull_request import GitPullRequest -from .git_pull_request_change import GitPullRequestChange -from .git_pull_request_comment_thread import GitPullRequestCommentThread -from .git_pull_request_comment_thread_context import GitPullRequestCommentThreadContext -from .git_pull_request_completion_options import GitPullRequestCompletionOptions -from .git_pull_request_iteration import GitPullRequestIteration -from .git_pull_request_iteration_changes import GitPullRequestIterationChanges -from .git_pull_request_merge_options import GitPullRequestMergeOptions -from .git_pull_request_query import GitPullRequestQuery -from .git_pull_request_query_input import GitPullRequestQueryInput -from .git_pull_request_search_criteria import GitPullRequestSearchCriteria -from .git_pull_request_status import GitPullRequestStatus -from .git_push import GitPush -from .git_push_ref import GitPushRef -from .git_push_search_criteria import GitPushSearchCriteria -from .git_query_branch_stats_criteria import GitQueryBranchStatsCriteria -from .git_query_commits_criteria import GitQueryCommitsCriteria -from .git_ref import GitRef -from .git_ref_favorite import GitRefFavorite -from .git_ref_update import GitRefUpdate -from .git_ref_update_result import GitRefUpdateResult -from .git_repository import GitRepository -from .git_repository_create_options import GitRepositoryCreateOptions -from .git_repository_ref import GitRepositoryRef -from .git_repository_stats import GitRepositoryStats -from .git_revert import GitRevert -from .git_status import GitStatus -from .git_status_context import GitStatusContext -from .git_suggestion import GitSuggestion -from .git_target_version_descriptor import GitTargetVersionDescriptor -from .git_template import GitTemplate -from .git_tree_diff import GitTreeDiff -from .git_tree_diff_entry import GitTreeDiffEntry -from .git_tree_diff_response import GitTreeDiffResponse -from .git_tree_entry_ref import GitTreeEntryRef -from .git_tree_ref import GitTreeRef -from .git_user_date import GitUserDate -from .git_version_descriptor import GitVersionDescriptor -from .global_git_repository_key import GlobalGitRepositoryKey -from .identity_ref import IdentityRef -from .identity_ref_with_vote import IdentityRefWithVote -from .import_repository_validation import ImportRepositoryValidation -from .item_model import ItemModel -from .json_patch_operation import JsonPatchOperation -from .reference_links import ReferenceLinks -from .resource_ref import ResourceRef -from .share_notification_context import ShareNotificationContext -from .source_to_target_ref import SourceToTargetRef -from .team_project_collection_reference import TeamProjectCollectionReference -from .team_project_reference import TeamProjectReference -from .vsts_info import VstsInfo -from .web_api_create_tag_request_data import WebApiCreateTagRequestData -from .web_api_tag_definition import WebApiTagDefinition - -__all__ = [ - 'AssociatedWorkItem', - 'Attachment', - 'Change', - 'ChangeCountDictionary', - 'Comment', - 'CommentIterationContext', - 'CommentPosition', - 'CommentThread', - 'CommentThreadContext', - 'CommentTrackingCriteria', - 'FileContentMetadata', - 'GitAnnotatedTag', - 'GitAsyncRefOperation', - 'GitAsyncRefOperationDetail', - 'GitAsyncRefOperationParameters', - 'GitAsyncRefOperationSource', - 'GitBaseVersionDescriptor', - 'GitBlobRef', - 'GitBranchStats', - 'GitChange', - 'GitCherryPick', - 'GitCommit', - 'GitCommitChanges', - 'GitCommitDiffs', - 'GitCommitRef', - 'GitConflict', - 'GitConflictUpdateResult', - 'GitDeletedRepository', - 'GitFilePathsCollection', - 'GitForkOperationStatusDetail', - 'GitForkRef', - 'GitForkSyncRequest', - 'GitForkSyncRequestParameters', - 'GitImportGitSource', - 'GitImportRequest', - 'GitImportRequestParameters', - 'GitImportStatusDetail', - 'GitImportTfvcSource', - 'GitItem', - 'GitItemDescriptor', - 'GitItemRequestData', - 'GitMergeOriginRef', - 'GitObject', - 'GitPullRequest', - 'GitPullRequestChange', - 'GitPullRequestCommentThread', - 'GitPullRequestCommentThreadContext', - 'GitPullRequestCompletionOptions', - 'GitPullRequestIteration', - 'GitPullRequestIterationChanges', - 'GitPullRequestMergeOptions', - 'GitPullRequestQuery', - 'GitPullRequestQueryInput', - 'GitPullRequestSearchCriteria', - 'GitPullRequestStatus', - 'GitPush', - 'GitPushRef', - 'GitPushSearchCriteria', - 'GitQueryBranchStatsCriteria', - 'GitQueryCommitsCriteria', - 'GitRef', - 'GitRefFavorite', - 'GitRefUpdate', - 'GitRefUpdateResult', - 'GitRepository', - 'GitRepositoryCreateOptions', - 'GitRepositoryRef', - 'GitRepositoryStats', - 'GitRevert', - 'GitStatus', - 'GitStatusContext', - 'GitSuggestion', - 'GitTargetVersionDescriptor', - 'GitTemplate', - 'GitTreeDiff', - 'GitTreeDiffEntry', - 'GitTreeDiffResponse', - 'GitTreeEntryRef', - 'GitTreeRef', - 'GitUserDate', - 'GitVersionDescriptor', - 'GlobalGitRepositoryKey', - 'IdentityRef', - 'IdentityRefWithVote', - 'ImportRepositoryValidation', - 'ItemModel', - 'JsonPatchOperation', - 'ReferenceLinks', - 'ResourceRef', - 'ShareNotificationContext', - 'SourceToTargetRef', - 'TeamProjectCollectionReference', - 'TeamProjectReference', - 'VstsInfo', - 'WebApiCreateTagRequestData', - 'WebApiTagDefinition', -] diff --git a/vsts/vsts/git/v4_1/models/associated_work_item.py b/vsts/vsts/git/v4_1/models/associated_work_item.py deleted file mode 100644 index 1f491dad..00000000 --- a/vsts/vsts/git/v4_1/models/associated_work_item.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/git/v4_1/models/attachment.py b/vsts/vsts/git/v4_1/models/attachment.py deleted file mode 100644 index 1bc88d51..00000000 --- a/vsts/vsts/git/v4_1/models/attachment.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/git/v4_1/models/change.py b/vsts/vsts/git/v4_1/models/change.py deleted file mode 100644 index 6a5921f0..00000000 --- a/vsts/vsts/git/v4_1/models/change.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/change_count_dictionary.py b/vsts/vsts/git/v4_1/models/change_count_dictionary.py deleted file mode 100644 index 1c8e29bc..00000000 --- a/vsts/vsts/git/v4_1/models/change_count_dictionary.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ChangeCountDictionary(dict): - """ChangeCountDictionary. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ChangeCountDictionary, self).__init__() diff --git a/vsts/vsts/git/v4_1/models/comment.py b/vsts/vsts/git/v4_1/models/comment.py deleted file mode 100644 index a5546dc0..00000000 --- a/vsts/vsts/git/v4_1/models/comment.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/comment_iteration_context.py b/vsts/vsts/git/v4_1/models/comment_iteration_context.py deleted file mode 100644 index 39ce2354..00000000 --- a/vsts/vsts/git/v4_1/models/comment_iteration_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/comment_position.py b/vsts/vsts/git/v4_1/models/comment_position.py deleted file mode 100644 index 4e1dead2..00000000 --- a/vsts/vsts/git/v4_1/models/comment_position.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/comment_thread.py b/vsts/vsts/git/v4_1/models/comment_thread.py deleted file mode 100644 index 9cb6d0f4..00000000 --- a/vsts/vsts/git/v4_1/models/comment_thread.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_1/models/comment_thread_context.py b/vsts/vsts/git/v4_1/models/comment_thread_context.py deleted file mode 100644 index ab02bda7..00000000 --- a/vsts/vsts/git/v4_1/models/comment_thread_context.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/comment_tracking_criteria.py b/vsts/vsts/git/v4_1/models/comment_tracking_criteria.py deleted file mode 100644 index f6adc4e0..00000000 --- a/vsts/vsts/git/v4_1/models/comment_tracking_criteria.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/file_content_metadata.py b/vsts/vsts/git/v4_1/models/file_content_metadata.py deleted file mode 100644 index d2d6667d..00000000 --- a/vsts/vsts/git/v4_1/models/file_content_metadata.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_annotated_tag.py b/vsts/vsts/git/v4_1/models/git_annotated_tag.py deleted file mode 100644 index 22bc01ae..00000000 --- a/vsts/vsts/git/v4_1/models/git_annotated_tag.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_async_ref_operation.py b/vsts/vsts/git/v4_1/models/git_async_ref_operation.py deleted file mode 100644 index 717e9c30..00000000 --- a/vsts/vsts/git/v4_1/models/git_async_ref_operation.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_async_ref_operation_detail.py b/vsts/vsts/git/v4_1/models/git_async_ref_operation_detail.py deleted file mode 100644 index 227b9c74..00000000 --- a/vsts/vsts/git/v4_1/models/git_async_ref_operation_detail.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: number - :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': 'number'}, - '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 diff --git a/vsts/vsts/git/v4_1/models/git_async_ref_operation_parameters.py b/vsts/vsts/git/v4_1/models/git_async_ref_operation_parameters.py deleted file mode 100644 index 5ef419b1..00000000 --- a/vsts/vsts/git/v4_1/models/git_async_ref_operation_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_async_ref_operation_source.py b/vsts/vsts/git/v4_1/models/git_async_ref_operation_source.py deleted file mode 100644 index 202f7e5e..00000000 --- a/vsts/vsts/git/v4_1/models/git_async_ref_operation_source.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_base_version_descriptor.py b/vsts/vsts/git/v4_1/models/git_base_version_descriptor.py deleted file mode 100644 index d922e638..00000000 --- a/vsts/vsts/git/v4_1/models/git_base_version_descriptor.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_version_descriptor import GitVersionDescriptor - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_blob_ref.py b/vsts/vsts/git/v4_1/models/git_blob_ref.py deleted file mode 100644 index aa965e38..00000000 --- a/vsts/vsts/git/v4_1/models/git_blob_ref.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_branch_stats.py b/vsts/vsts/git/v4_1/models/git_branch_stats.py deleted file mode 100644 index f8a6ab31..00000000 --- a/vsts/vsts/git/v4_1/models/git_branch_stats.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_change.py b/vsts/vsts/git/v4_1/models/git_change.py deleted file mode 100644 index aa3c716c..00000000 --- a/vsts/vsts/git/v4_1/models/git_change.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .change import Change - - -class GitChange(Change): - """GitChange. - - :param change_id: ID of the change within the group of changes. - :type change_id: int - :param new_content_template: New Content template to be used when pushing new changes. - :type new_content_template: :class:`GitTemplate ` - :param original_path: Original path of item if different from current path. - :type original_path: str - """ - - _attribute_map = { - 'change_id': {'key': 'changeId', 'type': 'int'}, - 'new_content_template': {'key': 'newContentTemplate', 'type': 'GitTemplate'}, - 'original_path': {'key': 'originalPath', 'type': 'str'} - } - - def __init__(self, change_id=None, new_content_template=None, original_path=None): - super(GitChange, self).__init__() - self.change_id = change_id - self.new_content_template = new_content_template - self.original_path = original_path diff --git a/vsts/vsts/git/v4_1/models/git_cherry_pick.py b/vsts/vsts/git/v4_1/models/git_cherry_pick.py deleted file mode 100644 index c4b396f6..00000000 --- a/vsts/vsts/git/v4_1/models/git_cherry_pick.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_async_ref_operation import GitAsyncRefOperation - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_commit.py b/vsts/vsts/git/v4_1/models/git_commit.py deleted file mode 100644 index a158afdb..00000000 --- a/vsts/vsts/git/v4_1/models/git_commit.py +++ /dev/null @@ -1,68 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_commit_ref import GitCommitRef - - -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: :class:`ChangeCountDictionary ` - :param changes: An enumeration of the changes included with the commit. - :type changes: list of :class:`GitChange ` - :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 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 push: - :type push: :class:`GitPushRef ` - :param tree_id: - :type tree_id: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'author': {'key': 'author', 'type': 'GitUserDate'}, - 'change_counts': {'key': 'changeCounts', 'type': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'}, - '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]'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, - 'url': {'key': 'url', 'type': 'str'}, - 'work_items': {'key': 'workItems', 'type': '[ResourceRef]'}, - 'push': {'key': 'push', 'type': 'GitPushRef'}, - '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, remote_url=None, statuses=None, url=None, work_items=None, push=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, remote_url=remote_url, statuses=statuses, url=url, work_items=work_items) - self.push = push - self.tree_id = tree_id diff --git a/vsts/vsts/git/v4_1/models/git_commit_changes.py b/vsts/vsts/git/v4_1/models/git_commit_changes.py deleted file mode 100644 index b2a1c728..00000000 --- a/vsts/vsts/git/v4_1/models/git_commit_changes.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitCommitChanges(Model): - """GitCommitChanges. - - :param change_counts: - :type change_counts: :class:`ChangeCountDictionary ` - :param changes: - :type changes: list of :class:`GitChange ` - """ - - _attribute_map = { - 'change_counts': {'key': 'changeCounts', 'type': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'} - } - - def __init__(self, change_counts=None, changes=None): - super(GitCommitChanges, self).__init__() - self.change_counts = change_counts - self.changes = changes diff --git a/vsts/vsts/git/v4_1/models/git_commit_diffs.py b/vsts/vsts/git/v4_1/models/git_commit_diffs.py deleted file mode 100644 index c5d14b37..00000000 --- a/vsts/vsts/git/v4_1/models/git_commit_diffs.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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:`GitChange ` - :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': '[GitChange]'}, - '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 diff --git a/vsts/vsts/git/v4_1/models/git_commit_ref.py b/vsts/vsts/git/v4_1/models/git_commit_ref.py deleted file mode 100644 index a3f58b76..00000000 --- a/vsts/vsts/git/v4_1/models/git_commit_ref.py +++ /dev/null @@ -1,73 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: :class:`ChangeCountDictionary ` - :param changes: An enumeration of the changes included with the commit. - :type changes: list of :class:`GitChange ` - :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 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': 'ChangeCountDictionary'}, - 'changes': {'key': 'changes', 'type': '[GitChange]'}, - '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]'}, - '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, 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.remote_url = remote_url - self.statuses = statuses - self.url = url - self.work_items = work_items diff --git a/vsts/vsts/git/v4_1/models/git_conflict.py b/vsts/vsts/git/v4_1/models/git_conflict.py deleted file mode 100644 index 018a9afe..00000000 --- a/vsts/vsts/git/v4_1/models/git_conflict.py +++ /dev/null @@ -1,73 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_conflict_update_result.py b/vsts/vsts/git/v4_1/models/git_conflict_update_result.py deleted file mode 100644 index b60af798..00000000 --- a/vsts/vsts/git/v4_1/models/git_conflict_update_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_deleted_repository.py b/vsts/vsts/git/v4_1/models/git_deleted_repository.py deleted file mode 100644 index c6710b55..00000000 --- a/vsts/vsts/git/v4_1/models/git_deleted_repository.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_file_paths_collection.py b/vsts/vsts/git/v4_1/models/git_file_paths_collection.py deleted file mode 100644 index 9d0863d6..00000000 --- a/vsts/vsts/git/v4_1/models/git_file_paths_collection.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_fork_operation_status_detail.py b/vsts/vsts/git/v4_1/models/git_fork_operation_status_detail.py deleted file mode 100644 index ce438967..00000000 --- a/vsts/vsts/git/v4_1/models/git_fork_operation_status_detail.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_fork_ref.py b/vsts/vsts/git/v4_1/models/git_fork_ref.py deleted file mode 100644 index 46f8ab5f..00000000 --- a/vsts/vsts/git/v4_1/models/git_fork_ref.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_ref import GitRef - - -class GitForkRef(GitRef): - """GitForkRef. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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'}, - '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, 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, 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 diff --git a/vsts/vsts/git/v4_1/models/git_fork_sync_request.py b/vsts/vsts/git/v4_1/models/git_fork_sync_request.py deleted file mode 100644 index 4630508a..00000000 --- a/vsts/vsts/git/v4_1/models/git_fork_sync_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_fork_sync_request_parameters.py b/vsts/vsts/git/v4_1/models/git_fork_sync_request_parameters.py deleted file mode 100644 index 6aee27ed..00000000 --- a/vsts/vsts/git/v4_1/models/git_fork_sync_request_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_import_git_source.py b/vsts/vsts/git/v4_1/models/git_import_git_source.py deleted file mode 100644 index bc20b2b8..00000000 --- a/vsts/vsts/git/v4_1/models/git_import_git_source.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_import_request.py b/vsts/vsts/git/v4_1/models/git_import_request.py deleted file mode 100644 index 694e1fc0..00000000 --- a/vsts/vsts/git/v4_1/models/git_import_request.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_import_request_parameters.py b/vsts/vsts/git/v4_1/models/git_import_request_parameters.py deleted file mode 100644 index 62485b9e..00000000 --- a/vsts/vsts/git/v4_1/models/git_import_request_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_import_status_detail.py b/vsts/vsts/git/v4_1/models/git_import_status_detail.py deleted file mode 100644 index 5bb83114..00000000 --- a/vsts/vsts/git/v4_1/models/git_import_status_detail.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_import_tfvc_source.py b/vsts/vsts/git/v4_1/models/git_import_tfvc_source.py deleted file mode 100644 index 57f185fc..00000000 --- a/vsts/vsts/git/v4_1/models/git_import_tfvc_source.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_item.py b/vsts/vsts/git/v4_1/models/git_item.py deleted file mode 100644 index 0980208b..00000000 --- a/vsts/vsts/git/v4_1/models/git_item.py +++ /dev/null @@ -1,59 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .item_model import ItemModel - - -class GitItem(ItemModel): - """GitItem. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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_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_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_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 diff --git a/vsts/vsts/git/v4_1/models/git_item_descriptor.py b/vsts/vsts/git/v4_1/models/git_item_descriptor.py deleted file mode 100644 index 3995a564..00000000 --- a/vsts/vsts/git/v4_1/models/git_item_descriptor.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_item_request_data.py b/vsts/vsts/git/v4_1/models/git_item_request_data.py deleted file mode 100644 index 4b3c504f..00000000 --- a/vsts/vsts/git/v4_1/models/git_item_request_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_merge_origin_ref.py b/vsts/vsts/git/v4_1/models/git_merge_origin_ref.py deleted file mode 100644 index de5b7b63..00000000 --- a/vsts/vsts/git/v4_1/models/git_merge_origin_ref.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_object.py b/vsts/vsts/git/v4_1/models/git_object.py deleted file mode 100644 index 39f048af..00000000 --- a/vsts/vsts/git/v4_1/models/git_object.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request.py b/vsts/vsts/git/v4_1/models/git_pull_request.py deleted file mode 100644 index ee3288aa..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request.py +++ /dev/null @@ -1,153 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_change.py b/vsts/vsts/git/v4_1/models/git_pull_request_change.py deleted file mode 100644 index 69e19c22..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_change.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_change import GitChange - - -class GitPullRequestChange(GitChange): - """GitPullRequestChange. - - :param change_id: ID of the change within the group of changes. - :type change_id: int - :param new_content_template: New Content template to be used when pushing new changes. - :type new_content_template: :class:`GitTemplate ` - :param original_path: Original path of item if different from current path. - :type original_path: str - :param change_tracking_id: ID used to track files through multiple changes. - :type change_tracking_id: int - """ - - _attribute_map = { - 'change_id': {'key': 'changeId', 'type': 'int'}, - 'new_content_template': {'key': 'newContentTemplate', 'type': 'GitTemplate'}, - 'original_path': {'key': 'originalPath', 'type': 'str'}, - 'change_tracking_id': {'key': 'changeTrackingId', 'type': 'int'} - } - - def __init__(self, change_id=None, new_content_template=None, original_path=None, change_tracking_id=None): - super(GitPullRequestChange, self).__init__(change_id=change_id, new_content_template=new_content_template, original_path=original_path) - self.change_tracking_id = change_tracking_id diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread.py b/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread.py deleted file mode 100644 index 99164041..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .comment_thread import CommentThread - - -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 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'}, - '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, 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, 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread_context.py b/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread_context.py deleted file mode 100644 index c0173cf5..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_comment_thread_context.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_completion_options.py b/vsts/vsts/git/v4_1/models/git_pull_request_completion_options.py deleted file mode 100644 index d0439970..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_completion_options.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _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'} - } - - def __init__(self, bypass_policy=None, bypass_reason=None, delete_source_branch=None, merge_commit_message=None, squash_merge=None, transition_work_items=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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_iteration.py b/vsts/vsts/git/v4_1/models/git_pull_request_iteration.py deleted file mode 100644 index 4814062e..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_iteration.py +++ /dev/null @@ -1,77 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.push = push - self.reason = reason - self.source_ref_commit = source_ref_commit - self.target_ref_commit = target_ref_commit - self.updated_date = updated_date diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_iteration_changes.py b/vsts/vsts/git/v4_1/models/git_pull_request_iteration_changes.py deleted file mode 100644 index 56cc5534..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_iteration_changes.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py b/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py deleted file mode 100644 index 0dff7101..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitPullRequestMergeOptions(Model): - """GitPullRequestMergeOptions. - - :param disable_renames: If true, rename detection will not be performed during the merge. - :type disable_renames: bool - """ - - _attribute_map = { - 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} - } - - def __init__(self, disable_renames=None): - super(GitPullRequestMergeOptions, self).__init__() - self.disable_renames = disable_renames diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_query.py b/vsts/vsts/git/v4_1/models/git_pull_request_query.py deleted file mode 100644 index e557ed21..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_query.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_query_input.py b/vsts/vsts/git/v4_1/models/git_pull_request_query_input.py deleted file mode 100644 index f6f614a3..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_query_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_search_criteria.py b/vsts/vsts/git/v4_1/models/git_pull_request_search_criteria.py deleted file mode 100644 index 4550d42c..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_search_criteria.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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. - :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 diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_status.py b/vsts/vsts/git/v4_1/models/git_pull_request_status.py deleted file mode 100644 index 60115ed5..00000000 --- a/vsts/vsts/git/v4_1/models/git_pull_request_status.py +++ /dev/null @@ -1,56 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_status import GitStatus - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_push.py b/vsts/vsts/git/v4_1/models/git_push.py deleted file mode 100644 index 90c52e16..00000000 --- a/vsts/vsts/git/v4_1/models/git_push.py +++ /dev/null @@ -1,51 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_push_ref import GitPushRef - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_push_ref.py b/vsts/vsts/git/v4_1/models/git_push_ref.py deleted file mode 100644 index 12ee92fc..00000000 --- a/vsts/vsts/git/v4_1/models/git_push_ref.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_push_search_criteria.py b/vsts/vsts/git/v4_1/models/git_push_search_criteria.py deleted file mode 100644 index db9526a5..00000000 --- a/vsts/vsts/git/v4_1/models/git_push_search_criteria.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_query_branch_stats_criteria.py b/vsts/vsts/git/v4_1/models/git_query_branch_stats_criteria.py deleted file mode 100644 index 758ac676..00000000 --- a/vsts/vsts/git/v4_1/models/git_query_branch_stats_criteria.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_query_commits_criteria.py b/vsts/vsts/git/v4_1/models/git_query_commits_criteria.py deleted file mode 100644 index be8dc823..00000000 --- a/vsts/vsts/git/v4_1/models/git_query_commits_criteria.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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: If provided, the earliest commit in the graph to search - :type compare_version: :class:`GitVersionDescriptor ` - :param exclude_deletes: If true, don't include delete history entries - :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. - :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_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_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_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_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 diff --git a/vsts/vsts/git/v4_1/models/git_ref.py b/vsts/vsts/git/v4_1/models/git_ref.py deleted file mode 100644 index b549bebc..00000000 --- a/vsts/vsts/git/v4_1/models/git_ref.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 GitRef(Model): - """GitRef. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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'}, - '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, 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.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 diff --git a/vsts/vsts/git/v4_1/models/git_ref_favorite.py b/vsts/vsts/git/v4_1/models/git_ref_favorite.py deleted file mode 100644 index cef6f3fc..00000000 --- a/vsts/vsts/git/v4_1/models/git_ref_favorite.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_ref_update.py b/vsts/vsts/git/v4_1/models/git_ref_update.py deleted file mode 100644 index 6c10c600..00000000 --- a/vsts/vsts/git/v4_1/models/git_ref_update.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_ref_update_result.py b/vsts/vsts/git/v4_1/models/git_ref_update_result.py deleted file mode 100644 index d4b42d8d..00000000 --- a/vsts/vsts/git/v4_1/models/git_ref_update_result.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_repository.py b/vsts/vsts/git/v4_1/models/git_repository.py deleted file mode 100644 index 5950c196..00000000 --- a/vsts/vsts/git/v4_1/models/git_repository.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: :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 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'}, - '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, 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.ssh_url = ssh_url - self.url = url - self.valid_remote_urls = valid_remote_urls diff --git a/vsts/vsts/git/v4_1/models/git_repository_create_options.py b/vsts/vsts/git/v4_1/models/git_repository_create_options.py deleted file mode 100644 index c219de4b..00000000 --- a/vsts/vsts/git/v4_1/models/git_repository_create_options.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_repository_ref.py b/vsts/vsts/git/v4_1/models/git_repository_ref.py deleted file mode 100644 index 1f3dd3f1..00000000 --- a/vsts/vsts/git/v4_1/models/git_repository_ref.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_repository_stats.py b/vsts/vsts/git/v4_1/models/git_repository_stats.py deleted file mode 100644 index 0ea95e41..00000000 --- a/vsts/vsts/git/v4_1/models/git_repository_stats.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_revert.py b/vsts/vsts/git/v4_1/models/git_revert.py deleted file mode 100644 index 454be085..00000000 --- a/vsts/vsts/git/v4_1/models/git_revert.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_async_ref_operation import GitAsyncRefOperation - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_status.py b/vsts/vsts/git/v4_1/models/git_status.py deleted file mode 100644 index f662717a..00000000 --- a/vsts/vsts/git/v4_1/models/git_status.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_status_context.py b/vsts/vsts/git/v4_1/models/git_status_context.py deleted file mode 100644 index cf40205f..00000000 --- a/vsts/vsts/git/v4_1/models/git_status_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_suggestion.py b/vsts/vsts/git/v4_1/models/git_suggestion.py deleted file mode 100644 index 6a6a297a..00000000 --- a/vsts/vsts/git/v4_1/models/git_suggestion.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_target_version_descriptor.py b/vsts/vsts/git/v4_1/models/git_target_version_descriptor.py deleted file mode 100644 index 61bc2e33..00000000 --- a/vsts/vsts/git/v4_1/models/git_target_version_descriptor.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .git_version_descriptor import GitVersionDescriptor - - -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 diff --git a/vsts/vsts/git/v4_1/models/git_template.py b/vsts/vsts/git/v4_1/models/git_template.py deleted file mode 100644 index fbe26c8a..00000000 --- a/vsts/vsts/git/v4_1/models/git_template.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_tree_diff.py b/vsts/vsts/git/v4_1/models/git_tree_diff.py deleted file mode 100644 index c305ff1f..00000000 --- a/vsts/vsts/git/v4_1/models/git_tree_diff.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_tree_diff_entry.py b/vsts/vsts/git/v4_1/models/git_tree_diff_entry.py deleted file mode 100644 index b75431e3..00000000 --- a/vsts/vsts/git/v4_1/models/git_tree_diff_entry.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_tree_diff_response.py b/vsts/vsts/git/v4_1/models/git_tree_diff_response.py deleted file mode 100644 index 0c7f81a5..00000000 --- a/vsts/vsts/git/v4_1/models/git_tree_diff_response.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_tree_entry_ref.py b/vsts/vsts/git/v4_1/models/git_tree_entry_ref.py deleted file mode 100644 index 0440423c..00000000 --- a/vsts/vsts/git/v4_1/models/git_tree_entry_ref.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_tree_ref.py b/vsts/vsts/git/v4_1/models/git_tree_ref.py deleted file mode 100644 index a2d385d9..00000000 --- a/vsts/vsts/git/v4_1/models/git_tree_ref.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/git_user_date.py b/vsts/vsts/git/v4_1/models/git_user_date.py deleted file mode 100644 index 60bebffa..00000000 --- a/vsts/vsts/git/v4_1/models/git_user_date.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, date=None, email=None, name=None): - super(GitUserDate, self).__init__() - self.date = date - self.email = email - self.name = name diff --git a/vsts/vsts/git/v4_1/models/git_version_descriptor.py b/vsts/vsts/git/v4_1/models/git_version_descriptor.py deleted file mode 100644 index 919fc237..00000000 --- a/vsts/vsts/git/v4_1/models/git_version_descriptor.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/global_git_repository_key.py b/vsts/vsts/git/v4_1/models/global_git_repository_key.py deleted file mode 100644 index 696cbdec..00000000 --- a/vsts/vsts/git/v4_1/models/global_git_repository_key.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/identity_ref.py b/vsts/vsts/git/v4_1/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/git/v4_1/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py b/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py deleted file mode 100644 index 2830b26b..00000000 --- a/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py +++ /dev/null @@ -1,67 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef - - -class IdentityRefWithVote(IdentityRef): - """IdentityRefWithVote. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: 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 = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', '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, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, is_required=None, reviewer_url=None, vote=None, voted_for=None): - super(IdentityRefWithVote, self).__init__(directory_alias=directory_alias, display_name=display_name, id=id, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) - self.is_required = is_required - self.reviewer_url = reviewer_url - self.vote = vote - self.voted_for = voted_for diff --git a/vsts/vsts/git/v4_1/models/import_repository_validation.py b/vsts/vsts/git/v4_1/models/import_repository_validation.py deleted file mode 100644 index ef525499..00000000 --- a/vsts/vsts/git/v4_1/models/import_repository_validation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/item_model.py b/vsts/vsts/git/v4_1/models/item_model.py deleted file mode 100644 index 2bc23b37..00000000 --- a/vsts/vsts/git/v4_1/models/item_model.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ItemModel(Model): - """ItemModel. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :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_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_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): - super(ItemModel, self).__init__() - self._links = _links - self.content_metadata = content_metadata - self.is_folder = is_folder - self.is_sym_link = is_sym_link - self.path = path - self.url = url diff --git a/vsts/vsts/git/v4_1/models/json_patch_operation.py b/vsts/vsts/git/v4_1/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/git/v4_1/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/reference_links.py b/vsts/vsts/git/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/git/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/resource_ref.py b/vsts/vsts/git/v4_1/models/resource_ref.py deleted file mode 100644 index 903e57ee..00000000 --- a/vsts/vsts/git/v4_1/models/resource_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/share_notification_context.py b/vsts/vsts/git/v4_1/models/share_notification_context.py deleted file mode 100644 index ff08aad1..00000000 --- a/vsts/vsts/git/v4_1/models/share_notification_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/source_to_target_ref.py b/vsts/vsts/git/v4_1/models/source_to_target_ref.py deleted file mode 100644 index 8da6b8a2..00000000 --- a/vsts/vsts/git/v4_1/models/source_to_target_ref.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/team_project_collection_reference.py b/vsts/vsts/git/v4_1/models/team_project_collection_reference.py deleted file mode 100644 index 6f4a596a..00000000 --- a/vsts/vsts/git/v4_1/models/team_project_collection_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/team_project_reference.py b/vsts/vsts/git/v4_1/models/team_project_reference.py deleted file mode 100644 index fa79d465..00000000 --- a/vsts/vsts/git/v4_1/models/team_project_reference.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TeamProjectReference(Model): - """TeamProjectReference. - - :param abbreviation: Project abbreviation. - :type abbreviation: 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'}, - '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, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): - super(TeamProjectReference, self).__init__() - self.abbreviation = abbreviation - self.description = description - self.id = id - self.name = name - self.revision = revision - self.state = state - self.url = url - self.visibility = visibility diff --git a/vsts/vsts/git/v4_1/models/vsts_info.py b/vsts/vsts/git/v4_1/models/vsts_info.py deleted file mode 100644 index 1b494d28..00000000 --- a/vsts/vsts/git/v4_1/models/vsts_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/web_api_create_tag_request_data.py b/vsts/vsts/git/v4_1/models/web_api_create_tag_request_data.py deleted file mode 100644 index 9cf2bd29..00000000 --- a/vsts/vsts/git/v4_1/models/web_api_create_tag_request_data.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/git/v4_1/models/web_api_tag_definition.py b/vsts/vsts/git/v4_1/models/web_api_tag_definition.py deleted file mode 100644 index 4780adf3..00000000 --- a/vsts/vsts/git/v4_1/models/web_api_tag_definition.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/__init__.py b/vsts/vsts/identity/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/identity/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/identity/v4_0/__init__.py b/vsts/vsts/identity/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/identity/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/identity/v4_0/identity_client.py b/vsts/vsts/identity/v4_0/identity_client.py deleted file mode 100644 index 4e365fdf..00000000 --- a/vsts/vsts/identity/v4_0/identity_client.py +++ /dev/null @@ -1,548 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class IdentityClient(VssClient): - """Identity - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.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='4.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='4.0', - content=content, - returns_collection=True) - return self._deserialize('[Identity]', 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='4.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='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def get_identity_changes(self, identity_sequence_id, group_sequence_id, scope_id=None): - """GetIdentityChanges. - :param int identity_sequence_id: - :param int group_sequence_id: - :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 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='4.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='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def read_identities(self, descriptors=None, identity_ids=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 search_filter: - :param str filter_value: - :param QueryMembership query_membership: - :param str properties: - :param bool include_restricted_visibility: - :param ReadIdentitiesOptions 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 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, 'QueryMembership') - 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, 'ReadIdentitiesOptions') - response = self._send(http_method='GET', - location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def read_identities_by_scope(self, scope_id, query_membership=None, properties=None): - """ReadIdentitiesByScope. - :param str scope_id: - :param QueryMembership 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, 'QueryMembership') - 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='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def read_identity(self, identity_id, query_membership=None, properties=None): - """ReadIdentity. - :param str identity_id: - :param QueryMembership 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, 'QueryMembership') - 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='4.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='4.0', - content=content, - returns_collection=True) - return self._deserialize('[IdentityUpdateData]', 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='4.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='4.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='4.0-preview.1', - content=content, - returns_collection=True) - return self._deserialize('[Identity]', 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='4.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='4.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='4.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='4.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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', - version='4.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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', - version='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', 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='4.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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', - version='4.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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', - version='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', 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='4.0-preview.1', - 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='4.0-preview.1', - 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='4.0-preview.1', - 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='4.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('IdentityScope', response) - - def rename_scope(self, rename_scope, scope_id): - """RenameScope. - [Preview API] - :param :class:` ` rename_scope: - :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(rename_scope, 'IdentityScope') - self._send(http_method='PATCH', - location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', - version='4.0-preview.1', - route_values=route_values, - content=content) - - 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='4.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='4.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='4.0-preview.1', - route_values=route_values) - return self._deserialize('TenantInfo', response) - diff --git a/vsts/vsts/identity/v4_0/models/__init__.py b/vsts/vsts/identity/v4_0/models/__init__.py deleted file mode 100644 index 1580aa8a..00000000 --- a/vsts/vsts/identity/v4_0/models/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .access_token_result import AccessTokenResult -from .authorization_grant import AuthorizationGrant -from .changed_identities import ChangedIdentities -from .changed_identities_context import ChangedIdentitiesContext -from .create_scope_info import CreateScopeInfo -from .framework_identity_info import FrameworkIdentityInfo -from .group_membership import GroupMembership -from .identity import Identity -from .identity_batch_info import IdentityBatchInfo -from .identity_scope import IdentityScope -from .identity_self import IdentitySelf -from .identity_snapshot import IdentitySnapshot -from .identity_update_data import IdentityUpdateData -from .json_web_token import JsonWebToken -from .refresh_token_grant import RefreshTokenGrant -from .tenant_info import TenantInfo - -__all__ = [ - 'AccessTokenResult', - 'AuthorizationGrant', - 'ChangedIdentities', - 'ChangedIdentitiesContext', - 'CreateScopeInfo', - 'FrameworkIdentityInfo', - 'GroupMembership', - 'Identity', - 'IdentityBatchInfo', - 'IdentityScope', - 'IdentitySelf', - 'IdentitySnapshot', - 'IdentityUpdateData', - 'JsonWebToken', - 'RefreshTokenGrant', - 'TenantInfo', -] diff --git a/vsts/vsts/identity/v4_0/models/access_token_result.py b/vsts/vsts/identity/v4_0/models/access_token_result.py deleted file mode 100644 index 7ec13e88..00000000 --- a/vsts/vsts/identity/v4_0/models/access_token_result.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/identity/v4_0/models/authorization_grant.py b/vsts/vsts/identity/v4_0/models/authorization_grant.py deleted file mode 100644 index 6d7b7404..00000000 --- a/vsts/vsts/identity/v4_0/models/authorization_grant.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/changed_identities.py b/vsts/vsts/identity/v4_0/models/changed_identities.py deleted file mode 100644 index 1cb58d93..00000000 --- a/vsts/vsts/identity/v4_0/models/changed_identities.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ChangedIdentities(Model): - """ChangedIdentities. - - :param identities: Changed Identities - :type identities: list of :class:`Identity ` - :param sequence_context: Last Identity SequenceId - :type sequence_context: :class:`ChangedIdentitiesContext ` - """ - - _attribute_map = { - 'identities': {'key': 'identities', 'type': '[Identity]'}, - 'sequence_context': {'key': 'sequenceContext', 'type': 'ChangedIdentitiesContext'} - } - - def __init__(self, identities=None, sequence_context=None): - super(ChangedIdentities, self).__init__() - self.identities = identities - self.sequence_context = sequence_context diff --git a/vsts/vsts/identity/v4_0/models/changed_identities_context.py b/vsts/vsts/identity/v4_0/models/changed_identities_context.py deleted file mode 100644 index 7ac79f49..00000000 --- a/vsts/vsts/identity/v4_0/models/changed_identities_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _attribute_map = { - 'group_sequence_id': {'key': 'groupSequenceId', 'type': 'int'}, - 'identity_sequence_id': {'key': 'identitySequenceId', 'type': 'int'} - } - - def __init__(self, group_sequence_id=None, identity_sequence_id=None): - super(ChangedIdentitiesContext, self).__init__() - self.group_sequence_id = group_sequence_id - self.identity_sequence_id = identity_sequence_id diff --git a/vsts/vsts/identity/v4_0/models/create_scope_info.py b/vsts/vsts/identity/v4_0/models/create_scope_info.py deleted file mode 100644 index f838990f..00000000 --- a/vsts/vsts/identity/v4_0/models/create_scope_info.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/framework_identity_info.py b/vsts/vsts/identity/v4_0/models/framework_identity_info.py deleted file mode 100644 index 984ead3c..00000000 --- a/vsts/vsts/identity/v4_0/models/framework_identity_info.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/group_membership.py b/vsts/vsts/identity/v4_0/models/group_membership.py deleted file mode 100644 index 4728df3e..00000000 --- a/vsts/vsts/identity/v4_0/models/group_membership.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/identity.py b/vsts/vsts/identity/v4_0/models/identity.py deleted file mode 100644 index 3ab07faa..00000000 --- a/vsts/vsts/identity/v4_0/models/identity.py +++ /dev/null @@ -1,81 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Identity(Model): - """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__() - 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 diff --git a/vsts/vsts/identity/v4_0/models/identity_batch_info.py b/vsts/vsts/identity/v4_0/models/identity_batch_info.py deleted file mode 100644 index 5e1798c0..00000000 --- a/vsts/vsts/identity/v4_0/models/identity_batch_info.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _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'} - } - - def __init__(self, descriptors=None, identity_ids=None, include_restricted_visibility=None, property_names=None, query_membership=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 diff --git a/vsts/vsts/identity/v4_0/models/identity_scope.py b/vsts/vsts/identity/v4_0/models/identity_scope.py deleted file mode 100644 index 6cb63a09..00000000 --- a/vsts/vsts/identity/v4_0/models/identity_scope.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/identity_self.py b/vsts/vsts/identity/v4_0/models/identity_self.py deleted file mode 100644 index e4f90f43..00000000 --- a/vsts/vsts/identity/v4_0/models/identity_self.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentitySelf(Model): - """IdentitySelf. - - :param account_name: - :type account_name: str - :param display_name: - :type display_name: str - :param id: - :type id: str - :param tenants: - :type tenants: list of :class:`TenantInfo ` - """ - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'tenants': {'key': 'tenants', 'type': '[TenantInfo]'} - } - - def __init__(self, account_name=None, display_name=None, id=None, tenants=None): - super(IdentitySelf, self).__init__() - self.account_name = account_name - self.display_name = display_name - self.id = id - self.tenants = tenants diff --git a/vsts/vsts/identity/v4_0/models/identity_snapshot.py b/vsts/vsts/identity/v4_0/models/identity_snapshot.py deleted file mode 100644 index 59229d1a..00000000 --- a/vsts/vsts/identity/v4_0/models/identity_snapshot.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/identity_update_data.py b/vsts/vsts/identity/v4_0/models/identity_update_data.py deleted file mode 100644 index 70c2eb75..00000000 --- a/vsts/vsts/identity/v4_0/models/identity_update_data.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_0/models/json_web_token.py b/vsts/vsts/identity/v4_0/models/json_web_token.py deleted file mode 100644 index 03adaafc..00000000 --- a/vsts/vsts/identity/v4_0/models/json_web_token.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 JsonWebToken(Model): - """JsonWebToken. - - """ - - _attribute_map = { - } - - def __init__(self): - super(JsonWebToken, self).__init__() diff --git a/vsts/vsts/identity/v4_0/models/refresh_token_grant.py b/vsts/vsts/identity/v4_0/models/refresh_token_grant.py deleted file mode 100644 index 05a13501..00000000 --- a/vsts/vsts/identity/v4_0/models/refresh_token_grant.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .authorization_grant import AuthorizationGrant - - -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 diff --git a/vsts/vsts/identity/v4_0/models/tenant_info.py b/vsts/vsts/identity/v4_0/models/tenant_info.py deleted file mode 100644 index 79f0ef44..00000000 --- a/vsts/vsts/identity/v4_0/models/tenant_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/__init__.py b/vsts/vsts/identity/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/identity/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/identity/v4_1/identity_client.py b/vsts/vsts/identity/v4_1/identity_client.py deleted file mode 100644 index 27513abb..00000000 --- a/vsts/vsts/identity/v4_1/identity_client.py +++ /dev/null @@ -1,559 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class IdentityClient(VssClient): - """Identity - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def create_groups(self, container): - """CreateGroups. - [Preview API] - :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='4.1-preview.1', - content=content, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def delete_group(self, group_id): - """DeleteGroup. - [Preview API] - :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='4.1-preview.1', - route_values=route_values) - - def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=None): - """ListGroups. - [Preview API] - :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='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def get_identity_changes(self, identity_sequence_id, group_sequence_id, scope_id=None): - """GetIdentityChanges. - [Preview API] - :param int identity_sequence_id: - :param int group_sequence_id: - :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 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='4.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('ChangedIdentities', response) - - def get_user_identity_ids_by_domain_id(self, domain_id): - """GetUserIdentityIdsByDomainId. - [Preview API] - :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='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', response) - - def read_identities(self, descriptors=None, identity_ids=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): - """ReadIdentities. - [Preview API] - :param str descriptors: - :param str identity_ids: - :param str search_filter: - :param str filter_value: - :param QueryMembership query_membership: - :param str properties: - :param bool include_restricted_visibility: - :param ReadIdentitiesOptions 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 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, 'QueryMembership') - 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, 'ReadIdentitiesOptions') - response = self._send(http_method='GET', - location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def read_identities_by_scope(self, scope_id, query_membership=None, properties=None): - """ReadIdentitiesByScope. - [Preview API] - :param str scope_id: - :param QueryMembership 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, 'QueryMembership') - 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='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[Identity]', response) - - def read_identity(self, identity_id, query_membership=None, properties=None): - """ReadIdentity. - [Preview API] - :param str identity_id: - :param QueryMembership 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, 'QueryMembership') - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Identity', response) - - def update_identities(self, identities): - """UpdateIdentities. - [Preview API] - :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='4.1-preview.1', - content=content, - returns_collection=True) - return self._deserialize('[IdentityUpdateData]', response) - - def update_identity(self, identity, identity_id): - """UpdateIdentity. - [Preview API] - :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='4.1-preview.1', - route_values=route_values, - content=content) - - def create_identity(self, framework_identity_info): - """CreateIdentity. - [Preview API] - :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='4.1-preview.1', - 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='4.1-preview.1', - content=content, - returns_collection=True) - return self._deserialize('[Identity]', 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('IdentitySnapshot', response) - - def get_max_sequence_id(self): - """GetMaxSequenceId. - [Preview API] 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='4.1-preview.1') - return self._deserialize('long', response) - - def get_self(self): - """GetSelf. - [Preview API] Read identity of the home tenant request user. - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='4bb02b5b-c120-4be2-b68e-21f7c50a4b82', - version='4.1-preview.1') - 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='4.1-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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', - version='4.1-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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', - version='4.1-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 QueryMembership 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, 'QueryMembership') - response = self._send(http_method='GET', - location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[str]', 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='4.1-preview.1', - 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='4.1-preview.1', - 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='4.1-preview.1', - 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='4.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('IdentityScope', response) - - def rename_scope(self, rename_scope, scope_id): - """RenameScope. - [Preview API] - :param :class:` ` rename_scope: - :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(rename_scope, 'IdentityScope') - self._send(http_method='PATCH', - location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', - version='4.1-preview.1', - route_values=route_values, - content=content) - - 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values) - return self._deserialize('TenantInfo', response) - diff --git a/vsts/vsts/identity/v4_1/models/__init__.py b/vsts/vsts/identity/v4_1/models/__init__.py deleted file mode 100644 index 1580aa8a..00000000 --- a/vsts/vsts/identity/v4_1/models/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .access_token_result import AccessTokenResult -from .authorization_grant import AuthorizationGrant -from .changed_identities import ChangedIdentities -from .changed_identities_context import ChangedIdentitiesContext -from .create_scope_info import CreateScopeInfo -from .framework_identity_info import FrameworkIdentityInfo -from .group_membership import GroupMembership -from .identity import Identity -from .identity_batch_info import IdentityBatchInfo -from .identity_scope import IdentityScope -from .identity_self import IdentitySelf -from .identity_snapshot import IdentitySnapshot -from .identity_update_data import IdentityUpdateData -from .json_web_token import JsonWebToken -from .refresh_token_grant import RefreshTokenGrant -from .tenant_info import TenantInfo - -__all__ = [ - 'AccessTokenResult', - 'AuthorizationGrant', - 'ChangedIdentities', - 'ChangedIdentitiesContext', - 'CreateScopeInfo', - 'FrameworkIdentityInfo', - 'GroupMembership', - 'Identity', - 'IdentityBatchInfo', - 'IdentityScope', - 'IdentitySelf', - 'IdentitySnapshot', - 'IdentityUpdateData', - 'JsonWebToken', - 'RefreshTokenGrant', - 'TenantInfo', -] diff --git a/vsts/vsts/identity/v4_1/models/access_token_result.py b/vsts/vsts/identity/v4_1/models/access_token_result.py deleted file mode 100644 index 958f43bb..00000000 --- a/vsts/vsts/identity/v4_1/models/access_token_result.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/identity/v4_1/models/authorization_grant.py b/vsts/vsts/identity/v4_1/models/authorization_grant.py deleted file mode 100644 index 6d7b7404..00000000 --- a/vsts/vsts/identity/v4_1/models/authorization_grant.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/changed_identities.py b/vsts/vsts/identity/v4_1/models/changed_identities.py deleted file mode 100644 index 32b30a32..00000000 --- a/vsts/vsts/identity/v4_1/models/changed_identities.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ChangedIdentities(Model): - """ChangedIdentities. - - :param identities: Changed Identities - :type identities: list of :class:`Identity ` - :param sequence_context: Last Identity SequenceId - :type sequence_context: :class:`ChangedIdentitiesContext ` - """ - - _attribute_map = { - 'identities': {'key': 'identities', 'type': '[Identity]'}, - 'sequence_context': {'key': 'sequenceContext', 'type': 'ChangedIdentitiesContext'} - } - - def __init__(self, identities=None, sequence_context=None): - super(ChangedIdentities, self).__init__() - self.identities = identities - self.sequence_context = sequence_context diff --git a/vsts/vsts/identity/v4_1/models/changed_identities_context.py b/vsts/vsts/identity/v4_1/models/changed_identities_context.py deleted file mode 100644 index 7ac79f49..00000000 --- a/vsts/vsts/identity/v4_1/models/changed_identities_context.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _attribute_map = { - 'group_sequence_id': {'key': 'groupSequenceId', 'type': 'int'}, - 'identity_sequence_id': {'key': 'identitySequenceId', 'type': 'int'} - } - - def __init__(self, group_sequence_id=None, identity_sequence_id=None): - super(ChangedIdentitiesContext, self).__init__() - self.group_sequence_id = group_sequence_id - self.identity_sequence_id = identity_sequence_id diff --git a/vsts/vsts/identity/v4_1/models/create_scope_info.py b/vsts/vsts/identity/v4_1/models/create_scope_info.py deleted file mode 100644 index f838990f..00000000 --- a/vsts/vsts/identity/v4_1/models/create_scope_info.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/framework_identity_info.py b/vsts/vsts/identity/v4_1/models/framework_identity_info.py deleted file mode 100644 index 984ead3c..00000000 --- a/vsts/vsts/identity/v4_1/models/framework_identity_info.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/group_membership.py b/vsts/vsts/identity/v4_1/models/group_membership.py deleted file mode 100644 index 8a0d801b..00000000 --- a/vsts/vsts/identity/v4_1/models/group_membership.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/identity.py b/vsts/vsts/identity/v4_1/models/identity.py deleted file mode 100644 index 2622bc22..00000000 --- a/vsts/vsts/identity/v4_1/models/identity.py +++ /dev/null @@ -1,81 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Identity(Model): - """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__() - 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 diff --git a/vsts/vsts/identity/v4_1/models/identity_batch_info.py b/vsts/vsts/identity/v4_1/models/identity_batch_info.py deleted file mode 100644 index 527e9a8e..00000000 --- a/vsts/vsts/identity/v4_1/models/identity_batch_info.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 - """ - - _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'} - } - - def __init__(self, descriptors=None, identity_ids=None, include_restricted_visibility=None, property_names=None, query_membership=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 diff --git a/vsts/vsts/identity/v4_1/models/identity_scope.py b/vsts/vsts/identity/v4_1/models/identity_scope.py deleted file mode 100644 index 046f11e1..00000000 --- a/vsts/vsts/identity/v4_1/models/identity_scope.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/identity_self.py b/vsts/vsts/identity/v4_1/models/identity_self.py deleted file mode 100644 index daa61649..00000000 --- a/vsts/vsts/identity/v4_1/models/identity_self.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentitySelf(Model): - """IdentitySelf. - - :param account_name: - :type account_name: str - :param display_name: - :type display_name: str - :param id: - :type id: str - :param tenants: - :type tenants: list of :class:`TenantInfo ` - """ - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'tenants': {'key': 'tenants', 'type': '[TenantInfo]'} - } - - def __init__(self, account_name=None, display_name=None, id=None, tenants=None): - super(IdentitySelf, self).__init__() - self.account_name = account_name - self.display_name = display_name - self.id = id - self.tenants = tenants diff --git a/vsts/vsts/identity/v4_1/models/identity_snapshot.py b/vsts/vsts/identity/v4_1/models/identity_snapshot.py deleted file mode 100644 index dbba580b..00000000 --- a/vsts/vsts/identity/v4_1/models/identity_snapshot.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/identity_update_data.py b/vsts/vsts/identity/v4_1/models/identity_update_data.py deleted file mode 100644 index 70c2eb75..00000000 --- a/vsts/vsts/identity/v4_1/models/identity_update_data.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/identity/v4_1/models/json_web_token.py b/vsts/vsts/identity/v4_1/models/json_web_token.py deleted file mode 100644 index 03adaafc..00000000 --- a/vsts/vsts/identity/v4_1/models/json_web_token.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 JsonWebToken(Model): - """JsonWebToken. - - """ - - _attribute_map = { - } - - def __init__(self): - super(JsonWebToken, self).__init__() diff --git a/vsts/vsts/identity/v4_1/models/refresh_token_grant.py b/vsts/vsts/identity/v4_1/models/refresh_token_grant.py deleted file mode 100644 index 1ce08212..00000000 --- a/vsts/vsts/identity/v4_1/models/refresh_token_grant.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .authorization_grant import AuthorizationGrant - - -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 diff --git a/vsts/vsts/identity/v4_1/models/tenant_info.py b/vsts/vsts/identity/v4_1/models/tenant_info.py deleted file mode 100644 index 79f0ef44..00000000 --- a/vsts/vsts/identity/v4_1/models/tenant_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/__init__.py b/vsts/vsts/location/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/location/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/location/v4_0/__init__.py b/vsts/vsts/location/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/location/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/location/v4_0/location_client.py b/vsts/vsts/location/v4_0/location_client.py deleted file mode 100644 index 97cb9f1f..00000000 --- a/vsts/vsts/location/v4_0/location_client.py +++ /dev/null @@ -1,140 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class LocationClient(VssClient): - """Location - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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 ConnectOptions 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, 'ConnectOptions') - 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='4.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('ConnectionData', response) - - def get_resource_area(self, area_id): - """GetResourceArea. - [Preview API] - :param str area_id: - :rtype: :class:` ` - """ - route_values = {} - if area_id is not None: - route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') - response = self._send(http_method='GET', - location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', - version='4.0-preview.1', - route_values=route_values) - return self._deserialize('ResourceAreaInfo', response) - - def get_resource_areas(self): - """GetResourceAreas. - [Preview API] - :rtype: [ResourceAreaInfo] - """ - response = self._send(http_method='GET', - location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', - version='4.0-preview.1', - returns_collection=True) - return self._deserialize('[ResourceAreaInfo]', 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='4.0-preview.1', - route_values=route_values) - - def get_service_definition(self, service_type, identifier, allow_fault_in=None): - """GetServiceDefinition. - [Preview API] - :param str service_type: - :param str identifier: - :param bool allow_fault_in: - :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') - response = self._send(http_method='GET', - location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c', - version='4.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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[ServiceDefinition]', 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='4.0-preview.1', - content=content) - diff --git a/vsts/vsts/location/v4_0/models/__init__.py b/vsts/vsts/location/v4_0/models/__init__.py deleted file mode 100644 index dbde91d7..00000000 --- a/vsts/vsts/location/v4_0/models/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .access_mapping import AccessMapping -from .connection_data import ConnectionData -from .identity import Identity -from .location_mapping import LocationMapping -from .location_service_data import LocationServiceData -from .resource_area_info import ResourceAreaInfo -from .service_definition import ServiceDefinition - -__all__ = [ - 'AccessMapping', - 'ConnectionData', - 'Identity', - 'LocationMapping', - 'LocationServiceData', - 'ResourceAreaInfo', - 'ServiceDefinition', -] diff --git a/vsts/vsts/location/v4_0/models/access_mapping.py b/vsts/vsts/location/v4_0/models/access_mapping.py deleted file mode 100644 index 7734bec7..00000000 --- a/vsts/vsts/location/v4_0/models/access_mapping.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/location/v4_0/models/connection_data.py b/vsts/vsts/location/v4_0/models/connection_data.py deleted file mode 100644 index 85d70a0b..00000000 --- a/vsts/vsts/location/v4_0/models/connection_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.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 diff --git a/vsts/vsts/location/v4_0/models/identity.py b/vsts/vsts/location/v4_0/models/identity.py deleted file mode 100644 index 36327d2b..00000000 --- a/vsts/vsts/location/v4_0/models/identity.py +++ /dev/null @@ -1,81 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Identity(Model): - """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__() - 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 diff --git a/vsts/vsts/location/v4_0/models/location_mapping.py b/vsts/vsts/location/v4_0/models/location_mapping.py deleted file mode 100644 index 945f49dd..00000000 --- a/vsts/vsts/location/v4_0/models/location_mapping.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_0/models/location_service_data.py b/vsts/vsts/location/v4_0/models/location_service_data.py deleted file mode 100644 index 72027dd7..00000000 --- a/vsts/vsts/location/v4_0/models/location_service_data.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_0/models/resource_area_info.py b/vsts/vsts/location/v4_0/models/resource_area_info.py deleted file mode 100644 index c2816fbe..00000000 --- a/vsts/vsts/location/v4_0/models/resource_area_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_0/models/service_definition.py b/vsts/vsts/location/v4_0/models/service_definition.py deleted file mode 100644 index 8201cd26..00000000 --- a/vsts/vsts/location/v4_0/models/service_definition.py +++ /dev/null @@ -1,93 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_1/__init__.py b/vsts/vsts/location/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/location/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/location/v4_1/location_client.py b/vsts/vsts/location/v4_1/location_client.py deleted file mode 100644 index 99c429d7..00000000 --- a/vsts/vsts/location/v4_1/location_client.py +++ /dev/null @@ -1,143 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class LocationClient(VssClient): - """Location - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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 ConnectOptions 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, 'ConnectOptions') - 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='4.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('ConnectionData', response) - - def get_resource_area(self, area_id): - """GetResourceArea. - [Preview API] - :param str area_id: - :rtype: :class:` ` - """ - route_values = {} - if area_id is not None: - route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') - response = self._send(http_method='GET', - location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('ResourceAreaInfo', response) - - def get_resource_areas(self): - """GetResourceAreas. - [Preview API] - :rtype: [ResourceAreaInfo] - """ - response = self._send(http_method='GET', - location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', - version='4.1-preview.1', - returns_collection=True) - return self._deserialize('[ResourceAreaInfo]', 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[ServiceDefinition]', 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='4.1-preview.1', - content=content) - diff --git a/vsts/vsts/location/v4_1/models/__init__.py b/vsts/vsts/location/v4_1/models/__init__.py deleted file mode 100644 index dbde91d7..00000000 --- a/vsts/vsts/location/v4_1/models/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .access_mapping import AccessMapping -from .connection_data import ConnectionData -from .identity import Identity -from .location_mapping import LocationMapping -from .location_service_data import LocationServiceData -from .resource_area_info import ResourceAreaInfo -from .service_definition import ServiceDefinition - -__all__ = [ - 'AccessMapping', - 'ConnectionData', - 'Identity', - 'LocationMapping', - 'LocationServiceData', - 'ResourceAreaInfo', - 'ServiceDefinition', -] diff --git a/vsts/vsts/location/v4_1/models/access_mapping.py b/vsts/vsts/location/v4_1/models/access_mapping.py deleted file mode 100644 index 7734bec7..00000000 --- a/vsts/vsts/location/v4_1/models/access_mapping.py +++ /dev/null @@ -1,41 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/location/v4_1/models/connection_data.py b/vsts/vsts/location/v4_1/models/connection_data.py deleted file mode 100644 index 513b677d..00000000 --- a/vsts/vsts/location/v4_1/models/connection_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 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'}, - '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, 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.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 diff --git a/vsts/vsts/location/v4_1/models/identity.py b/vsts/vsts/location/v4_1/models/identity.py deleted file mode 100644 index 65172c4a..00000000 --- a/vsts/vsts/location/v4_1/models/identity.py +++ /dev/null @@ -1,81 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Identity(Model): - """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__() - 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 diff --git a/vsts/vsts/location/v4_1/models/location_mapping.py b/vsts/vsts/location/v4_1/models/location_mapping.py deleted file mode 100644 index 945f49dd..00000000 --- a/vsts/vsts/location/v4_1/models/location_mapping.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_1/models/location_service_data.py b/vsts/vsts/location/v4_1/models/location_service_data.py deleted file mode 100644 index 122cf2fb..00000000 --- a/vsts/vsts/location/v4_1/models/location_service_data.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_1/models/resource_area_info.py b/vsts/vsts/location/v4_1/models/resource_area_info.py deleted file mode 100644 index c2816fbe..00000000 --- a/vsts/vsts/location/v4_1/models/resource_area_info.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/location/v4_1/models/service_definition.py b/vsts/vsts/location/v4_1/models/service_definition.py deleted file mode 100644 index 8684205a..00000000 --- a/vsts/vsts/location/v4_1/models/service_definition.py +++ /dev/null @@ -1,93 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/models/__init__.py b/vsts/vsts/models/__init__.py deleted file mode 100644 index 6ddbb023..00000000 --- a/vsts/vsts/models/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .api_resource_location import ApiResourceLocation -from ..customer_intelligence.v4_0.models.customer_intelligence_event import CustomerIntelligenceEvent -from .improper_exception import ImproperException -from ..location.v4_0.models.resource_area_info import ResourceAreaInfo -from .vss_json_collection_wrapper_base import VssJsonCollectionWrapperBase -from .vss_json_collection_wrapper import VssJsonCollectionWrapper -from .wrapped_exception import WrappedException - -__all__ = [ - 'ApiResourceLocation', - 'CustomerIntelligenceEvent', - 'ImproperException', - 'ResourceAreaInfo', - 'VssJsonCollectionWrapperBase', - 'VssJsonCollectionWrapper', - 'WrappedException' -] diff --git a/vsts/vsts/models/api_resource_location.py b/vsts/vsts/models/api_resource_location.py deleted file mode 100644 index c45b01c7..00000000 --- a/vsts/vsts/models/api_resource_location.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 diff --git a/vsts/vsts/models/improper_exception.py b/vsts/vsts/models/improper_exception.py deleted file mode 100644 index 771ba338..00000000 --- a/vsts/vsts/models/improper_exception.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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 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 diff --git a/vsts/vsts/models/vss_json_collection_wrapper.py b/vsts/vsts/models/vss_json_collection_wrapper.py deleted file mode 100644 index 45245a58..00000000 --- a/vsts/vsts/models/vss_json_collection_wrapper.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .vss_json_collection_wrapper_base import VssJsonCollectionWrapperBase - - -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 diff --git a/vsts/vsts/models/vss_json_collection_wrapper_base.py b/vsts/vsts/models/vss_json_collection_wrapper_base.py deleted file mode 100644 index 82460267..00000000 --- a/vsts/vsts/models/vss_json_collection_wrapper_base.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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 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 diff --git a/vsts/vsts/models/wrapped_exception.py b/vsts/vsts/models/wrapped_exception.py deleted file mode 100644 index 8f274d63..00000000 --- a/vsts/vsts/models/wrapped_exception.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 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 diff --git a/vsts/vsts/operations/__init__.py b/vsts/vsts/operations/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/operations/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/operations/v4_0/__init__.py b/vsts/vsts/operations/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/operations/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/operations/v4_0/models/__init__.py b/vsts/vsts/operations/v4_0/models/__init__.py deleted file mode 100644 index 04d3e0dc..00000000 --- a/vsts/vsts/operations/v4_0/models/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .operation import Operation -from .operation_reference import OperationReference -from .reference_links import ReferenceLinks - -__all__ = [ - 'Operation', - 'OperationReference', - 'ReferenceLinks', -] diff --git a/vsts/vsts/operations/v4_0/models/operation.py b/vsts/vsts/operations/v4_0/models/operation.py deleted file mode 100644 index 1bc4e215..00000000 --- a/vsts/vsts/operations/v4_0/models/operation.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .operation_reference import OperationReference - - -class Operation(OperationReference): - """Operation. - - :param id: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - :param _links: The links to other objects related to this object. - :type _links: :class:`ReferenceLinks ` - :param result_message: The result message which is generally not set. - :type result_message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'result_message': {'key': 'resultMessage', 'type': 'str'} - } - - def __init__(self, id=None, status=None, url=None, _links=None, result_message=None): - super(Operation, self).__init__(id=id, status=status, url=url) - self._links = _links - self.result_message = result_message diff --git a/vsts/vsts/operations/v4_0/models/operation_reference.py b/vsts/vsts/operations/v4_0/models/operation_reference.py deleted file mode 100644 index fb73a6c6..00000000 --- a/vsts/vsts/operations/v4_0/models/operation_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, id=None, status=None, url=None): - super(OperationReference, self).__init__() - self.id = id - self.status = status - self.url = url diff --git a/vsts/vsts/operations/v4_0/models/reference_links.py b/vsts/vsts/operations/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/operations/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/operations/v4_0/operations_client.py b/vsts/vsts/operations/v4_0/operations_client.py deleted file mode 100644 index 70ba8f89..00000000 --- a/vsts/vsts/operations/v4_0/operations_client.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class OperationsClient(VssClient): - """Operations - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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): - """GetOperation. - Gets an operation from the the Id. - :param str operation_id: The id for the operation. - :rtype: :class:` ` - """ - route_values = {} - if operation_id is not None: - route_values['operationId'] = self._serialize.url('operation_id', operation_id, 'str') - response = self._send(http_method='GET', - location_id='9a1b74b4-2ca8-4a9f-8470-c2f2e6fdc949', - version='4.0', - route_values=route_values) - return self._deserialize('Operation', response) - diff --git a/vsts/vsts/operations/v4_1/__init__.py b/vsts/vsts/operations/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/operations/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/operations/v4_1/models/__init__.py b/vsts/vsts/operations/v4_1/models/__init__.py deleted file mode 100644 index 40c4f1a7..00000000 --- a/vsts/vsts/operations/v4_1/models/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .operation import Operation -from .operation_reference import OperationReference -from .operation_result_reference import OperationResultReference -from .reference_links import ReferenceLinks - -__all__ = [ - 'Operation', - 'OperationReference', - 'OperationResultReference', - 'ReferenceLinks', -] diff --git a/vsts/vsts/operations/v4_1/models/operation.py b/vsts/vsts/operations/v4_1/models/operation.py deleted file mode 100644 index 502b100d..00000000 --- a/vsts/vsts/operations/v4_1/models/operation.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .operation_reference import OperationReference - - -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 diff --git a/vsts/vsts/operations/v4_1/models/operation_reference.py b/vsts/vsts/operations/v4_1/models/operation_reference.py deleted file mode 100644 index cdbef013..00000000 --- a/vsts/vsts/operations/v4_1/models/operation_reference.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/operations/v4_1/models/operation_result_reference.py b/vsts/vsts/operations/v4_1/models/operation_result_reference.py deleted file mode 100644 index 0b7a0e28..00000000 --- a/vsts/vsts/operations/v4_1/models/operation_result_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/operations/v4_1/models/reference_links.py b/vsts/vsts/operations/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/operations/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/operations/v4_1/operations_client.py b/vsts/vsts/operations/v4_1/operations_client.py deleted file mode 100644 index 181c1a81..00000000 --- a/vsts/vsts/operations/v4_1/operations_client.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class OperationsClient(VssClient): - """Operations - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Operation', response) - diff --git a/vsts/vsts/policy/__init__.py b/vsts/vsts/policy/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/policy/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/policy/v4_0/__init__.py b/vsts/vsts/policy/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/policy/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/policy/v4_0/models/__init__.py b/vsts/vsts/policy/v4_0/models/__init__.py deleted file mode 100644 index 15df3183..00000000 --- a/vsts/vsts/policy/v4_0/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef -from .policy_configuration import PolicyConfiguration -from .policy_configuration_ref import PolicyConfigurationRef -from .policy_evaluation_record import PolicyEvaluationRecord -from .policy_type import PolicyType -from .policy_type_ref import PolicyTypeRef -from .reference_links import ReferenceLinks -from .versioned_policy_configuration_ref import VersionedPolicyConfigurationRef - -__all__ = [ - 'IdentityRef', - 'PolicyConfiguration', - 'PolicyConfigurationRef', - 'PolicyEvaluationRecord', - 'PolicyType', - 'PolicyTypeRef', - 'ReferenceLinks', - 'VersionedPolicyConfigurationRef', -] diff --git a/vsts/vsts/policy/v4_0/models/identity_ref.py b/vsts/vsts/policy/v4_0/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/policy/v4_0/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/policy/v4_0/models/policy_configuration.py b/vsts/vsts/policy/v4_0/models/policy_configuration.py deleted file mode 100644 index 444fb2f7..00000000 --- a/vsts/vsts/policy/v4_0/models/policy_configuration.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .versioned_policy_configuration_ref import VersionedPolicyConfigurationRef - - -class PolicyConfiguration(VersionedPolicyConfigurationRef): - """PolicyConfiguration. - - :param id: - :type id: int - :param type: - :type type: :class:`PolicyTypeRef ` - :param url: - :type url: str - :param revision: - :type revision: int - :param _links: - :type _links: :class:`ReferenceLinks ` - :param created_by: - :type created_by: :class:`IdentityRef ` - :param created_date: - :type created_date: datetime - :param is_blocking: - :type is_blocking: bool - :param is_deleted: - :type is_deleted: bool - :param is_enabled: - :type is_enabled: bool - :param 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 diff --git a/vsts/vsts/policy/v4_0/models/policy_configuration_ref.py b/vsts/vsts/policy/v4_0/models/policy_configuration_ref.py deleted file mode 100644 index 069f41bf..00000000 --- a/vsts/vsts/policy/v4_0/models/policy_configuration_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 PolicyConfigurationRef(Model): - """PolicyConfigurationRef. - - :param id: - :type id: int - :param type: - :type type: :class:`PolicyTypeRef ` - :param url: - :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 diff --git a/vsts/vsts/policy/v4_0/models/policy_evaluation_record.py b/vsts/vsts/policy/v4_0/models/policy_evaluation_record.py deleted file mode 100644 index 8ca910ea..00000000 --- a/vsts/vsts/policy/v4_0/models/policy_evaluation_record.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 PolicyEvaluationRecord(Model): - """PolicyEvaluationRecord. - - :param _links: - :type _links: :class:`ReferenceLinks ` - :param artifact_id: - :type artifact_id: str - :param completed_date: - :type completed_date: datetime - :param configuration: - :type configuration: :class:`PolicyConfiguration ` - :param context: - :type context: :class:`object ` - :param evaluation_id: - :type evaluation_id: str - :param started_date: - :type started_date: datetime - :param status: - :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 diff --git a/vsts/vsts/policy/v4_0/models/policy_type.py b/vsts/vsts/policy/v4_0/models/policy_type.py deleted file mode 100644 index b63adbd0..00000000 --- a/vsts/vsts/policy/v4_0/models/policy_type.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .policy_type_ref import PolicyTypeRef - - -class PolicyType(PolicyTypeRef): - """PolicyType. - - :param display_name: - :type display_name: str - :param id: - :type id: str - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param description: - :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 diff --git a/vsts/vsts/policy/v4_0/models/policy_type_ref.py b/vsts/vsts/policy/v4_0/models/policy_type_ref.py deleted file mode 100644 index bc9e52f9..00000000 --- a/vsts/vsts/policy/v4_0/models/policy_type_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 PolicyTypeRef(Model): - """PolicyTypeRef. - - :param display_name: - :type display_name: str - :param id: - :type id: str - :param url: - :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 diff --git a/vsts/vsts/policy/v4_0/models/reference_links.py b/vsts/vsts/policy/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/policy/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/policy/v4_0/models/versioned_policy_configuration_ref.py b/vsts/vsts/policy/v4_0/models/versioned_policy_configuration_ref.py deleted file mode 100644 index 89ad8bba..00000000 --- a/vsts/vsts/policy/v4_0/models/versioned_policy_configuration_ref.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .policy_configuration_ref import PolicyConfigurationRef - - -class VersionedPolicyConfigurationRef(PolicyConfigurationRef): - """VersionedPolicyConfigurationRef. - - :param id: - :type id: int - :param type: - :type type: :class:`PolicyTypeRef ` - :param url: - :type url: str - :param revision: - :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 diff --git a/vsts/vsts/policy/v4_0/policy_client.py b/vsts/vsts/policy/v4_0/policy_client.py deleted file mode 100644 index a0a1fc99..00000000 --- a/vsts/vsts/policy/v4_0/policy_client.py +++ /dev/null @@ -1,263 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class PolicyClient(VssClient): - """Policy - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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. - :param :class:` ` configuration: - :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='4.0', - route_values=route_values, - content=content) - return self._deserialize('PolicyConfiguration', response) - - def delete_policy_configuration(self, project, configuration_id): - """DeletePolicyConfiguration. - :param str project: Project ID or project name - :param int configuration_id: - """ - 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='4.0', - route_values=route_values) - - def get_policy_configuration(self, project, configuration_id): - """GetPolicyConfiguration. - :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') - response = self._send(http_method='GET', - location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='4.0', - route_values=route_values) - return self._deserialize('PolicyConfiguration', response) - - def get_policy_configurations(self, project, scope=None): - """GetPolicyConfigurations. - :param str project: Project ID or project name - :param str scope: - :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') - response = self._send(http_method='GET', - location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyConfiguration]', response) - - def update_policy_configuration(self, configuration, project, configuration_id): - """UpdatePolicyConfiguration. - :param :class:` ` configuration: - :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='PUT', - location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='4.0', - route_values=route_values, - content=content) - return self._deserialize('PolicyConfiguration', response) - - def get_policy_evaluation(self, project, evaluation_id): - """GetPolicyEvaluation. - [Preview API] - :param str project: Project ID or project name - :param str evaluation_id: - :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='4.0-preview.1', - route_values=route_values) - return self._deserialize('PolicyEvaluationRecord', response) - - def requeue_policy_evaluation(self, project, evaluation_id): - """RequeuePolicyEvaluation. - [Preview API] - :param str project: Project ID or project name - :param str evaluation_id: - :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='4.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] - :param str project: Project ID or project name - :param str artifact_id: - :param bool include_not_applicable: - :param int top: - :param int skip: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyEvaluationRecord]', response) - - def get_policy_configuration_revision(self, project, configuration_id, revision_id): - """GetPolicyConfigurationRevision. - :param str project: Project ID or project name - :param int configuration_id: - :param int 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='4.0', - route_values=route_values) - return self._deserialize('PolicyConfiguration', response) - - def get_policy_configuration_revisions(self, project, configuration_id, top=None, skip=None): - """GetPolicyConfigurationRevisions. - :param str project: Project ID or project name - :param int configuration_id: - :param int top: - :param int skip: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyConfiguration]', response) - - def get_policy_type(self, project, type_id): - """GetPolicyType. - :param str project: Project ID or project name - :param str type_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='4.0', - route_values=route_values) - return self._deserialize('PolicyType', response) - - def get_policy_types(self, project): - """GetPolicyTypes. - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[PolicyType]', response) - diff --git a/vsts/vsts/policy/v4_1/__init__.py b/vsts/vsts/policy/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/policy/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/policy/v4_1/models/__init__.py b/vsts/vsts/policy/v4_1/models/__init__.py deleted file mode 100644 index 15df3183..00000000 --- a/vsts/vsts/policy/v4_1/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef -from .policy_configuration import PolicyConfiguration -from .policy_configuration_ref import PolicyConfigurationRef -from .policy_evaluation_record import PolicyEvaluationRecord -from .policy_type import PolicyType -from .policy_type_ref import PolicyTypeRef -from .reference_links import ReferenceLinks -from .versioned_policy_configuration_ref import VersionedPolicyConfigurationRef - -__all__ = [ - 'IdentityRef', - 'PolicyConfiguration', - 'PolicyConfigurationRef', - 'PolicyEvaluationRecord', - 'PolicyType', - 'PolicyTypeRef', - 'ReferenceLinks', - 'VersionedPolicyConfigurationRef', -] diff --git a/vsts/vsts/policy/v4_1/models/identity_ref.py b/vsts/vsts/policy/v4_1/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/policy/v4_1/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/policy/v4_1/models/policy_configuration.py b/vsts/vsts/policy/v4_1/models/policy_configuration.py deleted file mode 100644 index 7b6445a6..00000000 --- a/vsts/vsts/policy/v4_1/models/policy_configuration.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .versioned_policy_configuration_ref import VersionedPolicyConfigurationRef - - -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 diff --git a/vsts/vsts/policy/v4_1/models/policy_configuration_ref.py b/vsts/vsts/policy/v4_1/models/policy_configuration_ref.py deleted file mode 100644 index ac5c5608..00000000 --- a/vsts/vsts/policy/v4_1/models/policy_configuration_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/policy/v4_1/models/policy_evaluation_record.py b/vsts/vsts/policy/v4_1/models/policy_evaluation_record.py deleted file mode 100644 index 27f43c0c..00000000 --- a/vsts/vsts/policy/v4_1/models/policy_evaluation_record.py +++ /dev/null @@ -1,53 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/policy/v4_1/models/policy_type.py b/vsts/vsts/policy/v4_1/models/policy_type.py deleted file mode 100644 index c4d045f9..00000000 --- a/vsts/vsts/policy/v4_1/models/policy_type.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .policy_type_ref import PolicyTypeRef - - -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 diff --git a/vsts/vsts/policy/v4_1/models/policy_type_ref.py b/vsts/vsts/policy/v4_1/models/policy_type_ref.py deleted file mode 100644 index 916b3afb..00000000 --- a/vsts/vsts/policy/v4_1/models/policy_type_ref.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/policy/v4_1/models/reference_links.py b/vsts/vsts/policy/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/policy/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/policy/v4_1/models/versioned_policy_configuration_ref.py b/vsts/vsts/policy/v4_1/models/versioned_policy_configuration_ref.py deleted file mode 100644 index 8b0a16da..00000000 --- a/vsts/vsts/policy/v4_1/models/versioned_policy_configuration_ref.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .policy_configuration_ref import PolicyConfigurationRef - - -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 diff --git a/vsts/vsts/policy/v4_1/policy_client.py b/vsts/vsts/policy/v4_1/policy_client.py deleted file mode 100644 index bdca231c..00000000 --- a/vsts/vsts/policy/v4_1/policy_client.py +++ /dev/null @@ -1,272 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class PolicyClient(VssClient): - """Policy - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('PolicyConfiguration', response) - - def delete_policy_configuration(self, project, configuration_id): - """DeletePolicyConfiguration. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - - def get_policy_configuration(self, project, configuration_id): - """GetPolicyConfiguration. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('PolicyConfiguration', response) - - def get_policy_configurations(self, project, scope=None): - """GetPolicyConfigurations. - [Preview API] Get a list of policy configurations in a project. - :param str project: Project ID or project name - :param str scope: The scope on which a subset of policies is applied. - :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') - response = self._send(http_method='GET', - location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyConfiguration]', response) - - def update_policy_configuration(self, configuration, project, configuration_id): - """UpdatePolicyConfiguration. - [Preview API] 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='4.1-preview.1', - 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='4.1-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='4.1-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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyEvaluationRecord]', response) - - def get_policy_configuration_revision(self, project, configuration_id, revision_id): - """GetPolicyConfigurationRevision. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('PolicyConfiguration', response) - - def get_policy_configuration_revisions(self, project, configuration_id, top=None, skip=None): - """GetPolicyConfigurationRevisions. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PolicyConfiguration]', response) - - def get_policy_type(self, project, type_id): - """GetPolicyType. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('PolicyType', response) - - def get_policy_types(self, project): - """GetPolicyTypes. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[PolicyType]', response) - diff --git a/vsts/vsts/vss_client.py b/vsts/vsts/vss_client.py deleted file mode 100644 index 687c7ef4..00000000 --- a/vsts/vsts/vss_client.py +++ /dev/null @@ -1,253 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import logging -import os -import re -import uuid - -from msrest import Deserializer, Serializer -from msrest.exceptions import DeserializationError, SerializationError -from msrest.pipeline import ClientRequest -from msrest.service_client import ServiceClient -from .exceptions import VstsAuthenticationError, VstsClientRequestError, VstsServiceError -from .vss_client_configuration import VssClientConfiguration -from . import models -from ._file_cache import OPTIONS_CACHE as OPTIONS_FILE_CACHE - - -class VssClient: - """VssClient. - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - self.config = VssClientConfiguration(base_url) - self._client = ServiceClient(creds, 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.normalized_url = VssClient._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, **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': - print(request.method + ' ' + request.url) - response = self._client.send(request=request, headers=headers, - content=content, **operation_config) - 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', - returns_collection=False): - 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) - # Construct headers - headers = {'Content-Type': media_type + '; charset=utf-8', - 'Accept': 'application/json;api-version=' + negotiated_version} - 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 VssClient._session_header_key in VssClient._session_data and VssClient._session_header_key not in headers: - headers[VssClient._session_header_key] = VssClient._session_data[VssClient._session_header_key] - response = self._send_request(request=request, headers=headers, content=content) - if VssClient._session_header_key in response.headers: - VssClient._session_data[VssClient._session_header_key] = response.headers[VssClient._session_header_key] - if returns_collection: - 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 - else: - return response - - 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) - logging.debug('Route template: %s', location.route_template) - url = self._client.format_url(route_template, **route_values) - request = ClientRequest() - request.url = self._client.format_url(url) - if query_parameters: - request.format_parameters(query_parameters) - request.method = http_method - 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 VssClient._locations_cache: - VssClient._locations_cache[self.config.base_url] = self._get_resource_locations(all_host_types=False) - for location in VssClient._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: - logging.info('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: - logging.exception(str(ex)) - else: - logging.info('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() - request.url = self._client.format_url(options_uri) - if all_host_types: - query_parameters = {'allHostTypes': True} - request.format_parameters(query_parameters) - request.method = 'OPTIONS' - headers = {'Accept': 'application/json'} - if self._suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - response = self._send_request(request, headers=headers) - wrapper = self._base_deserialize('VssJsonCollectionWrapper', response) - if wrapper is None: - raise VstsClientRequestError("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: - logging.exception(str(ex)) - 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 = str(requested_api_version) - 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 VstsServiceError(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: - wrapped_exception = self._base_deserialize('ImproperException', collection_wrapper.value) - raise VstsClientRequestError(wrapped_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 VstsAuthenticationError(full_message_format.format(error_message=error_message, - url=request.url)) - else: - full_message_format = '{error_message}Operation returned an invalid status code of {status_code}.' - raise VstsClientRequestError(full_message_format.format(error_message=error_message, - status_code=response.status_code)) - - @staticmethod - def _normalize_url(url): - return url.rstrip('/').lower() - - _locations_cache = {} - _session_header_key = 'X-TFS-Session' - _session_data = {_session_header_key: str(uuid.uuid4())} - - -TRACE_ENV_VAR = 'vsts_python_print_urls' diff --git a/vsts/vsts/vss_client_configuration.py b/vsts/vsts/vss_client_configuration.py deleted file mode 100644 index 1e4001a3..00000000 --- a/vsts/vsts/vss_client_configuration.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 VssClientConfiguration(Configuration): - def __init__(self, base_url=None): - if not base_url: - raise ValueError('base_url is required.') - base_url = base_url.rstrip('/') - super(VssClientConfiguration, self).__init__(base_url) - self.add_user_agent('vsts/{}'.format(VERSION)) - self.additional_headers = {} diff --git a/vsts/vsts/vss_connection.py b/vsts/vsts/vss_connection.py deleted file mode 100644 index 10361408..00000000 --- a/vsts/vsts/vss_connection.py +++ /dev/null @@ -1,102 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .exceptions import VstsClientRequestError -from .location.v4_0.location_client import LocationClient -from .vss_client_configuration import VssClientConfiguration - - -class VssConnection: - """VssConnection. - """ - - def __init__(self, base_url=None, creds=None, user_agent=None): - self._config = VssClientConfiguration(base_url) - 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 - - 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) - 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 VstsClientRequestError(('Failed to retrieve resource areas ' - + 'from server: {url}').format(url=self.base_url)) - if len(resource_areas) == 0: - # 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 - raise VstsClientRequestError(('Could not find information for resource area {id} ' - + 'from server: {url}').format(id=resource_id, - url=self.base_url)) - - 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 not force and RESOURCE_FILE_CACHE[location_client.normalized_url]: - try: - logging.info('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: - logging.exception(str(ex)) - elif not force: - logging.info('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: - logging.exception(str(ex)) - return self._resource_areas - - @staticmethod - def _combine_url(part1, part2): - return part1.rstrip('/') + '/' + part2.strip('/') diff --git a/vsts/vsts/work_item_tracking/__init__.py b/vsts/vsts/work_item_tracking/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/work_item_tracking/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/work_item_tracking/v4_0/__init__.py b/vsts/vsts/work_item_tracking/v4_0/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/work_item_tracking/v4_0/models/__init__.py b/vsts/vsts/work_item_tracking/v4_0/models/__init__.py deleted file mode 100644 index be116758..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/__init__.py +++ /dev/null @@ -1,141 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .account_my_work_result import AccountMyWorkResult -from .account_recent_activity_work_item_model import AccountRecentActivityWorkItemModel -from .account_recent_mention_work_item_model import AccountRecentMentionWorkItemModel -from .account_work_work_item_model import AccountWorkWorkItemModel -from .artifact_uri_query import ArtifactUriQuery -from .artifact_uri_query_result import ArtifactUriQueryResult -from .attachment_reference import AttachmentReference -from .field_dependent_rule import FieldDependentRule -from .fields_to_evaluate import FieldsToEvaluate -from .identity_ref import IdentityRef -from .identity_reference import IdentityReference -from .json_patch_operation import JsonPatchOperation -from .link import Link -from .project_work_item_state_colors import ProjectWorkItemStateColors -from .provisioning_result import ProvisioningResult -from .query_hierarchy_item import QueryHierarchyItem -from .query_hierarchy_items_result import QueryHierarchyItemsResult -from .reference_links import ReferenceLinks -from .reporting_work_item_link import ReportingWorkItemLink -from .reporting_work_item_links_batch import ReportingWorkItemLinksBatch -from .reporting_work_item_revisions_batch import ReportingWorkItemRevisionsBatch -from .reporting_work_item_revisions_filter import ReportingWorkItemRevisionsFilter -from .streamed_batch import StreamedBatch -from .team_context import TeamContext -from .wiql import Wiql -from .work_artifact_link import WorkArtifactLink -from .work_item import WorkItem -from .work_item_classification_node import WorkItemClassificationNode -from .work_item_comment import WorkItemComment -from .work_item_comments import WorkItemComments -from .work_item_delete import WorkItemDelete -from .work_item_delete_reference import WorkItemDeleteReference -from .work_item_delete_shallow_reference import WorkItemDeleteShallowReference -from .work_item_delete_update import WorkItemDeleteUpdate -from .work_item_field import WorkItemField -from .work_item_field_operation import WorkItemFieldOperation -from .work_item_field_reference import WorkItemFieldReference -from .work_item_field_update import WorkItemFieldUpdate -from .work_item_history import WorkItemHistory -from .work_item_icon import WorkItemIcon -from .work_item_link import WorkItemLink -from .work_item_query_clause import WorkItemQueryClause -from .work_item_query_result import WorkItemQueryResult -from .work_item_query_sort_column import WorkItemQuerySortColumn -from .work_item_reference import WorkItemReference -from .work_item_relation import WorkItemRelation -from .work_item_relation_type import WorkItemRelationType -from .work_item_relation_updates import WorkItemRelationUpdates -from .work_item_state_color import WorkItemStateColor -from .work_item_state_transition import WorkItemStateTransition -from .work_item_template import WorkItemTemplate -from .work_item_template_reference import WorkItemTemplateReference -from .work_item_tracking_reference import WorkItemTrackingReference -from .work_item_tracking_resource import WorkItemTrackingResource -from .work_item_tracking_resource_reference import WorkItemTrackingResourceReference -from .work_item_type import WorkItemType -from .work_item_type_category import WorkItemTypeCategory -from .work_item_type_color import WorkItemTypeColor -from .work_item_type_color_and_icon import WorkItemTypeColorAndIcon -from .work_item_type_field_instance import WorkItemTypeFieldInstance -from .work_item_type_reference import WorkItemTypeReference -from .work_item_type_state_colors import WorkItemTypeStateColors -from .work_item_type_template import WorkItemTypeTemplate -from .work_item_type_template_update_model import WorkItemTypeTemplateUpdateModel -from .work_item_update import WorkItemUpdate - -__all__ = [ - 'AccountMyWorkResult', - 'AccountRecentActivityWorkItemModel', - 'AccountRecentMentionWorkItemModel', - 'AccountWorkWorkItemModel', - 'ArtifactUriQuery', - 'ArtifactUriQueryResult', - 'AttachmentReference', - 'FieldDependentRule', - 'FieldsToEvaluate', - 'IdentityRef', - 'IdentityReference', - 'JsonPatchOperation', - 'Link', - 'ProjectWorkItemStateColors', - 'ProvisioningResult', - 'QueryHierarchyItem', - 'QueryHierarchyItemsResult', - 'ReferenceLinks', - 'ReportingWorkItemLink', - 'ReportingWorkItemLinksBatch', - 'ReportingWorkItemRevisionsBatch', - 'ReportingWorkItemRevisionsFilter', - 'StreamedBatch', - 'TeamContext', - 'Wiql', - 'WorkArtifactLink', - 'WorkItem', - 'WorkItemClassificationNode', - 'WorkItemComment', - 'WorkItemComments', - 'WorkItemDelete', - 'WorkItemDeleteReference', - 'WorkItemDeleteShallowReference', - 'WorkItemDeleteUpdate', - 'WorkItemField', - 'WorkItemFieldOperation', - 'WorkItemFieldReference', - 'WorkItemFieldUpdate', - 'WorkItemHistory', - 'WorkItemIcon', - 'WorkItemLink', - 'WorkItemQueryClause', - 'WorkItemQueryResult', - 'WorkItemQuerySortColumn', - 'WorkItemReference', - 'WorkItemRelation', - 'WorkItemRelationType', - 'WorkItemRelationUpdates', - 'WorkItemStateColor', - 'WorkItemStateTransition', - 'WorkItemTemplate', - 'WorkItemTemplateReference', - 'WorkItemTrackingReference', - 'WorkItemTrackingResource', - 'WorkItemTrackingResourceReference', - 'WorkItemType', - 'WorkItemTypeCategory', - 'WorkItemTypeColor', - 'WorkItemTypeColorAndIcon', - 'WorkItemTypeFieldInstance', - 'WorkItemTypeReference', - 'WorkItemTypeStateColors', - 'WorkItemTypeTemplate', - 'WorkItemTypeTemplateUpdateModel', - 'WorkItemUpdate', -] diff --git a/vsts/vsts/work_item_tracking/v4_0/models/account_my_work_result.py b/vsts/vsts/work_item_tracking/v4_0/models/account_my_work_result.py deleted file mode 100644 index b11684b7..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/account_my_work_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/account_recent_activity_work_item_model.py b/vsts/vsts/work_item_tracking/v4_0/models/account_recent_activity_work_item_model.py deleted file mode 100644 index ac42f453..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/account_recent_activity_work_item_model.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/account_recent_mention_work_item_model.py b/vsts/vsts/work_item_tracking/v4_0/models/account_recent_mention_work_item_model.py deleted file mode 100644 index cd9bd1d4..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/account_recent_mention_work_item_model.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/account_work_work_item_model.py b/vsts/vsts/work_item_tracking/v4_0/models/account_work_work_item_model.py deleted file mode 100644 index 6cb04c84..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/account_work_work_item_model.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query.py b/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query.py deleted file mode 100644 index 227aa0b6..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ArtifactUriQuery(Model): - """ArtifactUriQuery. - - :param artifact_uris: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query_result.py b/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query_result.py deleted file mode 100644 index a7d9b67f..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/artifact_uri_query_result.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ArtifactUriQueryResult(Model): - """ArtifactUriQueryResult. - - :param artifact_uris_query_result: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/attachment_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/attachment_reference.py deleted file mode 100644 index b05f6c11..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/attachment_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/field_dependent_rule.py b/vsts/vsts/work_item_tracking/v4_0/models/field_dependent_rule.py deleted file mode 100644 index 9f83c976..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/field_dependent_rule.py +++ /dev/null @@ -1,31 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class FieldDependentRule(WorkItemTrackingResource): - """FieldDependentRule. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/fields_to_evaluate.py b/vsts/vsts/work_item_tracking/v4_0/models/fields_to_evaluate.py deleted file mode 100644 index b0c3cb2c..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/fields_to_evaluate.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 FieldsToEvaluate(Model): - """FieldsToEvaluate. - - :param fields: - :type fields: list of str - :param field_updates: - :type field_updates: dict - :param field_values: - :type field_values: dict - :param rules_from: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/identity_ref.py b/vsts/vsts/work_item_tracking/v4_0/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/work_item_tracking/v4_0/models/identity_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/identity_reference.py deleted file mode 100644 index 29c2e6ee..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/identity_reference.py +++ /dev/null @@ -1,56 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef - - -class IdentityReference(IdentityRef): - """IdentityReference. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: 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 = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, id=None, name=None): - super(IdentityReference, self).__init__(directory_alias=directory_alias, display_name=display_name, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) - self.id = id - self.name = name diff --git a/vsts/vsts/work_item_tracking/v4_0/models/json_patch_operation.py b/vsts/vsts/work_item_tracking/v4_0/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/link.py b/vsts/vsts/work_item_tracking/v4_0/models/link.py deleted file mode 100644 index 3de1815d..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Link(Model): - """Link. - - :param attributes: - :type attributes: dict - :param rel: - :type rel: str - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/project_work_item_state_colors.py b/vsts/vsts/work_item_tracking/v4_0/models/project_work_item_state_colors.py deleted file mode 100644 index 31111254..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/project_work_item_state_colors.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/provisioning_result.py b/vsts/vsts/work_item_tracking/v4_0/models/provisioning_result.py deleted file mode 100644 index 983ec8e5..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/provisioning_result.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ProvisioningResult(Model): - """ProvisioningResult. - - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_item.py b/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_item.py deleted file mode 100644 index b0c0dc3f..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_item.py +++ /dev/null @@ -1,115 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class QueryHierarchyItem(WorkItemTrackingResource): - """QueryHierarchyItem. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param children: - :type children: list of :class:`QueryHierarchyItem ` - :param clauses: - :type clauses: :class:`WorkItemQueryClause ` - :param columns: - :type columns: list of :class:`WorkItemFieldReference ` - :param created_by: - :type created_by: :class:`IdentityReference ` - :param created_date: - :type created_date: datetime - :param filter_options: - :type filter_options: object - :param has_children: - :type has_children: bool - :param id: - :type id: str - :param is_deleted: - :type is_deleted: bool - :param is_folder: - :type is_folder: bool - :param is_invalid_syntax: - :type is_invalid_syntax: bool - :param is_public: - :type is_public: bool - :param last_modified_by: - :type last_modified_by: :class:`IdentityReference ` - :param last_modified_date: - :type last_modified_date: datetime - :param link_clauses: - :type link_clauses: :class:`WorkItemQueryClause ` - :param name: - :type name: str - :param path: - :type path: str - :param query_type: - :type query_type: object - :param sort_columns: - :type sort_columns: list of :class:`WorkItemQuerySortColumn ` - :param source_clauses: - :type source_clauses: :class:`WorkItemQueryClause ` - :param target_clauses: - :type target_clauses: :class:`WorkItemQueryClause ` - :param wiql: - :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_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_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_modified_by=None, last_modified_date=None, link_clauses=None, name=None, path=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_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_type = query_type - self.sort_columns = sort_columns - self.source_clauses = source_clauses - self.target_clauses = target_clauses - self.wiql = wiql diff --git a/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_items_result.py b/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_items_result.py deleted file mode 100644 index 76f1d64a..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/query_hierarchy_items_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 QueryHierarchyItemsResult(Model): - """QueryHierarchyItemsResult. - - :param count: - :type count: int - :param has_more: - :type has_more: bool - :param value: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/reference_links.py b/vsts/vsts/work_item_tracking/v4_0/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_link.py b/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_link.py deleted file mode 100644 index def0a49d..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_link.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ReportingWorkItemLink(Model): - """ReportingWorkItemLink. - - :param changed_by: - :type changed_by: :class:`IdentityRef ` - :param changed_date: - :type changed_date: datetime - :param changed_operation: - :type changed_operation: object - :param comment: - :type comment: str - :param is_active: - :type is_active: bool - :param link_type: - :type link_type: str - :param rel: - :type rel: str - :param source_id: - :type source_id: int - :param target_id: - :type target_id: int - """ - - _attribute_map = { - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'changed_operation': {'key': 'changedOperation', 'type': 'object'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'rel': {'key': 'rel', 'type': 'str'}, - 'source_id': {'key': 'sourceId', 'type': 'int'}, - 'target_id': {'key': 'targetId', 'type': 'int'} - } - - def __init__(self, changed_by=None, changed_date=None, changed_operation=None, comment=None, is_active=None, link_type=None, rel=None, source_id=None, target_id=None): - super(ReportingWorkItemLink, self).__init__() - self.changed_by = changed_by - self.changed_date = changed_date - self.changed_operation = changed_operation - self.comment = comment - self.is_active = is_active - self.link_type = link_type - self.rel = rel - self.source_id = source_id - self.target_id = target_id diff --git a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_links_batch.py b/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_links_batch.py deleted file mode 100644 index 525223a2..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_links_batch.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .streamed_batch import StreamedBatch - - -class ReportingWorkItemLinksBatch(StreamedBatch): - """ReportingWorkItemLinksBatch. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ReportingWorkItemLinksBatch, self).__init__() diff --git a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_batch.py b/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_batch.py deleted file mode 100644 index 5c401a3d..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_batch.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .streamed_batch import StreamedBatch - - -class ReportingWorkItemRevisionsBatch(StreamedBatch): - """ReportingWorkItemRevisionsBatch. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ReportingWorkItemRevisionsBatch, self).__init__() diff --git a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_filter.py b/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_filter.py deleted file mode 100644 index be8e5148..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/reporting_work_item_revisions_filter.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/streamed_batch.py b/vsts/vsts/work_item_tracking/v4_0/models/streamed_batch.py deleted file mode 100644 index 06713ff2..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/streamed_batch.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/team_context.py b/vsts/vsts/work_item_tracking/v4_0/models/team_context.py deleted file mode 100644 index 18418ce7..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/team_context.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/wiql.py b/vsts/vsts/work_item_tracking/v4_0/models/wiql.py deleted file mode 100644 index 963d17e3..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/wiql.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Wiql(Model): - """Wiql. - - :param query: - :type query: str - """ - - _attribute_map = { - 'query': {'key': 'query', 'type': 'str'} - } - - def __init__(self, query=None): - super(Wiql, self).__init__() - self.query = query diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_artifact_link.py b/vsts/vsts/work_item_tracking/v4_0/models/work_artifact_link.py deleted file mode 100644 index 5ce77abe..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_artifact_link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkArtifactLink(Model): - """WorkArtifactLink. - - :param artifact_type: - :type artifact_type: str - :param link_type: - :type link_type: str - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item.py deleted file mode 100644 index f31fcdfb..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItem(WorkItemTrackingResource): - """WorkItem. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param fields: - :type fields: dict - :param id: - :type id: int - :param relations: - :type relations: list of :class:`WorkItemRelation ` - :param rev: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_classification_node.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_classification_node.py deleted file mode 100644 index 1864398d..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_classification_node.py +++ /dev/null @@ -1,51 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemClassificationNode(WorkItemTrackingResource): - """WorkItemClassificationNode. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param attributes: - :type attributes: dict - :param children: - :type children: list of :class:`WorkItemClassificationNode ` - :param id: - :type id: int - :param identifier: - :type identifier: str - :param name: - :type name: str - :param 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]'}, - '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, id=None, identifier=None, name=None, structure_type=None): - super(WorkItemClassificationNode, self).__init__(url=url, _links=_links) - self.attributes = attributes - self.children = children - self.id = id - self.identifier = identifier - self.name = name - self.structure_type = structure_type diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_comment.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_comment.py deleted file mode 100644 index 398a4a01..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_comment.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemComment(WorkItemTrackingResource): - """WorkItemComment. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param revised_by: - :type revised_by: :class:`IdentityReference ` - :param revised_date: - :type revised_date: datetime - :param revision: - :type revision: int - :param text: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_comments.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_comments.py deleted file mode 100644 index 5fab0ced..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_comments.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemComments(Model): - """WorkItemComments. - - :param comments: - :type comments: list of :class:`WorkItemComment ` - :param count: - :type count: int - :param from_revision_count: - :type from_revision_count: int - :param total_count: - :type total_count: int - """ - - _attribute_map = { - '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, comments=None, count=None, from_revision_count=None, total_count=None): - super(WorkItemComments, self).__init__() - self.comments = comments - self.count = count - self.from_revision_count = from_revision_count - self.total_count = total_count diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete.py deleted file mode 100644 index d1a6686e..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_delete_reference import WorkItemDeleteReference - - -class WorkItemDelete(WorkItemDeleteReference): - """WorkItemDelete. - - :param code: - :type code: int - :param deleted_by: - :type deleted_by: str - :param deleted_date: - :type deleted_date: str - :param id: - :type id: int - :param message: - :type message: str - :param name: - :type name: str - :param project: - :type project: str - :param type: - :type type: str - :param url: - :type url: str - :param resource: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_reference.py deleted file mode 100644 index 60ccf011..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_reference.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemDeleteReference(Model): - """WorkItemDeleteReference. - - :param code: - :type code: int - :param deleted_by: - :type deleted_by: str - :param deleted_date: - :type deleted_date: str - :param id: - :type id: int - :param message: - :type message: str - :param name: - :type name: str - :param project: - :type project: str - :param type: - :type type: str - :param url: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_shallow_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_shallow_reference.py deleted file mode 100644 index 9aab4bb1..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_shallow_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemDeleteShallowReference(Model): - """WorkItemDeleteShallowReference. - - :param id: - :type id: int - :param url: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_update.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_update.py deleted file mode 100644 index 7ac3b8d5..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_delete_update.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemDeleteUpdate(Model): - """WorkItemDeleteUpdate. - - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_field.py deleted file mode 100644 index be716c99..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field.py +++ /dev/null @@ -1,63 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemField(WorkItemTrackingResource): - """WorkItemField. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param description: - :type description: str - :param is_identity: - :type is_identity: bool - :param is_picklist: - :type is_picklist: bool - :param is_picklist_suggested: - :type is_picklist_suggested: bool - :param name: - :type name: str - :param read_only: - :type read_only: bool - :param reference_name: - :type reference_name: str - :param supported_operations: - :type supported_operations: list of :class:`WorkItemFieldOperation ` - :param type: - :type type: object - """ - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_identity': {'key': 'isIdentity', 'type': 'bool'}, - 'is_picklist': {'key': 'isPicklist', 'type': 'bool'}, - 'is_picklist_suggested': {'key': 'isPicklistSuggested', 'type': 'bool'}, - 'name': {'key': 'name', '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'} - } - - def __init__(self, url=None, _links=None, description=None, is_identity=None, is_picklist=None, is_picklist_suggested=None, name=None, read_only=None, reference_name=None, supported_operations=None, type=None): - super(WorkItemField, self).__init__(url=url, _links=_links) - self.description = description - self.is_identity = is_identity - self.is_picklist = is_picklist - self.is_picklist_suggested = is_picklist_suggested - self.name = name - self.read_only = read_only - self.reference_name = reference_name - self.supported_operations = supported_operations - self.type = type diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_operation.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_operation.py deleted file mode 100644 index 2fd56f17..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_operation.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemFieldOperation(Model): - """WorkItemFieldOperation. - - :param name: - :type name: str - :param reference_name: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_reference.py deleted file mode 100644 index 625dbfdf..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemFieldReference(Model): - """WorkItemFieldReference. - - :param name: - :type name: str - :param reference_name: - :type reference_name: str - :param url: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_update.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_update.py deleted file mode 100644 index 3160cd29..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_field_update.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemFieldUpdate(Model): - """WorkItemFieldUpdate. - - :param new_value: - :type new_value: object - :param old_value: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py deleted file mode 100644 index 1c11baf3..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemHistory(WorkItemTrackingResource): - """WorkItemHistory. - - :param url: - :type url: str - :param _links: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_icon.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_icon.py deleted file mode 100644 index 426e8f58..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_icon.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemIcon(Model): - """WorkItemIcon. - - :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(WorkItemIcon, self).__init__() - self.id = id - self.url = url diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_link.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_link.py deleted file mode 100644 index abf2d833..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemLink(Model): - """WorkItemLink. - - :param rel: - :type rel: str - :param source: - :type source: :class:`WorkItemReference ` - :param target: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_clause.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_clause.py deleted file mode 100644 index 5b845e6e..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_clause.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQueryClause(Model): - """WorkItemQueryClause. - - :param clauses: - :type clauses: list of :class:`WorkItemQueryClause ` - :param field: - :type field: :class:`WorkItemFieldReference ` - :param field_value: - :type field_value: :class:`WorkItemFieldReference ` - :param is_field_value: - :type is_field_value: bool - :param logical_operator: - :type logical_operator: object - :param operator: - :type operator: :class:`WorkItemFieldOperation ` - :param value: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_result.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_result.py deleted file mode 100644 index 79a17cc4..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQueryResult(Model): - """WorkItemQueryResult. - - :param as_of: - :type as_of: datetime - :param columns: - :type columns: list of :class:`WorkItemFieldReference ` - :param query_result_type: - :type query_result_type: object - :param query_type: - :type query_type: object - :param sort_columns: - :type sort_columns: list of :class:`WorkItemQuerySortColumn ` - :param work_item_relations: - :type work_item_relations: list of :class:`WorkItemLink ` - :param work_items: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_sort_column.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_sort_column.py deleted file mode 100644 index 1203e993..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_query_sort_column.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQuerySortColumn(Model): - """WorkItemQuerySortColumn. - - :param descending: - :type descending: bool - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_reference.py deleted file mode 100644 index c9f2ee35..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemReference(Model): - """WorkItemReference. - - :param id: - :type id: int - :param url: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation.py deleted file mode 100644 index 081ad541..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation.py +++ /dev/null @@ -1,30 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .link import Link - - -class WorkItemRelation(Link): - """WorkItemRelation. - - :param attributes: - :type attributes: dict - :param rel: - :type rel: str - :param 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) diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_type.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_type.py deleted file mode 100644 index 9192153b..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_type.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_reference import WorkItemTrackingReference - - -class WorkItemRelationType(WorkItemTrackingReference): - """WorkItemRelationType. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param name: - :type name: str - :param reference_name: - :type reference_name: str - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_updates.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_updates.py deleted file mode 100644 index ba6739e5..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_relation_updates.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemRelationUpdates(Model): - """WorkItemRelationUpdates. - - :param added: - :type added: list of :class:`WorkItemRelation ` - :param removed: - :type removed: list of :class:`WorkItemRelation ` - :param updated: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_color.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_color.py deleted file mode 100644 index 360fe743..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_color.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemStateColor(Model): - """WorkItemStateColor. - - :param color: Color value - :type color: str - :param name: Work item type state name - :type name: str - """ - - _attribute_map = { - 'color': {'key': 'color', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, color=None, name=None): - super(WorkItemStateColor, self).__init__() - self.color = color - self.name = name diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_transition.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_transition.py deleted file mode 100644 index 911a53f3..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_state_transition.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemStateTransition(Model): - """WorkItemStateTransition. - - :param actions: - :type actions: list of str - :param to: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_template.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_template.py deleted file mode 100644 index b456dbdc..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_template.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_template_reference import WorkItemTemplateReference - - -class WorkItemTemplate(WorkItemTemplateReference): - """WorkItemTemplate. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param description: - :type description: str - :param id: - :type id: str - :param name: - :type name: str - :param work_item_type_name: - :type work_item_type_name: str - :param fields: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_template_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_template_reference.py deleted file mode 100644 index 672d9c17..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_template_reference.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemTemplateReference(WorkItemTrackingResource): - """WorkItemTemplateReference. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param description: - :type description: str - :param id: - :type id: str - :param name: - :type name: str - :param work_item_type_name: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_reference.py deleted file mode 100644 index b74bee0c..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_reference.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemTrackingReference(WorkItemTrackingResource): - """WorkItemTrackingReference. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param name: - :type name: str - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource.py deleted file mode 100644 index 19f3d6d6..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource_reference import WorkItemTrackingResourceReference - - -class WorkItemTrackingResource(WorkItemTrackingResourceReference): - """WorkItemTrackingResource. - - :param url: - :type url: str - :param _links: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource_reference.py deleted file mode 100644 index de9a728b..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_tracking_resource_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type.py deleted file mode 100644 index fb9fe1ef..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type.py +++ /dev/null @@ -1,59 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemType(WorkItemTrackingResource): - """WorkItemType. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param color: - :type color: str - :param description: - :type description: str - :param field_instances: - :type field_instances: list of :class:`WorkItemTypeFieldInstance ` - :param fields: - :type fields: list of :class:`WorkItemTypeFieldInstance ` - :param icon: - :type icon: :class:`WorkItemIcon ` - :param name: - :type name: str - :param transitions: - :type transitions: dict - :param 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'}, - 'name': {'key': 'name', 'type': 'str'}, - '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, name=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.name = name - self.transitions = transitions - self.xml_form = xml_form diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_category.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_category.py deleted file mode 100644 index 5581bc08..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_category.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemTypeCategory(WorkItemTrackingResource): - """WorkItemTypeCategory. - - :param url: - :type url: str - :param _links: - :type _links: :class:`ReferenceLinks ` - :param default_work_item_type: - :type default_work_item_type: :class:`WorkItemTypeReference ` - :param name: - :type name: str - :param reference_name: - :type reference_name: str - :param work_item_types: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color.py deleted file mode 100644 index 13d95615..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemTypeColor(Model): - """WorkItemTypeColor. - - :param primary_color: - :type primary_color: str - :param secondary_color: - :type secondary_color: str - :param work_item_type_name: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color_and_icon.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color_and_icon.py deleted file mode 100644 index 195ac573..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_color_and_icon.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemTypeColorAndIcon(Model): - """WorkItemTypeColorAndIcon. - - :param color: - :type color: str - :param icon: - :type icon: str - :param work_item_type_name: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_field_instance.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_field_instance.py deleted file mode 100644 index 91eb5881..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_field_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_field_reference import WorkItemFieldReference - - -class WorkItemTypeFieldInstance(WorkItemFieldReference): - """WorkItemTypeFieldInstance. - - :param name: - :type name: str - :param reference_name: - :type reference_name: str - :param url: - :type url: str - :param always_required: - :type always_required: bool - :param field: - :type field: :class:`WorkItemFieldReference ` - :param help_text: - :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'}, - 'field': {'key': 'field', 'type': 'WorkItemFieldReference'}, - 'help_text': {'key': 'helpText', 'type': 'str'} - } - - def __init__(self, name=None, reference_name=None, url=None, always_required=None, field=None, help_text=None): - super(WorkItemTypeFieldInstance, self).__init__(name=name, reference_name=reference_name, url=url) - self.always_required = always_required - self.field = field - self.help_text = help_text diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_reference.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_reference.py deleted file mode 100644 index 29f8ec5b..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_reference.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource_reference import WorkItemTrackingResourceReference - - -class WorkItemTypeReference(WorkItemTrackingResourceReference): - """WorkItemTypeReference. - - :param url: - :type url: str - :param name: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_state_colors.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_state_colors.py deleted file mode 100644 index b0a24fde..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_state_colors.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template.py deleted file mode 100644 index af36b022..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemTypeTemplate(Model): - """WorkItemTypeTemplate. - - :param template: - :type template: str - """ - - _attribute_map = { - 'template': {'key': 'template', 'type': 'str'} - } - - def __init__(self, template=None): - super(WorkItemTypeTemplate, self).__init__() - self.template = template diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template_update_model.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template_update_model.py deleted file mode 100644 index 71863f76..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_type_template_update_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemTypeTemplateUpdateModel(Model): - """WorkItemTypeTemplateUpdateModel. - - :param action_type: - :type action_type: object - :param methodology: - :type methodology: str - :param template: - :type template: str - :param template_type: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_0/models/work_item_update.py b/vsts/vsts/work_item_tracking/v4_0/models/work_item_update.py deleted file mode 100644 index c2ba7ccf..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/models/work_item_update.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource_reference import WorkItemTrackingResourceReference - - -class WorkItemUpdate(WorkItemTrackingResourceReference): - """WorkItemUpdate. - - :param url: - :type url: str - :param fields: - :type fields: dict - :param id: - :type id: int - :param relations: - :type relations: :class:`WorkItemRelationUpdates ` - :param rev: - :type rev: int - :param revised_by: - :type revised_by: :class:`IdentityReference ` - :param revised_date: - :type revised_date: datetime - :param work_item_id: - :type work_item_id: int - """ - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - '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, fields=None, id=None, relations=None, rev=None, revised_by=None, revised_date=None, work_item_id=None): - super(WorkItemUpdate, self).__init__(url=url) - 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 diff --git a/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py b/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py deleted file mode 100644 index 2aa104c0..00000000 --- a/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py +++ /dev/null @@ -1,1471 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class WorkItemTrackingClient(VssClient): - """WorkItemTracking - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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 workItemTracking toolTypes outboundLinks of type WorkItem - :rtype: [WorkArtifactLink] - """ - response = self._send(http_method='GET', - location_id='1a31de40-e318-41cd-a6c6-881077df52e3', - version='4.0-preview.1', - returns_collection=True) - return self._deserialize('[WorkArtifactLink]', response) - - def get_work_item_ids_for_artifact_uris(self, artifact_uri_query): - """GetWorkItemIdsForArtifactUris. - [Preview API] Gets the results of the work item ids linked to the artifact uri - :param :class:` ` artifact_uri_query: List of artifact uris. - :rtype: :class:` ` - """ - content = self._serialize.body(artifact_uri_query, 'ArtifactUriQuery') - response = self._send(http_method='POST', - location_id='a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3', - version='4.0-preview.1', - content=content) - return self._deserialize('ArtifactUriQueryResult', response) - - def create_attachment(self, upload_stream, file_name=None, upload_type=None, area_path=None): - """CreateAttachment. - Creates an attachment. - :param object upload_stream: Stream to upload - :param str file_name: - :param str upload_type: - :param str area_path: - :rtype: :class:` ` - """ - 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') - content = self._serialize.body(upload_stream, 'object') - response = self._send(http_method='POST', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.0', - query_parameters=query_parameters, - content=content, - media_type='application/octet-stream') - return self._deserialize('AttachmentReference', response) - - def get_attachment_content(self, id, file_name=None): - """GetAttachmentContent. - Returns an attachment - :param str id: - :param str file_name: - :rtype: object - """ - route_values = {} - 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') - response = self._send(http_method='GET', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_attachment_zip(self, id, file_name=None): - """GetAttachmentZip. - Returns an attachment - :param str id: - :param str file_name: - :rtype: object - """ - route_values = {} - 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') - response = self._send(http_method='GET', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_root_nodes(self, project, depth=None): - """GetRootNodes. - :param str project: Project ID or project name - :param int depth: - :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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemClassificationNode]', response) - - def create_or_update_classification_node(self, posted_node, project, structure_group, path=None): - """CreateOrUpdateClassificationNode. - :param :class:` ` posted_node: - :param str project: Project ID or project name - :param TreeStructureGroup structure_group: - :param str path: - :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='4.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. - :param str project: Project ID or project name - :param TreeStructureGroup structure_group: - :param str path: - :param int reclassify_id: - """ - 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='4.0', - route_values=route_values, - query_parameters=query_parameters) - - def get_classification_node(self, project, structure_group, path=None, depth=None): - """GetClassificationNode. - :param str project: Project ID or project name - :param TreeStructureGroup structure_group: - :param str path: - :param int depth: - :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='4.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. - :param :class:` ` posted_node: - :param str project: Project ID or project name - :param TreeStructureGroup structure_group: - :param str path: - :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='4.0', - route_values=route_values, - content=content) - return self._deserialize('WorkItemClassificationNode', response) - - def get_comment(self, id, revision): - """GetComment. - [Preview API] Returns comment for a work item at the specified revision - :param int id: - :param int revision: - :rtype: :class:` ` - """ - route_values = {} - 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='4.0-preview.1', - route_values=route_values) - return self._deserialize('WorkItemComment', response) - - def get_comments(self, id, from_revision=None, top=None, order=None): - """GetComments. - [Preview API] Returns specified number of comments for a work item from the specified revision - :param int id: Work item id - :param int from_revision: Revision from which comments are to be fetched - :param int top: The number of comments to return - :param CommentSortOrder order: Ascending or descending by revision id - :rtype: :class:` ` - """ - route_values = {} - 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, 'CommentSortOrder') - response = self._send(http_method='GET', - location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', - version='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItemComments', response) - - def delete_field(self, field_name_or_ref_name, project=None): - """DeleteField. - :param str field_name_or_ref_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='4.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='4.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 GetFieldsExpand 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, 'GetFieldsExpand') - response = self._send(http_method='GET', - location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemField]', response) - - def update_field(self, work_item_field, field_name_or_ref_name, project=None): - """UpdateField. - :param :class:` ` work_item_field: - :param str field_name_or_ref_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') - content = self._serialize.body(work_item_field, 'WorkItemField') - self._send(http_method='PATCH', - location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='4.0', - route_values=route_values, - content=content) - - 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 path for the query to create. - :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='4.0', - route_values=route_values, - content=content) - return self._deserialize('QueryHierarchyItem', response) - - def delete_query(self, project, query): - """DeleteQuery. - :param str project: Project ID or project name - :param str query: - """ - 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='4.0', - route_values=route_values) - - def get_queries(self, project, expand=None, depth=None, include_deleted=None): - """GetQueries. - Retrieves all queries the user has access to in the current project - :param str project: Project ID or project name - :param QueryExpand expand: - :param int depth: - :param bool include_deleted: - :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, 'QueryExpand') - 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[QueryHierarchyItem]', response) - - def get_query(self, project, query, expand=None, depth=None, include_deleted=None): - """GetQuery. - Retrieves a single query by project and either id or path - :param str project: Project ID or project name - :param str query: - :param QueryExpand expand: - :param int depth: - :param bool include_deleted: - :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, 'QueryExpand') - 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='4.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: - :param int top: - :param QueryExpand expand: - :param bool include_deleted: - :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, 'QueryExpand') - 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='4.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. - :param :class:` ` query_update: - :param str project: Project ID or project name - :param str query: - :param bool undelete_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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('QueryHierarchyItem', response) - - def destroy_work_item(self, id, project=None): - """DestroyWorkItem. - [Preview API] - :param int id: - :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='4.0-preview.1', - route_values=route_values) - - def get_deleted_work_item(self, id, project=None): - """GetDeletedWorkItem. - [Preview API] - :param int 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 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='4.0-preview.1', - route_values=route_values) - return self._deserialize('WorkItemDelete', response) - - def get_deleted_work_item_references(self, project=None): - """GetDeletedWorkItemReferences. - [Preview API] - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemDeleteShallowReference]', response) - - def get_deleted_work_items(self, ids, project=None): - """GetDeletedWorkItems. - [Preview API] - :param [int] ids: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemDeleteReference]', response) - - def restore_work_item(self, payload, id, project=None): - """RestoreWorkItem. - [Preview API] - :param :class:` ` payload: - :param int 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 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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('WorkItemDelete', response) - - def get_revision(self, id, revision_number, expand=None): - """GetRevision. - Returns a fully hydrated work item for the requested revision - :param int id: - :param int revision_number: - :param WorkItemExpand expand: - :rtype: :class:` ` - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - - def get_revisions(self, id, top=None, skip=None, expand=None): - """GetRevisions. - Returns the list of fully hydrated work item revisions, paged. - :param int id: - :param int top: - :param int skip: - :param WorkItemExpand expand: - :rtype: [WorkItem] - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItem]', response) - - def evaluate_rules_on_field(self, rule_engine_input): - """EvaluateRulesOnField. - Validates the fields values. - :param :class:` ` rule_engine_input: - """ - content = self._serialize.body(rule_engine_input, 'FieldsToEvaluate') - self._send(http_method='POST', - location_id='1a3a1536-dca6-4509-b9c3-dd9bb2981506', - version='4.0', - content=content) - - 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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemTemplateReference]', 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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('WorkItemTemplate', response) - - def get_update(self, id, update_number): - """GetUpdate. - Returns a single update for a work item - :param int id: - :param int update_number: - :rtype: :class:` ` - """ - route_values = {} - 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='4.0', - route_values=route_values) - return self._deserialize('WorkItemUpdate', response) - - def get_updates(self, id, top=None, skip=None): - """GetUpdates. - Returns a the deltas between work item revisions - :param int id: - :param int top: - :param int skip: - :rtype: [WorkItemUpdate] - """ - route_values = {} - 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemUpdate]', response) - - def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): - """QueryByWiql. - Gets the results of the query. - :param :class:` ` wiql: The query containing the wiql. - :param :class:` ` team_context: The team context for the operation - :param bool time_precision: - :param int top: - :rtype: :class:` ` - """ - project = None - team = None - if team_context is not None: - if team_context.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.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): - """GetQueryResultCount. - Gets the results of the query by id. - :param str id: The query id. - :param :class:` ` team_context: The team context for the operation - :param bool time_precision: - :rtype: int - """ - project = None - team = None - if team_context is not None: - if team_context.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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') - response = self._send(http_method='HEAD', - location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='4.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): - """QueryById. - Gets the results of the query by id. - :param str id: The query id. - :param :class:` ` team_context: The team context for the operation - :param bool time_precision: - :rtype: :class:` ` - """ - project = None - team = None - if team_context is not None: - if team_context.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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') - response = self._send(http_method='GET', - location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='4.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 svg by icon friendly name and icon color - :param str icon: - :param str color: - :param int v: - :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='4.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='4.0-preview.1', - returns_collection=True) - return self._deserialize('[WorkItemIcon]', response) - - def get_work_item_icon_svg(self, icon, color=None, v=None): - """GetWorkItemIconSvg. - [Preview API] Get a work item icon svg by icon friendly name and icon color - :param str icon: - :param str color: - :param int v: - :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='4.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_reporting_links(self, project=None, types=None, continuation_token=None, start_date_time=None): - """GetReportingLinks. - Get a batch of work item links - :param str project: Project ID or project name - :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 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='4.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 types. - :param str relation: - :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='4.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='4.0', - returns_collection=True) - return self._deserialize('[WorkItemRelationType]', 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): - """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 ReportingRevisionsExpand 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 - :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, 'ReportingRevisionsExpand') - if include_discussion_changes_only is not None: - query_parameters['includeDiscussionChangesOnly'] = self._serialize.query('include_discussion_changes_only', include_discussion_changes_only, 'bool') - response = self._send(http_method='GET', - location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', - version='4.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 - :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 ReportingRevisionsExpand 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, 'ReportingRevisionsExpand') - content = self._serialize.body(filter, 'ReportingWorkItemRevisionsFilter') - response = self._send(http_method='POST', - location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', - version='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('ReportingWorkItemRevisionsBatch', response) - - def delete_work_item(self, id, destroy=None): - """DeleteWorkItem. - :param int id: - :param bool destroy: - :rtype: :class:` ` - """ - route_values = {} - 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='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItemDelete', response) - - def get_work_item(self, id, fields=None, as_of=None, expand=None): - """GetWorkItem. - Returns a single work item - :param int id: - :param [str] fields: - :param datetime as_of: - :param WorkItemExpand expand: - :rtype: :class:` ` - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - - def get_work_items(self, ids, fields=None, as_of=None, expand=None, error_policy=None): - """GetWorkItems. - Returns a list of work items - :param [int] ids: - :param [str] fields: - :param datetime as_of: - :param WorkItemExpand expand: - :param WorkItemErrorPolicy error_policy: - :rtype: [WorkItem] - """ - 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, 'WorkItemExpand') - if error_policy is not None: - query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'WorkItemErrorPolicy') - response = self._send(http_method='GET', - location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='4.0', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItem]', response) - - def update_work_item(self, document, id, 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 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 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='4.0', - route_values=route_values, - query_parameters=query_parameters, - content=content, - media_type='application/json-patch+json') - return self._deserialize('WorkItem', 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='4.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: - :param str fields: - :param datetime as_of: - :param WorkItemExpand expand: - :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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - - def get_work_item_type_categories(self, project): - """GetWorkItemTypeCategories. - Returns a the deltas between work item revisions - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemTypeCategory]', response) - - def get_work_item_type_category(self, project, category): - """GetWorkItemTypeCategory. - Returns a the deltas between work item revisions - :param str project: Project ID or project name - :param str category: - :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='4.0', - route_values=route_values) - return self._deserialize('WorkItemTypeCategory', response) - - def get_work_item_type(self, project, type): - """GetWorkItemType. - Returns a the deltas between work item revisions - :param str project: Project ID or project name - :param str type: - :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='4.0', - route_values=route_values) - return self._deserialize('WorkItemType', response) - - def get_work_item_types(self, project): - """GetWorkItemTypes. - Returns a the deltas between work item revisions - :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='4.0', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemType]', response) - - def get_dependent_fields(self, project, type, field): - """GetDependentFields. - Returns the dependent fields for the corresponding workitem type and fieldname - :param str project: Project ID or project name - :param str type: - :param str field: - :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') - response = self._send(http_method='GET', - location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', - version='4.0', - route_values=route_values) - return self._deserialize('FieldDependentRule', 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: - :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='4.0-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemStateColor]', response) - - def export_work_item_type_definition(self, project=None, type=None, export_global_lists=None): - """ExportWorkItemTypeDefinition. - Export work item type - :param str project: Project ID or project name - :param str type: - :param bool export_global_lists: - :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 export_global_lists is not None: - query_parameters['exportGlobalLists'] = self._serialize.query('export_global_lists', export_global_lists, 'bool') - response = self._send(http_method='GET', - location_id='8637ac8b-5eb6-4f90-b3f7-4f2ff576a459', - version='4.0', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItemTypeTemplate', response) - - def update_work_item_type_definition(self, update_model, project=None): - """UpdateWorkItemTypeDefinition. - Add/updates a work item type - :param :class:` ` update_model: - :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(update_model, 'WorkItemTypeTemplateUpdateModel') - response = self._send(http_method='POST', - location_id='8637ac8b-5eb6-4f90-b3f7-4f2ff576a459', - version='4.0', - route_values=route_values, - content=content) - return self._deserialize('ProvisioningResult', response) - diff --git a/vsts/vsts/work_item_tracking/v4_1/__init__.py b/vsts/vsts/work_item_tracking/v4_1/__init__.py deleted file mode 100644 index b19525a6..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/work_item_tracking/v4_1/models/__init__.py b/vsts/vsts/work_item_tracking/v4_1/models/__init__.py deleted file mode 100644 index 996ebf8d..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/__init__.py +++ /dev/null @@ -1,141 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .account_my_work_result import AccountMyWorkResult -from .account_recent_activity_work_item_model import AccountRecentActivityWorkItemModel -from .account_recent_mention_work_item_model import AccountRecentMentionWorkItemModel -from .account_work_work_item_model import AccountWorkWorkItemModel -from .artifact_uri_query import ArtifactUriQuery -from .artifact_uri_query_result import ArtifactUriQueryResult -from .attachment_reference import AttachmentReference -from .field_dependent_rule import FieldDependentRule -from .fields_to_evaluate import FieldsToEvaluate -from .identity_ref import IdentityRef -from .identity_reference import IdentityReference -from .json_patch_operation import JsonPatchOperation -from .link import Link -from .project_work_item_state_colors import ProjectWorkItemStateColors -from .provisioning_result import ProvisioningResult -from .query_hierarchy_item import QueryHierarchyItem -from .query_hierarchy_items_result import QueryHierarchyItemsResult -from .reference_links import ReferenceLinks -from .reporting_work_item_link import ReportingWorkItemLink -from .reporting_work_item_links_batch import ReportingWorkItemLinksBatch -from .reporting_work_item_revisions_batch import ReportingWorkItemRevisionsBatch -from .reporting_work_item_revisions_filter import ReportingWorkItemRevisionsFilter -from .streamed_batch import StreamedBatch -from .team_context import TeamContext -from .wiql import Wiql -from .work_artifact_link import WorkArtifactLink -from .work_item import WorkItem -from .work_item_classification_node import WorkItemClassificationNode -from .work_item_comment import WorkItemComment -from .work_item_comments import WorkItemComments -from .work_item_delete import WorkItemDelete -from .work_item_delete_reference import WorkItemDeleteReference -from .work_item_delete_update import WorkItemDeleteUpdate -from .work_item_field import WorkItemField -from .work_item_field_operation import WorkItemFieldOperation -from .work_item_field_reference import WorkItemFieldReference -from .work_item_field_update import WorkItemFieldUpdate -from .work_item_history import WorkItemHistory -from .work_item_icon import WorkItemIcon -from .work_item_link import WorkItemLink -from .work_item_next_state_on_transition import WorkItemNextStateOnTransition -from .work_item_query_clause import WorkItemQueryClause -from .work_item_query_result import WorkItemQueryResult -from .work_item_query_sort_column import WorkItemQuerySortColumn -from .work_item_reference import WorkItemReference -from .work_item_relation import WorkItemRelation -from .work_item_relation_type import WorkItemRelationType -from .work_item_relation_updates import WorkItemRelationUpdates -from .work_item_state_color import WorkItemStateColor -from .work_item_state_transition import WorkItemStateTransition -from .work_item_template import WorkItemTemplate -from .work_item_template_reference import WorkItemTemplateReference -from .work_item_tracking_reference import WorkItemTrackingReference -from .work_item_tracking_resource import WorkItemTrackingResource -from .work_item_tracking_resource_reference import WorkItemTrackingResourceReference -from .work_item_type import WorkItemType -from .work_item_type_category import WorkItemTypeCategory -from .work_item_type_color import WorkItemTypeColor -from .work_item_type_color_and_icon import WorkItemTypeColorAndIcon -from .work_item_type_field_instance import WorkItemTypeFieldInstance -from .work_item_type_reference import WorkItemTypeReference -from .work_item_type_state_colors import WorkItemTypeStateColors -from .work_item_type_template import WorkItemTypeTemplate -from .work_item_type_template_update_model import WorkItemTypeTemplateUpdateModel -from .work_item_update import WorkItemUpdate - -__all__ = [ - 'AccountMyWorkResult', - 'AccountRecentActivityWorkItemModel', - 'AccountRecentMentionWorkItemModel', - 'AccountWorkWorkItemModel', - 'ArtifactUriQuery', - 'ArtifactUriQueryResult', - 'AttachmentReference', - 'FieldDependentRule', - 'FieldsToEvaluate', - 'IdentityRef', - 'IdentityReference', - 'JsonPatchOperation', - 'Link', - 'ProjectWorkItemStateColors', - 'ProvisioningResult', - 'QueryHierarchyItem', - 'QueryHierarchyItemsResult', - 'ReferenceLinks', - 'ReportingWorkItemLink', - 'ReportingWorkItemLinksBatch', - 'ReportingWorkItemRevisionsBatch', - 'ReportingWorkItemRevisionsFilter', - 'StreamedBatch', - 'TeamContext', - 'Wiql', - 'WorkArtifactLink', - 'WorkItem', - 'WorkItemClassificationNode', - 'WorkItemComment', - 'WorkItemComments', - 'WorkItemDelete', - 'WorkItemDeleteReference', - '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', - 'WorkItemTypeReference', - 'WorkItemTypeStateColors', - 'WorkItemTypeTemplate', - 'WorkItemTypeTemplateUpdateModel', - 'WorkItemUpdate', -] diff --git a/vsts/vsts/work_item_tracking/v4_1/models/account_my_work_result.py b/vsts/vsts/work_item_tracking/v4_1/models/account_my_work_result.py deleted file mode 100644 index 39d22a57..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/account_my_work_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/account_recent_activity_work_item_model.py b/vsts/vsts/work_item_tracking/v4_1/models/account_recent_activity_work_item_model.py deleted file mode 100644 index ac42f453..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/account_recent_activity_work_item_model.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/account_recent_mention_work_item_model.py b/vsts/vsts/work_item_tracking/v4_1/models/account_recent_mention_work_item_model.py deleted file mode 100644 index cd9bd1d4..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/account_recent_mention_work_item_model.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/account_work_work_item_model.py b/vsts/vsts/work_item_tracking/v4_1/models/account_work_work_item_model.py deleted file mode 100644 index 6cb04c84..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/account_work_work_item_model.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query.py b/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query.py deleted file mode 100644 index 8353b779..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query_result.py b/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query_result.py deleted file mode 100644 index bf996b14..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/artifact_uri_query_result.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/attachment_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/attachment_reference.py deleted file mode 100644 index b05f6c11..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/attachment_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/field_dependent_rule.py b/vsts/vsts/work_item_tracking/v4_1/models/field_dependent_rule.py deleted file mode 100644 index 126f8f95..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/field_dependent_rule.py +++ /dev/null @@ -1,31 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/fields_to_evaluate.py b/vsts/vsts/work_item_tracking/v4_1/models/fields_to_evaluate.py deleted file mode 100644 index 5dcd2fd3..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/fields_to_evaluate.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py b/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py deleted file mode 100644 index 40c776c5..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 IdentityRef(Model): - """IdentityRef. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() - self.directory_alias = directory_alias - self.display_name = display_name - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.profile_url = profile_url - self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py deleted file mode 100644 index 29c2e6ee..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py +++ /dev/null @@ -1,56 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .identity_ref import IdentityRef - - -class IdentityReference(IdentityRef): - """IdentityReference. - - :param directory_alias: - :type directory_alias: str - :param display_name: - :type display_name: 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 profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - :param url: - :type url: 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 = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'display_name': {'key': 'displayName', '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'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, directory_alias=None, display_name=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, id=None, name=None): - super(IdentityReference, self).__init__(directory_alias=directory_alias, display_name=display_name, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) - self.id = id - self.name = name diff --git a/vsts/vsts/work_item_tracking/v4_1/models/json_patch_operation.py b/vsts/vsts/work_item_tracking/v4_1/models/json_patch_operation.py deleted file mode 100644 index 7d45b0f6..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/json_patch_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/link.py b/vsts/vsts/work_item_tracking/v4_1/models/link.py deleted file mode 100644 index 1cfccded..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/project_work_item_state_colors.py b/vsts/vsts/work_item_tracking/v4_1/models/project_work_item_state_colors.py deleted file mode 100644 index 7931e5de..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/project_work_item_state_colors.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/provisioning_result.py b/vsts/vsts/work_item_tracking/v4_1/models/provisioning_result.py deleted file mode 100644 index 0d1dc1de..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/provisioning_result.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py b/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py deleted file mode 100644 index fe37d45c..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py +++ /dev/null @@ -1,123 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class QueryHierarchyItem(WorkItemTrackingResource): - """QueryHierarchyItem. - - :param url: - :type url: str - :param _links: Link references to related REST resources. - :type _links: :class:`ReferenceLinks ` - :param children: - :type children: list of :class:`QueryHierarchyItem ` - :param clauses: - :type clauses: :class:`WorkItemQueryClause ` - :param columns: - :type columns: list of :class:`WorkItemFieldReference ` - :param created_by: - :type created_by: :class:`IdentityReference ` - :param created_date: - :type created_date: datetime - :param filter_options: - :type filter_options: object - :param has_children: - :type has_children: bool - :param id: - :type id: str - :param is_deleted: - :type is_deleted: bool - :param is_folder: - :type is_folder: bool - :param is_invalid_syntax: - :type is_invalid_syntax: bool - :param is_public: - :type is_public: bool - :param last_executed_by: - :type last_executed_by: :class:`IdentityReference ` - :param last_executed_date: - :type last_executed_date: datetime - :param last_modified_by: - :type last_modified_by: :class:`IdentityReference ` - :param last_modified_date: - :type last_modified_date: datetime - :param link_clauses: - :type link_clauses: :class:`WorkItemQueryClause ` - :param name: - :type name: str - :param path: - :type path: str - :param query_type: - :type query_type: object - :param sort_columns: - :type sort_columns: list of :class:`WorkItemQuerySortColumn ` - :param source_clauses: - :type source_clauses: :class:`WorkItemQueryClause ` - :param target_clauses: - :type target_clauses: :class:`WorkItemQueryClause ` - :param wiql: - :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_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_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_type = query_type - self.sort_columns = sort_columns - self.source_clauses = source_clauses - self.target_clauses = target_clauses - self.wiql = wiql diff --git a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_items_result.py b/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_items_result.py deleted file mode 100644 index ff5a4898..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_items_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 QueryHierarchyItemsResult(Model): - """QueryHierarchyItemsResult. - - :param count: - :type count: int - :param has_more: - :type has_more: bool - :param value: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/reference_links.py b/vsts/vsts/work_item_tracking/v4_1/models/reference_links.py deleted file mode 100644 index 54f03acd..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/reference_links.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_link.py b/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_link.py deleted file mode 100644 index acbfd840..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_link.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ReportingWorkItemLink(Model): - """ReportingWorkItemLink. - - :param changed_by: - :type changed_by: :class:`IdentityRef ` - :param changed_date: - :type changed_date: datetime - :param changed_operation: - :type changed_operation: object - :param comment: - :type comment: str - :param is_active: - :type is_active: bool - :param link_type: - :type link_type: str - :param rel: - :type rel: str - :param source_id: - :type source_id: int - :param target_id: - :type target_id: int - """ - - _attribute_map = { - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'changed_operation': {'key': 'changedOperation', 'type': 'object'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'rel': {'key': 'rel', 'type': 'str'}, - 'source_id': {'key': 'sourceId', 'type': 'int'}, - 'target_id': {'key': 'targetId', 'type': 'int'} - } - - def __init__(self, changed_by=None, changed_date=None, changed_operation=None, comment=None, is_active=None, link_type=None, rel=None, source_id=None, target_id=None): - super(ReportingWorkItemLink, self).__init__() - self.changed_by = changed_by - self.changed_date = changed_date - self.changed_operation = changed_operation - self.comment = comment - self.is_active = is_active - self.link_type = link_type - self.rel = rel - self.source_id = source_id - self.target_id = target_id diff --git a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_links_batch.py b/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_links_batch.py deleted file mode 100644 index 525223a2..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_links_batch.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .streamed_batch import StreamedBatch - - -class ReportingWorkItemLinksBatch(StreamedBatch): - """ReportingWorkItemLinksBatch. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ReportingWorkItemLinksBatch, self).__init__() diff --git a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_batch.py b/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_batch.py deleted file mode 100644 index 5c401a3d..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_batch.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .streamed_batch import StreamedBatch - - -class ReportingWorkItemRevisionsBatch(StreamedBatch): - """ReportingWorkItemRevisionsBatch. - - """ - - _attribute_map = { - } - - def __init__(self): - super(ReportingWorkItemRevisionsBatch, self).__init__() diff --git a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_filter.py b/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_filter.py deleted file mode 100644 index be8e5148..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/reporting_work_item_revisions_filter.py +++ /dev/null @@ -1,45 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/streamed_batch.py b/vsts/vsts/work_item_tracking/v4_1/models/streamed_batch.py deleted file mode 100644 index 06713ff2..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/streamed_batch.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/team_context.py b/vsts/vsts/work_item_tracking/v4_1/models/team_context.py deleted file mode 100644 index 18418ce7..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/team_context.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/wiql.py b/vsts/vsts/work_item_tracking/v4_1/models/wiql.py deleted file mode 100644 index 963d17e3..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/wiql.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 Wiql(Model): - """Wiql. - - :param query: - :type query: str - """ - - _attribute_map = { - 'query': {'key': 'query', 'type': 'str'} - } - - def __init__(self, query=None): - super(Wiql, self).__init__() - self.query = query diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_artifact_link.py b/vsts/vsts/work_item_tracking/v4_1/models/work_artifact_link.py deleted file mode 100644 index 7b73e52c..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_artifact_link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item.py deleted file mode 100644 index 3d8d61d1..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_classification_node.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_classification_node.py deleted file mode 100644 index 9e98f26e..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_classification_node.py +++ /dev/null @@ -1,55 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py deleted file mode 100644 index 3298de29..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemComment(WorkItemTrackingResource): - """WorkItemComment. - - :param url: - :type url: str - :param _links: Link references to related REST resources. - :type _links: :class:`ReferenceLinks ` - :param revised_by: - :type revised_by: :class:`IdentityReference ` - :param revised_date: - :type revised_date: datetime - :param revision: - :type revision: int - :param text: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py deleted file mode 100644 index 549ad7bf..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemComments(Model): - """WorkItemComments. - - :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 = { - '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, comments=None, count=None, from_revision_count=None, total_count=None): - super(WorkItemComments, self).__init__() - self.comments = comments - self.count = count - self.from_revision_count = from_revision_count - self.total_count = total_count diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete.py deleted file mode 100644 index 76968794..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete.py +++ /dev/null @@ -1,52 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_delete_reference import WorkItemDeleteReference - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_reference.py deleted file mode 100644 index 025e3c6d..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_reference.py +++ /dev/null @@ -1,57 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_update.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_update.py deleted file mode 100644 index ec79c030..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_delete_update.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_field.py deleted file mode 100644 index 8963da50..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field.py +++ /dev/null @@ -1,67 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -class WorkItemField(WorkItemTrackingResource): - """WorkItemField. - - :param url: - :type url: str - :param _links: Link references to related REST resources. - :type _links: :class:`ReferenceLinks ` - :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 name: The name of the field. - :type name: 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'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_identity': {'key': 'isIdentity', 'type': 'bool'}, - 'is_picklist': {'key': 'isPicklist', 'type': 'bool'}, - 'is_picklist_suggested': {'key': 'isPicklistSuggested', 'type': 'bool'}, - 'name': {'key': 'name', '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, description=None, is_identity=None, is_picklist=None, is_picklist_suggested=None, name=None, read_only=None, reference_name=None, supported_operations=None, type=None, usage=None): - super(WorkItemField, self).__init__(url=url, _links=_links) - self.description = description - self.is_identity = is_identity - self.is_picklist = is_picklist - self.is_picklist_suggested = is_picklist_suggested - self.name = name - self.read_only = read_only - self.reference_name = reference_name - self.supported_operations = supported_operations - self.type = type - self.usage = usage diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_operation.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_operation.py deleted file mode 100644 index fe59903a..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_operation.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_reference.py deleted file mode 100644 index 29ebbbf2..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_reference.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_update.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_update.py deleted file mode 100644 index 2b83b0fb..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_field_update.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_history.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_history.py deleted file mode 100644 index 60a120f4..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_history.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_icon.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_icon.py deleted file mode 100644 index 8473466a..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_icon.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_link.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_link.py deleted file mode 100644 index 190f060c..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_link.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemLink(Model): - """WorkItemLink. - - :param rel: - :type rel: str - :param source: - :type source: :class:`WorkItemReference ` - :param target: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_next_state_on_transition.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_next_state_on_transition.py deleted file mode 100644 index f81c85b7..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_next_state_on_transition.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_clause.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_clause.py deleted file mode 100644 index 4a260268..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_clause.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQueryClause(Model): - """WorkItemQueryClause. - - :param clauses: - :type clauses: list of :class:`WorkItemQueryClause ` - :param field: - :type field: :class:`WorkItemFieldReference ` - :param field_value: - :type field_value: :class:`WorkItemFieldReference ` - :param is_field_value: - :type is_field_value: bool - :param logical_operator: - :type logical_operator: object - :param operator: - :type operator: :class:`WorkItemFieldOperation ` - :param value: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_result.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_result.py deleted file mode 100644 index 3c342d4c..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQueryResult(Model): - """WorkItemQueryResult. - - :param as_of: - :type as_of: datetime - :param columns: - :type columns: list of :class:`WorkItemFieldReference ` - :param query_result_type: - :type query_result_type: object - :param query_type: - :type query_type: object - :param sort_columns: - :type sort_columns: list of :class:`WorkItemQuerySortColumn ` - :param work_item_relations: - :type work_item_relations: list of :class:`WorkItemLink ` - :param work_items: - :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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_sort_column.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_sort_column.py deleted file mode 100644 index 7517ac9a..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_query_sort_column.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemQuerySortColumn(Model): - """WorkItemQuerySortColumn. - - :param descending: - :type descending: bool - :param 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_reference.py deleted file mode 100644 index 748e2243..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_reference.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation.py deleted file mode 100644 index 9eff8a82..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation.py +++ /dev/null @@ -1,30 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .link import Link - - -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) diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_type.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_type.py deleted file mode 100644 index f04f57e9..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_type.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_reference import WorkItemTrackingReference - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_updates.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_updates.py deleted file mode 100644 index cc5c9ac2..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_relation_updates.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_color.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_color.py deleted file mode 100644 index 360fe743..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_color.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 WorkItemStateColor(Model): - """WorkItemStateColor. - - :param color: Color value - :type color: str - :param name: Work item type state name - :type name: str - """ - - _attribute_map = { - 'color': {'key': 'color', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, color=None, name=None): - super(WorkItemStateColor, self).__init__() - self.color = color - self.name = name diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_transition.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_transition.py deleted file mode 100644 index a712bbc2..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_state_transition.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_template.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_template.py deleted file mode 100644 index c9cb3c3f..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_template.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_template_reference import WorkItemTemplateReference - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_template_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_template_reference.py deleted file mode 100644 index 2be411cd..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_template_reference.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_reference.py deleted file mode 100644 index 21f33d10..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_reference.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource.py deleted file mode 100644 index ab6aad07..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource_reference import WorkItemTrackingResourceReference - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource_reference.py deleted file mode 100644 index de9a728b..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_tracking_resource_reference.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type.py deleted file mode 100644 index 26647eeb..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type.py +++ /dev/null @@ -1,63 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 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 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'reference_name': {'key': 'referenceName', 'type': 'str'}, - '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, name=None, reference_name=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.name = name - self.reference_name = reference_name - self.transitions = transitions - self.xml_form = xml_form diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_category.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_category.py deleted file mode 100644 index cbab1415..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_category.py +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color.py deleted file mode 100644 index a92a1ffc..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color_and_icon.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color_and_icon.py deleted file mode 100644 index e64cce99..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_color_and_icon.py +++ /dev/null @@ -1,33 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py deleted file mode 100644 index 20f833b7..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py +++ /dev/null @@ -1,38 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_field_reference import WorkItemFieldReference - - -class WorkItemTypeFieldInstance(WorkItemFieldReference): - """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 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'}, - 'help_text': {'key': 'helpText', 'type': 'str'} - } - - def __init__(self, name=None, reference_name=None, url=None, always_required=None, help_text=None): - super(WorkItemTypeFieldInstance, self).__init__(name=name, reference_name=reference_name, url=url) - self.always_required = always_required - self.help_text = help_text diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_reference.py deleted file mode 100644 index 8757dc1d..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_reference.py +++ /dev/null @@ -1,28 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource_reference import WorkItemTrackingResourceReference - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_state_colors.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_state_colors.py deleted file mode 100644 index 956e6e87..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_state_colors.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template.py deleted file mode 100644 index f85f1b7e..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template_update_model.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template_update_model.py deleted file mode 100644 index 1ea4e525..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_template_update_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 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 diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_update.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_update.py deleted file mode 100644 index 3a96caab..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_update.py +++ /dev/null @@ -1,55 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .work_item_tracking_resource import WorkItemTrackingResource - - -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 diff --git a/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py b/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py deleted file mode 100644 index 1f6b8de9..00000000 --- a/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py +++ /dev/null @@ -1,1452 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...vss_client import VssClient -from . import models - - -class WorkItemTrackingClient(VssClient): - """WorkItemTracking - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - VssClient.__init__(self, 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='4.1-preview.1', - returns_collection=True) - return self._deserialize('[WorkArtifactLink]', response) - - def query_work_items_for_artifact_uris(self, artifact_uri_query): - """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. - :rtype: :class:` ` - """ - content = self._serialize.body(artifact_uri_query, 'ArtifactUriQuery') - response = self._send(http_method='POST', - location_id='a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3', - version='4.1-preview.1', - content=content) - return self._deserialize('ArtifactUriQueryResult', response) - - def create_attachment(self, upload_stream, file_name=None, upload_type=None, area_path=None): - """CreateAttachment. - [Preview API] Uploads an attachment. - :param object upload_stream: Stream to upload - :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:` ` - """ - 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') - content = self._serialize.body(upload_stream, 'object') - response = self._send(http_method='POST', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', - query_parameters=query_parameters, - content=content, - media_type='application/octet-stream') - return self._deserialize('AttachmentReference', response) - - def get_attachment_content(self, id, file_name=None): - """GetAttachmentContent. - [Preview API] Downloads an attachment. - :param str id: Attachment ID - :param str file_name: Name of the file - :rtype: object - """ - route_values = {} - 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') - response = self._send(http_method='GET', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_attachment_zip(self, id, file_name=None): - """GetAttachmentZip. - [Preview API] Downloads an attachment. - :param str id: Attachment ID - :param str file_name: Name of the file - :rtype: object - """ - route_values = {} - 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') - response = self._send(http_method='GET', - location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_root_nodes(self, project, depth=None): - """GetRootNodes. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemClassificationNode]', response) - - def create_or_update_classification_node(self, posted_node, project, structure_group, path=None): - """CreateOrUpdateClassificationNode. - [Preview API] 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='4.1-preview.2', - 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. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - - def get_classification_node(self, project, structure_group, path=None, depth=None): - """GetClassificationNode. - [Preview API] 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='4.1-preview.2', - 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. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('WorkItemClassificationNode', response) - - def get_comment(self, id, revision): - """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 - :rtype: :class:` ` - """ - route_values = {} - 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('WorkItemComment', response) - - def get_comments(self, id, 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 int from_revision: Revision from which comments are to be fetched - :param int top: The number of comments to return - :param CommentSortOrder order: Ascending or descending by revision id - :rtype: :class:` ` - """ - route_values = {} - 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, 'CommentSortOrder') - response = self._send(http_method='GET', - location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItemComments', response) - - def delete_field(self, field_name_or_ref_name, project=None): - """DeleteField. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - - def get_field(self, field_name_or_ref_name, project=None): - """GetField. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WorkItemField', response) - - def get_fields(self, project=None, expand=None): - """GetFields. - [Preview API] Returns information for all fields. - :param str project: Project ID or project name - :param GetFieldsExpand 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, 'GetFieldsExpand') - response = self._send(http_method='GET', - location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemField]', response) - - def update_field(self, work_item_field, field_name_or_ref_name, project=None): - """UpdateField. - [Preview API] Updates the field. - :param :class:` ` work_item_field: New field definition - :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') - content = self._serialize.body(work_item_field, 'WorkItemField') - self._send(http_method='PATCH', - location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='4.1-preview.2', - route_values=route_values, - content=content) - - def create_query(self, posted_query, project, query): - """CreateQuery. - [Preview API] 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 path for the query to create. - :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='4.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('QueryHierarchyItem', response) - - def delete_query(self, project, query): - """DeleteQuery. - [Preview API] Delete a query or a 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='4.1-preview.2', - route_values=route_values) - - def get_queries(self, project, expand=None, depth=None, include_deleted=None): - """GetQueries. - [Preview API] Gets the root queries and their children - :param str project: Project ID or project name - :param QueryExpand 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, 'QueryExpand') - 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[QueryHierarchyItem]', response) - - def get_query(self, project, query, expand=None, depth=None, include_deleted=None): - """GetQuery. - [Preview API] Retrieves an individual query and its children - :param str project: Project ID or project name - :param str query: - :param QueryExpand 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, 'QueryExpand') - 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='4.1-preview.2', - 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. - [Preview API] 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 QueryExpand 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, 'QueryExpand') - 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='4.1-preview.2', - 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. - [Preview API] 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 path for the query to update. - :param bool undelete_descendants: Undelete the children of this folder. - :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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('QueryHierarchyItem', response) - - def destroy_work_item(self, id, project=None): - """DestroyWorkItem. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - - def get_deleted_work_item(self, id, project=None): - """GetDeletedWorkItem. - [Preview API] 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='4.1-preview.1', - route_values=route_values) - return self._deserialize('WorkItemDelete', response) - - def get_deleted_work_item_references(self, project=None): - """GetDeletedWorkItemReferences. - [Preview API] 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: [WorkItemReference] - """ - 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemReference]', response) - - def get_deleted_work_items(self, ids, project=None): - """GetDeletedWorkItems. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemDeleteReference]', response) - - def restore_work_item(self, payload, id, project=None): - """RestoreWorkItem. - [Preview API] 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='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('WorkItemDelete', response) - - def get_revision(self, id, revision_number, expand=None): - """GetRevision. - [Preview API] Returns a fully hydrated work item for the requested revision - :param int id: - :param int revision_number: - :param WorkItemExpand expand: - :rtype: :class:` ` - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - - def get_revisions(self, id, top=None, skip=None, expand=None): - """GetRevisions. - [Preview API] Returns the list of fully hydrated work item revisions, paged. - :param int id: - :param int top: - :param int skip: - :param WorkItemExpand expand: - :rtype: [WorkItem] - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItem]', 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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemTemplateReference]', 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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('WorkItemTemplate', response) - - def get_update(self, id, update_number): - """GetUpdate. - [Preview API] Returns a single update for a work item - :param int id: - :param int update_number: - :rtype: :class:` ` - """ - route_values = {} - 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WorkItemUpdate', response) - - def get_updates(self, id, top=None, skip=None): - """GetUpdates. - [Preview API] Returns a the deltas between work item revisions - :param int id: - :param int top: - :param int skip: - :rtype: [WorkItemUpdate] - """ - route_values = {} - 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemUpdate]', response) - - def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): - """QueryByWiql. - [Preview API] 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.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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='4.1-preview.2', - 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): - """GetQueryResultCount. - [Preview API] 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. - :rtype: int - """ - project = None - team = None - if team_context is not None: - if team_context.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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') - response = self._send(http_method='HEAD', - location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='4.1-preview.2', - 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): - """QueryById. - [Preview API] 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. - :rtype: :class:` ` - """ - project = None - team = None - if team_context is not None: - if team_context.projectId: - project = team_context.projectId - else: - project = team_context.project - if team_context.teamId: - team = team_context.teamId - 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') - response = self._send(http_method='GET', - location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='4.1-preview.2', - 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='4.1-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='4.1-preview.1', - returns_collection=True) - return self._deserialize('[WorkItemIcon]', response) - - def get_work_item_icon_svg(self, icon, color=None, v=None): - """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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_reporting_links(self, project=None, types=None, continuation_token=None, start_date_time=None): - """GetReportingLinks. - [Preview API] Get a batch of work item links - :param str project: Project ID or project name - :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 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('ReportingWorkItemLinksBatch', response) - - def get_relation_type(self, relation): - """GetRelationType. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WorkItemRelationType', response) - - def get_relation_types(self): - """GetRelationTypes. - [Preview API] Gets the work item relation types. - :rtype: [WorkItemRelationType] - """ - response = self._send(http_method='GET', - location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', - version='4.1-preview.2', - returns_collection=True) - return self._deserialize('[WorkItemRelationType]', 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. - [Preview API] 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 ReportingRevisionsExpand 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, 'ReportingRevisionsExpand') - 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='4.1-preview.2', - 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. - [Preview API] 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 ReportingRevisionsExpand 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, 'ReportingRevisionsExpand') - content = self._serialize.body(filter, 'ReportingWorkItemRevisionsFilter') - response = self._send(http_method='POST', - location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('ReportingWorkItemRevisionsBatch', response) - - def delete_work_item(self, id, destroy=None): - """DeleteWorkItem. - [Preview API] 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 bool destroy: Optional parameter, if set to true, the work item is deleted permanently - :rtype: :class:` ` - """ - route_values = {} - 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItemDelete', response) - - def get_work_item(self, id, fields=None, as_of=None, expand=None): - """GetWorkItem. - [Preview API] Returns a single work item. - :param int id: The work item id - :param [str] fields: Comma-separated list of requested fields - :param datetime as_of: AsOf UTC date time string - :param WorkItemExpand expand: The expand parameters for work item attributes - :rtype: :class:` ` - """ - route_values = {} - 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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - - def get_work_items(self, ids, fields=None, as_of=None, expand=None, error_policy=None): - """GetWorkItems. - [Preview API] Returns a list of work items. - :param [int] ids: The comma-separated list of requested work item ids - :param [str] fields: Comma-separated list of requested fields - :param datetime as_of: AsOf UTC date time string - :param WorkItemExpand expand: The expand parameters for work item attributes - :param WorkItemErrorPolicy error_policy: The flag to control error policy in a bulk get work items request - :rtype: [WorkItem] - """ - 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, 'WorkItemExpand') - if error_policy is not None: - query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'WorkItemErrorPolicy') - response = self._send(http_method='GET', - location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='4.1-preview.2', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItem]', response) - - def update_work_item(self, document, id, validate_only=None, bypass_rules=None, suppress_notifications=None): - """UpdateWorkItem. - [Preview API] 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 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 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='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content, - media_type='application/json-patch+json') - return self._deserialize('WorkItem', response) - - def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None): - """CreateWorkItem. - [Preview API] 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='4.1-preview.2', - 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. - [Preview API] 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 WorkItemExpand expand: The expand parameters for work item attributes - :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, 'WorkItemExpand') - response = self._send(http_method='GET', - location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', 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='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[WorkItemNextStateOnTransition]', response) - - def get_work_item_type_categories(self, project): - """GetWorkItemTypeCategories. - [Preview API] Returns a the deltas between work item revisions. - :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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemTypeCategory]', response) - - def get_work_item_type_category(self, project, category): - """GetWorkItemTypeCategory. - [Preview API] Returns a the deltas between work item revisions. - :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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WorkItemTypeCategory', response) - - def get_work_item_type(self, project, type): - """GetWorkItemType. - [Preview API] 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='4.1-preview.2', - route_values=route_values) - return self._deserialize('WorkItemType', response) - - def get_work_item_types(self, project): - """GetWorkItemTypes. - [Preview API] 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='4.1-preview.2', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemType]', response) - - def get_dependent_fields(self, project, type, field): - """GetDependentFields. - [Preview API] Returns the dependent fields for the corresponding workitem type and fieldname. - :param str project: Project ID or project name - :param str type: The work item type name - :param str field: - :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') - response = self._send(http_method='GET', - location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('FieldDependentRule', 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='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemStateColor]', response) -