diff --git a/.gitignore b/.gitignore index 0ff8aecc..903d30ba 100644 --- a/.gitignore +++ b/.gitignore @@ -299,8 +299,8 @@ vsts/build/bdist.win32/ # don't ignore release management client !azure-devops/azure/devops/released/release -!azure-devops/azure/devops/v5_0/release !azure-devops/azure/devops/v5_1/release +!azure-devops/azure/devops/v6_0/release # ignore private folder for testing reported issues issues/ \ No newline at end of file diff --git a/azure-devops/azure/devops/connection.py b/azure-devops/azure/devops/connection.py index ea21a5ac..78d8f9cf 100644 --- a/azure-devops/azure/devops/connection.py +++ b/azure-devops/azure/devops/connection.py @@ -10,9 +10,9 @@ from .client_configuration import ClientConfiguration from .exceptions import AzureDevOpsClientRequestError from .released.client_factory import ClientFactory -from .v5_0.location.location_client import LocationClient -from .v5_0.client_factory import ClientFactoryV5_0 +from .v5_1.location.location_client import LocationClient from .v5_1.client_factory import ClientFactoryV5_1 +from .v6_0.client_factory import ClientFactoryV6_0 logger = logging.getLogger(__name__) @@ -33,8 +33,8 @@ def __init__(self, base_url=None, creds=None, user_agent=None): self._creds = creds self._resource_areas = None self.clients = ClientFactory(self) - self.clients_v5_0 = ClientFactoryV5_0(self) self.clients_v5_1 = ClientFactoryV5_1(self) + self.clients_v6_0 = ClientFactoryV6_0(self) self.use_fiddler = False def get_client(self, client_type): diff --git a/azure-devops/azure/devops/issue_tests/test_issue_268.py b/azure-devops/azure/devops/issue_tests/test_issue_268.py index 9dbfab0a..b429db0b 100644 --- a/azure-devops/azure/devops/issue_tests/test_issue_268.py +++ b/azure-devops/azure/devops/issue_tests/test_issue_268.py @@ -22,13 +22,13 @@ def text(self, encoding=None): class TestDeserialization(unittest.TestCase): # https://github.com/microsoft/azure-devops-python-api/issues/268 - def test_deserialization_issue_268_50(self): - from azure.devops.v5_0.task_agent import models + def test_deserialization_issue_268_51(self): + from azure.devops.v5_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_51(self): - from azure.devops.v5_1.task_agent import models + def test_deserialization_issue_268_60(self): + from azure.devops.v6_0.task_agent import models self._test_deserialization(models.__dict__.items(), _268_type, _268_json) @staticmethod diff --git a/azure-devops/azure/devops/v5_0/boards/__init__.py b/azure-devops/azure/devops/v5_0/boards/__init__.py deleted file mode 100644 index 470629c6..00000000 --- a/azure-devops/azure/devops/v5_0/boards/__init__.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 .models import * -from .boards_client import BoardsClient - -__all__ = [ - 'Board', - 'BoardColumn', - 'BoardColumnBase', - 'BoardColumnCollectionResponse', - 'BoardColumnCreate', - 'BoardColumnResponse', - 'BoardColumnUpdate', - 'BoardItem', - 'BoardItemCollectionResponse', - 'BoardItemIdAndType', - 'BoardItemReference', - 'BoardItemResponse', - 'BoardReference', - 'BoardResponse', - 'BoardRow', - 'BoardRowBase', - 'BoardRowCollectionResponse', - 'BoardRowCreate', - 'BoardRowResponse', - 'BoardRowUpdate', - 'CreateBoard', - 'EntityReference', - 'NewBoardItem', - 'ReferenceLinks', - 'UpdateBoard', - 'UpdateBoardItem', - 'BoardsClient' -] diff --git a/azure-devops/azure/devops/v5_0/boards/boards_client.py b/azure-devops/azure/devops/v5_0/boards/boards_client.py deleted file mode 100644 index 3ef4bfa0..00000000 --- a/azure-devops/azure/devops/v5_0/boards/boards_client.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 msrest import Serializer, Deserializer -from ...client import Client -from . import models - - -class BoardsClient(Client): - """Boards - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(BoardsClient, self).__init__(base_url, creds) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - resource_area_identifier = '11635d5f-a4f9-43ea-a48b-d56be43fee0f' - diff --git a/azure-devops/azure/devops/v5_0/boards/models.py b/azure-devops/azure/devops/v5_0/boards/models.py deleted file mode 100644 index 927be126..00000000 --- a/azure-devops/azure/devops/v5_0/boards/models.py +++ /dev/null @@ -1,644 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BoardColumnBase(Model): - """BoardColumnBase. - - :param description: Board column description. - :type description: str - :param name: Name of the column. - :type name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, description=None, name=None): - super(BoardColumnBase, self).__init__() - self.description = description - self.name = name - - -class BoardColumnCollectionResponse(Model): - """BoardColumnCollectionResponse. - - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param board_columns: The resulting collection of BoardColumn. - :type board_columns: list of :class:`BoardColumn ` - :param eTag: The last change date and time for all the columns in the collection. - :type eTag: list of str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'board_columns': {'key': 'boardColumns', 'type': '[BoardColumn]'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, _links=None, board_columns=None, eTag=None): - super(BoardColumnCollectionResponse, self).__init__() - self._links = _links - self.board_columns = board_columns - self.eTag = eTag - - -class BoardColumnCreate(BoardColumnBase): - """BoardColumnCreate. - - :param description: Board column description. - :type description: str - :param name: Name of the column. - :type name: str - :param next_column_id: Next column identifier or supported directive: $first or $last. - :type next_column_id: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'next_column_id': {'key': 'nextColumnId', 'type': 'str'} - } - - def __init__(self, description=None, name=None, next_column_id=None): - super(BoardColumnCreate, self).__init__(description=description, name=name) - self.next_column_id = next_column_id - - -class BoardColumnResponse(Model): - """BoardColumnResponse. - - :param board_column: The resulting BoardColumn. - :type board_column: :class:`BoardColumn ` - :param eTag: The last change date and time for all the columns in the collection. - :type eTag: list of str - """ - - _attribute_map = { - 'board_column': {'key': 'boardColumn', 'type': 'BoardColumn'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, board_column=None, eTag=None): - super(BoardColumnResponse, self).__init__() - self.board_column = board_column - self.eTag = eTag - - -class BoardColumnUpdate(BoardColumnCreate): - """BoardColumnUpdate. - - :param description: Board column description. - :type description: str - :param next_column_id: Next column identifier or supported directive: $first or $last. - :type next_column_id: str - :param name: Name of the column. - :type name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'next_column_id': {'key': 'nextColumnId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, description=None, next_column_id=None, name=None): - super(BoardColumnUpdate, self).__init__(description=description, next_column_id=next_column_id) - self.name = name - - -class BoardItemCollectionResponse(Model): - """BoardItemCollectionResponse. - - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param board_items: The resulting collection of BoardItem. - :type board_items: list of :class:`BoardItem ` - :param eTag: The last change date and time for all items in the collection. - :type eTag: list of str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'board_items': {'key': 'boardItems', 'type': '[BoardItem]'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, _links=None, board_items=None, eTag=None): - super(BoardItemCollectionResponse, self).__init__() - self._links = _links - self.board_items = board_items - self.eTag = eTag - - -class BoardItemIdAndType(Model): - """BoardItemIdAndType. - - :param item_id: Item id. - :type item_id: str - :param item_type: Item type. - :type item_type: str - """ - - _attribute_map = { - 'item_id': {'key': 'itemId', 'type': 'str'}, - 'item_type': {'key': 'itemType', 'type': 'str'} - } - - def __init__(self, item_id=None, item_type=None): - super(BoardItemIdAndType, self).__init__() - self.item_id = item_id - self.item_type = item_type - - -class BoardItemReference(BoardItemIdAndType): - """BoardItemReference. - - :param item_id: Item id. - :type item_id: str - :param item_type: Item type. - :type item_type: str - :param unique_id: Board's unique identifier. Compound identifier generated using the item identifier and item type. - :type unique_id: str - :param url: Full http link to the resource. - :type url: str - """ - - _attribute_map = { - 'item_id': {'key': 'itemId', 'type': 'str'}, - 'item_type': {'key': 'itemType', 'type': 'str'}, - 'unique_id': {'key': 'uniqueId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, item_id=None, item_type=None, unique_id=None, url=None): - super(BoardItemReference, self).__init__(item_id=item_id, item_type=item_type) - self.unique_id = unique_id - self.url = url - - -class BoardItemResponse(Model): - """BoardItemResponse. - - :param eTag: The last changed date for the board item. - :type eTag: list of str - :param item: The resulting BoardItem. - :type item: :class:`BoardItem ` - """ - - _attribute_map = { - 'eTag': {'key': 'eTag', 'type': '[str]'}, - 'item': {'key': 'item', 'type': 'BoardItem'} - } - - def __init__(self, eTag=None, item=None): - super(BoardItemResponse, self).__init__() - self.eTag = eTag - self.item = item - - -class BoardResponse(Model): - """BoardResponse. - - :param board: The resulting Board. - :type board: :class:`Board ` - :param eTag: The last date and time the board was changed. - :type eTag: list of str - """ - - _attribute_map = { - 'board': {'key': 'board', 'type': 'Board'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, board=None, eTag=None): - super(BoardResponse, self).__init__() - self.board = board - self.eTag = eTag - - -class BoardRowBase(Model): - """BoardRowBase. - - :param name: Row name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, name=None): - super(BoardRowBase, self).__init__() - self.name = name - - -class BoardRowCollectionResponse(Model): - """BoardRowCollectionResponse. - - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param board_rows: The resulting collection of BoardRow. - :type board_rows: list of :class:`BoardRow ` - :param eTag: The last change date and time for all the rows in the collection. - :type eTag: list of str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'board_rows': {'key': 'boardRows', 'type': '[BoardRow]'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, _links=None, board_rows=None, eTag=None): - super(BoardRowCollectionResponse, self).__init__() - self._links = _links - self.board_rows = board_rows - self.eTag = eTag - - -class BoardRowCreate(BoardRowBase): - """BoardRowCreate. - - :param name: Row name. - :type name: str - :param next_row_id: Next row identifier or supported directive: $first or $last. - :type next_row_id: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'next_row_id': {'key': 'nextRowId', 'type': 'str'} - } - - def __init__(self, name=None, next_row_id=None): - super(BoardRowCreate, self).__init__(name=name) - self.next_row_id = next_row_id - - -class BoardRowResponse(Model): - """BoardRowResponse. - - :param board_row: The resulting collection of BoardRow. - :type board_row: :class:`BoardRow ` - :param eTag: The last change date and time for all the rows in the collection. - :type eTag: list of str - """ - - _attribute_map = { - 'board_row': {'key': 'boardRow', 'type': 'BoardRow'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, board_row=None, eTag=None): - super(BoardRowResponse, self).__init__() - self.board_row = board_row - self.eTag = eTag - - -class BoardRowUpdate(BoardRowCreate): - """BoardRowUpdate. - - :param name: Row name. - :type name: str - :param next_row_id: Next row identifier or supported directive: $first or $last. - :type next_row_id: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'next_row_id': {'key': 'nextRowId', 'type': 'str'}, - } - - def __init__(self, name=None, next_row_id=None): - super(BoardRowUpdate, self).__init__(name=name, next_row_id=next_row_id) - - -class CreateBoard(Model): - """CreateBoard. - - :param description: Description of the board. - :type description: str - :param name: Name of the board to create. - :type name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, description=None, name=None): - super(CreateBoard, self).__init__() - self.description = description - self.name = name - - -class EntityReference(Model): - """EntityReference. - - :param name: Name of the resource. - :type name: str - :param url: Full http link to the resource. - :type url: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, name=None, url=None): - super(EntityReference, self).__init__() - self.name = name - self.url = url - - -class NewBoardItem(BoardItemIdAndType): - """NewBoardItem. - - :param item_id: Item id. - :type item_id: str - :param item_type: Item type. - :type item_type: str - :param column_id: Board column identifier. - :type column_id: str - :param next_item_unique_id: Next item unique identifier or supported directive: $first or $last. - :type next_item_unique_id: str - :param row_id: Board row identifier. - :type row_id: str - """ - - _attribute_map = { - 'item_id': {'key': 'itemId', 'type': 'str'}, - 'item_type': {'key': 'itemType', 'type': 'str'}, - 'column_id': {'key': 'columnId', 'type': 'str'}, - 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, - 'row_id': {'key': 'rowId', 'type': 'str'} - } - - def __init__(self, item_id=None, item_type=None, column_id=None, next_item_unique_id=None, row_id=None): - super(NewBoardItem, self).__init__(item_id=item_id, item_type=item_type) - self.column_id = column_id - self.next_item_unique_id = next_item_unique_id - self.row_id = row_id - - -class ReferenceLinks(Model): - """ReferenceLinks. - - :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class UpdateBoard(Model): - """UpdateBoard. - - :param description: New description of the board. - :type description: str - :param name: New name of the board. - :type name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, description=None, name=None): - super(UpdateBoard, self).__init__() - self.description = description - self.name = name - - -class UpdateBoardItem(Model): - """UpdateBoardItem. - - :param column_id: Board column identifier. - :type column_id: str - :param next_item_unique_id: Next unique item identifier or supported directive: $first or $last. - :type next_item_unique_id: str - :param row_id: Board row identifier. - :type row_id: str - """ - - _attribute_map = { - 'column_id': {'key': 'columnId', 'type': 'str'}, - 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, - 'row_id': {'key': 'rowId', 'type': 'str'} - } - - def __init__(self, column_id=None, next_item_unique_id=None, row_id=None): - super(UpdateBoardItem, self).__init__() - self.column_id = column_id - self.next_item_unique_id = next_item_unique_id - self.row_id = row_id - - -class BoardColumn(BoardColumnBase): - """BoardColumn. - - :param description: Board column description. - :type description: str - :param name: Name of the column. - :type name: str - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param id: Id of the resource. - :type id: str - :param next_column_id: Next column identifier. - :type next_column_id: str - :param url: Full http link to the resource. - :type url: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'str'}, - 'next_column_id': {'key': 'nextColumnId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, description=None, name=None, _links=None, id=None, next_column_id=None, url=None): - super(BoardColumn, self).__init__(description=description, name=name) - self._links = _links - self.id = id - self.next_column_id = next_column_id - self.url = url - - -class BoardItem(BoardItemReference): - """BoardItem. - - :param item_id: Item id. - :type item_id: str - :param item_type: Item type. - :type item_type: str - :param unique_id: Board's unique identifier. Compound identifier generated using the item identifier and item type. - :type unique_id: str - :param url: Full http link to the resource. - :type url: str - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param board_id: Board id for this item. - :type board_id: int - :param column: Board column id for this item. - :type column: str - :param next_item_unique_id: Next item unique identifier. - :type next_item_unique_id: str - :param row: Board row id for this item. - :type row: str - """ - - _attribute_map = { - 'item_id': {'key': 'itemId', 'type': 'str'}, - 'item_type': {'key': 'itemType', 'type': 'str'}, - 'unique_id': {'key': 'uniqueId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'board_id': {'key': 'boardId', 'type': 'int'}, - 'column': {'key': 'column', 'type': 'str'}, - 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, - 'row': {'key': 'row', 'type': 'str'} - } - - def __init__(self, item_id=None, item_type=None, unique_id=None, url=None, _links=None, board_id=None, column=None, next_item_unique_id=None, row=None): - super(BoardItem, self).__init__(item_id=item_id, item_type=item_type, unique_id=unique_id, url=url) - self._links = _links - self.board_id = board_id - self.column = column - self.next_item_unique_id = next_item_unique_id - self.row = row - - -class BoardReference(EntityReference): - """BoardReference. - - :param name: Name of the resource. - :type name: str - :param url: Full http link to the resource. - :type url: str - :param id: Id of the resource. - :type id: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, name=None, url=None, id=None): - super(BoardReference, self).__init__(name=name, url=url) - self.id = id - - -class BoardRow(BoardRowBase): - """BoardRow. - - :param name: Row name. - :type name: str - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param id: Id of the resource. - :type id: str - :param next_row_id: Next row identifier. - :type next_row_id: str - :param url: Full http link to the resource. - :type url: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'str'}, - 'next_row_id': {'key': 'nextRowId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, name=None, _links=None, id=None, next_row_id=None, url=None): - super(BoardRow, self).__init__(name=name) - self._links = _links - self.id = id - self.next_row_id = next_row_id - self.url = url - - -class Board(BoardReference): - """Board. - - :param name: Name of the resource. - :type name: str - :param url: Full http link to the resource. - :type url: str - :param id: Id of the resource. - :type id: int - :param _links: Links to other related objects. - :type _links: :class:`ReferenceLinks ` - :param description: Description of the board. - :type description: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'description': {'key': 'description', 'type': 'str'} - } - - def __init__(self, name=None, url=None, id=None, _links=None, description=None): - super(Board, self).__init__(name=name, url=url, id=id) - self._links = _links - self.description = description - - -__all__ = [ - 'BoardColumnBase', - 'BoardColumnCollectionResponse', - 'BoardColumnCreate', - 'BoardColumnResponse', - 'BoardColumnUpdate', - 'BoardItemCollectionResponse', - 'BoardItemIdAndType', - 'BoardItemReference', - 'BoardItemResponse', - 'BoardResponse', - 'BoardRowBase', - 'BoardRowCollectionResponse', - 'BoardRowCreate', - 'BoardRowResponse', - 'BoardRowUpdate', - 'CreateBoard', - 'EntityReference', - 'NewBoardItem', - 'ReferenceLinks', - 'UpdateBoard', - 'UpdateBoardItem', - 'BoardColumn', - 'BoardItem', - 'BoardReference', - 'BoardRow', - 'Board', -] diff --git a/azure-devops/azure/devops/v5_0/client_factory.py b/azure-devops/azure/devops/v5_0/client_factory.py deleted file mode 100644 index 99486908..00000000 --- a/azure-devops/azure/devops/v5_0/client_factory.py +++ /dev/null @@ -1,381 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - - -class ClientFactoryV5_0(object): - """ClientFactoryV5_0. - A factory class to get the 5.0 clients. - """ - - def __init__(self, connection): - self._connection = connection - - def get_accounts_client(self): - """get_accounts_client. - Gets the 5.0 version of the AccountsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.accounts.accounts_client.AccountsClient') - - def get_boards_client(self): - """get_boards_client. - Gets the 5.0 version of the BoardsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.boards.boards_client.BoardsClient') - - def get_build_client(self): - """get_build_client. - Gets the 5.0 version of the BuildClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.build.build_client.BuildClient') - - def get_client_trace_client(self): - """get_client_trace_client. - Gets the 5.0 version of the ClientTraceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.client_trace.client_trace_client.ClientTraceClient') - - def get_cloud_load_test_client(self): - """get_cloud_load_test_client. - Gets the 5.0 version of the CloudLoadTestClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') - - def get_contributions_client(self): - """get_contributions_client. - Gets the 5.0 version of the ContributionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.contributions.contributions_client.ContributionsClient') - - def get_core_client(self): - """get_core_client. - Gets the 5.0 version of the CoreClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.core.core_client.CoreClient') - - def get_customer_intelligence_client(self): - """get_customer_intelligence_client. - Gets the 5.0 version of the CustomerIntelligenceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') - - def get_dashboard_client(self): - """get_dashboard_client. - Gets the 5.0 version of the DashboardClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.dashboard.dashboard_client.DashboardClient') - - def get_extension_management_client(self): - """get_extension_management_client. - Gets the 5.0 version of the ExtensionManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.extension_management.extension_management_client.ExtensionManagementClient') - - def get_feature_availability_client(self): - """get_feature_availability_client. - Gets the 5.0 version of the FeatureAvailabilityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') - - def get_feature_management_client(self): - """get_feature_management_client. - Gets the 5.0 version of the FeatureManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.feature_management.feature_management_client.FeatureManagementClient') - - def get_feed_client(self): - """get_feed_client. - Gets the 5.0 version of the FeedClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.feed.feed_client.FeedClient') - - def get_feed_token_client(self): - """get_feed_token_client. - Gets the 5.0 version of the FeedTokenClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.feed_token.feed_token_client.FeedTokenClient') - - def get_file_container_client(self): - """get_file_container_client. - Gets the 5.0 version of the FileContainerClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.file_container.file_container_client.FileContainerClient') - - def get_gallery_client(self): - """get_gallery_client. - Gets the 5.0 version of the GalleryClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.gallery.gallery_client.GalleryClient') - - def get_git_client(self): - """get_git_client. - Gets the 5.0 version of the GitClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.git.git_client.GitClient') - - def get_graph_client(self): - """get_graph_client. - Gets the 5.0 version of the GraphClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.graph.graph_client.GraphClient') - - def get_identity_client(self): - """get_identity_client. - Gets the 5.0 version of the IdentityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.identity.identity_client.IdentityClient') - - def get_licensing_client(self): - """get_licensing_client. - Gets the 5.0 version of the LicensingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.licensing.licensing_client.LicensingClient') - - def get_location_client(self): - """get_location_client. - Gets the 5.0 version of the LocationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.location.location_client.LocationClient') - - def get_maven_client(self): - """get_maven_client. - Gets the 5.0 version of the MavenClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.maven.maven_client.MavenClient') - - def get_member_entitlement_management_client(self): - """get_member_entitlement_management_client. - Gets the 5.0 version of the MemberEntitlementManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') - - def get_notification_client(self): - """get_notification_client. - Gets the 5.0 version of the NotificationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.notification.notification_client.NotificationClient') - - def get_npm_client(self): - """get_npm_client. - Gets the 5.0 version of the NpmClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.npm.npm_client.NpmClient') - - def get_nuget_client(self): - """get_nuget_client. - Gets the 5.0 version of the NuGetClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.nuget.nuget_client.NuGetClient') - - def get_operations_client(self): - """get_operations_client. - Gets the 5.0 version of the OperationsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.operations.operations_client.OperationsClient') - - def get_policy_client(self): - """get_policy_client. - Gets the 5.0 version of the PolicyClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.policy.policy_client.PolicyClient') - - def get_profile_client(self): - """get_profile_client. - Gets the 5.0 version of the ProfileClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.profile.profile_client.ProfileClient') - - def get_project_analysis_client(self): - """get_project_analysis_client. - Gets the 5.0 version of the ProjectAnalysisClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.project_analysis.project_analysis_client.ProjectAnalysisClient') - - def get_provenance_client(self): - """get_provenance_client. - Gets the 5.0 version of the ProvenanceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.provenance.provenance_client.ProvenanceClient') - - def get_py_pi_api_client(self): - """get_py_pi_api_client. - Gets the 5.0 version of the PyPiApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.py_pi_api.py_pi_api_client.PyPiApiClient') - - def get_release_client(self): - """get_release_client. - Gets the 5.0 version of the ReleaseClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.release.release_client.ReleaseClient') - - def get_search_client(self): - """get_search_client. - Gets the 5.0 version of the SearchClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.search.search_client.SearchClient') - - def get_security_client(self): - """get_security_client. - Gets the 5.0 version of the SecurityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.security.security_client.SecurityClient') - - def get_service_endpoint_client(self): - """get_service_endpoint_client. - Gets the 5.0 version of the ServiceEndpointClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') - - def get_service_hooks_client(self): - """get_service_hooks_client. - Gets the 5.0 version of the ServiceHooksClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.service_hooks.service_hooks_client.ServiceHooksClient') - - def get_settings_client(self): - """get_settings_client. - Gets the 5.0 version of the SettingsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.settings.settings_client.SettingsClient') - - def get_symbol_client(self): - """get_symbol_client. - Gets the 5.0 version of the SymbolClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.symbol.symbol_client.SymbolClient') - - def get_task_client(self): - """get_task_client. - Gets the 5.0 version of the TaskClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.task.task_client.TaskClient') - - def get_task_agent_client(self): - """get_task_agent_client. - Gets the 5.0 version of the TaskAgentClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.task_agent.task_agent_client.TaskAgentClient') - - def get_test_client(self): - """get_test_client. - Gets the 5.0 version of the TestClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.test.test_client.TestClient') - - def get_tfvc_client(self): - """get_tfvc_client. - Gets the 5.0 version of the TfvcClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.tfvc.tfvc_client.TfvcClient') - - def get_token_admin_client(self): - """get_token_admin_client. - Gets the 5.0 version of the TokenAdminClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.token_admin.token_admin_client.TokenAdminClient') - - def get_token_administration_client(self): - """get_token_administration_client. - Gets the 5.0 version of the TokenAdministrationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.token_administration.token_administration_client.TokenAdministrationClient') - - def get_upack_api_client(self): - """get_upack_api_client. - Gets the 5.0 version of the UPackApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.upack_api.upack_api_client.UPackApiClient') - - def get_upack_packaging_client(self): - """get_upack_packaging_client. - Gets the 5.0 version of the UPackPackagingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.upack_packaging.upack_packaging_client.UPackPackagingClient') - - def get_wiki_client(self): - """get_wiki_client. - Gets the 5.0 version of the WikiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.wiki.wiki_client.WikiClient') - - def get_work_client(self): - """get_work_client. - Gets the 5.0 version of the WorkClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.work.work_client.WorkClient') - - def get_work_item_tracking_client(self): - """get_work_item_tracking_client. - Gets the 5.0 version of the WorkItemTrackingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') - - def get_work_item_tracking_process_client(self): - """get_work_item_tracking_process_client. - Gets the 5.0 version of the WorkItemTrackingProcessClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.work_item_tracking_process.work_item_tracking_process_client.WorkItemTrackingProcessClient') - - def get_work_item_tracking_process_template_client(self): - """get_work_item_tracking_process_template_client. - Gets the 5.0 version of the WorkItemTrackingProcessTemplateClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') - diff --git a/azure-devops/azure/devops/v5_0/licensing/licensing_client.py b/azure-devops/azure/devops/v5_0/licensing/licensing_client.py deleted file mode 100644 index 9c0e7422..00000000 --- a/azure-devops/azure/devops/v5_0/licensing/licensing_client.py +++ /dev/null @@ -1,400 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest import Serializer, Deserializer -from ...client import Client -from . import models - - -class LicensingClient(Client): - """Licensing - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(LicensingClient, self).__init__(base_url, creds) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - resource_area_identifier = 'c73a23a1-59bb-458c-8ce3-02c83215e015' - - def get_extension_license_usage(self): - """GetExtensionLicenseUsage. - [Preview API] Returns Licensing info about paid extensions assigned to user passed into GetExtensionsAssignedToAccount - :rtype: [AccountLicenseExtensionUsage] - """ - response = self._send(http_method='GET', - location_id='01bce8d3-c130-480f-a332-474ae3f6662e', - version='5.0-preview.1') - return self._deserialize('[AccountLicenseExtensionUsage]', self._unwrap_collection(response)) - - def get_certificate(self, **kwargs): - """GetCertificate. - [Preview API] - :rtype: object - """ - response = self._send(http_method='GET', - location_id='2e0dbce7-a327-4bc0-a291-056139393f6d', - version='5.0-preview.1', - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_client_rights(self, right_name=None, product_version=None, edition=None, rel_type=None, include_certificate=None, canary=None, machine_id=None): - """GetClientRights. - [Preview API] - :param str right_name: - :param str product_version: - :param str edition: - :param str rel_type: - :param bool include_certificate: - :param str canary: - :param str machine_id: - :rtype: :class:` ` - """ - route_values = {} - if right_name is not None: - route_values['rightName'] = self._serialize.url('right_name', right_name, 'str') - query_parameters = {} - if product_version is not None: - query_parameters['productVersion'] = self._serialize.query('product_version', product_version, 'str') - if edition is not None: - query_parameters['edition'] = self._serialize.query('edition', edition, 'str') - if rel_type is not None: - query_parameters['relType'] = self._serialize.query('rel_type', rel_type, 'str') - if include_certificate is not None: - query_parameters['includeCertificate'] = self._serialize.query('include_certificate', include_certificate, 'bool') - if canary is not None: - query_parameters['canary'] = self._serialize.query('canary', canary, 'str') - if machine_id is not None: - query_parameters['machineId'] = self._serialize.query('machine_id', machine_id, 'str') - response = self._send(http_method='GET', - location_id='643c72da-eaee-4163-9f07-d748ef5c2a0c', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('ClientRightsContainer', response) - - def assign_available_account_entitlement(self, user_id, dont_notify_user=None, origin=None): - """AssignAvailableAccountEntitlement. - [Preview API] Assign an available entitilement to a user - :param str user_id: The user to which to assign the entitilement - :param bool dont_notify_user: - :param str origin: - :rtype: :class:` ` - """ - query_parameters = {} - if user_id is not None: - query_parameters['userId'] = self._serialize.query('user_id', user_id, 'str') - if dont_notify_user is not None: - query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') - if origin is not None: - query_parameters['origin'] = self._serialize.query('origin', origin, 'str') - response = self._send(http_method='POST', - location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', - version='5.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlement(self): - """GetAccountEntitlement. - [Preview API] Gets the account entitlement of the current user it is mapped to _apis/licensing/entitlements/me so specifically is looking for the user of the request - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', - version='5.0-preview.1') - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlements(self, top=None, skip=None): - """GetAccountEntitlements. - [Preview API] Gets top (top) entitlements for users in the account from offset (skip) order by DateCreated ASC - :param int top: number of accounts to return - :param int skip: records to skip, null is interpreted as 0 - :rtype: [AccountEntitlement] - """ - query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if skip is not None: - query_parameters['skip'] = self._serialize.query('skip', skip, 'int') - response = self._send(http_method='GET', - location_id='ea37be6f-8cd7-48dd-983d-2b72d6e3da0f', - version='5.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def assign_account_entitlement_for_user(self, body, user_id, dont_notify_user=None, origin=None): - """AssignAccountEntitlementForUser. - [Preview API] Assign an explicit account entitlement - :param :class:` ` body: The update model for the entitlement - :param str user_id: The id of the user - :param bool dont_notify_user: - :param str origin: - :rtype: :class:` ` - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - query_parameters = {} - if dont_notify_user is not None: - query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') - if origin is not None: - query_parameters['origin'] = self._serialize.query('origin', origin, 'str') - content = self._serialize.body(body, 'AccountEntitlementUpdateModel') - response = self._send(http_method='PUT', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('AccountEntitlement', response) - - def delete_user_entitlements(self, user_id): - """DeleteUserEntitlements. - [Preview API] - :param str user_id: - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - self._send(http_method='DELETE', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.0-preview.1', - route_values=route_values) - - def get_account_entitlement_for_user(self, user_id, determine_rights=None, create_if_not_exists=None): - """GetAccountEntitlementForUser. - [Preview API] Get the entitlements for a user - :param str user_id: The id of the user - :param bool determine_rights: - :param bool create_if_not_exists: - :rtype: :class:` ` - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - query_parameters = {} - if determine_rights is not None: - query_parameters['determineRights'] = self._serialize.query('determine_rights', determine_rights, 'bool') - if create_if_not_exists is not None: - query_parameters['createIfNotExists'] = self._serialize.query('create_if_not_exists', create_if_not_exists, 'bool') - response = self._send(http_method='GET', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlements_batch(self, user_ids): - """GetAccountEntitlementsBatch. - [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account - :param [str] user_ids: List of user Ids. - :rtype: [AccountEntitlement] - """ - route_values = {} - route_values['action'] = 'GetUsersEntitlements' - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='POST', - location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def obtain_available_account_entitlements(self, user_ids): - """ObtainAvailableAccountEntitlements. - [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account - :param [str] user_ids: List of user Ids. - :rtype: [AccountEntitlement] - """ - route_values = {} - route_values['action'] = 'GetAvailableUsersEntitlements' - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='POST', - location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def assign_extension_to_all_eligible_users(self, extension_id): - """AssignExtensionToAllEligibleUsers. - [Preview API] Assigns the access to the given extension for all eligible users in the account that do not already have access to the extension though bundle or account assignment - :param str extension_id: The extension id to assign the access to. - :rtype: [ExtensionOperationResult] - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='PUT', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) - - def get_eligible_users_for_extension(self, extension_id, options): - """GetEligibleUsersForExtension. - [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions - :param str extension_id: The extension to check the eligibility of the users for. - :param str options: The options to filter the list. - :rtype: [str] - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - query_parameters = {} - if options is not None: - query_parameters['options'] = self._serialize.query('options', options, 'str') - response = self._send(http_method='GET', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[str]', self._unwrap_collection(response)) - - def get_extension_status_for_users(self, extension_id): - """GetExtensionStatusForUsers. - [Preview API] Returns extension assignment status of all account users for the given extension - :param str extension_id: The extension to check the status of the users for. - :rtype: {ExtensionAssignmentDetails} - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='GET', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('{ExtensionAssignmentDetails}', self._unwrap_collection(response)) - - def assign_extension_to_users(self, body): - """AssignExtensionToUsers. - [Preview API] Assigns the access to the given extension for a given list of users - :param :class:` ` body: The extension assignment details. - :rtype: [ExtensionOperationResult] - """ - content = self._serialize.body(body, 'ExtensionAssignment') - response = self._send(http_method='PUT', - location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', - version='5.0-preview.1', - content=content) - return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) - - def get_extensions_assigned_to_user(self, user_id): - """GetExtensionsAssignedToUser. - [Preview API] Returns extensions that are currently assigned to the user in the account - :param str user_id: The user's identity id. - :rtype: {LicensingSource} - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - response = self._send(http_method='GET', - location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('{LicensingSource}', self._unwrap_collection(response)) - - def bulk_get_extensions_assigned_to_users(self, user_ids): - """BulkGetExtensionsAssignedToUsers. - [Preview API] Returns extensions that are currrently assigned to the users that are in the account - :param [str] user_ids: - :rtype: {[ExtensionSource]} - """ - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='PUT', - location_id='1d42ddc2-3e7d-4daa-a0eb-e12c1dbd7c72', - version='5.0-preview.2', - content=content) - return self._deserialize('{[ExtensionSource]}', self._unwrap_collection(response)) - - def get_extension_license_data(self, extension_id): - """GetExtensionLicenseData. - [Preview API] - :param str extension_id: - :rtype: :class:` ` - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='GET', - location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('ExtensionLicenseData', response) - - def register_extension_license(self, extension_license_data): - """RegisterExtensionLicense. - [Preview API] - :param :class:` ` extension_license_data: - :rtype: bool - """ - content = self._serialize.body(extension_license_data, 'ExtensionLicenseData') - response = self._send(http_method='POST', - location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', - version='5.0-preview.1', - content=content) - return self._deserialize('bool', response) - - def compute_extension_rights(self, ids): - """ComputeExtensionRights. - [Preview API] - :param [str] ids: - :rtype: {bool} - """ - content = self._serialize.body(ids, '[str]') - response = self._send(http_method='POST', - location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', - version='5.0-preview.1', - content=content) - return self._deserialize('{bool}', self._unwrap_collection(response)) - - def get_extension_rights(self): - """GetExtensionRights. - [Preview API] - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', - version='5.0-preview.1') - return self._deserialize('ExtensionRightsResult', response) - - def get_msdn_presence(self): - """GetMsdnPresence. - [Preview API] - """ - self._send(http_method='GET', - location_id='69522c3f-eecc-48d0-b333-f69ffb8fa6cc', - version='5.0-preview.1') - - def get_entitlements(self): - """GetEntitlements. - [Preview API] - :rtype: [MsdnEntitlement] - """ - response = self._send(http_method='GET', - location_id='1cc6137e-12d5-4d44-a4f2-765006c9e85d', - version='5.0-preview.1') - return self._deserialize('[MsdnEntitlement]', self._unwrap_collection(response)) - - def get_account_licenses_usage(self): - """GetAccountLicensesUsage. - [Preview API] - :rtype: [AccountLicenseUsage] - """ - response = self._send(http_method='GET', - location_id='d3266b87-d395-4e91-97a5-0215b81a0b7d', - version='5.0-preview.1') - return self._deserialize('[AccountLicenseUsage]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v5_0/licensing/models.py b/azure-devops/azure/devops/v5_0/licensing/models.py deleted file mode 100644 index 29a2d8d1..00000000 --- a/azure-devops/azure/devops/v5_0/licensing/models.py +++ /dev/null @@ -1,595 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AccountEntitlement(Model): - """AccountEntitlement. - - :param account_id: Gets or sets the id of the account to which the license belongs - :type account_id: str - :param assignment_date: Gets or sets the date the license was assigned - :type assignment_date: datetime - :param assignment_source: Assignment Source - :type assignment_source: object - :param date_created: Gets or sets the creation date of the user in this account - :type date_created: datetime - :param last_accessed_date: Gets or sets the date of the user last sign-in to this account - :type last_accessed_date: datetime - :param license: - :type license: :class:`License ` - :param origin: Licensing origin - :type origin: object - :param rights: The computed rights of this user in the account. - :type rights: :class:`AccountRights ` - :param status: The status of the user in the account - :type status: object - :param user: Identity information of the user to which the license belongs - :type user: :class:`IdentityRef ` - :param user_id: Gets the id of the user to which the license belongs - :type user_id: str - """ - - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'assignment_date': {'key': 'assignmentDate', 'type': 'iso-8601'}, - 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, - 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, - 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, - 'license': {'key': 'license', 'type': 'License'}, - 'origin': {'key': 'origin', 'type': 'object'}, - 'rights': {'key': 'rights', 'type': 'AccountRights'}, - 'status': {'key': 'status', 'type': 'object'}, - 'user': {'key': 'user', 'type': 'IdentityRef'}, - 'user_id': {'key': 'userId', 'type': 'str'} - } - - def __init__(self, account_id=None, assignment_date=None, assignment_source=None, date_created=None, last_accessed_date=None, license=None, origin=None, rights=None, status=None, user=None, user_id=None): - super(AccountEntitlement, self).__init__() - self.account_id = account_id - self.assignment_date = assignment_date - self.assignment_source = assignment_source - self.date_created = date_created - self.last_accessed_date = last_accessed_date - self.license = license - self.origin = origin - self.rights = rights - self.status = status - self.user = user - self.user_id = user_id - - -class AccountEntitlementUpdateModel(Model): - """AccountEntitlementUpdateModel. - - :param license: Gets or sets the license for the entitlement - :type license: :class:`License ` - """ - - _attribute_map = { - 'license': {'key': 'license', 'type': 'License'} - } - - def __init__(self, license=None): - super(AccountEntitlementUpdateModel, self).__init__() - self.license = license - - -class AccountLicenseExtensionUsage(Model): - """AccountLicenseExtensionUsage. - - :param extension_id: - :type extension_id: str - :param extension_name: - :type extension_name: str - :param included_quantity: - :type included_quantity: int - :param is_trial: - :type is_trial: bool - :param minimum_license_required: - :type minimum_license_required: object - :param msdn_used_count: - :type msdn_used_count: int - :param provisioned_count: - :type provisioned_count: int - :param remaining_trial_days: - :type remaining_trial_days: int - :param trial_expiry_date: - :type trial_expiry_date: datetime - :param used_count: - :type used_count: int - """ - - _attribute_map = { - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'extension_name': {'key': 'extensionName', 'type': 'str'}, - 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, - 'is_trial': {'key': 'isTrial', 'type': 'bool'}, - 'minimum_license_required': {'key': 'minimumLicenseRequired', 'type': 'object'}, - 'msdn_used_count': {'key': 'msdnUsedCount', 'type': 'int'}, - 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, - 'remaining_trial_days': {'key': 'remainingTrialDays', 'type': 'int'}, - 'trial_expiry_date': {'key': 'trialExpiryDate', 'type': 'iso-8601'}, - 'used_count': {'key': 'usedCount', 'type': 'int'} - } - - def __init__(self, extension_id=None, extension_name=None, included_quantity=None, is_trial=None, minimum_license_required=None, msdn_used_count=None, provisioned_count=None, remaining_trial_days=None, trial_expiry_date=None, used_count=None): - super(AccountLicenseExtensionUsage, self).__init__() - self.extension_id = extension_id - self.extension_name = extension_name - self.included_quantity = included_quantity - self.is_trial = is_trial - self.minimum_license_required = minimum_license_required - self.msdn_used_count = msdn_used_count - self.provisioned_count = provisioned_count - self.remaining_trial_days = remaining_trial_days - self.trial_expiry_date = trial_expiry_date - self.used_count = used_count - - -class AccountLicenseUsage(Model): - """AccountLicenseUsage. - - :param disabled_count: Amount that is disabled (Usually from licenses that were provisioned, but became invalid due to loss of subscription in a new billing cycle) - :type disabled_count: int - :param license: - :type license: :class:`AccountUserLicense ` - :param pending_provisioned_count: Amount that will be purchased in the next billing cycle - :type pending_provisioned_count: int - :param provisioned_count: Amount that has been purchased - :type provisioned_count: int - :param used_count: Amount currently being used. - :type used_count: int - """ - - _attribute_map = { - 'disabled_count': {'key': 'disabledCount', 'type': 'int'}, - 'license': {'key': 'license', 'type': 'AccountUserLicense'}, - 'pending_provisioned_count': {'key': 'pendingProvisionedCount', 'type': 'int'}, - 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, - 'used_count': {'key': 'usedCount', 'type': 'int'} - } - - def __init__(self, disabled_count=None, license=None, pending_provisioned_count=None, provisioned_count=None, used_count=None): - super(AccountLicenseUsage, self).__init__() - self.disabled_count = disabled_count - self.license = license - self.pending_provisioned_count = pending_provisioned_count - self.provisioned_count = provisioned_count - self.used_count = used_count - - -class AccountRights(Model): - """AccountRights. - - :param level: - :type level: object - :param reason: - :type reason: str - """ - - _attribute_map = { - 'level': {'key': 'level', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'str'} - } - - def __init__(self, level=None, reason=None): - super(AccountRights, self).__init__() - self.level = level - self.reason = reason - - -class AccountUserLicense(Model): - """AccountUserLicense. - - :param license: - :type license: int - :param source: - :type source: object - """ - - _attribute_map = { - 'license': {'key': 'license', 'type': 'int'}, - 'source': {'key': 'source', 'type': 'object'} - } - - def __init__(self, license=None, source=None): - super(AccountUserLicense, self).__init__() - self.license = license - self.source = source - - -class ClientRightsContainer(Model): - """ClientRightsContainer. - - :param certificate_bytes: - :type certificate_bytes: str - :param token: - :type token: str - """ - - _attribute_map = { - 'certificate_bytes': {'key': 'certificateBytes', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'} - } - - def __init__(self, certificate_bytes=None, token=None): - super(ClientRightsContainer, self).__init__() - self.certificate_bytes = certificate_bytes - self.token = token - - -class ExtensionAssignment(Model): - """ExtensionAssignment. - - :param extension_gallery_id: Gets or sets the extension ID to assign. - :type extension_gallery_id: str - :param is_auto_assignment: Set to true if this a auto assignment scenario. - :type is_auto_assignment: bool - :param licensing_source: Gets or sets the licensing source. - :type licensing_source: object - :param user_ids: Gets or sets the user IDs to assign the extension to. - :type user_ids: list of str - """ - - _attribute_map = { - 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, - 'is_auto_assignment': {'key': 'isAutoAssignment', 'type': 'bool'}, - 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, - 'user_ids': {'key': 'userIds', 'type': '[str]'} - } - - def __init__(self, extension_gallery_id=None, is_auto_assignment=None, licensing_source=None, user_ids=None): - super(ExtensionAssignment, self).__init__() - self.extension_gallery_id = extension_gallery_id - self.is_auto_assignment = is_auto_assignment - self.licensing_source = licensing_source - self.user_ids = user_ids - - -class ExtensionAssignmentDetails(Model): - """ExtensionAssignmentDetails. - - :param assignment_status: - :type assignment_status: object - :param source_collection_name: - :type source_collection_name: str - """ - - _attribute_map = { - 'assignment_status': {'key': 'assignmentStatus', 'type': 'object'}, - 'source_collection_name': {'key': 'sourceCollectionName', 'type': 'str'} - } - - def __init__(self, assignment_status=None, source_collection_name=None): - super(ExtensionAssignmentDetails, self).__init__() - self.assignment_status = assignment_status - self.source_collection_name = source_collection_name - - -class ExtensionLicenseData(Model): - """ExtensionLicenseData. - - :param created_date: - :type created_date: datetime - :param extension_id: - :type extension_id: str - :param is_free: - :type is_free: bool - :param minimum_required_access_level: - :type minimum_required_access_level: object - :param updated_date: - :type updated_date: datetime - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'is_free': {'key': 'isFree', 'type': 'bool'}, - 'minimum_required_access_level': {'key': 'minimumRequiredAccessLevel', 'type': 'object'}, - 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} - } - - def __init__(self, created_date=None, extension_id=None, is_free=None, minimum_required_access_level=None, updated_date=None): - super(ExtensionLicenseData, self).__init__() - self.created_date = created_date - self.extension_id = extension_id - self.is_free = is_free - self.minimum_required_access_level = minimum_required_access_level - self.updated_date = updated_date - - -class ExtensionOperationResult(Model): - """ExtensionOperationResult. - - :param account_id: - :type account_id: str - :param extension_id: - :type extension_id: str - :param message: - :type message: str - :param operation: - :type operation: object - :param result: - :type result: object - :param user_id: - :type user_id: str - """ - - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'object'}, - 'result': {'key': 'result', 'type': 'object'}, - 'user_id': {'key': 'userId', 'type': 'str'} - } - - def __init__(self, account_id=None, extension_id=None, message=None, operation=None, result=None, user_id=None): - super(ExtensionOperationResult, self).__init__() - self.account_id = account_id - self.extension_id = extension_id - self.message = message - self.operation = operation - self.result = result - self.user_id = user_id - - -class ExtensionRightsResult(Model): - """ExtensionRightsResult. - - :param entitled_extensions: - :type entitled_extensions: list of str - :param host_id: - :type host_id: str - :param reason: - :type reason: str - :param reason_code: - :type reason_code: object - :param result_code: - :type result_code: object - """ - - _attribute_map = { - 'entitled_extensions': {'key': 'entitledExtensions', 'type': '[str]'}, - 'host_id': {'key': 'hostId', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'reason_code': {'key': 'reasonCode', 'type': 'object'}, - 'result_code': {'key': 'resultCode', 'type': 'object'} - } - - def __init__(self, entitled_extensions=None, host_id=None, reason=None, reason_code=None, result_code=None): - super(ExtensionRightsResult, self).__init__() - self.entitled_extensions = entitled_extensions - self.host_id = host_id - self.reason = reason - self.reason_code = reason_code - self.result_code = result_code - - -class ExtensionSource(Model): - """ExtensionSource. - - :param assignment_source: Assignment Source - :type assignment_source: object - :param extension_gallery_id: extension Identifier - :type extension_gallery_id: str - :param licensing_source: The licensing source of the extension. Account, Msdn, ect. - :type licensing_source: object - """ - - _attribute_map = { - 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, - 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, - 'licensing_source': {'key': 'licensingSource', 'type': 'object'} - } - - def __init__(self, assignment_source=None, extension_gallery_id=None, licensing_source=None): - super(ExtensionSource, self).__init__() - self.assignment_source = assignment_source - self.extension_gallery_id = extension_gallery_id - self.licensing_source = licensing_source - - -class GraphSubjectBase(Model): - """GraphSubjectBase. - - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityRef(GraphSubjectBase): - """IdentityRef. - - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - :param directory_alias: - :type directory_alias: str - :param id: - :type id: str - :param image_url: - :type image_url: str - :param inactive: - :type inactive: bool - :param is_aad_identity: - :type is_aad_identity: bool - :param is_container: - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class License(Model): - """License. - - :param source: Gets the source of the license - :type source: object - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'object'} - } - - def __init__(self, source=None): - super(License, self).__init__() - self.source = source - - -class MsdnEntitlement(Model): - """MsdnEntitlement. - - :param entitlement_code: Entilement id assigned to Entitlement in Benefits Database. - :type entitlement_code: str - :param entitlement_name: Entitlement Name e.g. Downloads, Chat. - :type entitlement_name: str - :param entitlement_type: Type of Entitlement e.g. Downloads, Chat. - :type entitlement_type: str - :param is_activated: Entitlement activation status - :type is_activated: bool - :param is_entitlement_available: Entitlement availability - :type is_entitlement_available: bool - :param subscription_channel: Write MSDN Channel into CRCT (Retail,MPN,VL,BizSpark,DreamSpark,MCT,FTE,Technet,WebsiteSpark,Other) - :type subscription_channel: str - :param subscription_expiration_date: Subscription Expiration Date. - :type subscription_expiration_date: datetime - :param subscription_id: Subscription id which identifies the subscription itself. This is the Benefit Detail Guid from BMS. - :type subscription_id: str - :param subscription_level_code: Identifier of the subscription or benefit level. - :type subscription_level_code: str - :param subscription_level_name: Name of subscription level. - :type subscription_level_name: str - :param subscription_status: Subscription Status Code (ACT, PND, INA ...). - :type subscription_status: str - """ - - _attribute_map = { - 'entitlement_code': {'key': 'entitlementCode', 'type': 'str'}, - 'entitlement_name': {'key': 'entitlementName', 'type': 'str'}, - 'entitlement_type': {'key': 'entitlementType', 'type': 'str'}, - 'is_activated': {'key': 'isActivated', 'type': 'bool'}, - 'is_entitlement_available': {'key': 'isEntitlementAvailable', 'type': 'bool'}, - 'subscription_channel': {'key': 'subscriptionChannel', 'type': 'str'}, - 'subscription_expiration_date': {'key': 'subscriptionExpirationDate', 'type': 'iso-8601'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'subscription_level_code': {'key': 'subscriptionLevelCode', 'type': 'str'}, - 'subscription_level_name': {'key': 'subscriptionLevelName', 'type': 'str'}, - 'subscription_status': {'key': 'subscriptionStatus', 'type': 'str'} - } - - def __init__(self, entitlement_code=None, entitlement_name=None, entitlement_type=None, is_activated=None, is_entitlement_available=None, subscription_channel=None, subscription_expiration_date=None, subscription_id=None, subscription_level_code=None, subscription_level_name=None, subscription_status=None): - super(MsdnEntitlement, self).__init__() - self.entitlement_code = entitlement_code - self.entitlement_name = entitlement_name - self.entitlement_type = entitlement_type - self.is_activated = is_activated - self.is_entitlement_available = is_entitlement_available - self.subscription_channel = subscription_channel - self.subscription_expiration_date = subscription_expiration_date - self.subscription_id = subscription_id - self.subscription_level_code = subscription_level_code - self.subscription_level_name = subscription_level_name - self.subscription_status = subscription_status - - -class ReferenceLinks(Model): - """ReferenceLinks. - - :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -__all__ = [ - 'AccountEntitlement', - 'AccountEntitlementUpdateModel', - 'AccountLicenseExtensionUsage', - 'AccountLicenseUsage', - 'AccountRights', - 'AccountUserLicense', - 'ClientRightsContainer', - 'ExtensionAssignment', - 'ExtensionAssignmentDetails', - 'ExtensionLicenseData', - 'ExtensionOperationResult', - 'ExtensionRightsResult', - 'ExtensionSource', - 'GraphSubjectBase', - 'IdentityRef', - 'License', - 'MsdnEntitlement', - 'ReferenceLinks', -] diff --git a/azure-devops/azure/devops/v5_0/search/models.py b/azure-devops/azure/devops/v5_0/search/models.py deleted file mode 100644 index 21160e97..00000000 --- a/azure-devops/azure/devops/v5_0/search/models.py +++ /dev/null @@ -1,605 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CodeResult(Model): - """CodeResult. - - :param collection: Collection of the result file. - :type collection: :class:`Collection ` - :param content_id: ContentId of the result file. - :type content_id: str - :param file_name: Name of the result file. - :type file_name: str - :param matches: Dictionary of field to hit offsets in the result file. Key identifies the area in which hits were found, for ex: file content/file name etc. - :type matches: dict - :param path: Path at which result file is present. - :type path: str - :param project: Project of the result file. - :type project: :class:`Project ` - :param repository: Repository of the result file. - :type repository: :class:`Repository ` - :param versions: Versions of the result file. - :type versions: list of :class:`str ` - """ - - _attribute_map = { - 'collection': {'key': 'collection', 'type': 'Collection'}, - 'content_id': {'key': 'contentId', 'type': 'str'}, - 'file_name': {'key': 'fileName', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '{[Hit]}'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'Project'}, - 'repository': {'key': 'repository', 'type': 'Repository'}, - 'versions': {'key': 'versions', 'type': '[str]'} - } - - def __init__(self, collection=None, content_id=None, file_name=None, matches=None, path=None, project=None, repository=None, versions=None): - super(CodeResult, self).__init__() - self.collection = collection - self.content_id = content_id - self.file_name = file_name - self.matches = matches - self.path = path - self.project = project - self.repository = repository - self.versions = versions - - -class Collection(Model): - """Collection. - - :param name: Name of the collection. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, name=None): - super(Collection, self).__init__() - self.name = name - - -class EntitySearchRequestBase(Model): - """EntitySearchRequestBase. - - :param filters: Filters to be applied. Set it to null if there are no filters to be applied. - :type filters: dict - :param search_text: The search text. - :type search_text: str - """ - - _attribute_map = { - 'filters': {'key': 'filters', 'type': '{[str]}'}, - 'search_text': {'key': 'searchText', 'type': 'str'} - } - - def __init__(self, filters=None, search_text=None): - super(EntitySearchRequestBase, self).__init__() - self.filters = filters - self.search_text = search_text - - -class EntitySearchResponse(Model): - """EntitySearchResponse. - - :param facets: A dictionary storing an array of Filter object against each facet. - :type facets: dict - :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. - :type info_code: int - """ - - _attribute_map = { - 'facets': {'key': 'facets', 'type': '{[Filter]}'}, - 'info_code': {'key': 'infoCode', 'type': 'int'} - } - - def __init__(self, facets=None, info_code=None): - super(EntitySearchResponse, self).__init__() - self.facets = facets - self.info_code = info_code - - -class Filter(Model): - """Filter. - - :param id: Id of the filter bucket. - :type id: str - :param name: Name of the filter bucket. - :type name: str - :param result_count: Count of matches in the filter bucket. - :type result_count: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'result_count': {'key': 'resultCount', 'type': 'int'} - } - - def __init__(self, id=None, name=None, result_count=None): - super(Filter, self).__init__() - self.id = id - self.name = name - self.result_count = result_count - - -class Hit(Model): - """Hit. - - :param char_offset: Gets or sets the start character offset of a piece of text. - :type char_offset: int - :param length: Gets or sets the length of a piece of text. - :type length: int - """ - - _attribute_map = { - 'char_offset': {'key': 'charOffset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'} - } - - def __init__(self, char_offset=None, length=None): - super(Hit, self).__init__() - self.char_offset = char_offset - self.length = length - - -class Project(Model): - """Project. - - :param id: Id of the project. - :type id: str - :param name: Name of the project. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, name=None): - super(Project, self).__init__() - self.id = id - self.name = name - - -class ProjectReference(Model): - """ProjectReference. - - :param id: ID of the project. - :type id: str - :param name: Name of the project. - :type name: str - :param visibility: Visibility of the project. - :type visibility: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'visibility': {'key': 'visibility', 'type': 'str'} - } - - def __init__(self, id=None, name=None, visibility=None): - super(ProjectReference, self).__init__() - self.id = id - self.name = name - self.visibility = visibility - - -class Repository(Model): - """Repository. - - :param id: Id of the repository. - :type id: str - :param name: Name of the repository. - :type name: str - :param type: Version control type of the result file. - :type type: object - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'object'} - } - - def __init__(self, id=None, name=None, type=None): - super(Repository, self).__init__() - self.id = id - self.name = name - self.type = type - - -class SortOption(Model): - """SortOption. - - :param field: Field name on which sorting should be done. - :type field: str - :param sort_order: Order (ASC/DESC) in which the results should be sorted. - :type sort_order: str - """ - - _attribute_map = { - 'field': {'key': 'field', 'type': 'str'}, - 'sort_order': {'key': 'sortOrder', 'type': 'str'} - } - - def __init__(self, field=None, sort_order=None): - super(SortOption, self).__init__() - self.field = field - self.sort_order = sort_order - - -class Wiki(Model): - """Wiki. - - :param id: Id of the wiki. - :type id: str - :param mapped_path: Mapped path for the wiki. - :type mapped_path: str - :param name: Name of the wiki. - :type name: str - :param version: Version for wiki. - :type version: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, id=None, mapped_path=None, name=None, version=None): - super(Wiki, self).__init__() - self.id = id - self.mapped_path = mapped_path - self.name = name - self.version = version - - -class WikiHit(Model): - """WikiHit. - - :param field_reference_name: Reference name of the highlighted field. - :type field_reference_name: str - :param highlights: Matched/highlighted snippets of the field. - :type highlights: list of str - """ - - _attribute_map = { - 'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'}, - 'highlights': {'key': 'highlights', 'type': '[str]'} - } - - def __init__(self, field_reference_name=None, highlights=None): - super(WikiHit, self).__init__() - self.field_reference_name = field_reference_name - self.highlights = highlights - - -class WikiResult(Model): - """WikiResult. - - :param collection: Collection of the result file. - :type collection: :class:`Collection ` - :param content_id: ContentId of the result file. - :type content_id: str - :param file_name: Name of the result file. - :type file_name: str - :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets. - :type hits: list of :class:`WikiHit ` - :param path: Path at which result file is present. - :type path: str - :param project: Project details of the wiki document. - :type project: :class:`ProjectReference ` - :param wiki: Wiki information for the result. - :type wiki: :class:`Wiki ` - """ - - _attribute_map = { - 'collection': {'key': 'collection', 'type': 'Collection'}, - 'content_id': {'key': 'contentId', 'type': 'str'}, - 'file_name': {'key': 'fileName', 'type': 'str'}, - 'hits': {'key': 'hits', 'type': '[WikiHit]'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'ProjectReference'}, - 'wiki': {'key': 'wiki', 'type': 'Wiki'} - } - - def __init__(self, collection=None, content_id=None, file_name=None, hits=None, path=None, project=None, wiki=None): - super(WikiResult, self).__init__() - self.collection = collection - self.content_id = content_id - self.file_name = file_name - self.hits = hits - self.path = path - self.project = project - self.wiki = wiki - - -class WikiSearchResponse(EntitySearchResponse): - """WikiSearchResponse. - - :param facets: A dictionary storing an array of Filter object against each facet. - :type facets: dict - :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. - :type info_code: int - :param count: Total number of matched wiki documents. - :type count: int - :param results: List of top matched wiki documents. - :type results: list of :class:`WikiResult ` - """ - - _attribute_map = { - 'facets': {'key': 'facets', 'type': '{[Filter]}'}, - 'info_code': {'key': 'infoCode', 'type': 'int'}, - 'count': {'key': 'count', 'type': 'int'}, - 'results': {'key': 'results', 'type': '[WikiResult]'} - } - - def __init__(self, facets=None, info_code=None, count=None, results=None): - super(WikiSearchResponse, self).__init__(facets=facets, info_code=info_code) - self.count = count - self.results = results - - -class WorkItemHit(Model): - """WorkItemHit. - - :param field_reference_name: Reference name of the highlighted field. - :type field_reference_name: str - :param highlights: Matched/highlighted snippets of the field. - :type highlights: list of str - """ - - _attribute_map = { - 'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'}, - 'highlights': {'key': 'highlights', 'type': '[str]'} - } - - def __init__(self, field_reference_name=None, highlights=None): - super(WorkItemHit, self).__init__() - self.field_reference_name = field_reference_name - self.highlights = highlights - - -class WorkItemResult(Model): - """WorkItemResult. - - :param fields: A standard set of work item fields and their values. - :type fields: dict - :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets. - :type hits: list of :class:`WorkItemHit ` - :param project: Project details of the work item. - :type project: :class:`Project ` - :param url: Reference to the work item. - :type url: str - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '{str}'}, - 'hits': {'key': 'hits', 'type': '[WorkItemHit]'}, - 'project': {'key': 'project', 'type': 'Project'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, fields=None, hits=None, project=None, url=None): - super(WorkItemResult, self).__init__() - self.fields = fields - self.hits = hits - self.project = project - self.url = url - - -class WorkItemSearchResponse(EntitySearchResponse): - """WorkItemSearchResponse. - - :param facets: A dictionary storing an array of Filter object against each facet. - :type facets: dict - :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. - :type info_code: int - :param count: Total number of matched work items. - :type count: int - :param results: List of top matched work items. - :type results: list of :class:`WorkItemResult ` - """ - - _attribute_map = { - 'facets': {'key': 'facets', 'type': '{[Filter]}'}, - 'info_code': {'key': 'infoCode', 'type': 'int'}, - 'count': {'key': 'count', 'type': 'int'}, - 'results': {'key': 'results', 'type': '[WorkItemResult]'} - } - - def __init__(self, facets=None, info_code=None, count=None, results=None): - super(WorkItemSearchResponse, self).__init__(facets=facets, info_code=info_code) - self.count = count - self.results = results - - -class CodeSearchResponse(EntitySearchResponse): - """CodeSearchResponse. - - :param facets: A dictionary storing an array of Filter object against each facet. - :type facets: dict - :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. - :type info_code: int - :param count: Total number of matched files. - :type count: int - :param results: List of matched files. - :type results: list of :class:`CodeResult ` - """ - - _attribute_map = { - 'facets': {'key': 'facets', 'type': '{[Filter]}'}, - 'info_code': {'key': 'infoCode', 'type': 'int'}, - 'count': {'key': 'count', 'type': 'int'}, - 'results': {'key': 'results', 'type': '[CodeResult]'} - } - - def __init__(self, facets=None, info_code=None, count=None, results=None): - super(CodeSearchResponse, self).__init__(facets=facets, info_code=info_code) - self.count = count - self.results = results - - -class EntitySearchRequest(EntitySearchRequestBase): - """EntitySearchRequest. - - :param filters: Filters to be applied. Set it to null if there are no filters to be applied. - :type filters: dict - :param search_text: The search text. - :type search_text: str - :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. - :type order_by: list of :class:`SortOption ` - :param skip: Number of results to be skipped. - :type skip: int - :param top: Number of results to be returned. - :type top: int - :param include_facets: Flag to opt for faceting in the result. Default behavior is false. - :type include_facets: bool - """ - - _attribute_map = { - 'filters': {'key': 'filters', 'type': '{[str]}'}, - 'search_text': {'key': 'searchText', 'type': 'str'}, - 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - 'include_facets': {'key': 'includeFacets', 'type': 'bool'} - } - - def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): - super(EntitySearchRequest, self).__init__(filters=filters, search_text=search_text) - self.order_by = order_by - self.skip = skip - self.top = top - self.include_facets = include_facets - - -class WikiSearchRequest(EntitySearchRequest): - """WikiSearchRequest. - - :param filters: Filters to be applied. Set it to null if there are no filters to be applied. - :type filters: dict - :param search_text: The search text. - :type search_text: str - :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. - :type order_by: list of :class:`SortOption ` - :param skip: Number of results to be skipped. - :type skip: int - :param top: Number of results to be returned. - :type top: int - :param include_facets: Flag to opt for faceting in the result. Default behavior is false. - :type include_facets: bool - """ - - _attribute_map = { - 'filters': {'key': 'filters', 'type': '{[str]}'}, - 'search_text': {'key': 'searchText', 'type': 'str'}, - 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, - } - - def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): - super(WikiSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) - - -class WorkItemSearchRequest(EntitySearchRequest): - """WorkItemSearchRequest. - - :param filters: Filters to be applied. Set it to null if there are no filters to be applied. - :type filters: dict - :param search_text: The search text. - :type search_text: str - :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. - :type order_by: list of :class:`SortOption ` - :param skip: Number of results to be skipped. - :type skip: int - :param top: Number of results to be returned. - :type top: int - :param include_facets: Flag to opt for faceting in the result. Default behavior is false. - :type include_facets: bool - """ - - _attribute_map = { - 'filters': {'key': 'filters', 'type': '{[str]}'}, - 'search_text': {'key': 'searchText', 'type': 'str'}, - 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, - } - - def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): - super(WorkItemSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) - - -class CodeSearchRequest(EntitySearchRequest): - """CodeSearchRequest. - - :param filters: Filters to be applied. Set it to null if there are no filters to be applied. - :type filters: dict - :param search_text: The search text. - :type search_text: str - :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. - :type order_by: list of :class:`SortOption ` - :param skip: Number of results to be skipped. - :type skip: int - :param top: Number of results to be returned. - :type top: int - :param include_facets: Flag to opt for faceting in the result. Default behavior is false. - :type include_facets: bool - """ - - _attribute_map = { - 'filters': {'key': 'filters', 'type': '{[str]}'}, - 'search_text': {'key': 'searchText', 'type': 'str'}, - 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, - } - - def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): - super(CodeSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) - - -__all__ = [ - 'CodeResult', - 'Collection', - 'EntitySearchRequestBase', - 'EntitySearchResponse', - 'Filter', - 'Hit', - 'Project', - 'ProjectReference', - 'Repository', - 'SortOption', - 'Wiki', - 'WikiHit', - 'WikiResult', - 'WikiSearchResponse', - 'WorkItemHit', - 'WorkItemResult', - 'WorkItemSearchResponse', - 'CodeSearchResponse', - 'EntitySearchRequest', - 'WikiSearchRequest', - 'WorkItemSearchRequest', - 'CodeSearchRequest', -] diff --git a/azure-devops/azure/devops/v5_0/task_agent/task_agent_client.py b/azure-devops/azure/devops/v5_0/task_agent/task_agent_client.py deleted file mode 100644 index 91d34731..00000000 --- a/azure-devops/azure/devops/v5_0/task_agent/task_agent_client.py +++ /dev/null @@ -1,560 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest import Serializer, Deserializer -from ...client import Client -from . import models - - -class TaskAgentClient(Client): - """TaskAgent - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(TaskAgentClient, self).__init__(base_url, creds) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - resource_area_identifier = 'a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd' - - def add_agent_cloud(self, agent_cloud): - """AddAgentCloud. - [Preview API] - :param :class:` ` agent_cloud: - :rtype: :class:` ` - """ - content = self._serialize.body(agent_cloud, 'TaskAgentCloud') - response = self._send(http_method='POST', - location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', - version='5.0-preview.1', - content=content) - return self._deserialize('TaskAgentCloud', response) - - def delete_agent_cloud(self, agent_cloud_id): - """DeleteAgentCloud. - [Preview API] - :param int agent_cloud_id: - :rtype: :class:` ` - """ - route_values = {} - if agent_cloud_id is not None: - route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') - response = self._send(http_method='DELETE', - location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('TaskAgentCloud', response) - - def get_agent_cloud(self, agent_cloud_id): - """GetAgentCloud. - [Preview API] - :param int agent_cloud_id: - :rtype: :class:` ` - """ - route_values = {} - if agent_cloud_id is not None: - route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') - response = self._send(http_method='GET', - location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('TaskAgentCloud', response) - - def get_agent_clouds(self): - """GetAgentClouds. - [Preview API] - :rtype: [TaskAgentCloud] - """ - response = self._send(http_method='GET', - location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', - version='5.0-preview.1') - return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) - - def get_agent_cloud_types(self): - """GetAgentCloudTypes. - [Preview API] Get agent cloud types. - :rtype: [TaskAgentCloudType] - """ - response = self._send(http_method='GET', - location_id='5932e193-f376-469d-9c3e-e5588ce12cb5', - version='5.0-preview.1') - return self._deserialize('[TaskAgentCloudType]', self._unwrap_collection(response)) - - def add_deployment_group(self, deployment_group, project): - """AddDeploymentGroup. - [Preview API] Create a deployment group. - :param :class:` ` deployment_group: Deployment group to create. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(deployment_group, 'DeploymentGroupCreateParameter') - response = self._send(http_method='POST', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentGroup', response) - - def delete_deployment_group(self, project, deployment_group_id): - """DeleteDeploymentGroup. - [Preview API] Delete a deployment group. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group to be deleted. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - self._send(http_method='DELETE', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='5.0-preview.1', - route_values=route_values) - - def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): - """GetDeploymentGroup. - [Preview API] Get a deployment group by its ID. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group. - :param str action_filter: Get the deployment group only if this action can be performed on it. - :param str expand: Include these additional details in the returned object. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - query_parameters = {} - if action_filter is not None: - query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - response = self._send(http_method='GET', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('DeploymentGroup', response) - - def get_deployment_groups(self, project, name=None, action_filter=None, expand=None, continuation_token=None, top=None, ids=None): - """GetDeploymentGroups. - [Preview API] Get a list of deployment groups by name or IDs. - :param str project: Project ID or project name - :param str name: Name of the deployment group. - :param str action_filter: Get only deployment groups on which this action can be performed. - :param str expand: Include these additional details in the returned objects. - :param str continuation_token: Get deployment groups with names greater than this continuationToken lexicographically. - :param int top: Maximum number of deployment groups to return. Default is **1000**. - :param [int] ids: Comma separated list of IDs of the deployment groups. - :rtype: [DeploymentGroup] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if action_filter is not None: - query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if ids is not None: - ids = ",".join(map(str, ids)) - query_parameters['ids'] = self._serialize.query('ids', ids, 'str') - response = self._send(http_method='GET', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[DeploymentGroup]', self._unwrap_collection(response)) - - def update_deployment_group(self, deployment_group, project, deployment_group_id): - """UpdateDeploymentGroup. - [Preview API] Update a deployment group. - :param :class:` ` deployment_group: Deployment group to update. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - content = self._serialize.body(deployment_group, 'DeploymentGroupUpdateParameter') - response = self._send(http_method='PATCH', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentGroup', response) - - def get_agent_cloud_requests(self, agent_cloud_id): - """GetAgentCloudRequests. - [Preview API] - :param int agent_cloud_id: - :rtype: [TaskAgentCloudRequest] - """ - route_values = {} - if agent_cloud_id is not None: - route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') - response = self._send(http_method='GET', - location_id='20189bd7-5134-49c2-b8e9-f9e856eea2b2', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('[TaskAgentCloudRequest]', self._unwrap_collection(response)) - - def delete_deployment_target(self, project, deployment_group_id, target_id): - """DeleteDeploymentTarget. - [Preview API] Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group in which deployment target is deleted. - :param int target_id: ID of the deployment target to delete. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - if target_id is not None: - route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') - self._send(http_method='DELETE', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='5.0-preview.1', - route_values=route_values) - - def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): - """GetDeploymentTarget. - [Preview API] Get a deployment target by its ID in a deployment group - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group to which deployment target belongs. - :param int target_id: ID of the deployment target to return. - :param str expand: Include these additional details in the returned objects. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - if target_id is not None: - route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') - query_parameters = {} - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - response = self._send(http_method='GET', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('DeploymentMachine', response) - - def get_deployment_targets(self, project, deployment_group_id, tags=None, name=None, partial_name_match=None, expand=None, agent_status=None, agent_job_result=None, continuation_token=None, top=None, enabled=None): - """GetDeploymentTargets. - [Preview API] Get a list of deployment targets in a deployment group. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group. - :param [str] tags: Get only the deployment targets that contain all these comma separted list of tags. - :param str name: Name pattern of the deployment targets to return. - :param bool partial_name_match: When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. - :param str expand: Include these additional details in the returned objects. - :param str agent_status: Get only deployment targets that have this status. - :param str agent_job_result: Get only deployment targets that have this last job result. - :param str continuation_token: Get deployment targets with names greater than this continuationToken lexicographically. - :param int top: Maximum number of deployment targets to return. Default is **1000**. - :param bool enabled: Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. - :rtype: [DeploymentMachine] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - query_parameters = {} - if tags is not None: - tags = ",".join(tags) - query_parameters['tags'] = self._serialize.query('tags', tags, 'str') - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if partial_name_match is not None: - query_parameters['partialNameMatch'] = self._serialize.query('partial_name_match', partial_name_match, 'bool') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if agent_status is not None: - query_parameters['agentStatus'] = self._serialize.query('agent_status', agent_status, 'str') - if agent_job_result is not None: - query_parameters['agentJobResult'] = self._serialize.query('agent_job_result', agent_job_result, 'str') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if enabled is not None: - query_parameters['enabled'] = self._serialize.query('enabled', enabled, 'bool') - response = self._send(http_method='GET', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) - - def update_deployment_targets(self, machines, project, deployment_group_id): - """UpdateDeploymentTargets. - [Preview API] Update tags of a list of deployment targets in a deployment group. - :param [DeploymentTargetUpdateParameter] machines: Deployment targets with tags to udpdate. - :param str project: Project ID or project name - :param int deployment_group_id: ID of the deployment group in which deployment targets are updated. - :rtype: [DeploymentMachine] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if deployment_group_id is not None: - route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') - content = self._serialize.body(machines, '[DeploymentTargetUpdateParameter]') - response = self._send(http_method='PATCH', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) - - def add_task_group(self, task_group, project): - """AddTaskGroup. - [Preview API] Create a task group. - :param :class:` ` task_group: Task group object to create. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(task_group, 'TaskGroupCreateParameter') - response = self._send(http_method='POST', - location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskGroup', response) - - def delete_task_group(self, project, task_group_id, comment=None): - """DeleteTaskGroup. - [Preview API] Delete a task group. - :param str project: Project ID or project name - :param str task_group_id: Id of the task group to be deleted. - :param str comment: Comments to delete. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if task_group_id is not None: - route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') - query_parameters = {} - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - self._send(http_method='DELETE', - location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - - def get_task_groups(self, project, task_group_id=None, expanded=None, task_id_filter=None, deleted=None, top=None, continuation_token=None, query_order=None): - """GetTaskGroups. - [Preview API] List task groups. - :param str project: Project ID or project name - :param str task_group_id: Id of the task group. - :param bool expanded: 'true' to recursively expand task groups. Default is 'false'. - :param str task_id_filter: Guid of the taskId to filter. - :param bool deleted: 'true'to include deleted task groups. Default is 'false'. - :param int top: Number of task groups to get. - :param datetime continuation_token: Gets the task groups after the continuation token provided. - :param str query_order: Gets the results in the defined order. Default is 'CreatedOnDescending'. - :rtype: [TaskGroup] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if task_group_id is not None: - route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') - query_parameters = {} - if expanded is not None: - query_parameters['expanded'] = self._serialize.query('expanded', expanded, 'bool') - if task_id_filter is not None: - query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') - if deleted is not None: - query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'iso-8601') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - response = self._send(http_method='GET', - location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TaskGroup]', self._unwrap_collection(response)) - - def update_task_group(self, task_group, project, task_group_id=None): - """UpdateTaskGroup. - [Preview API] Update a task group. - :param :class:` ` task_group: Task group to update. - :param str project: Project ID or project name - :param str task_group_id: Id of the task group to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if task_group_id is not None: - route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') - content = self._serialize.body(task_group, 'TaskGroupUpdateParameter') - response = self._send(http_method='PUT', - location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskGroup', response) - - def add_variable_group(self, group, project): - """AddVariableGroup. - [Preview API] Add a variable group. - :param :class:` ` group: Variable group to add. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(group, 'VariableGroupParameters') - response = self._send(http_method='POST', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('VariableGroup', response) - - def delete_variable_group(self, project, group_id): - """DeleteVariableGroup. - [Preview API] Delete a variable group - :param str project: Project ID or project name - :param int group_id: Id of the variable group. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if group_id is not None: - route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') - self._send(http_method='DELETE', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values) - - def get_variable_group(self, project, group_id): - """GetVariableGroup. - [Preview API] Get a variable group. - :param str project: Project ID or project name - :param int group_id: Id of the variable group. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if group_id is not None: - route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') - response = self._send(http_method='GET', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values) - return self._deserialize('VariableGroup', response) - - def get_variable_groups(self, project, group_name=None, action_filter=None, top=None, continuation_token=None, query_order=None): - """GetVariableGroups. - [Preview API] Get variable groups. - :param str project: Project ID or project name - :param str group_name: Name of variable group. - :param str action_filter: Action filter for the variable group. It specifies the action which can be performed on the variable groups. - :param int top: Number of variable groups to get. - :param int continuation_token: Gets the variable groups after the continuation token provided. - :param str query_order: Gets the results in the defined order. Default is 'IdDescending'. - :rtype: [VariableGroup] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if group_name is not None: - query_parameters['groupName'] = self._serialize.query('group_name', group_name, 'str') - if action_filter is not None: - query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - response = self._send(http_method='GET', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) - - def get_variable_groups_by_id(self, project, group_ids): - """GetVariableGroupsById. - [Preview API] Get variable groups by ids. - :param str project: Project ID or project name - :param [int] group_ids: Comma separated list of Ids of variable groups. - :rtype: [VariableGroup] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if group_ids is not None: - group_ids = ",".join(map(str, group_ids)) - query_parameters['groupIds'] = self._serialize.query('group_ids', group_ids, 'str') - response = self._send(http_method='GET', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) - - def update_variable_group(self, group, project, group_id): - """UpdateVariableGroup. - [Preview API] Update a variable group. - :param :class:` ` group: Variable group to update. - :param str project: Project ID or project name - :param int group_id: Id of the variable group to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if group_id is not None: - route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') - content = self._serialize.body(group, 'VariableGroupParameters') - response = self._send(http_method='PUT', - location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', - version='5.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('VariableGroup', response) - diff --git a/azure-devops/azure/devops/v5_0/wiki/models.py b/azure-devops/azure/devops/v5_0/wiki/models.py deleted file mode 100644 index 152c9244..00000000 --- a/azure-devops/azure/devops/v5_0/wiki/models.py +++ /dev/null @@ -1,503 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class GitRepository(Model): - """GitRepository. - - :param _links: - :type _links: ReferenceLinks - :param default_branch: - :type default_branch: str - :param id: - :type id: str - :param is_fork: True if the repository was created as a fork - :type is_fork: bool - :param name: - :type name: str - :param parent_repository: - :type parent_repository: :class:`GitRepositoryRef ` - :param project: - :type project: TeamProjectReference - :param remote_url: - :type remote_url: str - :param size: Compressed size (bytes) of the repository. - :type size: long - :param ssh_url: - :type ssh_url: str - :param url: - :type url: str - :param valid_remote_urls: - :type valid_remote_urls: list of str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_fork': {'key': 'isFork', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, - 'project': {'key': 'project', 'type': 'TeamProjectReference'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'valid_remote_urls': {'key': 'validRemoteUrls', 'type': '[str]'} - } - - def __init__(self, _links=None, default_branch=None, id=None, is_fork=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None): - super(GitRepository, self).__init__() - self._links = _links - self.default_branch = default_branch - self.id = id - self.is_fork = is_fork - self.name = name - self.parent_repository = parent_repository - self.project = project - self.remote_url = remote_url - self.size = size - self.ssh_url = ssh_url - self.url = url - self.valid_remote_urls = valid_remote_urls - - -class GitRepositoryRef(Model): - """GitRepositoryRef. - - :param collection: Team Project Collection where this Fork resides - :type collection: TeamProjectCollectionReference - :param id: - :type id: str - :param is_fork: True if the repository was created as a fork - :type is_fork: bool - :param name: - :type name: str - :param project: - :type project: TeamProjectReference - :param remote_url: - :type remote_url: str - :param ssh_url: - :type ssh_url: str - :param url: - :type url: str - """ - - _attribute_map = { - 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_fork': {'key': 'isFork', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'TeamProjectReference'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, collection=None, id=None, is_fork=None, name=None, project=None, remote_url=None, ssh_url=None, url=None): - super(GitRepositoryRef, self).__init__() - self.collection = collection - self.id = id - self.is_fork = is_fork - self.name = name - self.project = project - self.remote_url = remote_url - self.ssh_url = ssh_url - self.url = url - - -class GitVersionDescriptor(Model): - """GitVersionDescriptor. - - :param version: Version string identifier (name of tag/branch, SHA1 of commit) - :type version: str - :param version_options: Version options - Specify additional modifiers to version (e.g Previous) - :type version_options: object - :param version_type: Version type (branch, tag, or commit). Determines how Id is interpreted - :type version_type: object - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'version_options': {'key': 'versionOptions', 'type': 'object'}, - 'version_type': {'key': 'versionType', 'type': 'object'} - } - - def __init__(self, version=None, version_options=None, version_type=None): - super(GitVersionDescriptor, self).__init__() - self.version = version - self.version_options = version_options - self.version_type = version_type - - -class WikiAttachment(Model): - """WikiAttachment. - - :param name: Name of the wiki attachment file. - :type name: str - :param path: Path of the wiki attachment file. - :type path: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, name=None, path=None): - super(WikiAttachment, self).__init__() - self.name = name - self.path = path - - -class WikiAttachmentResponse(Model): - """WikiAttachmentResponse. - - :param attachment: Defines properties for wiki attachment file. - :type attachment: :class:`WikiAttachment ` - :param eTag: Contains the list of ETag values from the response header of the attachments API call. The first item in the list contains the version of the wiki attachment. - :type eTag: list of str - """ - - _attribute_map = { - 'attachment': {'key': 'attachment', 'type': 'WikiAttachment'}, - 'eTag': {'key': 'eTag', 'type': '[str]'} - } - - def __init__(self, attachment=None, eTag=None): - super(WikiAttachmentResponse, self).__init__() - self.attachment = attachment - self.eTag = eTag - - -class WikiCreateBaseParameters(Model): - """WikiCreateBaseParameters. - - :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. - :type mapped_path: str - :param name: Wiki name. - :type name: str - :param project_id: ID of the project in which the wiki is to be created. - :type project_id: str - :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. - :type repository_id: str - :param type: Type of the wiki. - :type type: object - """ - - _attribute_map = { - 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'repository_id': {'key': 'repositoryId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'object'} - } - - def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None): - super(WikiCreateBaseParameters, self).__init__() - self.mapped_path = mapped_path - self.name = name - self.project_id = project_id - self.repository_id = repository_id - self.type = type - - -class WikiCreateParametersV2(WikiCreateBaseParameters): - """WikiCreateParametersV2. - - :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. - :type mapped_path: str - :param name: Wiki name. - :type name: str - :param project_id: ID of the project in which the wiki is to be created. - :type project_id: str - :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. - :type repository_id: str - :param type: Type of the wiki. - :type type: object - :param version: Version of the wiki. Not required for ProjectWiki type. - :type version: :class:`GitVersionDescriptor ` - """ - - _attribute_map = { - 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'repository_id': {'key': 'repositoryId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'object'}, - 'version': {'key': 'version', 'type': 'GitVersionDescriptor'} - } - - def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None, version=None): - super(WikiCreateParametersV2, self).__init__(mapped_path=mapped_path, name=name, project_id=project_id, repository_id=repository_id, type=type) - self.version = version - - -class WikiPageCreateOrUpdateParameters(Model): - """WikiPageCreateOrUpdateParameters. - - :param content: Content of the wiki page. - :type content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'} - } - - def __init__(self, content=None): - super(WikiPageCreateOrUpdateParameters, self).__init__() - self.content = content - - -class WikiPageMoveParameters(Model): - """WikiPageMoveParameters. - - :param new_order: New order of the wiki page. - :type new_order: int - :param new_path: New path of the wiki page. - :type new_path: str - :param path: Current path of the wiki page. - :type path: str - """ - - _attribute_map = { - 'new_order': {'key': 'newOrder', 'type': 'int'}, - 'new_path': {'key': 'newPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, new_order=None, new_path=None, path=None): - super(WikiPageMoveParameters, self).__init__() - self.new_order = new_order - self.new_path = new_path - self.path = path - - -class WikiPageMoveResponse(Model): - """WikiPageMoveResponse. - - :param eTag: Contains the list of ETag values from the response header of the page move API call. The first item in the list contains the version of the wiki page subject to page move. - :type eTag: list of str - :param page_move: Defines properties for wiki page move. - :type page_move: :class:`WikiPageMove ` - """ - - _attribute_map = { - 'eTag': {'key': 'eTag', 'type': '[str]'}, - 'page_move': {'key': 'pageMove', 'type': 'WikiPageMove'} - } - - def __init__(self, eTag=None, page_move=None): - super(WikiPageMoveResponse, self).__init__() - self.eTag = eTag - self.page_move = page_move - - -class WikiPageResponse(Model): - """WikiPageResponse. - - :param eTag: Contains the list of ETag values from the response header of the pages API call. The first item in the list contains the version of the wiki page. - :type eTag: list of str - :param page: Defines properties for wiki page. - :type page: :class:`WikiPage ` - """ - - _attribute_map = { - 'eTag': {'key': 'eTag', 'type': '[str]'}, - 'page': {'key': 'page', 'type': 'WikiPage'} - } - - def __init__(self, eTag=None, page=None): - super(WikiPageResponse, self).__init__() - self.eTag = eTag - self.page = page - - -class WikiPageViewStats(Model): - """WikiPageViewStats. - - :param count: Wiki page view count. - :type count: int - :param last_viewed_time: Wiki page last viewed time. - :type last_viewed_time: datetime - :param path: Wiki page path. - :type path: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'last_viewed_time': {'key': 'lastViewedTime', 'type': 'iso-8601'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, count=None, last_viewed_time=None, path=None): - super(WikiPageViewStats, self).__init__() - self.count = count - self.last_viewed_time = last_viewed_time - self.path = path - - -class WikiUpdateParameters(Model): - """WikiUpdateParameters. - - :param name: Name for wiki. - :type name: str - :param versions: Versions of the wiki. - :type versions: list of :class:`GitVersionDescriptor ` - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[GitVersionDescriptor]'} - } - - def __init__(self, name=None, versions=None): - super(WikiUpdateParameters, self).__init__() - self.name = name - self.versions = versions - - -class WikiV2(WikiCreateBaseParameters): - """WikiV2. - - :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. - :type mapped_path: str - :param name: Wiki name. - :type name: str - :param project_id: ID of the project in which the wiki is to be created. - :type project_id: str - :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. - :type repository_id: str - :param type: Type of the wiki. - :type type: object - :param id: ID of the wiki. - :type id: str - :param properties: Properties of the wiki. - :type properties: dict - :param remote_url: Remote web url to the wiki. - :type remote_url: str - :param url: REST url for this wiki. - :type url: str - :param versions: Versions of the wiki. - :type versions: list of :class:`GitVersionDescriptor ` - """ - - _attribute_map = { - 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'repository_id': {'key': 'repositoryId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'object'}, - 'id': {'key': 'id', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[GitVersionDescriptor]'} - } - - def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None, id=None, properties=None, remote_url=None, url=None, versions=None): - super(WikiV2, self).__init__(mapped_path=mapped_path, name=name, project_id=project_id, repository_id=repository_id, type=type) - self.id = id - self.properties = properties - self.remote_url = remote_url - self.url = url - self.versions = versions - - -class WikiPage(WikiPageCreateOrUpdateParameters): - """WikiPage. - - :param content: Content of the wiki page. - :type content: str - :param git_item_path: Path of the git item corresponding to the wiki page stored in the backing Git repository. - :type git_item_path: str - :param is_non_conformant: True if a page is non-conforming, i.e. 1) if the name doesn't match page naming standards. 2) if the page does not have a valid entry in the appropriate order file. - :type is_non_conformant: bool - :param is_parent_page: True if this page has subpages under its path. - :type is_parent_page: bool - :param order: Order of the wiki page, relative to other pages in the same hierarchy level. - :type order: int - :param path: Path of the wiki page. - :type path: str - :param remote_url: Remote web url to the wiki page. - :type remote_url: str - :param sub_pages: List of subpages of the current page. - :type sub_pages: list of :class:`WikiPage ` - :param url: REST url for this wiki page. - :type url: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - 'git_item_path': {'key': 'gitItemPath', 'type': 'str'}, - 'is_non_conformant': {'key': 'isNonConformant', 'type': 'bool'}, - 'is_parent_page': {'key': 'isParentPage', 'type': 'bool'}, - 'order': {'key': 'order', 'type': 'int'}, - 'path': {'key': 'path', 'type': 'str'}, - 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, - 'sub_pages': {'key': 'subPages', 'type': '[WikiPage]'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, content=None, git_item_path=None, is_non_conformant=None, is_parent_page=None, order=None, path=None, remote_url=None, sub_pages=None, url=None): - super(WikiPage, self).__init__(content=content) - self.git_item_path = git_item_path - self.is_non_conformant = is_non_conformant - self.is_parent_page = is_parent_page - self.order = order - self.path = path - self.remote_url = remote_url - self.sub_pages = sub_pages - self.url = url - - -class WikiPageMove(WikiPageMoveParameters): - """WikiPageMove. - - :param new_order: New order of the wiki page. - :type new_order: int - :param new_path: New path of the wiki page. - :type new_path: str - :param path: Current path of the wiki page. - :type path: str - :param page: Resultant page of this page move operation. - :type page: :class:`WikiPage ` - """ - - _attribute_map = { - 'new_order': {'key': 'newOrder', 'type': 'int'}, - 'new_path': {'key': 'newPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'page': {'key': 'page', 'type': 'WikiPage'} - } - - def __init__(self, new_order=None, new_path=None, path=None, page=None): - super(WikiPageMove, self).__init__(new_order=new_order, new_path=new_path, path=path) - self.page = page - - -__all__ = [ - 'GitRepository', - 'GitRepositoryRef', - 'GitVersionDescriptor', - 'WikiAttachment', - 'WikiAttachmentResponse', - 'WikiCreateBaseParameters', - 'WikiCreateParametersV2', - 'WikiPageCreateOrUpdateParameters', - 'WikiPageMoveParameters', - 'WikiPageMoveResponse', - 'WikiPageResponse', - 'WikiPageViewStats', - 'WikiUpdateParameters', - 'WikiV2', - 'WikiPage', - 'WikiPageMove', -] diff --git a/azure-devops/azure/devops/v5_0/wiki/wiki_client.py b/azure-devops/azure/devops/v5_0/wiki/wiki_client.py deleted file mode 100644 index 6f0d72c9..00000000 --- a/azure-devops/azure/devops/v5_0/wiki/wiki_client.py +++ /dev/null @@ -1,370 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest import Serializer, Deserializer -from ...client import Client -from . import models - - -class WikiClient(Client): - """Wiki - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(WikiClient, self).__init__(base_url, creds) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - resource_area_identifier = 'bf7d82a0-8aa5-4613-94ef-6172a5ea01f3' - - def create_attachment(self, upload_stream, project, wiki_identifier, name, **kwargs): - """CreateAttachment. - Creates an attachment in the wiki. - :param object upload_stream: Stream to upload - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str name: Wiki attachment name. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - content = self._client.stream_upload(upload_stream, callback=callback) - response = self._send(http_method='PUT', - location_id='c4382d8d-fefc-40e0-92c5-49852e9e17c0', - version='5.0', - route_values=route_values, - query_parameters=query_parameters, - content=content, - media_type='application/octet-stream') - response_object = models.WikiAttachmentResponse() - response_object.attachment = self._deserialize('WikiAttachment', response) - response_object.eTag = response.headers.get('ETag') - return response_object - - def create_page_move(self, page_move_parameters, project, wiki_identifier, comment=None): - """CreatePageMove. - Creates a page move operation that updates the path and order of the page as provided in the parameters. - :param :class:` ` page_move_parameters: Page more operation parameters. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str comment: Comment that is to be associated with this page move. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - content = self._serialize.body(page_move_parameters, 'WikiPageMoveParameters') - response = self._send(http_method='POST', - location_id='e37bbe71-cbae-49e5-9a4e-949143b9d910', - version='5.0', - route_values=route_values, - query_parameters=query_parameters, - content=content) - response_object = models.WikiPageMoveResponse() - response_object.page_move = self._deserialize('WikiPageMove', response) - response_object.eTag = response.headers.get('ETag') - return response_object - - def create_or_update_page(self, parameters, project, wiki_identifier, path, version, comment=None): - """CreateOrUpdatePage. - Creates or edits a wiki page. - :param :class:` ` parameters: Wiki create or update operation parameters. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str path: Wiki page path. - :param String version: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request. - :param str comment: Comment to be associated with the page operation. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - additional_headers = {} - if version is not None: - additional_headers['If-Match'] = version - content = self._serialize.body(parameters, 'WikiPageCreateOrUpdateParameters') - response = self._send(http_method='PUT', - location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.0', - route_values=route_values, - query_parameters=query_parameters, - additional_headers=additional_headers, - content=content) - response_object = models.WikiPageResponse() - response_object.page = self._deserialize('WikiPage', response) - response_object.eTag = response.headers.get('ETag') - return response_object - - def delete_page(self, project, wiki_identifier, path, comment=None): - """DeletePage. - Deletes a wiki page. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str path: Wiki page path. - :param str comment: Comment to be associated with this page delete. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - response = self._send(http_method='DELETE', - location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.0', - route_values=route_values, - query_parameters=query_parameters) - response_object = models.WikiPageResponse() - response_object.page = self._deserialize('WikiPage', response) - response_object.eTag = response.headers.get('ETag') - return response_object - - def get_page(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None): - """GetPage. - Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str path: Wiki page path. - :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). - :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if recursion_level is not None: - query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') - if version_descriptor is not None: - if version_descriptor.version_type is not None: - query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type - if version_descriptor.version is not None: - query_parameters['versionDescriptor.version'] = version_descriptor.version - if version_descriptor.version_options is not None: - query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options - if include_content is not None: - query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') - response = self._send(http_method='GET', - location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.0', - route_values=route_values, - query_parameters=query_parameters) - response_object = models.WikiPageResponse() - response_object.page = self._deserialize('WikiPage', response) - response_object.eTag = response.headers.get('ETag') - return response_object - - def get_page_text(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): - """GetPageText. - Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str path: Wiki page path. - :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). - :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if recursion_level is not None: - query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') - if version_descriptor is not None: - if version_descriptor.version_type is not None: - query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type - if version_descriptor.version is not None: - query_parameters['versionDescriptor.version'] = version_descriptor.version - if version_descriptor.version_options is not None: - query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options - if include_content is not None: - query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') - response = self._send(http_method='GET', - location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.0', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): - """GetPageZip. - Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. - :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. - :param str path: Wiki page path. - :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). - :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - query_parameters = {} - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if recursion_level is not None: - query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') - if version_descriptor is not None: - if version_descriptor.version_type is not None: - query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type - if version_descriptor.version is not None: - query_parameters['versionDescriptor.version'] = version_descriptor.version - if version_descriptor.version_options is not None: - query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options - if include_content is not None: - query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') - response = self._send(http_method='GET', - location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.0', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def create_wiki(self, wiki_create_params, project=None): - """CreateWiki. - Creates the wiki resource. - :param :class:` ` wiki_create_params: Parameters for the wiki creation. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(wiki_create_params, 'WikiCreateParametersV2') - response = self._send(http_method='POST', - location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.0', - route_values=route_values, - content=content) - return self._deserialize('WikiV2', response) - - def delete_wiki(self, wiki_identifier, project=None): - """DeleteWiki. - Deletes the wiki corresponding to the wiki name or Id provided. - :param str wiki_identifier: Wiki name or Id. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - response = self._send(http_method='DELETE', - location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.0', - route_values=route_values) - return self._deserialize('WikiV2', response) - - def get_all_wikis(self, project=None): - """GetAllWikis. - Gets all wikis in a project or collection. - :param str project: Project ID or project name - :rtype: [WikiV2] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - response = self._send(http_method='GET', - location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.0', - route_values=route_values) - return self._deserialize('[WikiV2]', self._unwrap_collection(response)) - - def get_wiki(self, wiki_identifier, project=None): - """GetWiki. - Gets the wiki corresponding to the wiki name or Id provided. - :param str wiki_identifier: Wiki name or id. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - response = self._send(http_method='GET', - location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.0', - route_values=route_values) - return self._deserialize('WikiV2', response) - - def update_wiki(self, update_parameters, wiki_identifier, project=None): - """UpdateWiki. - Updates the wiki corresponding to the wiki Id or name provided using the update parameters. - :param :class:` ` update_parameters: Update parameters. - :param str wiki_identifier: Wiki name or Id. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if wiki_identifier is not None: - route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') - content = self._serialize.body(update_parameters, 'WikiUpdateParameters') - response = self._send(http_method='PATCH', - location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.0', - route_values=route_values, - content=content) - return self._deserialize('WikiV2', response) - diff --git a/azure-devops/azure/devops/v5_0/__init__.py b/azure-devops/azure/devops/v6_0/__init__.py similarity index 100% rename from azure-devops/azure/devops/v5_0/__init__.py rename to azure-devops/azure/devops/v6_0/__init__.py diff --git a/azure-devops/azure/devops/v5_0/accounts/__init__.py b/azure-devops/azure/devops/v6_0/accounts/__init__.py similarity index 100% rename from azure-devops/azure/devops/v5_0/accounts/__init__.py rename to azure-devops/azure/devops/v6_0/accounts/__init__.py diff --git a/azure-devops/azure/devops/v5_0/accounts/accounts_client.py b/azure-devops/azure/devops/v6_0/accounts/accounts_client.py similarity index 93% rename from azure-devops/azure/devops/v5_0/accounts/accounts_client.py rename to azure-devops/azure/devops/v6_0/accounts/accounts_client.py index 2e44a8e1..b70744c1 100644 --- a/azure-devops/azure/devops/v5_0/accounts/accounts_client.py +++ b/azure-devops/azure/devops/v6_0/accounts/accounts_client.py @@ -27,7 +27,7 @@ def __init__(self, base_url=None, creds=None): 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. + [Preview API] Get a list of accounts for a specific owner or a specific member. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: @@ -42,7 +42,7 @@ def get_accounts(self, owner_id=None, member_id=None, properties=None): query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', - version='5.0', + version='6.0-preview.1', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/v5_0/accounts/models.py b/azure-devops/azure/devops/v6_0/accounts/models.py similarity index 95% rename from azure-devops/azure/devops/v5_0/accounts/models.py rename to azure-devops/azure/devops/v6_0/accounts/models.py index 1179b0fc..eabc2704 100644 --- a/azure-devops/azure/devops/v5_0/accounts/models.py +++ b/azure-devops/azure/devops/v6_0/accounts/models.py @@ -10,8 +10,7 @@ class Account(Model): - """Account. - + """ :param account_id: Identifier for an Account :type account_id: str :param account_name: Name for an account @@ -41,7 +40,7 @@ class Account(Model): :param organization_name: Organization that created the account :type organization_name: str :param properties: Extended properties - :type properties: :class:`object ` + :type properties: :class:`object ` :param status_reason: Reason for current status :type status_reason: str """ @@ -86,8 +85,7 @@ def __init__(self, account_id=None, account_name=None, account_owner=None, accou class AccountCreateInfoInternal(Model): - """AccountCreateInfoInternal. - + """ :param account_name: :type account_name: str :param creator: @@ -95,9 +93,9 @@ class AccountCreateInfoInternal(Model): :param organization: :type organization: str :param preferences: - :type preferences: :class:`AccountPreferencesInternal ` + :type preferences: :class:`AccountPreferencesInternal ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param service_definitions: :type service_definitions: list of { key: str; value: str } """ @@ -122,8 +120,7 @@ def __init__(self, account_name=None, creator=None, organization=None, preferenc class AccountPreferencesInternal(Model): - """AccountPreferencesInternal. - + """ :param culture: :type culture: object :param language: diff --git a/azure-devops/azure/devops/v6_0/audit/__init__.py b/azure-devops/azure/devops/v6_0/audit/__init__.py new file mode 100644 index 00000000..419e92ab --- /dev/null +++ b/azure-devops/azure/devops/v6_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/v6_0/audit/audit_client.py b/azure-devops/azure/devops/v6_0/audit/audit_client.py new file mode 100644 index 00000000..16a6ca2b --- /dev/null +++ b/azure-devops/azure/devops/v6_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='6.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='6.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='6.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='6.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='6.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='6.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='6.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='6.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='6.0-preview.1', + content=content) + return self._deserialize('AuditStream', response) + diff --git a/azure-devops/azure/devops/v6_0/audit/models.py b/azure-devops/azure/devops/v6_0/audit/models.py new file mode 100644 index 00000000..7bdcda32 --- /dev/null +++ b/azure-devops/azure/devops/v6_0/audit/models.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.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_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_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_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_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_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_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_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_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/v5_0/build/__init__.py b/azure-devops/azure/devops/v6_0/build/__init__.py similarity index 88% rename from azure-devops/azure/devops/v5_0/build/__init__.py rename to azure-devops/azure/devops/v6_0/build/__init__.py index 769eb009..09d0d63a 100644 --- a/azure-devops/azure/devops/v5_0/build/__init__.py +++ b/azure-devops/azure/devops/v6_0/build/__init__.py @@ -11,6 +11,7 @@ __all__ = [ 'AgentPoolQueue', + 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', @@ -55,18 +56,26 @@ 'GraphSubjectBase', 'IdentityRef', 'Issue', + 'JobReference', 'JsonPatchOperation', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineReference', 'ProcessParameters', + 'ProjectRetentionSetting', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', + 'RetentionLease', 'RetentionPolicy', + 'RetentionSetting', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', + 'StageReference', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', @@ -81,6 +90,9 @@ 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', diff --git a/azure-devops/azure/devops/v5_0/build/build_client.py b/azure-devops/azure/devops/v6_0/build/build_client.py similarity index 83% rename from azure-devops/azure/devops/v5_0/build/build_client.py rename to azure-devops/azure/devops/v6_0/build/build_client.py index 47d291c1..4b4cf381 100644 --- a/azure-devops/azure/devops/v5_0/build/build_client.py +++ b/azure-devops/azure/devops/v6_0/build/build_client.py @@ -27,11 +27,11 @@ def __init__(self, base_url=None, creds=None): def create_artifact(self, artifact, project, build_id): """CreateArtifact. - Associates an artifact with a build. - :param :class:` ` artifact: The artifact. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -41,18 +41,18 @@ def create_artifact(self, artifact, project, build_id): content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.0', + version='6.0-preview.5', 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. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -64,14 +64,14 @@ def get_artifact(self, project, build_id, artifact_name): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.0', + version='6.0-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. - Gets a specific artifact for a build. + [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. @@ -87,7 +87,7 @@ def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.0', + version='6.0-preview.5', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -99,7 +99,7 @@ def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): def get_artifacts(self, project, build_id): """GetArtifacts. - Gets all artifacts for a build. + [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] @@ -111,13 +111,13 @@ def get_artifacts(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.0', + version='6.0-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. - Gets a file from the build. + [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. @@ -139,7 +139,7 @@ def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwarg query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.0', + version='6.0-preview.5', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -166,7 +166,7 @@ def get_attachments(self, project, build_id, type): route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='f2192269-89fa-4f94-baf6-8fb128c55159', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values) return self._deserialize('[Attachment]', self._unwrap_collection(response)) @@ -196,7 +196,7 @@ def get_attachment(self, project, build_id, timeline_id, record_id, type, name, route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='af5122d3-3438-485e-a25a-2dbbfde84ee6', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: @@ -218,7 +218,7 @@ def authorize_project_resources(self, resources, project): content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) @@ -241,18 +241,19 @@ def get_project_resources(self, project, type=None, id=None): query_parameters['id'] = self._serialize.query('id', id, 'str') response = self._send(http_method='GET', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', - version='5.0-preview.1', + version='6.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): + 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: 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 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 = {} @@ -265,9 +266,11 @@ def list_branches(self, project, provider_name, service_endpoint_id=None, reposi query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + if branch_name is not None: + query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='e05d4403-9b81-4244-8763-20fde28d1976', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -279,7 +282,7 @@ def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -293,7 +296,7 @@ def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildBadge', response) @@ -319,14 +322,14 @@ def get_build_badge_data(self, project, repo_type, repo_id=None, branch_name=Non query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def delete_build(self, project, build_id): """DeleteBuild. - Deletes a build. + [Preview API] Deletes a build. :param str project: Project ID or project name :param int build_id: The ID of the build. """ @@ -337,16 +340,16 @@ def delete_build(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', route_values=route_values) def get_build(self, project, build_id, property_filters=None): """GetBuild. - Gets a build + [Preview API] Gets a build :param str project: Project ID or project name :param int build_id: :param str property_filters: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -358,14 +361,14 @@ def get_build(self, project, build_id, property_filters=None): query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', 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. + [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. @@ -387,7 +390,7 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, :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] + :rtype: :class:`<[Build]> ` """ route_values = {} if project is not None: @@ -440,20 +443,20 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Build]', self._unwrap_collection(response)) def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): """QueueBuild. - Queues a build - :param :class:` ` build: + [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: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -468,7 +471,7 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', route_values=route_values, query_parameters=query_parameters, content=content) @@ -476,12 +479,12 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None def update_build(self, build, project, build_id, retry=None): """UpdateBuild. - Updates a build. - :param :class:` ` build: The build. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -494,7 +497,7 @@ def update_build(self, build, project, build_id, retry=None): content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', route_values=route_values, query_parameters=query_parameters, content=content) @@ -502,7 +505,7 @@ def update_build(self, build, project, build_id, retry=None): def update_builds(self, builds, project): """UpdateBuilds. - Updates multiple builds. + [Preview API] Updates multiple builds. :param [Build] builds: The builds to update. :param str project: Project ID or project name :rtype: [Build] @@ -513,20 +516,20 @@ def update_builds(self, builds, project): content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.0', + version='6.0-preview.5', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): """GetBuildChanges. - Gets the changes associated with a build + [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: [Change] + :rtype: :class:`<[Change]> ` """ route_values = {} if project is not None: @@ -542,7 +545,7 @@ def get_build_changes(self, project, build_id, continuation_token=None, top=None query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') response = self._send(http_method='GET', location_id='54572c7b-bbd3-45d4-80dc-28be08941620', - version='5.0', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Change]', self._unwrap_collection(response)) @@ -568,29 +571,29 @@ def get_changes_between_builds(self, project, from_build_id=None, to_build_id=No query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Change]', self._unwrap_collection(response)) def get_build_controller(self, controller_id): """GetBuildController. - Gets a controller + [Preview API] Gets a controller :param int controller_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.0', + version='6.0-preview.2', route_values=route_values) return self._deserialize('BuildController', response) def get_build_controllers(self, name=None): """GetBuildControllers. - Gets controller, optionally filtered by name + [Preview API] Gets controller, optionally filtered by name :param str name: :rtype: [BuildController] """ @@ -599,18 +602,18 @@ def get_build_controllers(self, name=None): query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.0', + version='6.0-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. - Creates a new definition. - :param :class:` ` definition: The definition. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -623,7 +626,7 @@ def create_definition(self, definition, project, definition_to_clone_id=None, de content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-preview.7', route_values=route_values, query_parameters=query_parameters, content=content) @@ -631,7 +634,7 @@ def create_definition(self, definition, project, definition_to_clone_id=None, de def delete_definition(self, project, definition_id): """DeleteDefinition. - Deletes a definition and all associated builds. + [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. """ @@ -642,19 +645,19 @@ def delete_definition(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-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. - Gets a definition, optionally at a specific revision. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -673,14 +676,14 @@ def get_definition(self, project, definition_id, revision=None, min_metrics_time query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-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. - Gets a list of definitions. + [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. @@ -698,7 +701,7 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. - :rtype: [BuildDefinitionReference] + :rtype: :class:`<[BuildDefinitionReference]> ` """ route_values = {} if project is not None: @@ -739,18 +742,18 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-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. - Restores a deleted definition + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -762,20 +765,20 @@ def restore_definition(self, project, definition_id, deleted): query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-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. - Updates an existing definition. - :param :class:` ` definition: The new version of the defintion. + [Preview API] Updates an existing definition. + :param :class:` ` definition: The new version of the definition. :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -790,7 +793,7 @@ def update_definition(self, definition, project, definition_id, secrets_source_d content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.0', + version='6.0-preview.7', route_values=route_values, query_parameters=query_parameters, content=content) @@ -823,7 +826,7 @@ def get_file_contents(self, project, provider_name, service_endpoint_id=None, re query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='29d12225-b1d9-425f-b668-6c594a981313', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -836,21 +839,23 @@ def get_file_contents(self, project, provider_name, service_endpoint_id=None, re def create_folder(self, folder, project, path): """CreateFolder. [Preview API] Creates a new folder. - :param :class:` ` folder: The 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:` ` + :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: - route_values['path'] = self._serialize.url('path', path, 'str') + query_parameters['path'] = self._serialize.query('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='PUT', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, + query_parameters=query_parameters, content=content) return self._deserialize('Folder', response) @@ -863,12 +868,14 @@ def delete_folder(self, project, path): route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') + query_parameters['path'] = self._serialize.query('path', path, 'str') self._send(http_method='DELETE', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.0-preview.2', - route_values=route_values) + version='6.0-preview.2', + route_values=route_values, + query_parameters=query_parameters) def get_folders(self, project, path=None, query_order=None): """GetFolders. @@ -888,7 +895,7 @@ def get_folders(self, project, path=None, query_order=None): query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Folder]', self._unwrap_collection(response)) @@ -896,21 +903,23 @@ def get_folders(self, project, path=None, query_order=None): 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 :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:` ` + :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: - route_values['path'] = self._serialize.url('path', path, 'str') + query_parameters['path'] = self._serialize.query('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='POST', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, + query_parameters=query_parameters, content=content) return self._deserialize('Folder', response) @@ -920,7 +929,7 @@ def get_latest_build(self, project, definition, branch_name=None): :param str project: Project ID or project name :param str definition: definition name with optional leading folder path, or the definition id :param str branch_name: optional parameter that indicates the specific branch to use - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -932,14 +941,121 @@ def get_latest_build(self, project, definition, branch_name=None): query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='54481611-01f4-47f3-998f-160da0f0c229', - version='5.0-preview.1', + version='6.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. + [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='6.0-preview.1', + 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='6.0-preview.1', + 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='6.0-preview.1', + route_values=route_values) + return self._deserialize('RetentionLease', 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='6.0-preview.1', + 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='6.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(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. + [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. @@ -961,7 +1077,7 @@ def get_build_log(self, project, build_id, log_id, start_line=None, end_line=Non query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.0', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -973,7 +1089,7 @@ def get_build_log(self, project, build_id, log_id, start_line=None, end_line=Non 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. + [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. @@ -995,14 +1111,14 @@ def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_li query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.0', + version='6.0-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. - Gets the logs for a build. + [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] @@ -1014,13 +1130,13 @@ def get_build_logs(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.0', + version='6.0-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. - Gets the logs for a build. + [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 @@ -1032,7 +1148,7 @@ def get_build_logs_zip(self, project, build_id, **kwargs): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.0', + version='6.0-preview.2', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: @@ -1043,7 +1159,7 @@ def get_build_logs_zip(self, project, build_id, **kwargs): 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. + [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. @@ -1065,7 +1181,7 @@ def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.0', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -1093,7 +1209,7 @@ def get_project_metrics(self, project, metric_aggregation_type=None, min_metrics query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='7433fae7-a6bc-41dc-a6e2-eef9005ce41a', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) @@ -1116,14 +1232,14 @@ def get_definition_metrics(self, project, definition_id, min_metrics_time=None): query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='d973b939-0ce0-4fec-91d8-da3940fa1827', - version='5.0-preview.1', + version='6.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. + [Preview API] Gets all build definition options supported by the system. :param str project: Project ID or project name :rtype: [BuildOptionDefinition] """ @@ -1132,7 +1248,7 @@ def get_build_option_definitions(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', - version='5.0', + version='6.0-preview.2', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) @@ -1163,7 +1279,7 @@ def get_path_contents(self, project, provider_name, service_endpoint_id=None, re query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='7944d6fb-df01-4709-920a-7a189aa34037', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SourceRepositoryItem]', self._unwrap_collection(response)) @@ -1174,7 +1290,7 @@ def get_build_properties(self, project, build_id, filter=None): :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1187,7 +1303,7 @@ def get_build_properties(self, project, build_id, filter=None): query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) @@ -1195,10 +1311,10 @@ def get_build_properties(self, project, build_id, filter=None): 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 :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1208,7 +1324,7 @@ def update_build_properties(self, document, project, build_id): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') @@ -1220,7 +1336,7 @@ def get_definition_properties(self, project, definition_id, filter=None): :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1233,7 +1349,7 @@ def get_definition_properties(self, project, definition_id, filter=None): query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) @@ -1241,10 +1357,10 @@ def get_definition_properties(self, project, definition_id, filter=None): 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 :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1254,7 +1370,7 @@ def update_definition_properties(self, document, project, definition_id): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') @@ -1268,7 +1384,7 @@ def get_pull_request(self, project, provider_name, pull_request_id, repository_i :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1284,7 +1400,7 @@ def get_pull_request(self, project, provider_name, pull_request_id, repository_i query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') response = self._send(http_method='GET', location_id='d8763ec7-9ff0-4fb4-b2b2-9d757906ff14', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PullRequest', response) @@ -1295,7 +1411,7 @@ def get_build_report(self, project, build_id, type=None): :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1307,7 +1423,7 @@ def get_build_report(self, project, build_id, type=None): query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildReportMetadata', response) @@ -1330,7 +1446,7 @@ def get_build_report_html_content(self, project, build_id, type=None, **kwargs): query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/html') @@ -1350,7 +1466,7 @@ def list_repositories(self, project, provider_name, service_endpoint_id=None, re :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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1370,7 +1486,7 @@ def list_repositories(self, project, provider_name, service_endpoint_id=None, re query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='d44d1680-f978-4834-9b93-8c6e132329c9', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('SourceRepositories', response) @@ -1391,7 +1507,7 @@ def authorize_definition_resources(self, resources, project, definition_id): content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) @@ -1410,23 +1526,56 @@ def get_definition_resources(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', - version='5.0-preview.1', + version='6.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:` ` + :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='3813d06c-9e36-4ea1-aac3-61a485d60e3d', - version='5.0-preview.2') + version='6.0-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='6.0-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='6.0-preview.1', + 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. + [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] @@ -1438,31 +1587,31 @@ def get_definition_revisions(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', - version='5.0', + version='6.0-preview.3', route_values=route_values) return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) def get_build_settings(self, project=None): """GetBuildSettings. - Gets the build settings. + [Preview API] Gets the build settings. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.0', + version='6.0-preview.1', route_values=route_values) return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. - Updates the build settings. - :param :class:` ` settings: The new settings. + [Preview API] Updates the build settings. + :param :class:` ` settings: The new settings. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1470,7 +1619,7 @@ def update_build_settings(self, settings, project=None): content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.0', + version='6.0-preview.1', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) @@ -1486,10 +1635,32 @@ def list_source_providers(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='3ce81729-954f-423d-a581-9fea01d25186', - version='5.0-preview.1', + version='6.0-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='6.0-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.

