Skip to content

Commit b5db5ac

Browse files
authored
Merge pull request #207 from Microsoft/dev
regen 5.1 from M150
2 parents 174ecbe + b9fb46a commit b5db5ac

31 files changed

+3215
-211
lines changed

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

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

1212
__all__ = [
1313
'ConfigurationFile',
14+
'CreatedResources',
1415
'CreatePipelineConnectionInputs',
1516
'DetectedBuildFramework',
1617
'DetectedBuildTarget',
@@ -19,9 +20,11 @@
1920
'OperationResultReference',
2021
'PipelineConnection',
2122
'ReferenceLinks',
23+
'ResourceCreationParameter',
2224
'TeamProject',
2325
'TeamProjectReference',
2426
'Template',
27+
'TemplateAsset',
2528
'TemplateParameterDefinition',
2629
'TemplateParameters',
2730
'WebApiTeamRef',

azure-devops/azure/devops/v5_1/cix/cix_client.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,9 @@ def get_configurations(self, project, repository_type=None, repository_id=None,
5454
query_parameters=query_parameters)
5555
return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response))
5656

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-
7057
def create_project_connection(self, create_connection_inputs, project):
7158
"""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
59+
[Preview API] Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created.
7360
:param :class:`<CreatePipelineConnectionInputs> <azure.devops.v5_1.cix.models.CreatePipelineConnectionInputs>` create_connection_inputs:
7461
:param str project:
7562
:rtype: :class:`<PipelineConnection> <azure.devops.v5_1.cix.models.PipelineConnection>`
@@ -146,6 +133,24 @@ def get_template_recommendations(self, project, repository_type=None, repository
146133
query_parameters=query_parameters)
147134
return self._deserialize('[Template]', self._unwrap_collection(response))
148135

136+
def create_resources(self, creation_parameters, project):
137+
"""CreateResources.
138+
[Preview API]
139+
:param {ResourceCreationParameter} creation_parameters:
140+
:param str project: Project ID or project name
141+
:rtype: :class:`<CreatedResources> <azure.devops.v5_1.cix.models.CreatedResources>`
142+
"""
143+
route_values = {}
144+
if project is not None:
145+
route_values['project'] = self._serialize.url('project', project, 'str')
146+
content = self._serialize.body(creation_parameters, '{ResourceCreationParameter}')
147+
response = self._send(http_method='POST',
148+
location_id='43201899-7690-4870-9c79-ab69605f21ed',
149+
version='5.1-preview.1',
150+
route_values=route_values,
151+
content=content)
152+
return self._deserialize('CreatedResources', response)
153+
149154
def render_template(self, template_parameters, template_id):
150155
"""RenderTemplate.
151156
[Preview API]

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

Lines changed: 92 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,29 @@ def __init__(self, content=None, is_base64_encoded=None, path=None):
3333
self.path = path
3434

3535

36+
class CreatedResources(Model):
37+
"""CreatedResources.
38+
39+
:param error:
40+
:type error: str
41+
:param resources:
42+
:type resources: dict
43+
"""
44+
45+
_attribute_map = {
46+
'error': {'key': 'error', 'type': 'str'},
47+
'resources': {'key': 'resources', 'type': '{object}'}
48+
}
49+
50+
def __init__(self, error=None, resources=None):
51+
super(CreatedResources, self).__init__()
52+
self.error = error
53+
self.resources = resources
54+
55+
3656
class CreatePipelineConnectionInputs(Model):
3757
"""CreatePipelineConnectionInputs.
3858
39-
:param configuration_file_path: The path to the VSTS YAML file in the repository. (use only forward slashes as path separators)
40-
:type configuration_file_path: str
41-
:param create_build_definition: Use true to create a build definition for this connection. Requires repository information be supplied.
42-
:type create_build_definition: bool
4359
:param project: The team project settings for an existing team project or for a new team project.
4460
:type project: :class:`TeamProject <azure.devops.v5_1.pipelines.models.TeamProject>`
4561
:param provider_data: This dictionary contains information that is specific to the provider. This data is opaque to the rest of the Pipelines infrastructure and does NOT contribute to the resources Token. The format of the string and its contents depend on the implementation of the provider.
@@ -48,45 +64,25 @@ class CreatePipelineConnectionInputs(Model):
4864
:type provider_id: str
4965
:param redirect_url: If provided, this will be the URL returned with the PipelineConnection. This will override any other redirect URL that would have been generated for the connection.
5066
:type redirect_url: str
51-
:param repository_id: The repository id for which the connection is being made. This may be the same as the name.
52-
:type repository_id: str
53-
:param repository_name: The repository name for which the connection is being made.
54-
:type repository_name: str
5567
:param request_source: Where the request to create the pipeline originated (such as 'GitHub Marketplace' or 'Azure DevOps')
5668
:type request_source: str
57-
:param routing_method: The method used to identify the target hostd.
58-
:type routing_method: object
59-
:param target_branch: The target branch for which the connection is being made.
60-
:type target_branch: str
6169
"""
6270

