From 278b753663093da385c13e209854f53c792ea96f Mon Sep 17 00:00:00 2001 From: Ted Chambers Date: Wed, 13 Mar 2019 11:45:22 -0400 Subject: [PATCH] Update 5.1 apis to M149 --- .../azure/devops/v5_1/build/__init__.py | 1 + .../azure/devops/v5_1/build/models.py | 25 +- .../azure/devops/v5_1/cix/__init__.py | 29 + .../azure/devops/v5_1/cix/cix_client.py | 166 ++++++ azure-devops/azure/devops/v5_1/cix/models.py | 502 ++++++++++++++++++ .../azure/devops/v5_1/client_factory.py | 28 +- .../azure/devops/v5_1/core/core_client.py | 10 +- azure-devops/azure/devops/v5_1/core/models.py | 4 +- .../azure/devops/v5_1/feed/__init__.py | 1 + .../azure/devops/v5_1/feed/feed_client.py | 29 +- azure-devops/azure/devops/v5_1/feed/models.py | 32 +- .../azure/devops/v5_1/gallery/__init__.py | 5 + .../devops/v5_1/gallery/gallery_client.py | 23 + .../azure/devops/v5_1/gallery/models.py | 185 +++++++ .../azure/devops/v5_1/git/git_client_base.py | 18 + azure-devops/azure/devops/v5_1/git/models.py | 10 +- .../azure/devops/v5_1/graph/__init__.py | 2 + .../azure/devops/v5_1/graph/graph_client.py | 70 +++ .../azure/devops/v5_1/graph/models.py | 48 +- .../azure/devops/v5_1/identity/models.py | 10 +- .../member_entitlement_management/models.py | 2 +- .../v5_1/notification/notification_client.py | 2 +- azure-devops/azure/devops/v5_1/npm/models.py | 2 +- .../azure/devops/v5_1/nuget/models.py | 2 +- .../azure/devops/v5_1/pipelines/__init__.py | 16 + .../azure/devops/v5_1/pipelines/models.py | 51 ++ .../devops/v5_1/pipelines/pipelines_client.py | 50 ++ .../azure/devops/v5_1/py_pi_api/models.py | 2 +- .../azure/devops/v5_1/release/__init__.py | 1 + .../azure/devops/v5_1/release/models.py | 45 +- .../devops/v5_1/release/release_client.py | 21 + .../devops/v5_1/service_endpoint/models.py | 64 +-- .../azure/devops/v5_1/service_hooks/models.py | 16 +- .../azure/devops/v5_1/task_agent/__init__.py | 8 +- .../azure/devops/v5_1/task_agent/models.py | 432 ++++++++------- .../v5_1/task_agent/task_agent_client.py | 366 +++++++++++++ .../azure/devops/v5_1/test/__init__.py | 2 + azure-devops/azure/devops/v5_1/test/models.py | 76 ++- .../azure/devops/v5_1/universal/models.py | 2 +- .../azure/devops/v5_1/work/__init__.py | 2 + azure-devops/azure/devops/v5_1/work/models.py | 90 +++- .../azure/devops/v5_1/work/work_client.py | 44 +- .../v5_1/work_item_tracking/__init__.py | 10 + .../devops/v5_1/work_item_tracking/models.py | 391 +++++++++++++- .../work_item_tracking_client.py | 325 +++++++++++- .../v5_1/work_item_tracking_process/models.py | 24 +- .../models.py | 6 +- ...k_item_tracking_process_template_client.py | 28 +- 48 files changed, 2886 insertions(+), 392 deletions(-) create mode 100644 azure-devops/azure/devops/v5_1/cix/__init__.py create mode 100644 azure-devops/azure/devops/v5_1/cix/cix_client.py create mode 100644 azure-devops/azure/devops/v5_1/cix/models.py create mode 100644 azure-devops/azure/devops/v5_1/pipelines/__init__.py create mode 100644 azure-devops/azure/devops/v5_1/pipelines/models.py create mode 100644 azure-devops/azure/devops/v5_1/pipelines/pipelines_client.py diff --git a/azure-devops/azure/devops/v5_1/build/__init__.py b/azure-devops/azure/devops/v5_1/build/__init__.py index 769eb009..b9cb53c4 100644 --- a/azure-devops/azure/devops/v5_1/build/__init__.py +++ b/azure-devops/azure/devops/v5_1/build/__init__.py @@ -11,6 +11,7 @@ __all__ = [ 'AgentPoolQueue', + 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', diff --git a/azure-devops/azure/devops/v5_1/build/models.py b/azure-devops/azure/devops/v5_1/build/models.py index 419e5b05..31f30e54 100644 --- a/azure-devops/azure/devops/v5_1/build/models.py +++ b/azure-devops/azure/devops/v5_1/build/models.py @@ -41,6 +41,22 @@ def __init__(self, _links=None, id=None, name=None, pool=None, url=None): self.url = url +class AgentSpecification(Model): + """AgentSpecification. + + :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): """AggregatedResultsAnalysis. @@ -318,6 +334,8 @@ class Build(Model): :param _links: :type _links: :class:`ReferenceLinks ` + :param agent_specification: The agent specification for the build. + :type agent_specification: :class:`AgentSpecification ` :param build_number: The build number/name of the build. :type build_number: str :param build_number_revision: The build number revision. @@ -406,6 +424,7 @@ class Build(Model): _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 @@ -1432,7 +1452,7 @@ class JsonPatchOperation(Model): :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 @@ -2963,6 +2983,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non __all__ = [ 'AgentPoolQueue', + 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', diff --git a/azure-devops/azure/devops/v5_1/cix/__init__.py b/azure-devops/azure/devops/v5_1/cix/__init__.py new file mode 100644 index 00000000..bf3d8afc --- /dev/null +++ b/azure-devops/azure/devops/v5_1/cix/__init__.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# Generated file, DO NOT EDIT +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------------------------- + +from .models import * +from .cix_client import CixClient + +__all__ = [ + 'ConfigurationFile', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'Operation', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', + 'ReferenceLinks', + 'TeamProject', + 'TeamProjectReference', + 'Template', + 'TemplateParameterDefinition', + 'TemplateParameters', + 'WebApiTeamRef', + 'CixClient' +] diff --git a/azure-devops/azure/devops/v5_1/cix/cix_client.py b/azure-devops/azure/devops/v5_1/cix/cix_client.py new file mode 100644 index 00000000..dff4428d --- /dev/null +++ b/azure-devops/azure/devops/v5_1/cix/cix_client.py @@ -0,0 +1,166 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# Generated file, DO NOT EDIT +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------------------------- + +from msrest import Serializer, Deserializer +from ...client import Client +from . import models + + +class CixClient(Client): + """Cix + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(CixClient, self).__init__(base_url, creds) + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + resource_area_identifier = None + + def get_configurations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None): + """GetConfigurations. + [Preview API] Gets a list of existing configuration files for the given repository. + :param str project: Project ID or project name + :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + :param str branch: The repository branch where to look for the configuration file. + :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + :rtype: [ConfigurationFile] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_type is not None: + query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if branch is not None: + query_parameters['branch'] = self._serialize.query('branch', branch, 'str') + if service_connection_id is not None: + query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') + response = self._send(http_method='GET', + location_id='8fc87684-9ebc-4c37-ab92-f4ac4a58cb3a', + version='5.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response)) + + def create_connection(self, create_connection_inputs): + """CreateConnection. + [Preview API] LEGACY METHOD - Obsolete Creates a new team project with the name provided if one does not already exist and then creates a new Pipeline connection within that project. Returns an Operation object that wraps the Job and provides status + :param :class:` ` create_connection_inputs: + :rtype: :class:` ` + """ + content = self._serialize.body(create_connection_inputs, 'CreatePipelineConnectionInputs') + response = self._send(http_method='POST', + location_id='00df4879-9216-45d5-b38d-4a487b626b2c', + version='5.1-preview.1', + content=content) + return self._deserialize('Operation', response) + + def create_project_connection(self, create_connection_inputs, project): + """CreateProjectConnection. + [Preview API] Creates a new team project with the name provided if one does not already exist and then creates a new Pipeline connection within that project. Returns an Operation object that wraps the Job and provides status + :param :class:` ` create_connection_inputs: + :param str project: + :rtype: :class:` ` + """ + query_parameters = {} + if project is not None: + query_parameters['project'] = self._serialize.query('project', project, 'str') + content = self._serialize.body(create_connection_inputs, 'CreatePipelineConnectionInputs') + response = self._send(http_method='POST', + location_id='00df4879-9216-45d5-b38d-4a487b626b2c', + version='5.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('PipelineConnection', response) + + def get_detected_build_frameworks(self, project, repository_type=None, repository_id=None, branch=None, detection_type=None, service_connection_id=None): + """GetDetectedBuildFrameworks. + [Preview API] Returns a list of build frameworks that best match the given repository based on its contents. + :param str project: Project ID or project name + :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + :param str branch: The repository branch to detect build frameworks for. + :param str detection_type: + :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + :rtype: [DetectedBuildFramework] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_type is not None: + query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if branch is not None: + query_parameters['branch'] = self._serialize.query('branch', branch, 'str') + if detection_type is not None: + query_parameters['detectionType'] = self._serialize.query('detection_type', detection_type, 'str') + if service_connection_id is not None: + query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') + response = self._send(http_method='GET', + location_id='29a30bab-9efb-4652-bf1b-9269baca0980', + version='5.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) + + def get_template_recommendations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None): + """GetTemplateRecommendations. + [Preview API] Returns a list of all YAML templates with weighting based on which would best fit the given repository. + :param str project: Project ID or project name + :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + :param str branch: The repository branch which to find matching templates for. + :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + :rtype: [Template] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_type is not None: + query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if branch is not None: + query_parameters['branch'] = self._serialize.query('branch', branch, 'str') + if service_connection_id is not None: + query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') + response = self._send(http_method='GET', + location_id='63ea8f13-b563-4be7-bc31-3a96eda27220', + version='5.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Template]', self._unwrap_collection(response)) + + def render_template(self, template_parameters, template_id): + """RenderTemplate. + [Preview API] + :param :class:` ` template_parameters: + :param str template_id: + :rtype: :class:`