Skip to content
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
3 changes: 3 additions & 0 deletions azure-devops/azure/devops/v5_1/cix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

__all__ = [
'ConfigurationFile',
'CreatedResources',
'CreatePipelineConnectionInputs',
'DetectedBuildFramework',
'DetectedBuildTarget',
Expand All @@ -19,9 +20,11 @@
'OperationResultReference',
'PipelineConnection',
'ReferenceLinks',
'ResourceCreationParameter',
'TeamProject',
'TeamProjectReference',
'Template',
'TemplateAsset',
'TemplateParameterDefinition',
'TemplateParameters',
'WebApiTeamRef',
Expand Down
33 changes: 19 additions & 14 deletions azure-devops/azure/devops/v5_1/cix/cix_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,9 @@ def get_configurations(self, project, repository_type=None, repository_id=None,
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
[Preview API] Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created.
: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>`
Expand Down Expand Up @@ -146,6 +133,24 @@ def get_template_recommendations(self, project, repository_type=None, repository
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:`<CreatedResources> <azure.devops.v5_1.cix.models.CreatedResources>`
"""
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='5.1-preview.1',
route_values=route_values,
content=content)
return self._deserialize('CreatedResources', response)

def render_template(self, template_parameters, template_id):
"""RenderTemplate.
[Preview API]
Expand Down
121 changes: 92 additions & 29 deletions azure-devops/azure/devops/v5_1/cix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,29 @@ def __init__(self, content=None, is_base64_encoded=None, path=None):
self.path = path


class CreatedResources(Model):
"""CreatedResources.

:param error:
:type error: str
:param resources:
:type resources: dict
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'str'},
'resources': {'key': 'resources', 'type': '{object}'}
}

def __init__(self, error=None, resources=None):
super(CreatedResources, self).__init__()
self.error = error
self.resources = resources


class CreatePipelineConnectionInputs(Model):
"""CreatePipelineConnectionInputs.

:param configuration_file_path: The path to the VSTS YAML file in the repository. (use only forward slashes as path separators)
:type configuration_file_path: str
:param create_build_definition: Use true to create a build definition for this connection. Requires repository information be supplied.
:type create_build_definition: bool
:param project: The team project settings for an existing team project or for a new team project.
:type project: :class:`TeamProject <azure.devops.v5_1.pipelines.models.TeamProject>`
: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.
Expand All @@ -48,45 +64,25 @@ class CreatePipelineConnectionInputs(Model):
:type provider_id: str
: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.
:type redirect_url: str
:param repository_id: The repository id for which the connection is being made. This may be the same as the name.
:type repository_id: str
:param repository_name: The repository name for which the connection is being made.
:type repository_name: str
:param request_source: Where the request to create the pipeline originated (such as 'GitHub Marketplace' or 'Azure DevOps')
:type request_source: str
:param routing_method: The method used to identify the target hostd.
:type routing_method: object
:param target_branch: The target branch for which the connection is being made.
:type target_branch: str
"""

_attribute_map = {
'configuration_file_path': {'key': 'configurationFilePath', 'type': 'str'},
'create_build_definition': {'key': 'createBuildDefinition', 'type': 'bool'},
'project': {'key': 'project', 'type': 'TeamProject'},
'provider_data': {'key': 'providerData', 'type': '{str}'},
'provider_id': {'key': 'providerId', 'type': 'str'},
'redirect_url': {'key': 'redirectUrl', 'type': 'str'},
'repository_id': {'key': 'repositoryId', 'type': 'str'},
'repository_name': {'key': 'repositoryName', 'type': 'str'},
'request_source': {'key': 'requestSource', 'type': 'str'},
'routing_method': {'key': 'routingMethod', 'type': 'object'},
'target_branch': {'key': 'targetBranch', 'type': 'str'}
'request_source': {'key': 'requestSource', 'type': 'str'}
}

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):
def __init__(self, project=None, provider_data=None, provider_id=None, redirect_url=None, request_source=None):
super(CreatePipelineConnectionInputs, self).__init__()
self.configuration_file_path = configuration_file_path
self.create_build_definition = create_build_definition
self.project = project
self.provider_data = provider_data
self.provider_id = provider_id
self.redirect_url = redirect_url
self.repository_id = repository_id
self.repository_name = repository_name
self.request_source = request_source
self.routing_method = routing_method
self.target_branch = target_branch


class DetectedBuildFramework(Model):
Expand Down Expand Up @@ -233,6 +229,26 @@ def __init__(self, links=None):
self.links = links


class ResourceCreationParameter(Model):
"""ResourceCreationParameter.

:param resource_to_create:
:type resource_to_create: :class:`object <azure.devops.v5_1.pipelines.models.object>`
:param type:
:type type: str
"""

_attribute_map = {
'resource_to_create': {'key': 'resourceToCreate', 'type': 'object'},
'type': {'key': 'type', 'type': 'str'}
}

def __init__(self, resource_to_create=None, type=None):
super(ResourceCreationParameter, self).__init__()
self.resource_to_create = resource_to_create
self.type = type


class TeamProjectReference(Model):
"""TeamProjectReference.

Expand Down Expand Up @@ -288,6 +304,8 @@ def __init__(self, abbreviation=None, default_team_image_url=None, description=N
class Template(Model):
"""Template.

:param assets:
:type assets: list of :class:`TemplateAsset <azure.devops.v5_1.pipelines.models.TemplateAsset>`
:param content:
:type content: str
:param description:
Expand All @@ -305,6 +323,7 @@ class Template(Model):
"""

_attribute_map = {
'assets': {'key': 'assets', 'type': '[TemplateAsset]'},
'content': {'key': 'content', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'icon_url': {'key': 'iconUrl', 'type': 'str'},
Expand All @@ -314,8 +333,9 @@ class Template(Model):
'recommended_weight': {'key': 'recommendedWeight', 'type': 'int'}
}

def __init__(self, content=None, description=None, icon_url=None, id=None, name=None, parameters=None, recommended_weight=None):
def __init__(self, assets=None, content=None, description=None, icon_url=None, id=None, name=None, parameters=None, recommended_weight=None):
super(Template, self).__init__()
self.assets = assets
self.content = content
self.description = description
self.icon_url = icon_url
Expand All @@ -325,9 +345,45 @@ def __init__(self, content=None, description=None, icon_url=None, id=None, name=
self.recommended_weight = recommended_weight


class TemplateAsset(Model):
"""TemplateAsset.

:param content:
:type content: str
:param description:
:type description: str
:param destination_path:
:type destination_path: str
:param path:
:type path: str
:param type:
:type type: str
"""

_attribute_map = {
'content': {'key': 'content', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'destination_path': {'key': 'destinationPath', 'type': 'str'},
'path': {'key': 'path', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'}
}

def __init__(self, content=None, description=None, destination_path=None, path=None, type=None):
super(TemplateAsset, self).__init__()
self.content = content
self.description = description
self.destination_path = destination_path
self.path = path
self.type = type


class TemplateParameterDefinition(Model):
"""TemplateParameterDefinition.

:param default_value:
:type default_value: str
:param display_name:
:type display_name: str
:param name:
:type name: str
:param required:
Expand All @@ -337,13 +393,17 @@ class TemplateParameterDefinition(Model):
"""

_attribute_map = {
'default_value': {'key': 'defaultValue', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'required': {'key': 'required', 'type': 'bool'},
'type': {'key': 'type', 'type': 'str'}
}

def __init__(self, name=None, required=None, type=None):
def __init__(self, default_value=None, display_name=None, name=None, required=None, type=None):
super(TemplateParameterDefinition, self).__init__()
self.default_value = default_value
self.display_name = display_name
self.name = name
self.required = required
self.type = type
Expand All @@ -357,7 +417,7 @@ class TemplateParameters(Model):
"""

_attribute_map = {
'tokens': {'key': 'tokens', 'type': '{str}'}
'tokens': {'key': 'tokens', 'type': '{object}'}
}

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

__all__ = [
'ConfigurationFile',
'CreatedResources',
'CreatePipelineConnectionInputs',
'DetectedBuildFramework',
'DetectedBuildTarget',
'OperationReference',
'OperationResultReference',
'PipelineConnection',
'ReferenceLinks',
'ResourceCreationParameter',
'TeamProjectReference',
'Template',
'TemplateAsset',
'TemplateParameterDefinition',
'TemplateParameters',
'WebApiTeamRef',
Expand Down
7 changes: 7 additions & 0 deletions azure-devops/azure/devops/v5_1/client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ def get_test_client(self):
"""
return self._connection.get_client('azure.devops.v5_1.test.test_client.TestClient')

def get_test_plan_client(self):
"""get_test_plan_client.
Gets the 5.1 version of the TestPlanClient
:rtype: :class:`<TestPlanClient> <azure.devops.v5_1.test_plan.test_plan_client.TestPlanClient>`
"""
return self._connection.get_client('azure.devops.v5_1.test_plan.test_plan_client.TestPlanClient')

def get_tfvc_client(self):
"""get_tfvc_client.
Gets the 5.1 version of the TfvcClient
Expand Down
Loading