6371
_attribute_map = {
64-
'configuration_file_path': {'key': 'configurationFilePath', 'type': 'str'},
65-
'create_build_definition': {'key': 'createBuildDefinition', 'type': 'bool'},
6672
'project': {'key': 'project', 'type': 'TeamProject'},
6773
'provider_data': {'key': 'providerData', 'type': '{str}'},
6874
'provider_id': {'key': 'providerId', 'type': 'str'},
6975
'redirect_url': {'key': 'redirectUrl', 'type': 'str'},
70-
'repository_id': {'key': 'repositoryId', 'type': 'str'},
71-
'repository_name': {'key': 'repositoryName', 'type': 'str'},
72-
'request_source': {'key': 'requestSource', 'type': 'str'},
73-
'routing_method': {'key': 'routingMethod', 'type': 'object'},
74-
'target_branch': {'key': 'targetBranch', 'type': 'str'}
76+
'request_source': {'key': 'requestSource', 'type': 'str'}
7577
}
7678

77-
def __init__(self, configuration_file_path=None, create_build_definition=None, project=None, provider_data=None, provider_id=None, redirect_url=None, repository_id=None, repository_name=None, request_source=None, routing_method=None, target_branch=None):
79+
def __init__(self, project=None, provider_data=None, provider_id=None, redirect_url=None, request_source=None):
7880
super(CreatePipelineConnectionInputs, self).__init__()
79-
self.configuration_file_path = configuration_file_path
80-
self.create_build_definition = create_build_definition
8181
self.project = project
8282
self.provider_data = provider_data
8383
self.provider_id = provider_id
8484
self.redirect_url = redirect_url
85-
self.repository_id = repository_id
86-
self.repository_name = repository_name
8785
self.request_source = request_source
88-
self.routing_method = routing_method
89-
self.target_branch = target_branch
9086

9187

9288
class DetectedBuildFramework(Model):
@@ -233,6 +229,26 @@ def __init__(self, links=None):
233229
self.links = links
234230

235231

