Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update 5.1 apis to M149 #189

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-devops/azure/devops/v5_1/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

__all__ = [
'AgentPoolQueue',
'AgentSpecification',
'AggregatedResultsAnalysis',
'AggregatedResultsByOutcome',
'AggregatedResultsDifference',
Expand Down
25 changes: 23 additions & 2 deletions azure-devops/azure/devops/v5_1/build/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -318,6 +334,8 @@ class Build(Model):

:param _links:
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.build.models.ReferenceLinks>`
:param agent_specification: The agent specification for the build.
:type agent_specification: :class:`AgentSpecification <azure.devops.v5_1.build.models.AgentSpecification>`
:param build_number: The build number/name of the build.
:type build_number: str
:param build_number_revision: The build number revision.
Expand Down Expand Up @@ -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'},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2963,6 +2983,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non

__all__ = [
'AgentPoolQueue',
'AgentSpecification',
'AggregatedResultsAnalysis',
'AggregatedResultsByOutcome',
'AggregatedResultsDifference',
Expand Down
29 changes: 29 additions & 0 deletions azure-devops/azure/devops/v5_1/cix/__init__.py
Original file line number Diff line number Diff line change
@@ -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'
]
166 changes: 166 additions & 0 deletions azure-devops/azure/devops/v5_1/cix/cix_client.py
Original file line number Diff line number Diff line change
@@ -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:`<CreatePipelineConnectionInputs> <azure.devops.v5_1.cix.models.CreatePipelineConnectionInputs>` create_connection_inputs:
:rtype: :class:`<Operation> <azure.devops.v5_1.cix.models.Operation>`
"""
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:`<CreatePipelineConnectionInputs> <azure.devops.v5_1.cix.models.CreatePipelineConnectionInputs>` create_connection_inputs:
:param str project:
:rtype: :class:`<PipelineConnection> <azure.devops.v5_1.cix.models.PipelineConnection>`
"""
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:`<TemplateParameters> <azure.devops.v5_1.cix.models.TemplateParameters>` template_parameters:
:param str template_id:
:rtype: :class:`<Template> <azure.devops.v5_1.cix.models.Template>`
"""
route_values = {}
if template_id is not None:
route_values['templateId'] = self._serialize.url('template_id', template_id, 'str')
content = self._serialize.body(template_parameters, 'TemplateParameters')
response = self._send(http_method='POST',
location_id='eb5d6d1d-98a2-4bbd-9028-f9a6b2d66515',
version='5.1-preview.1',
route_values=route_values,
content=content)
return self._deserialize('Template', response)

Loading