|
| 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