232+
class ResourceCreationParameter(Model):
233+
"""ResourceCreationParameter.
234+
235+
:param resource_to_create:
236+
:type resource_to_create: :class:`object <azure.devops.v5_1.pipelines.models.object>`
237+
:param type:
238+
:type type: str
239+
"""
240+
241+
_attribute_map = {
242+
'resource_to_create': {'key': 'resourceToCreate', 'type': 'object'},
243+
'type': {'key': 'type', 'type': 'str'}
244+
}
245+
246+
def __init__(self, resource_to_create=None, type=None):
247+
super(ResourceCreationParameter, self).__init__()
248+
self.resource_to_create = resource_to_create
249+
self.type = type
250+
251+
236252
class TeamProjectReference(Model):
237253
"""TeamProjectReference.
238254
@@ -288,6 +304,8 @@ def __init__(self, abbreviation=None, default_team_image_url=None, description=N
288304
class Template(Model):
289305
"""Template.
290306
307+
:param assets:
308+
:type assets: list of :class:`TemplateAsset <azure.devops.v5_1.pipelines.models.TemplateAsset>`
291309
:param content:
292310
:type content: str
293311
:param description:
@@ -305,6 +323,7 @@ class Template(Model):
305323
"""
306324

307325
_attribute_map = {
326+
'assets': {'key': 'assets', 'type': '[TemplateAsset]'},
308327
'content': {'key': 'content', 'type': 'str'},
309328
'description': {'key': 'description', 'type': 'str'},
310329
'icon_url': {'key': 'iconUrl', 'type': 'str'},
@@ -314,8 +333,9 @@ class Template(Model):
314333
'recommended_weight': {'key': 'recommendedWeight', 'type': 'int'}
315334
}
316335

317-
def __init__(self, content=None, description=None, icon_url=None, id=None, name=None, parameters=None, recommended_weight=None):
336+
def __init__(self, assets=None, content=None, description=None, icon_url=None, id=None, name=None, parameters=None, recommended_weight=None):
318337
super(Template, self).__init__()
338+
self.assets = assets
319339
self.content = content
320340
self.description = description
321341
self.icon_url = icon_url
@@ -325,9 +345,45 @@ def __init__(self, content=None, description=None, icon_url=None, id=None, name=
325345
self.recommended_weight = recommended_weight
326346

327347

348+
class TemplateAsset(Model):
349+
"""TemplateAsset.
350+
351+
:param content:
352+
:type content: str
353+
:param description:
354+
:type description: str
355+
:param destination_path:
356+
:type destination_path: str
357+
:param path:
358+
:type path: str
359+
:param type:
360+
:type type: str
361+
"""
362+
363+
_attribute_map = {
364+
'content': {'key': 'content', 'type': 'str'},
365+
'description': {'key': 'description', 'type': 'str'},
366+
'destination_path': {'key': 'destinationPath', 'type': 'str'},
367+
'path': {'key': 'path', 'type': 'str'},
368+
'type': {'key': 'type', 'type': 'str'}
369+
}
370+
371+
def __init__(self, content=None, description=None, destination_path=None, path=None, type=None):
372+
super(TemplateAsset, self).__init__()
373+
self.content = content
374+
self.description = description
375+
self.destination_path = destination_path
376+
self.path = path
377+
self.type = type
378+
379+
328380
class TemplateParameterDefinition(Model):
329381
"""TemplateParameterDefinition.
330382
383+
:param default_value:
384+
:type default_value: str
385+
:param display_name:
386+
:type display_name: str
331387
:param name:
332388
:type name: str
333389
:param required:
@@ -337,13 +393,17 @@ class TemplateParameterDefinition(Model):
337393
"""
338394

339395
_attribute_map = {
396+
'default_value': {'key': 'defaultValue', 'type': 'str'},
397+
'display_name': {'key': 'displayName', 'type': 'str'},
340398
'name': {'key': 'name', 'type': 'str'},
341399
'required': {'key': 'required', 'type': 'bool'},
342400
'type': {'key': 'type', 'type': 'str'}
343401
}
344402

345-
def __init__(self, name=None, required=None, type=None):
403+
def __init__(self, default_value=None, display_name=None, name=None, required=None, type=None):
346404
super(TemplateParameterDefinition, self).__init__()
405+
self.default_value = default_value
406+
self.display_name = display_name
347407
self.name = name
348408
self.required = required
349409
self.type = type
@@ -357,7 +417,7 @@ class TemplateParameters(Model):
357417
"""
358418

359419
_attribute_map = {
360-
'tokens': {'key': 'tokens', 'type': '{str}'}
420+
'tokens': {'key': 'tokens', 'type': '{object}'}
361421
}
362422

363423
def __init__(self, tokens=None):
@@ -485,15 +545,18 @@ def __init__(self, abbreviation=None, default_team_image_url=None, description=N
485545

486546
__all__ = [
487547
'ConfigurationFile',
548+
'CreatedResources',
488549
'CreatePipelineConnectionInputs',
489550
'DetectedBuildFramework',
490551
'DetectedBuildTarget',
491552
'OperationReference',
492553
'OperationResultReference',
493554
'PipelineConnection',
494555
'ReferenceLinks',
556+
'ResourceCreationParameter',
495557
'TeamProjectReference',
496558
'Template',
559+
'TemplateAsset',
497560
'TemplateParameterDefinition',
498561
'TemplateParameters',
499562
'WebApiTeamRef',

azure-devops/azure/devops/v5_1/client_factory.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,13 @@ def get_test_client(self):
309309
"""
310310
return self._connection.get_client('azure.devops.v5_1.test.test_client.TestClient')
311311

312+
def get_test_plan_client(self):
313+
"""get_test_plan_client.
314+
Gets the 5.1 version of the TestPlanClient
315+
:rtype: :class:`<TestPlanClient> <azure.devops.v5_1.test_plan.test_plan_client.TestPlanClient>`
316+
"""
317+
return self._connection.get_client('azure.devops.v5_1.test_plan.test_plan_client.TestPlanClient')
318+
312319
def get_tfvc_client(self):
313320
"""get_tfvc_client.
314321
Gets the 5.1 version of the TfvcClient

0 commit comments

Comments
 (0)