@@ -1520,14 +1691,14 @@ def get_status_badge(self, project, definition, branch_name=None, stage_name=Non query_parameters['label'] = self._serialize.query('label', label, 'str') response = self._send(http_method='GET', location_id='07acfdce-4757-4439-b422-ddd13a2fcc10', - version='5.0-preview.1', + version='6.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. + [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. @@ -1542,13 +1713,13 @@ def add_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.0', + version='6.0-preview.2', 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. + [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. @@ -1562,14 +1733,14 @@ def add_build_tags(self, tags, project, build_id): content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.0', + version='6.0-preview.2', 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. + [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. @@ -1584,13 +1755,13 @@ def delete_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.0', + version='6.0-preview.2', 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. + [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] @@ -1602,22 +1773,7 @@ def get_build_tags(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.0', - route_values=route_values) - return self._deserialize('[str]', self._unwrap_collection(response)) - - def get_tags(self, project): - """GetTags. - Gets a list of all build and definition tags in the project. - :param str project: Project ID or project name - :rtype: [str] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - response = self._send(http_method='GET', - location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', - version='5.0', + version='6.0-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1638,7 +1794,7 @@ def add_definition_tag(self, project, definition_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1658,7 +1814,7 @@ def add_definition_tags(self, tags, project, definition_id): content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1680,7 +1836,7 @@ def delete_definition_tag(self, project, definition_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1702,14 +1858,47 @@ def get_definition_tags(self, project, definition_id, revision=None): query_parameters['revision'] = self._serialize.query('revision', revision, 'int') response = self._send(http_method='GET', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) 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='6.0-preview.2', + 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='6.0-preview.2', + 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. + [Preview API] Deletes a build definition template. :param str project: Project ID or project name :param str template_id: The ID of the template. """ @@ -1720,15 +1909,15 @@ def delete_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.0', + version='6.0-preview.3', route_values=route_values) def get_template(self, project, template_id): """GetTemplate. - Gets a specific build definition template. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1737,13 +1926,13 @@ def get_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.0', + version='6.0-preview.3', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) def get_templates(self, project): """GetTemplates. - Gets all definition templates. + [Preview API] Gets all definition templates. :param str project: Project ID or project name :rtype: [BuildDefinitionTemplate] """ @@ -1752,17 +1941,17 @@ def get_templates(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.0', + version='6.0-preview.3', 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. + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1772,20 +1961,20 @@ def save_template(self, template, project, template_id): content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.0', + version='6.0-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. - Gets details for a build + [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:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1801,7 +1990,7 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', - version='5.0', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) @@ -1828,7 +2017,7 @@ def restore_webhooks(self, trigger_types, project, provider_name, service_endpoi content = self._serialize.body(trigger_types, '[DefinitionTriggerType]') self._send(http_method='POST', location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1854,14 +2043,14 @@ def list_webhooks(self, project, provider_name, service_endpoint_id=None, reposi query_parameters['repository'] = self._serialize.query('repository', repository, 'str') response = self._send(http_method='GET', location_id='8f20ff82-9498-4812-9f6e-9c01bdc50e99', - version='5.0-preview.1', + version='6.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RepositoryWebhook]', self._unwrap_collection(response)) def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. - Gets the work items associated with a build. + [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. @@ -1877,14 +2066,14 @@ def get_build_work_items_refs(self, project, build_id, top=None): query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.0', + version='6.0-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. - Gets the work items associated with a build, filtered to specific commits. + [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. @@ -1902,7 +2091,7 @@ def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.0', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1929,7 +2118,7 @@ def get_work_items_between_builds(self, project, from_build_id, to_build_id, top query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='52ba8915-5518-42e3-a4bb-b0182d159e2d', - version='5.0-preview.2', + version='6.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/v5_0/build/models.py b/azure-devops/azure/devops/v6_0/build/models.py similarity index 80% rename from azure-devops/azure/devops/v5_0/build/models.py rename to azure-devops/azure/devops/v6_0/build/models.py index 28772e26..dd914001 100644 --- a/azure-devops/azure/devops/v5_0/build/models.py +++ b/azure-devops/azure/devops/v6_0/build/models.py @@ -10,16 +10,17 @@ class AgentPoolQueue(Model): - """AgentPoolQueue. + """ + Represents a queue for running builds. :param _links: - :type _links: :class:`ReferenceLinks ` + :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 ` + :type pool: :class:`TaskAgentPoolReference ` :param url: The full http link to the resource. :type url: str """ @@ -41,19 +42,35 @@ def __init__(self, _links=None, id=None, name=None, pool=None, url=None): self.url = url -class AggregatedResultsAnalysis(Model): - """AggregatedResultsAnalysis. +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 ` + :type previous_context: :class:`TestResultsContext ` :param results_by_outcome: :type results_by_outcome: dict :param results_difference: - :type results_difference: :class:`AggregatedResultsDifference ` + :type results_difference: :class:`AggregatedResultsDifference ` :param run_summary_by_outcome: :type run_summary_by_outcome: dict :param run_summary_by_state: @@ -86,8 +103,7 @@ def __init__(self, duration=None, not_reported_results_by_outcome=None, previous class AggregatedResultsByOutcome(Model): - """AggregatedResultsByOutcome. - + """ :param count: :type count: int :param duration: @@ -122,12 +138,13 @@ def __init__(self, count=None, duration=None, group_by_field=None, group_by_valu class AggregatedResultsDifference(Model): - """AggregatedResultsDifference. - + """ :param increase_in_duration: :type increase_in_duration: object :param increase_in_failures: :type increase_in_failures: int + :param increase_in_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: @@ -139,23 +156,24 @@ class AggregatedResultsDifference(Model): _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_other_tests=None, increase_in_passed_tests=None, increase_in_total_tests=None): + 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): - """AggregatedRunsByOutcome. - + """ :param outcome: :type outcome: object :param runs_count: @@ -174,8 +192,7 @@ def __init__(self, outcome=None, runs_count=None): class AggregatedRunsByState(Model): - """AggregatedRunsByState. - + """ :param results_by_outcome: :type results_by_outcome: dict :param runs_count: @@ -198,10 +215,9 @@ def __init__(self, results_by_outcome=None, runs_count=None, state=None): class ArtifactResource(Model): - """ArtifactResource. - + """ :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param data: Type-specific data about the artifact. :type data: str :param download_url: A link to download the resource. @@ -234,8 +250,7 @@ def __init__(self, _links=None, data=None, download_url=None, properties=None, t class AssociatedWorkItem(Model): - """AssociatedWorkItem. - + """ :param assigned_to: :type assigned_to: str :param id: Id of associated the work item. @@ -274,10 +289,11 @@ def __init__(self, assigned_to=None, id=None, state=None, title=None, url=None, class Attachment(Model): - """Attachment. + """ + Represents an attachment to a build. :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param name: The name of the attachment. :type name: str """ @@ -294,8 +310,7 @@ def __init__(self, _links=None, name=None): class AuthorizationHeader(Model): - """AuthorizationHeader. - + """ :param name: :type name: str :param value: @@ -314,28 +329,31 @@ def __init__(self, name=None, value=None): class Build(Model): - """Build. + """ + Data representation of a build. :param _links: - :type _links: :class:`ReferenceLinks ` + :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 ` + :type controller: :class:`BuildController ` :param definition: The definition associated with the build. - :type definition: :class:`DefinitionReference ` + :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 ` + :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 ` + :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. @@ -343,27 +361,27 @@ class Build(Model): :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 ` + :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 ` + :type logs: :class:`BuildLogReference ` :param orchestration_plan: The orchestration plan for the build. - :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` + :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 ` + :type plans: list of :class:`TaskOrchestrationPlanReference ` :param priority: The build's priority. :type priority: object :param project: The team project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param properties: - :type properties: :class:`object ` + :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 ` + :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. @@ -373,11 +391,11 @@ class Build(Model): :param reason: The reason that the build was created. :type reason: object :param repository: The repository. - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param requested_by: The identity that queued the build. - :type requested_by: :class:`IdentityRef ` + :type requested_by: :class:`IdentityRef ` :param requested_for: The identity on whose behalf the build was queued. - :type requested_for: :class:`IdentityRef ` + :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. @@ -393,7 +411,7 @@ class Build(Model): :param tags: :type tags: list of str :param triggered_by_build: The build that triggered this build via a Build completion trigger. - :type triggered_by_build: :class:`Build ` + :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. @@ -401,11 +419,12 @@ class Build(Model): :param url: The REST URL of the build. :type url: str :param validation_results: - :type validation_results: list of :class:`BuildRequestValidationResult ` + :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'}, @@ -450,9 +469,10 @@ class Build(Model): 'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'} } - def __init__(self, _links=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, triggered_by_build=None, trigger_info=None, uri=None, url=None, validation_results=None): + def __init__(self, _links=None, agent_specification=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, triggered_by_build=None, trigger_info=None, uri=None, url=None, validation_results=None): super(Build, self).__init__() self._links = _links + self.agent_specification = agent_specification self.build_number = build_number self.build_number_revision = build_number_revision self.controller = controller @@ -498,31 +518,37 @@ def __init__(self, _links=None, build_number=None, build_number_revision=None, c class BuildArtifact(Model): - """BuildArtifact. + """ + 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 ` + :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'} + 'resource': {'key': 'resource', 'type': 'ArtifactResource'}, + 'source': {'key': 'source', 'type': 'str'} } - def __init__(self, id=None, name=None, resource=None): + 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): - """BuildBadge. + """ + Represents a build badge. :param build_id: The ID of the build represented by this badge. :type build_id: int @@ -542,10 +568,11 @@ def __init__(self, build_id=None, image_url=None): class BuildDefinitionRevision(Model): - """BuildDefinitionRevision. + """ + Represents a revision of a build definition. :param changed_by: The identity of the person or process that changed the definition. - :type changed_by: :class:`IdentityRef ` + :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). @@ -582,7 +609,8 @@ def __init__(self, changed_by=None, changed_date=None, change_type=None, comment class BuildDefinitionStep(Model): - """BuildDefinitionStep. + """ + 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 @@ -601,7 +629,7 @@ class BuildDefinitionStep(Model): :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 ` + :type task: :class:`TaskDefinitionReference ` :param timeout_in_minutes: The time, in minutes, that this step is allowed to run. :type timeout_in_minutes: int """ @@ -634,7 +662,8 @@ def __init__(self, always_run=None, condition=None, continue_on_error=None, disp class BuildDefinitionTemplate(Model): - """BuildDefinitionTemplate. + """ + 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 @@ -653,7 +682,7 @@ class BuildDefinitionTemplate(Model): :param name: The name of the template. :type name: str :param template: The actual template. - :type template: :class:`BuildDefinition ` + :type template: :class:`BuildDefinition ` """ _attribute_map = { @@ -682,7 +711,8 @@ def __init__(self, can_delete=None, category=None, default_hosted_queue=None, de class BuildDefinitionTemplate3_2(Model): - """BuildDefinitionTemplate3_2. + """ + For back-compat with extensions that use the old Steps format instead of Process and Phases :param can_delete: :type can_delete: bool @@ -701,7 +731,7 @@ class BuildDefinitionTemplate3_2(Model): :param name: :type name: str :param template: - :type template: :class:`BuildDefinition3_2 ` + :type template: :class:`BuildDefinition3_2 ` """ _attribute_map = { @@ -730,7 +760,8 @@ def __init__(self, can_delete=None, category=None, default_hosted_queue=None, de class BuildDefinitionVariable(Model): - """BuildDefinitionVariable. + """ + 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 @@ -754,7 +785,8 @@ def __init__(self, allow_override=None, is_secret=None, value=None): class BuildLogReference(Model): - """BuildLogReference. + """ + Represents a reference to a build log. :param id: The ID of the log. :type id: int @@ -778,7 +810,8 @@ def __init__(self, id=None, type=None, url=None): class BuildMetric(Model): - """BuildMetric. + """ + Represents metadata about builds in the system. :param date: The date for the scope. :type date: datetime @@ -806,10 +839,11 @@ def __init__(self, date=None, int_value=None, name=None, scope=None): class BuildOption(Model): - """BuildOption. + """ + Represents the application of an optional behavior to a build definition. :param definition: A reference to the build option. - :type definition: :class:`BuildOptionDefinitionReference ` + :type definition: :class:`BuildOptionDefinitionReference ` :param enabled: Indicates whether the behavior is enabled. :type enabled: bool :param inputs: @@ -830,7 +864,8 @@ def __init__(self, definition=None, enabled=None, inputs=None): class BuildOptionDefinitionReference(Model): - """BuildOptionDefinitionReference. + """ + Represents a reference to a build option definition. :param id: The ID of the referenced build option. :type id: str @@ -846,7 +881,8 @@ def __init__(self, id=None): class BuildOptionGroupDefinition(Model): - """BuildOptionGroupDefinition. + """ + 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 @@ -870,7 +906,8 @@ def __init__(self, display_name=None, is_expanded=None, name=None): class BuildOptionInputDefinition(Model): - """BuildOptionInputDefinition. + """ + Represents an input for a build option. :param default_value: The default value. :type default_value: str @@ -918,7 +955,8 @@ def __init__(self, default_value=None, group_name=None, help=None, label=None, n class BuildReportMetadata(Model): - """BuildReportMetadata. + """ + Represents information about a build report. :param build_id: The Id of the build. :type build_id: int @@ -942,7 +980,8 @@ def __init__(self, build_id=None, content=None, type=None): class BuildRepository(Model): - """BuildRepository. + """ + Represents a repository used by a build definition. :param checkout_submodules: Indicates whether to checkout submodules. :type checkout_submodules: bool @@ -990,7 +1029,8 @@ def __init__(self, checkout_submodules=None, clean=None, default_branch=None, id class BuildRequestValidationResult(Model): - """BuildRequestValidationResult. + """ + Represents the result of validating a build request. :param message: The message associated with the result. :type message: str @@ -1010,7 +1050,8 @@ def __init__(self, message=None, result=None): class BuildResourceUsage(Model): - """BuildResourceUsage. + """ + Represents information about resources used by builds in the system. :param distributed_task_agents: The number of build agents. :type distributed_task_agents: int @@ -1038,14 +1079,15 @@ def __init__(self, distributed_task_agents=None, paid_private_agent_slots=None, class BuildSettings(Model): - """BuildSettings. + """ + 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 ` + :type default_retention_policy: :class:`RetentionPolicy ` :param maximum_retention_policy: The maximum retention policy. - :type maximum_retention_policy: :class:`RetentionPolicy ` + :type maximum_retention_policy: :class:`RetentionPolicy ` """ _attribute_map = { @@ -1062,10 +1104,11 @@ def __init__(self, days_to_keep_deleted_builds_before_destroy=None, default_rete class Change(Model): - """Change. + """ + Represents a change associated with a build. :param author: The author of the change. - :type author: :class:`IdentityRef ` + :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. @@ -1110,7 +1153,8 @@ def __init__(self, author=None, display_uri=None, id=None, location=None, messag class DataSourceBindingBase(Model): - """DataSourceBindingBase. + """ + 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 @@ -1123,11 +1167,15 @@ class DataSourceBindingBase(Model): :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 ` + :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. @@ -1145,12 +1193,14 @@ class DataSourceBindingBase(Model): '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, result_selector=None, result_template=None, target=None): + 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 @@ -1160,15 +1210,18 @@ def __init__(self, callback_context_template=None, callback_required_template=No 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): - """DefinitionReference. + """ + Represents a reference to a definition. - :param created_date: The date the definition was created. + :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 @@ -1177,7 +1230,7 @@ class DefinitionReference(Model): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :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. @@ -1218,8 +1271,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non class DefinitionResourceReference(Model): - """DefinitionResourceReference. - + """ :param authorized: Indicates whether the resource is authorized for use. :type authorized: bool :param id: The id of the resource. @@ -1246,7 +1298,8 @@ def __init__(self, authorized=None, id=None, name=None, type=None): class Deployment(Model): - """Deployment. + """ + Represents the data from the build information nodes for type "DeploymentInformation" for xaml builds :param type: :type type: str @@ -1262,22 +1315,23 @@ def __init__(self, type=None): class Folder(Model): - """Folder. + """ + Represents a folder that contains build definitions. :param created_by: The process or person who created the folder. - :type created_by: :class:`IdentityRef ` + :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 ` + :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 ` + :type project: :class:`TeamProjectReference ` """ _attribute_map = { @@ -1302,10 +1356,9 @@ def __init__(self, created_by=None, created_on=None, description=None, last_chan class GraphSubjectBase(Model): - """GraphSubjectBase. - + """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` + :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. @@ -1330,33 +1383,32 @@ def __init__(self, _links=None, descriptor=None, display_name=None, url=None): class IdentityRef(GraphSubjectBase): - """IdentityRef. - + """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` + :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: + :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: + :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary :type image_url: str - :param inactive: + :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: + :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: + :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: + :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef :type profile_url: str - :param unique_name: + :param unique_name: Deprecated - use Domain+PrincipalName instead :type unique_name: str """ @@ -1390,7 +1442,8 @@ def __init__(self, _links=None, descriptor=None, display_name=None, url=None, di class Issue(Model): - """Issue. + """ + Represents an issue (error, warning) associated with a build. :param category: The category. :type category: str @@ -1417,14 +1470,36 @@ def __init__(self, category=None, data=None, message=None, type=None): 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): - """JsonPatchOperation. + """ + 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 + :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 @@ -1445,15 +1520,95 @@ def __init__(self, from_=None, op=None, path=None, value=None): self.value = value -class ProcessParameters(Model): - """ProcessParameters. +class NewRetentionLease(Model): + """ + :param days_valid: The number of days to consider the lease valid. + :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 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 ` + :type data_source_bindings: list of :class:`DataSourceBindingBase ` :param inputs: - :type inputs: list of :class:`TaskInputDefinitionBase ` + :type inputs: list of :class:`TaskInputDefinitionBase ` :param source_definitions: - :type source_definitions: list of :class:`TaskSourceDefinitionBase ` + :type source_definitions: list of :class:`TaskSourceDefinitionBase ` """ _attribute_map = { @@ -1469,13 +1624,43 @@ def __init__(self, data_source_bindings=None, inputs=None, source_definitions=No 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): - """PullRequest. + """ + 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 ` + :type _links: :class:`ReferenceLinks ` :param author: Author of the pull request. - :type author: :class:`IdentityRef ` + :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. @@ -1526,7 +1711,8 @@ def __init__(self, _links=None, author=None, current_state=None, description=Non class ReferenceLinks(Model): - """ReferenceLinks. + """ + 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 @@ -1542,15 +1728,16 @@ def __init__(self, links=None): class ReleaseReference(Model): - """ReleaseReference. + """ + Reference to a release. - :param attempt: + :param attempt: Number of Release Attempt. :type attempt: int - :param creation_date: + :param creation_date: Release Creation Date. :type creation_date: datetime :param definition_id: Release definition ID. :type definition_id: int - :param environment_creation_date: + :param environment_creation_date: Environment creation Date. :type environment_creation_date: datetime :param environment_definition_id: Release environment definition ID. :type environment_definition_id: int @@ -1594,7 +1781,8 @@ def __init__(self, attempt=None, creation_date=None, definition_id=None, environ class RepositoryWebhook(Model): - """RepositoryWebhook. + """ + Represents a repository's webhook returned from a source provider. :param name: The friendly name of the repository. :type name: str @@ -1618,8 +1806,7 @@ def __init__(self, name=None, types=None, url=None): class ResourceRef(Model): - """ResourceRef. - + """ :param id: :type id: str :param url: @@ -1637,8 +1824,46 @@ def __init__(self, id=None, url=None): 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 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'}, + '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, 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.run_id = run_id + self.valid_until = valid_until + + class RetentionPolicy(Model): - """RetentionPolicy. + """ + Represents a retention policy for a build definition. :param artifacts: :type artifacts: list of str @@ -1677,15 +1902,39 @@ def __init__(self, artifacts=None, artifact_types_to_delete=None, branches=None, self.minimum_to_keep = minimum_to_keep -class SourceProviderAttributes(Model): - """SourceProviderAttributes. +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 ` + :type supported_triggers: list of :class:`SupportedTrigger ` """ _attribute_map = { @@ -1702,14 +1951,15 @@ def __init__(self, name=None, supported_capabilities=None, supported_triggers=No class SourceRepositories(Model): - """SourceRepositories. + """ + 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 ` + :type repositories: list of :class:`SourceRepository ` :param total_page_count: The total number of pages, or '-1' if unknown :type total_page_count: int """ @@ -1730,7 +1980,8 @@ def __init__(self, continuation_token=None, page_length=None, repositories=None, class SourceRepository(Model): - """SourceRepository. + """ + Represents a repository returned from a source provider. :param default_branch: The name of the default branch. :type default_branch: str @@ -1770,7 +2021,8 @@ def __init__(self, default_branch=None, full_name=None, id=None, name=None, prop class SourceRepositoryItem(Model): - """SourceRepositoryItem. + """ + 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 @@ -1797,9 +2049,29 @@ def __init__(self, is_container=None, path=None, type=None, url=None): self.url = url -class SupportedTrigger(Model): - """SupportedTrigger. +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. @@ -1826,7 +2098,8 @@ def __init__(self, default_polling_interval=None, notification_type=None, suppor class TaskAgentPoolReference(Model): - """TaskAgentPoolReference. + """ + Represents a reference to an agent pool. :param id: The pool ID. :type id: int @@ -1850,7 +2123,8 @@ def __init__(self, id=None, is_hosted=None, name=None): class TaskDefinitionReference(Model): - """TaskDefinitionReference. + """ + A reference to a task definition. :param definition_type: The type of task (task or task group). :type definition_type: str @@ -1874,8 +2148,7 @@ def __init__(self, definition_type=None, id=None, version_spec=None): class TaskInputDefinitionBase(Model): - """TaskInputDefinitionBase. - + """ :param aliases: :type aliases: list of str :param default_value: @@ -1897,7 +2170,7 @@ class TaskInputDefinitionBase(Model): :param type: :type type: str :param validation: - :type validation: :class:`TaskInputValidation ` + :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ @@ -1934,8 +2207,7 @@ def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_ class TaskInputValidation(Model): - """TaskInputValidation. - + """ :param expression: Conditional expression :type expression: str :param message: Message explaining how user can correct if validation fails @@ -1954,7 +2226,8 @@ def __init__(self, expression=None, message=None): class TaskOrchestrationPlanReference(Model): - """TaskOrchestrationPlanReference. + """ + Represents a reference to an orchestration plan. :param orchestration_type: The type of the plan. :type orchestration_type: int @@ -1974,7 +2247,8 @@ def __init__(self, orchestration_type=None, plan_id=None): class TaskReference(Model): - """TaskReference. + """ + Represents a reference to a task. :param id: The ID of the task definition. :type id: str @@ -1998,8 +2272,7 @@ def __init__(self, id=None, name=None, version=None): class TaskSourceDefinitionBase(Model): - """TaskSourceDefinitionBase. - + """ :param auth_key: :type auth_key: str :param endpoint: @@ -2030,7 +2303,8 @@ def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=Non class TeamProjectReference(Model): - """TeamProjectReference. + """ + Represents a shallow reference to a TeamProject. :param abbreviation: Project abbreviation. :type abbreviation: str @@ -2040,6 +2314,8 @@ class TeamProjectReference(Model): :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. @@ -2057,6 +2333,7 @@ class TeamProjectReference(Model): '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'}, @@ -2064,12 +2341,13 @@ class TeamProjectReference(Model): 'visibility': {'key': 'visibility', 'type': 'object'} } - def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): + 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 @@ -2078,32 +2356,34 @@ def __init__(self, abbreviation=None, default_team_image_url=None, description=N class TestResultsContext(Model): - """TestResultsContext. - + """ :param build: - :type build: :class:`BuildReference ` + :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 ` + :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, release=None): + 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): - """TimelineAttempt. - + """ :param attempt: Gets or sets the attempt of the record. :type attempt: int :param record_id: Gets or sets the record identifier located within the specified timeline. @@ -2126,30 +2406,33 @@ def __init__(self, attempt=None, record_id=None, timeline_id=None): class TimelineRecord(Model): - """TimelineRecord. + """ + Represents an entry in a build's timeline. :param _links: - :type _links: :class:`ReferenceLinks ` - :param attempt: + :type _links: :class:`ReferenceLinks ` + :param attempt: Attempt number of record. :type attempt: int :param change_id: The change ID. :type change_id: int :param current_operation: A string that indicates the current operation. :type current_operation: str :param details: A reference to a sub-timeline. - :type details: :class:`TimelineReference ` + :type details: :class:`TimelineReference ` :param error_count: The number of errors produced by this operation. :type error_count: int :param finish_time: The finish time. :type finish_time: datetime :param id: The ID of the record. :type id: str + :param identifier: String identifier that is consistent across attempts. + :type identifier: str :param issues: - :type issues: list of :class:`Issue ` + :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 ` + :type log: :class:`BuildLogReference ` :param name: The name. :type name: str :param order: An ordinal value relative to other records. @@ -2159,7 +2442,7 @@ class TimelineRecord(Model): :param percent_complete: The current completion percentage. :type percent_complete: int :param previous_attempts: - :type previous_attempts: list of :class:`TimelineAttempt ` + :type previous_attempts: list of :class:`TimelineAttempt ` :param result: The result. :type result: object :param result_code: The result code. @@ -2169,7 +2452,7 @@ class TimelineRecord(Model): :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 ` + :type task: :class:`TaskReference ` :param type: The type of the record. :type type: str :param url: The REST URL of the timeline record. @@ -2189,6 +2472,7 @@ class TimelineRecord(Model): 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, + 'identifier': {'key': 'identifier', 'type': 'str'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, 'log': {'key': 'log', 'type': 'BuildLogReference'}, @@ -2208,7 +2492,7 @@ class TimelineRecord(Model): 'worker_name': {'key': 'workerName', 'type': 'str'} } - def __init__(self, _links=None, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): + def __init__(self, _links=None, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, identifier=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): super(TimelineRecord, self).__init__() self._links = _links self.attempt = attempt @@ -2218,6 +2502,7 @@ def __init__(self, _links=None, attempt=None, change_id=None, current_operation= self.error_count = error_count self.finish_time = finish_time self.id = id + self.identifier = identifier self.issues = issues self.last_modified = last_modified self.log = log @@ -2238,7 +2523,8 @@ def __init__(self, _links=None, attempt=None, change_id=None, current_operation= class TimelineReference(Model): - """TimelineReference. + """ + Represents a reference to a timeline. :param change_id: The change ID. :type change_id: int @@ -2261,8 +2547,68 @@ def __init__(self, change_id=None, id=None, url=None): 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 state: + :type state: object + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'object'} + } + + def __init__(self, state=None): + super(UpdateStageParameters, self).__init__() + self.state = state + + class VariableGroupReference(Model): - """VariableGroupReference. + """ + Represents a reference to a variable group. :param alias: The Name of the variable group. :type alias: str @@ -2282,8 +2628,7 @@ def __init__(self, alias=None, id=None): class WebApiConnectedServiceRef(Model): - """WebApiConnectedServiceRef. - + """ :param id: :type id: str :param url: @@ -2302,8 +2647,7 @@ def __init__(self, id=None, url=None): 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.) @@ -2326,8 +2670,7 @@ def __init__(self, id=None, name=None, url=None): 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.) @@ -2335,7 +2678,7 @@ class BuildController(XamlBuildControllerReference): :param url: Full http link to the resource :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param created_date: The date the controller was created. :type created_date: datetime :param description: The description of the controller. @@ -2375,9 +2718,10 @@ def __init__(self, id=None, name=None, url=None, _links=None, created_date=None, class BuildDefinitionReference(DefinitionReference): - """BuildDefinitionReference. + """ + Represents a reference to a build definition. - :param created_date: The date the definition was created. + :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 @@ -2386,7 +2730,7 @@ class BuildDefinitionReference(DefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :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. @@ -2398,23 +2742,23 @@ class BuildDefinitionReference(DefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :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 ` + :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 ` + :type drafts: list of :class:`DefinitionReference ` :param latest_build: - :type latest_build: :class:`Build ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :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 ` + :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { @@ -2453,9 +2797,10 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non class BuildDefinitionReference3_2(DefinitionReference): - """BuildDefinitionReference3_2. + """ + For back-compat with extensions that use the old Steps format instead of Process and Phases - :param created_date: The date the definition was created. + :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 @@ -2464,7 +2809,7 @@ class BuildDefinitionReference3_2(DefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :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. @@ -2476,19 +2821,19 @@ class BuildDefinitionReference3_2(DefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :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 ` + :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 ` + :type drafts: list of :class:`DefinitionReference ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :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 ` + :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { @@ -2523,7 +2868,8 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non class BuildLog(BuildLogReference): - """BuildLog. + """ + Represents a build log. :param id: The ID of the log. :type id: int @@ -2556,16 +2902,17 @@ def __init__(self, id=None, type=None, url=None, created_on=None, last_changed_o class BuildOptionDefinition(BuildOptionDefinitionReference): - """BuildOptionDefinition. + """ + 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 ` + :type groups: list of :class:`BuildOptionGroupDefinition ` :param inputs: The list of inputs defined for the build option. - :type inputs: list of :class:`BuildOptionInputDefinition ` + :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. @@ -2591,7 +2938,8 @@ def __init__(self, id=None, description=None, groups=None, inputs=None, name=Non class Timeline(TimelineReference): - """Timeline. + """ + Represents the timeline of a build. :param change_id: The change ID. :type change_id: int @@ -2604,7 +2952,7 @@ class Timeline(TimelineReference): :param last_changed_on: The time the timeline was last changed. :type last_changed_on: datetime :param records: - :type records: list of :class:`TimelineRecord ` + :type records: list of :class:`TimelineRecord ` """ _attribute_map = { @@ -2624,7 +2972,8 @@ def __init__(self, change_id=None, id=None, url=None, last_changed_by=None, last class VariableGroup(VariableGroupReference): - """VariableGroup. + """ + Represents a variable group. :param alias: The Name of the variable group. :type alias: str @@ -2658,9 +3007,10 @@ def __init__(self, alias=None, id=None, description=None, name=None, type=None, class BuildDefinition(BuildDefinitionReference): - """BuildDefinition. + """ + Represents a build definition. - :param created_date: The date the definition was created. + :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 @@ -2669,7 +3019,7 @@ class BuildDefinition(BuildDefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :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. @@ -2681,23 +3031,23 @@ class BuildDefinition(BuildDefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :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 ` + :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 ` + :type drafts: list of :class:`DefinitionReference ` :param latest_build: - :type latest_build: :class:`Build ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :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 ` + :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. @@ -2705,7 +3055,7 @@ class BuildDefinition(BuildDefinitionReference): :param comment: A save-time comment for the definition. :type comment: str :param demands: - :type demands: list of :class:`object ` + :type demands: list of :class:`object ` :param description: The description. :type description: str :param drop_location: The drop location for the definition. @@ -2717,23 +3067,23 @@ class BuildDefinition(BuildDefinitionReference): :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 ` + :type options: list of :class:`BuildOption ` :param process: The build process. - :type process: :class:`object ` + :type process: :class:`object ` :param process_parameters: The process parameters for this definition. - :type process_parameters: :class:`ProcessParameters ` + :type process_parameters: :class:`ProcessParameters ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param repository: The repository. - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param retention_rules: - :type retention_rules: list of :class:`RetentionPolicy ` + :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: - :type triggers: list of :class:`object ` + :type triggers: list of :class:`object ` :param variable_groups: - :type variable_groups: list of :class:`VariableGroup ` + :type variable_groups: list of :class:`VariableGroup ` :param variables: :type variables: dict """ @@ -2803,9 +3153,10 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non class BuildDefinition3_2(BuildDefinitionReference3_2): - """BuildDefinition3_2. + """ + For back-compat with extensions that use the old Steps format instead of Process and Phases - :param created_date: The date the definition was created. + :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 @@ -2814,7 +3165,7 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :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. @@ -2826,29 +3177,29 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :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 ` + :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 ` + :type drafts: list of :class:`DefinitionReference ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :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 ` + :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 ` + :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 ` + :type demands: list of :class:`object ` :param description: The description :type description: str :param drop_location: The drop location for the definition @@ -2860,23 +3211,23 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :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 ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param options: - :type options: list of :class:`BuildOption ` + :type options: list of :class:`BuildOption ` :param process_parameters: Process Parameters - :type process_parameters: :class:`ProcessParameters ` + :type process_parameters: :class:`ProcessParameters ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param repository: The repository - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param retention_rules: - :type retention_rules: list of :class:`RetentionPolicy ` + :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: - :type triggers: list of :class:`object ` + :type triggers: list of :class:`object ` :param variables: :type variables: dict """ @@ -2947,6 +3298,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non __all__ = [ 'AgentPoolQueue', + 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', @@ -2984,18 +3336,26 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non 'GraphSubjectBase', 'IdentityRef', 'Issue', + 'JobReference', 'JsonPatchOperation', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineReference', 'ProcessParameters', + 'ProjectRetentionSetting', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', + 'RetentionLease', 'RetentionPolicy', + 'RetentionSetting', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', + 'StageReference', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', @@ -3009,6 +3369,9 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', diff --git a/azure-devops/azure/devops/v5_0/licensing/__init__.py b/azure-devops/azure/devops/v6_0/cix/__init__.py similarity index 53% rename from azure-devops/azure/devops/v5_0/licensing/__init__.py rename to azure-devops/azure/devops/v6_0/cix/__init__.py index e0460d1d..b654a5ef 100644 --- a/azure-devops/azure/devops/v5_0/licensing/__init__.py +++ b/azure-devops/azure/devops/v6_0/cix/__init__.py @@ -7,26 +7,27 @@ # -------------------------------------------------------------------------------------------- from .models import * -from .licensing_client import LicensingClient +from .cix_client import CixClient __all__ = [ - 'AccountEntitlement', - 'AccountEntitlementUpdateModel', - 'AccountLicenseExtensionUsage', - 'AccountLicenseUsage', - 'AccountRights', - 'AccountUserLicense', - 'ClientRightsContainer', - 'ExtensionAssignment', - 'ExtensionAssignmentDetails', - 'ExtensionLicenseData', - 'ExtensionOperationResult', - 'ExtensionRightsResult', - 'ExtensionSource', - 'GraphSubjectBase', - 'IdentityRef', - 'License', - 'MsdnEntitlement', + 'ConfigurationFile', + 'CreatedResources', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'Operation', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', 'ReferenceLinks', - 'LicensingClient' + 'ResourceCreationParameter', + 'TeamProject', + 'TeamProjectReference', + 'Template', + 'TemplateAsset', + 'TemplateDataSourceBinding', + 'TemplateParameterDefinition', + 'TemplateParameters', + 'WebApiTeamRef', + 'CixClient' ] diff --git a/azure-devops/azure/devops/v6_0/cix/cix_client.py b/azure-devops/azure/devops/v6_0/cix/cix_client.py new file mode 100644 index 00000000..d0459986 --- /dev/null +++ b/azure-devops/azure/devops/v6_0/cix/cix_client.py @@ -0,0 +1,171 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root 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='6.0-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='6.0-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='6.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) + + def get_template_recommendations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None): + """GetTemplateRecommendations. + [Preview API] Returns a list of all YAML templates with weighting based on which would best fit the given repository. + :param str project: Project ID or project name + :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + :param str branch: The repository branch which to find matching templates for. + :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + :rtype: [Template] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_type is not None: + query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if branch is not None: + query_parameters['branch'] = self._serialize.query('branch', branch, 'str') + if service_connection_id is not None: + query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') + response = self._send(http_method='GET', + location_id='63ea8f13-b563-4be7-bc31-3a96eda27220', + version='6.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Template]', self._unwrap_collection(response)) + + def create_resources(self, creation_parameters, project): + """CreateResources. + [Preview API] + :param {ResourceCreationParameter} creation_parameters: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(creation_parameters, '{ResourceCreationParameter}') + response = self._send(http_method='POST', + location_id='43201899-7690-4870-9c79-ab69605f21ed', + version='6.0-preview.1', + route_values=route_values, + content=content) + return self._deserialize('CreatedResources', response) + + def render_template(self, template_parameters, template_id): + """RenderTemplate. + [Preview API] + :param :class:` ` template_parameters: + :param str template_id: + :rtype: :class:`