Skip to content

Commit de4e5c6

Browse files
authored
Merge pull request #191 from Microsoft/dev
M149 Update
2 parents 45ab7a1 + f592060 commit de4e5c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2888
-415
lines changed

azure-devops/azure/devops/v5_0/work_item_tracking_process_template/work_item_tracking_process_template_client.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,6 @@ def get_behaviors(self, process_id):
6060
route_values=route_values)
6161
return self._deserialize('[AdminBehavior]', self._unwrap_collection(response))
6262

63-
def check_template_existence(self, upload_stream, **kwargs):
64-
"""CheckTemplateExistence.
65-
[Preview API] Check if process template exists.
66-
:param object upload_stream: Stream to upload
67-
:rtype: :class:`<CheckTemplateExistenceResult> <azure.devops.v5_0.work_item_tracking_process_template.models.CheckTemplateExistenceResult>`
68-
"""
69-
route_values = {}
70-
route_values['action'] = 'CheckTemplateExistence'
71-
if "callback" in kwargs:
72-
callback = kwargs["callback"]
73-
else:
74-
callback = None
75-
content = self._client.stream_upload(upload_stream, callback=callback)
76-
response = self._send(http_method='POST',
77-
location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759',
78-
version='5.0-preview.1',
79-
route_values=route_values,
80-
content=content,
81-
media_type='application/octet-stream')
82-
return self._deserialize('CheckTemplateExistenceResult', response)
83-
8463
def export_process_template(self, id, **kwargs):
8564
"""ExportProcessTemplate.
8665
[Preview API] Returns requested process template.

azure-devops/azure/devops/v5_1/build/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
__all__ = [
1313
'AgentPoolQueue',
14+
'AgentSpecification',
1415
'AggregatedResultsAnalysis',
1516
'AggregatedResultsByOutcome',
1617
'AggregatedResultsDifference',

azure-devops/azure/devops/v5_1/build/models.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ def __init__(self, _links=None, id=None, name=None, pool=None, url=None):
4141
self.url = url
4242

4343

44+
class AgentSpecification(Model):
45+
"""AgentSpecification.
46+
47+
:param identifier: Agent specification unique identifier.
48+
:type identifier: str
49+
"""
50+
51+
_attribute_map = {
52+
'identifier': {'key': 'identifier', 'type': 'str'}
53+
}
54+
55+
def __init__(self, identifier=None):
56+
super(AgentSpecification, self).__init__()
57+
self.identifier = identifier
58+
59+
4460
class AggregatedResultsAnalysis(Model):
4561
"""AggregatedResultsAnalysis.
4662
@@ -318,6 +334,8 @@ class Build(Model):
318334
319335
:param _links:
320336
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.build.models.ReferenceLinks>`
337+
:param agent_specification: The agent specification for the build.
338+
:type agent_specification: :class:`AgentSpecification <azure.devops.v5_1.build.models.AgentSpecification>`
321339
:param build_number: The build number/name of the build.
322340
:type build_number: str
323341
:param build_number_revision: The build number revision.
@@ -406,6 +424,7 @@ class Build(Model):
406424

407425
_attribute_map = {
408426
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
427+
'agent_specification': {'key': 'agentSpecification', 'type': 'AgentSpecification'},
409428
'build_number': {'key': 'buildNumber', 'type': 'str'},
410429
'build_number_revision': {'key': 'buildNumberRevision', 'type': 'int'},
411430
'controller': {'key': 'controller', 'type': 'BuildController'},
@@ -450,9 +469,10 @@ class Build(Model):
450469
'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'}
451470
}
452471

453-
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):
472+
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):
454473
super(Build, self).__init__()
455474
self._links = _links
475+
self.agent_specification = agent_specification
456476
self.build_number = build_number
457477
self.build_number_revision = build_number_revision
458478
self.controller = controller
@@ -1432,7 +1452,7 @@ class JsonPatchOperation(Model):
14321452
:type from_: str
14331453
:param op: The patch operation
14341454
:type op: object
1435-
:param path: The path for the operation
1455+
: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/-).
14361456
:type path: str
14371457
:param value: The value for the operation. This is either a primitive or a JToken.
14381458
:type value: object
@@ -2963,6 +2983,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non
29632983

29642984
__all__ = [
29652985
'AgentPoolQueue',
2986+
'AgentSpecification',
29662987
'AggregatedResultsAnalysis',
29672988
'AggregatedResultsByOutcome',
29682989
'AggregatedResultsDifference',
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
from .models import *
10+
from .cix_client import CixClient
11+
12+
__all__ = [
13+
'ConfigurationFile',
14+
'CreatePipelineConnectionInputs',
15+
'DetectedBuildFramework',
16+
'DetectedBuildTarget',
17+
'Operation',
18+
'OperationReference',
19+
'OperationResultReference',
20+
'PipelineConnection',
21+
'ReferenceLinks',
22+
'TeamProject',
23+
'TeamProjectReference',
24+
'Template',
25+
'TemplateParameterDefinition',
26+
'TemplateParameters',
27+
'WebApiTeamRef',
28+
'CixClient'
29+
]
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
from msrest import Serializer, Deserializer
10+
from ...client import Client
11+
from . import models
12+
13+
14+
class CixClient(Client):
15+
"""Cix
16+
:param str base_url: Service URL
17+
:param Authentication creds: Authenticated credentials.
18+
"""
19+
20+
def __init__(self, base_url=None, creds=None):
21+
super(CixClient, self).__init__(base_url, creds)
22+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
23+
self._serialize = Serializer(client_models)
24+
self._deserialize = Deserializer(client_models)
25+
26+
resource_area_identifier = None
27+
28+
def get_configurations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None):
29+
"""GetConfigurations.
30+
[Preview API] Gets a list of existing configuration files for the given repository.
31+
:param str project: Project ID or project name
32+
:param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc.
33+
: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)
34+
:param str branch: The repository branch where to look for the configuration file.
35+
: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).
36+
:rtype: [ConfigurationFile]
37+
"""
38+
route_values = {}
39+
if project is not None:
40+
route_values['project'] = self._serialize.url('project', project, 'str')
41+
query_parameters = {}
42+
if repository_type is not None:
43+
query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str')
44+
if repository_id is not None:
45+
query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str')
46+
if branch is not None:
47+
query_parameters['branch'] = self._serialize.query('branch', branch, 'str')
48+
if service_connection_id is not None:
49+
query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str')
50+
response = self._send(http_method='GET',
51+
location_id='8fc87684-9ebc-4c37-ab92-f4ac4a58cb3a',
52+
version='5.1-preview.1',
53+
route_values=route_values,
54+
query_parameters=query_parameters)
55+
return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response))
56+
57+
def create_connection(self, create_connection_inputs):
58+
"""CreateConnection.
59+
[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
60+
:param :class:`<CreatePipelineConnectionInputs> <azure.devops.v5_1.cix.models.CreatePipelineConnectionInputs>` create_connection_inputs:
61+
:rtype: :class:`<Operation> <azure.devops.v5_1.cix.models.Operation>`
62+
"""
63+
content = self._serialize.body(create_connection_inputs, 'CreatePipelineConnectionInputs')
64+
response = self._send(http_method='POST',
65+
location_id='00df4879-9216-45d5-b38d-4a487b626b2c',
66+
version='5.1-preview.1',
67+
content=content)
68+
return self._deserialize('Operation', response)
69+
70+
def create_project_connection(self, create_connection_inputs, project):
71+
"""CreateProjectConnection.
72+
[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
73+
:param :class:`<CreatePipelineConnectionInputs> <azure.devops.v5_1.cix.models.CreatePipelineConnectionInputs>` create_connection_inputs:
74+
:param str project:
75+
:rtype: :class:`<PipelineConnection> <azure.devops.v5_1.cix.models.PipelineConnection>`
76+
"""
77+
query_parameters = {}
78+
if project is not None:
79+
query_parameters['project'] = self._serialize.query('project', project, 'str')
80+
content = self._serialize.body(create_connection_inputs, 'CreatePipelineConnectionInputs')
81+
response = self._send(http_method='POST',
82+
location_id='00df4879-9216-45d5-b38d-4a487b626b2c',
83+
version='5.1-preview.1',
84+
query_parameters=query_parameters,
85+
content=content)
86+
return self._deserialize('PipelineConnection', response)
87+
88+
def get_detected_build_frameworks(self, project, repository_type=None, repository_id=None, branch=None, detection_type=None, service_connection_id=None):
89+
"""GetDetectedBuildFrameworks.
90+
[Preview API] Returns a list of build frameworks that best match the given repository based on its contents.
91+
:param str project: Project ID or project name
92+
:param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc.
93+
: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)
94+
:param str branch: The repository branch to detect build frameworks for.
95+
:param str detection_type:
96+
: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).
97+
:rtype: [DetectedBuildFramework]
98+
"""
99+
route_values = {}
100+
if project is not None:
101+
route_values['project'] = self._serialize.url('project', project, 'str')
102+
query_parameters = {}
103+
if repository_type is not None:
104+
query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str')
105+
if repository_id is not None:
106+
query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str')
107+
if branch is not None:
108+
query_parameters['branch'] = self._serialize.query('branch', branch, 'str')
109+
if detection_type is not None:
110+
query_parameters['detectionType'] = self._serialize.query('detection_type', detection_type, 'str')
111+
if service_connection_id is not None:
112+
query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str')
113+
response = self._send(http_method='GET',
114+
location_id='29a30bab-9efb-4652-bf1b-9269baca0980',
115+
version='5.1-preview.1',
116+
route_values=route_values,
117+
query_parameters=query_parameters)
118+
return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response))
119+
120+
def get_template_recommendations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None):
121+
"""GetTemplateRecommendations.
122+
[Preview API] Returns a list of all YAML templates with weighting based on which would best fit the given repository.
123+
:param str project: Project ID or project name
124+
:param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc.
125+
: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)
126+
:param str branch: The repository branch which to find matching templates for.
127+
: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).
128+
:rtype: [Template]
129+
"""
130+
route_values = {}
131+
if project is not None:
132+
route_values['project'] = self._serialize.url('project', project, 'str')
133+
query_parameters = {}
134+
if repository_type is not None:
135+
query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str')
136+
if repository_id is not None:
137+
query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str')
138+
if branch is not None:
139+
query_parameters['branch'] = self._serialize.query('branch', branch, 'str')
140+
if service_connection_id is not None:
141+
query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str')
142+
response = self._send(http_method='GET',
143+
location_id='63ea8f13-b563-4be7-bc31-3a96eda27220',
144+
version='5.1-preview.1',
145+
route_values=route_values,
146+
query_parameters=query_parameters)
147+
return self._deserialize('[Template]', self._unwrap_collection(response))
148+
149+
def render_template(self, template_parameters, template_id):
150+
"""RenderTemplate.
151+
[Preview API]
152+
:param :class:`<TemplateParameters> <azure.devops.v5_1.cix.models.TemplateParameters>` template_parameters:
153+
:param str template_id:
154+
:rtype: :class:`<Template> <azure.devops.v5_1.cix.models.Template>`
155+
"""
156+
route_values = {}
157+
if template_id is not None:
158+
route_values['templateId'] = self._serialize.url('template_id', template_id, 'str')
159+
content = self._serialize.body(template_parameters, 'TemplateParameters')
160+
response = self._send(http_method='POST',
161+
location_id='eb5d6d1d-98a2-4bbd-9028-f9a6b2d66515',
162+
version='5.1-preview.1',
163+
route_values=route_values,
164+
content=content)
165+
return self._deserialize('Template', response)
166+

0 commit comments

Comments
 (0)