diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 506d02d2..1a8023cc 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 5 matrix: - python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] steps: - uses: actions/checkout@v1 diff --git a/azure-devops/azure/devops/connection.py b/azure-devops/azure/devops/connection.py index 78d8f9cf..9c76e52a 100644 --- a/azure-devops/azure/devops/connection.py +++ b/azure-devops/azure/devops/connection.py @@ -10,9 +10,9 @@ from .client_configuration import ClientConfiguration from .exceptions import AzureDevOpsClientRequestError from .released.client_factory import ClientFactory -from .v5_1.location.location_client import LocationClient -from .v5_1.client_factory import ClientFactoryV5_1 -from .v6_0.client_factory import ClientFactoryV6_0 +from .v7_1.location.location_client import LocationClient +from .v7_1.client_factory import ClientFactoryV7_1 +from .v7_0.client_factory import ClientFactoryV7_0 logger = logging.getLogger(__name__) @@ -33,8 +33,8 @@ def __init__(self, base_url=None, creds=None, user_agent=None): self._creds = creds self._resource_areas = None self.clients = ClientFactory(self) - self.clients_v5_1 = ClientFactoryV5_1(self) - self.clients_v6_0 = ClientFactoryV6_0(self) + self.clients_v7_1 = ClientFactoryV7_1(self) + self.clients_v7_0 = ClientFactoryV7_0(self) self.use_fiddler = False def get_client(self, client_type): diff --git a/azure-devops/azure/devops/issue_tests/test_issue_268.py b/azure-devops/azure/devops/issue_tests/test_issue_268.py index b429db0b..820c414d 100644 --- a/azure-devops/azure/devops/issue_tests/test_issue_268.py +++ b/azure-devops/azure/devops/issue_tests/test_issue_268.py @@ -22,13 +22,13 @@ def text(self, encoding=None): class TestDeserialization(unittest.TestCase): # https://github.com/microsoft/azure-devops-python-api/issues/268 - def test_deserialization_issue_268_51(self): - from azure.devops.v5_1.task_agent import models + def test_deserialization_issue_268_71(self): + from azure.devops.v7_1.task_agent import models self._test_deserialization(models.__dict__.items(), _268_type, _268_json) # https://github.com/microsoft/azure-devops-python-api/issues/268 - def test_deserialization_issue_268_60(self): - from azure.devops.v6_0.task_agent import models + def test_deserialization_issue_268_70(self): + from azure.devops.v7_0.task_agent import models self._test_deserialization(models.__dict__.items(), _268_type, _268_json) @staticmethod diff --git a/azure-devops/azure/devops/released/accounts/__init__.py b/azure-devops/azure/devops/released/accounts/__init__.py index fdc7c5d3..8f80a8a6 100644 --- a/azure-devops/azure/devops/released/accounts/__init__.py +++ b/azure-devops/azure/devops/released/accounts/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.accounts.models import * +from ...v7_0.accounts.models import * from .accounts_client import AccountsClient __all__ = [ diff --git a/azure-devops/azure/devops/released/accounts/accounts_client.py b/azure-devops/azure/devops/released/accounts/accounts_client.py index 8376bf68..8bc8fbaf 100644 --- a/azure-devops/azure/devops/released/accounts/accounts_client.py +++ b/azure-devops/azure/devops/released/accounts/accounts_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.accounts import models +from ...v7_0.accounts import models class AccountsClient(Client): @@ -27,7 +27,7 @@ def __init__(self, base_url=None, creds=None): def get_accounts(self, owner_id=None, member_id=None, properties=None): """GetAccounts. - Get a list of accounts for a specific owner or a specific member. + Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: @@ -42,7 +42,7 @@ def get_accounts(self, owner_id=None, member_id=None, properties=None): query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/released/build/__init__.py b/azure-devops/azure/devops/released/build/__init__.py index c1f92f41..cc816e75 100644 --- a/azure-devops/azure/devops/released/build/__init__.py +++ b/azure-devops/azure/devops/released/build/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.build.models import * +from ...v7_0.build.models import * from .build_client import BuildClient __all__ = [ @@ -46,28 +46,41 @@ 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', + 'BuildRetentionHistory', + 'BuildRetentionSample', 'BuildSettings', - 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', + 'Change', 'IdentityRef', 'Issue', + 'JobReference', 'JsonPatchOperation', + 'MinimalRetentionLease', + 'NewRetentionLease', + 'PhaseReference', + 'PipelineGeneralSettings', + 'PipelineReference', 'ProcessParameters', + 'ProjectRetentionSetting', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', + 'RetentionLease', + 'RetentionLeaseUpdate', 'RetentionPolicy', + 'RetentionSetting', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', + 'StageReference', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', @@ -82,9 +95,14 @@ 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', + 'UpdateProjectRetentionSettingModel', + 'UpdateRetentionSettingModel', + 'UpdateStageParameters', + 'UpdateTagParameters', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', + 'YamlBuild', 'BuildClient' ] diff --git a/azure-devops/azure/devops/released/build/build_client.py b/azure-devops/azure/devops/released/build/build_client.py index 1c2e98b8..ac932efb 100644 --- a/azure-devops/azure/devops/released/build/build_client.py +++ b/azure-devops/azure/devops/released/build/build_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.build import models +from ...v7_0.build import models class BuildClient(Client): @@ -28,10 +28,10 @@ def __init__(self, base_url=None, creds=None): def create_artifact(self, artifact, project, build_id): """CreateArtifact. Associates an artifact with a build. - :param :class:` ` artifact: The artifact. + :param :class:` ` artifact: The artifact. :param str project: Project ID or project name :param int build_id: The ID of the build. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -41,7 +41,7 @@ def create_artifact(self, artifact, project, build_id): content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildArtifact', response) @@ -52,7 +52,7 @@ def get_artifact(self, project, build_id, artifact_name): :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -64,7 +64,7 @@ def get_artifact(self, project, build_id, artifact_name): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildArtifact', response) @@ -87,7 +87,7 @@ def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -111,7 +111,7 @@ def get_artifacts(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildArtifact]', self._unwrap_collection(response)) @@ -139,7 +139,7 @@ def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwarg query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -149,6 +149,109 @@ def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwarg callback = None return self._client.stream_download(response, callback=callback) + def get_attachments(self, project, build_id, type): + """GetAttachments. + Gets the list of attachments of a specific type that are associated with a build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :param str type: The type of attachment. + :rtype: [Attachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='f2192269-89fa-4f94-baf6-8fb128c55159', + version='7.0', + route_values=route_values) + return self._deserialize('[Attachment]', self._unwrap_collection(response)) + + def get_attachment(self, project, build_id, timeline_id, record_id, type, name, **kwargs): + """GetAttachment. + Gets a specific attachment. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :param str timeline_id: The ID of the timeline. + :param str record_id: The ID of the timeline record. + :param str type: The type of the attachment. + :param str name: The name of the attachment. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + response = self._send(http_method='GET', + location_id='af5122d3-3438-485e-a25a-2dbbfde84ee6', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def list_branches(self, project, provider_name, service_endpoint_id=None, repository=None, branch_name=None): + """ListBranches. + Gets a list of branches for the given source code repository. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. + :param str branch_name: If supplied, the name of the branch to check for specifically. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + if branch_name is not None: + query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') + response = self._send(http_method='GET', + location_id='e05d4403-9b81-4244-8763-20fde28d1976', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_retention_leases_for_build(self, project, build_id): + """GetRetentionLeasesForBuild. + Gets all retention leases that apply to a specific build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + response = self._send(http_method='GET', + location_id='3da19a6a-f088-45c4-83ce-2ad3a87be6c4', + version='7.0', + route_values=route_values) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + def delete_build(self, project, build_id): """DeleteBuild. Deletes a build. @@ -162,7 +265,7 @@ def delete_build(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values) def get_build(self, project, build_id, property_filters=None): @@ -171,7 +274,7 @@ def get_build(self, project, build_id, property_filters=None): :param str project: Project ID or project name :param int build_id: :param str property_filters: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -183,7 +286,7 @@ def get_build(self, project, build_id, property_filters=None): query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) @@ -212,7 +315,7 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, :param [int] build_ids: A comma-delimited list that specifies the IDs of builds to retrieve. :param str repository_id: If specified, filters to builds that built from this repository. :param str repository_type: If specified, filters to builds that built from repositories of this type. - :rtype: :class:`` + :rtype: :class:`<[Build]> ` """ route_values = {} if project is not None: @@ -265,35 +368,21 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[Build]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetBuildsResponseValue(response_value, continuation_token) - - class GetBuildsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_builds method - - :param value: - :type value: :class:`<[Build]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): + return self._deserialize('[Build]', self._unwrap_collection(response)) + + def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None, definition_id=None): """QueueBuild. Queues a build - :param :class:` ` build: + :param :class:` ` build: :param str project: Project ID or project name :param bool ignore_warnings: :param str check_in_ticket: :param int source_build_id: - :rtype: :class:` ` + :param int definition_id: Optional definition id to queue a build without a body. Ignored if there's a valid body + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -305,10 +394,12 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None query_parameters['checkInTicket'] = self._serialize.query('check_in_ticket', check_in_ticket, 'str') if source_build_id is not None: query_parameters['sourceBuildId'] = self._serialize.query('source_build_id', source_build_id, 'int') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -317,11 +408,11 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None def update_build(self, build, project, build_id, retry=None): """UpdateBuild. Updates a build. - :param :class:` ` build: The build. + :param :class:` ` build: The build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param bool retry: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -334,7 +425,7 @@ def update_build(self, build, project, build_id, retry=None): content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -353,67 +444,23 @@ def update_builds(self, builds, project): content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) - def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): - """GetBuildChanges. - Gets the changes associated with a build - :param str project: Project ID or project name - :param int build_id: - :param str continuation_token: - :param int top: The maximum number of changes to return - :param bool include_source_change: - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if build_id is not None: - route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') - query_parameters = {} - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if include_source_change is not None: - query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') - response = self._send(http_method='GET', - location_id='54572c7b-bbd3-45d4-80dc-28be08941620', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[Change]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetBuildChangesResponseValue(response_value, continuation_token) - - class GetBuildChangesResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_build_changes method - - :param value: - :type value: :class:`<[Change]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - def get_build_controller(self, controller_id): """GetBuildController. Gets a controller :param int controller_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BuildController', response) @@ -428,18 +475,18 @@ def get_build_controllers(self, name=None): query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[BuildController]', self._unwrap_collection(response)) def create_definition(self, definition, project, definition_to_clone_id=None, definition_to_clone_revision=None): """CreateDefinition. Creates a new definition. - :param :class:` ` definition: The definition. + :param :class:` ` definition: The definition. :param str project: Project ID or project name :param int definition_to_clone_id: :param int definition_to_clone_revision: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -452,7 +499,7 @@ def create_definition(self, definition, project, definition_to_clone_id=None, de content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -471,7 +518,7 @@ def delete_definition(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values) def get_definition(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): @@ -483,7 +530,7 @@ def get_definition(self, project, definition_id, revision=None, min_metrics_time :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [str] property_filters: A comma-delimited list of properties to include in the results. :param bool include_latest_builds: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -502,7 +549,7 @@ def get_definition(self, project, definition_id, revision=None, min_metrics_time query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) @@ -526,8 +573,8 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ :param bool include_latest_builds: Indicates whether to return the latest and latest completed builds for this definition. :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. - :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. - :rtype: :class:`` + :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true + :rtype: :class:`<[BuildDefinitionReference]> ` """ route_values = {} if project is not None: @@ -568,25 +615,10 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetDefinitionsResponseValue(response_value, continuation_token) - - class GetDefinitionsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_definitions method - - :param value: - :type value: :class:`<[BuildDefinitionReference]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) def restore_definition(self, project, definition_id, deleted): """RestoreDefinition. @@ -594,7 +626,7 @@ def restore_definition(self, project, definition_id, deleted): :param str project: Project ID or project name :param int definition_id: The identifier of the definition to restore. :param bool deleted: When false, restores a deleted definition. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -606,20 +638,20 @@ def restore_definition(self, project, definition_id, deleted): query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def update_definition(self, definition, project, definition_id, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. - Updates an existing definition. - :param :class:` ` definition: The new version of the definition. + Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT. + :param :class:` ` definition: The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int secrets_source_definition_id: :param int secrets_source_definition_revision: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -634,12 +666,301 @@ def update_definition(self, definition, project, definition_id, secrets_source_d content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) + def get_file_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None, **kwargs): + """GetFileContents. + Gets the contents of a file in the given source code repository. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. + :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. + :param str path: The path to the file to retrieve, relative to the root of the repository. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + if commit_or_branch is not None: + query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') + if path is not None: + query_parameters['path'] = self._serialize.query('path', path, 'str') + response = self._send(http_method='GET', + location_id='29d12225-b1d9-425f-b668-6c594a981313', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_build_general_settings(self, project): + """GetBuildGeneralSettings. + Gets pipeline general settings. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values) + return self._deserialize('PipelineGeneralSettings', response) + + def update_build_general_settings(self, new_settings, project): + """UpdateBuildGeneralSettings. + Updates pipeline general settings. + :param :class:` ` new_settings: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_settings, 'PipelineGeneralSettings') + response = self._send(http_method='PATCH', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('PipelineGeneralSettings', response) + + def get_retention_history(self, days_to_lookback=None): + """GetRetentionHistory. + Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline. + :param int days_to_lookback: + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_lookback is not None: + query_parameters['daysToLookback'] = self._serialize.query('days_to_lookback', days_to_lookback, 'int') + response = self._send(http_method='GET', + location_id='1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('BuildRetentionHistory', response) + + def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): + """GetBuildChanges. + Gets the changes associated with a build + :param str project: Project ID or project name + :param int build_id: + :param str continuation_token: + :param int top: The maximum number of changes to return + :param bool include_source_change: + :rtype: :class:`<[Change]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if include_source_change is not None: + query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') + response = self._send(http_method='GET', + location_id='54572c7b-bbd3-45d4-80dc-28be08941620', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(response)) + + def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): + """GetChangesBetweenBuilds. + Gets the changes made to the repository between two given builds. + :param str project: Project ID or project name + :param int from_build_id: The ID of the first build. + :param int to_build_id: The ID of the last build. + :param int top: The maximum number of changes to return. + :rtype: [Change] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if from_build_id is not None: + query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') + if to_build_id is not None: + query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(response)) + + def add_retention_leases(self, new_leases, project): + """AddRetentionLeases. + Adds new leases for pipeline runs. + :param [NewRetentionLease] new_leases: + :param str project: Project ID or project name + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_leases, '[NewRetentionLease]') + response = self._send(http_method='POST', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_retention_leases_by_id(self, project, ids): + """DeleteRetentionLeasesById. + Removes specific retention leases. + :param str project: Project ID or project name + :param [int] ids: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + self._send(http_method='DELETE', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_retention_lease(self, project, lease_id): + """GetRetentionLease. + Returns the details of the retention lease given a lease id. + :param str project: Project ID or project name + :param int lease_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values) + return self._deserialize('RetentionLease', response) + + def get_retention_leases_by_minimal_retention_leases(self, project, leases_to_fetch): + """GetRetentionLeasesByMinimalRetentionLeases. + Returns any leases matching the specified MinimalRetentionLeases + :param str project: Project ID or project name + :param [MinimalRetentionLease] leases_to_fetch: List of JSON-serialized MinimalRetentionLeases separated by '|' + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if leases_to_fetch is not None: + leases_to_fetch = "|".join(map(str, leases_to_fetch)) + query_parameters['leasesToFetch'] = self._serialize.query('leases_to_fetch', leases_to_fetch, 'str') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_owner_id(self, project, owner_id=None, definition_id=None, run_id=None): + """GetRetentionLeasesByOwnerId. + Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str owner_id: + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner_id is not None: + query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_user_id(self, project, user_owner_id, definition_id=None, run_id=None): + """GetRetentionLeasesByUserId. + Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str user_owner_id: The user id to search for. + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if user_owner_id is not None: + query_parameters['userOwnerId'] = self._serialize.query('user_owner_id', user_owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def update_retention_lease(self, lease_update, project, lease_id): + """UpdateRetentionLease. + Updates the duration or pipeline protection status of a retention lease. + :param :class:` ` lease_update: The new data for the retention lease. + :param str project: Project ID or project name + :param int lease_id: The ID of the lease to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + content = self._serialize.body(lease_update, 'RetentionLeaseUpdate') + response = self._send(http_method='PATCH', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('RetentionLease', response) + def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLog. Gets an individual log file for a build. @@ -664,7 +985,7 @@ def get_build_log(self, project, build_id, log_id, start_line=None, end_line=Non query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -698,7 +1019,7 @@ def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_li query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -717,7 +1038,7 @@ def get_build_logs(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildLog]', self._unwrap_collection(response)) @@ -735,7 +1056,7 @@ def get_build_logs_zip(self, project, build_id, **kwargs): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: @@ -768,7 +1089,7 @@ def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -789,49 +1110,321 @@ def get_build_option_definitions(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) - def get_definition_revisions(self, project, definition_id): - """GetDefinitionRevisions. - Gets all revisions of a definition. + def get_path_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None): + """GetPathContents. + Gets the contents of a directory in the given source code repository. :param str project: Project ID or project name - :param int definition_id: The ID of the definition. - :rtype: [BuildDefinitionRevision] + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. + :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. + :param str path: The path contents to list, relative to the root of the repository. + :rtype: [SourceRepositoryItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + if commit_or_branch is not None: + query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') + if path is not None: + query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', - location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', - version='5.1', - route_values=route_values) - return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) + location_id='7944d6fb-df01-4709-920a-7a189aa34037', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SourceRepositoryItem]', self._unwrap_collection(response)) - def get_build_settings(self, project=None): - """GetBuildSettings. - Gets the build settings. + def get_build_properties(self, project, build_id, filter=None): + """GetBuildProperties. + Gets properties for a build. :param str project: Project ID or project name - :rtype: :class:` ` + :param int build_id: The ID of the build. + :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if filter is not None: + filter = ",".join(filter) + query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', - location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.1', - route_values=route_values) - return self._deserialize('BuildSettings', response) + location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_build_properties(self, document, project, build_id): + """UpdateBuildProperties. + Updates properties for a build. + :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('object', response) + + def get_definition_properties(self, project, definition_id, filter=None): + """GetDefinitionProperties. + Gets properties for a definition. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if filter is not None: + filter = ",".join(filter) + query_parameters['filter'] = self._serialize.query('filter', filter, 'str') + response = self._send(http_method='GET', + location_id='d9826ad7-2a68-46a9-a6e9-677698777895', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_definition_properties(self, document, project, definition_id): + """UpdateDefinitionProperties. + Updates properties for a definition. + :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='d9826ad7-2a68-46a9-a6e9-677698777895', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('object', response) + + def get_pull_request(self, project, provider_name, pull_request_id, repository_id=None, service_endpoint_id=None): + """GetPullRequest. + Gets a pull request object from source provider. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str pull_request_id: Vendor-specific id of the pull request. + :param str repository_id: Vendor-specific identifier or the name of the repository that contains the pull request. + :param str service_endpoint_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. TFVC or TFGit. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'str') + query_parameters = {} + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + response = self._send(http_method='GET', + location_id='d8763ec7-9ff0-4fb4-b2b2-9d757906ff14', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PullRequest', response) + + def get_build_report(self, project, build_id, type=None): + """GetBuildReport. + Gets a build report. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :param str type: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='GET', + location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('BuildReportMetadata', response) + + def get_build_report_html_content(self, project, build_id, type=None, **kwargs): + """GetBuildReportHtmlContent. + Gets a build report. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :param str type: + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + response = self._send(http_method='GET', + location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='text/html') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def list_repositories(self, project, provider_name, service_endpoint_id=None, repository=None, result_set=None, page_results=None, continuation_token=None): + """ListRepositories. + Gets a list of source code repositories. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: If specified, the vendor-specific identifier or the name of a single repository to get. + :param str result_set: 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set. + :param bool page_results: If set to true, this will limit the set of results and will return a continuation token to continue the query. + :param str continuation_token: When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + if result_set is not None: + query_parameters['resultSet'] = self._serialize.query('result_set', result_set, 'str') + if page_results is not None: + query_parameters['pageResults'] = self._serialize.query('page_results', page_results, 'bool') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='d44d1680-f978-4834-9b93-8c6e132329c9', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('SourceRepositories', response) + + def get_retention_settings(self, project): + """GetRetentionSettings. + Gets the project's retention settings. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values) + return self._deserialize('ProjectRetentionSetting', response) + + def update_retention_settings(self, update_model, project): + """UpdateRetentionSettings. + Updates the project's retention settings. + :param :class:` ` update_model: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(update_model, 'UpdateProjectRetentionSettingModel') + response = self._send(http_method='PATCH', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProjectRetentionSetting', response) + + def get_definition_revisions(self, project, definition_id): + """GetDefinitionRevisions. + Gets all revisions of a definition. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :rtype: [BuildDefinitionRevision] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + response = self._send(http_method='GET', + location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', + version='7.0', + route_values=route_values) + return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) + + def get_build_settings(self, project=None): + """GetBuildSettings. + Gets the build settings. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', + version='7.0', + route_values=route_values) + return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. Updates the build settings. - :param :class:` ` settings: The new settings. + :param :class:` ` settings: The new settings. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -839,11 +1432,48 @@ def update_build_settings(self, settings, project=None): content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) + def list_source_providers(self, project): + """ListSourceProviders. + Get a list of source providers and their capabilities. + :param str project: Project ID or project name + :rtype: [SourceProviderAttributes] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='3ce81729-954f-423d-a581-9fea01d25186', + version='7.0', + route_values=route_values) + return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) + + def update_stage(self, update_parameters, build_id, stage_ref_name, project=None): + """UpdateStage. + Update a build stage + :param :class:` ` update_parameters: + :param int build_id: + :param str stage_ref_name: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if stage_ref_name is not None: + route_values['stageRefName'] = self._serialize.url('stage_ref_name', stage_ref_name, 'str') + content = self._serialize.body(update_parameters, 'UpdateStageParameters') + self._send(http_method='PATCH', + location_id='b8aac6c9-744b-46e1-88fc-3550969f9313', + version='7.0', + route_values=route_values, + content=content) + def add_build_tag(self, project, build_id, tag): """AddBuildTag. Adds a tag to a build. @@ -861,7 +1491,7 @@ def add_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -881,14 +1511,14 @@ def add_build_tags(self, tags, project, build_id): content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_build_tag(self, project, build_id, tag): """DeleteBuildTag. - Removes a tag from a build. + Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to remove. @@ -903,7 +1533,7 @@ def delete_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -921,13 +1551,159 @@ def get_build_tags(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_build_tags(self, update_parameters, project, build_id): + """UpdateBuildTags. + Adds/Removes tags from a build. + :param :class:` ` update_parameters: The tags to add/remove. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + content = self._serialize.body(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tag(self, project, definition_id, tag): + """AddDefinitionTag. + Adds a tag to a definition + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param str tag: The tag to add. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + if tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='PUT', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def add_definition_tags(self, tags, project, definition_id): + """AddDefinitionTags. + Adds multiple tags to a definition. + :param [str] tags: The tags to add. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + content = self._serialize.body(tags, '[str]') + response = self._send(http_method='POST', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_definition_tag(self, project, definition_id, tag): + """DeleteDefinitionTag. + Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param str tag: The tag to remove. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + if tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_definition_tags(self, project, definition_id, revision=None): + """GetDefinitionTags. + Gets the tags for a definition. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param int revision: The definition revision number. If not specified, uses the latest revision of the definition. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if revision is not None: + query_parameters['revision'] = self._serialize.query('revision', revision, 'int') + response = self._send(http_method='GET', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def update_definition_tags(self, update_parameters, project, definition_id): + """UpdateDefinitionTags. + Adds/Removes tags from a definition. + :param :class:` ` update_parameters: The tags to add/remove. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + content = self._serialize.body(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_tag(self, project, tag): + """DeleteTag. + Removes a tag from builds, definitions, and from the tag store + :param str project: Project ID or project name + :param str tag: The tag to remove. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_tags(self, project): """GetTags. - Gets a list of all build and definition tags in the project. + Gets a list of all build tags in the project. :param str project: Project ID or project name :rtype: [str] """ @@ -936,7 +1712,7 @@ def get_tags(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -953,7 +1729,7 @@ def delete_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) def get_template(self, project, template_id): @@ -961,7 +1737,7 @@ def get_template(self, project, template_id): Gets a specific build definition template. :param str project: Project ID or project name :param str template_id: The ID of the requested template. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -970,7 +1746,7 @@ def get_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) @@ -985,17 +1761,17 @@ def get_templates(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) def save_template(self, template, project, template_id): """SaveTemplate. Updates an existing build definition template. - :param :class:` ` template: The new version of the template. + :param :class:` ` template: The new version of the template. :param str project: Project ID or project name :param str template_id: The ID of the template. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1005,7 +1781,7 @@ def save_template(self, template, project, template_id): content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildDefinitionTemplate', response) @@ -1018,7 +1794,7 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None :param str timeline_id: :param int change_id: :param str plan_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1034,14 +1810,67 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) + def restore_webhooks(self, trigger_types, project, provider_name, service_endpoint_id=None, repository=None): + """RestoreWebhooks. + Recreates the webhooks for the specified triggers in the given source code repository. + :param [DefinitionTriggerType] trigger_types: The types of triggers to restore webhooks for. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + content = self._serialize.body(trigger_types, '[DefinitionTriggerType]') + self._send(http_method='POST', + location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + + def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): + """ListWebhooks. + Gets a list of webhooks installed in the given source code repository. + :param str project: Project ID or project name + :param str provider_name: The name of the source provider. + :param str service_endpoint_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. TFVC or TFGit. + :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. + :rtype: [RepositoryWebhook] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if provider_name is not None: + route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') + query_parameters = {} + if service_endpoint_id is not None: + query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') + if repository is not None: + query_parameters['repository'] = self._serialize.query('repository', repository, 'str') + response = self._send(http_method='GET', + location_id='8f20ff82-9498-4812-9f6e-9c01bdc50e99', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RepositoryWebhook]', self._unwrap_collection(response)) + def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. - Gets the work items associated with a build. + Gets the work items associated with a build. Only work items in the same project are returned. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return. @@ -1057,7 +1886,7 @@ def get_build_work_items_refs(self, project, build_id, top=None): query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) @@ -1082,9 +1911,68 @@ def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + def get_work_items_between_builds(self, project, from_build_id, to_build_id, top=None): + """GetWorkItemsBetweenBuilds. + Gets all the work items between two builds. + :param str project: Project ID or project name + :param int from_build_id: The ID of the first build. + :param int to_build_id: The ID of the last build. + :param int top: The maximum number of work items to return. + :rtype: [ResourceRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if from_build_id is not None: + query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') + if to_build_id is not None: + query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='52ba8915-5518-42e3-a4bb-b0182d159e2d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + + def get_definition_yaml(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): + """GetDefinitionYaml. + Converts a definition to YAML, optionally at a specific revision. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param int revision: The revision number to retrieve. If this is not specified, the latest version will be returned. + :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. + :param [str] property_filters: A comma-delimited list of properties to include in the results. + :param bool include_latest_builds: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if revision is not None: + query_parameters['revision'] = self._serialize.query('revision', revision, 'int') + if min_metrics_time is not None: + query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') + if property_filters is not None: + property_filters = ",".join(property_filters) + query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') + if include_latest_builds is not None: + query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') + response = self._send(http_method='GET', + location_id='7c3df3a1-7e51-4150-8cf7-540347f8697f', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('YamlBuild', response) + diff --git a/azure-devops/azure/devops/released/cix/__init__.py b/azure-devops/azure/devops/released/cix/__init__.py new file mode 100644 index 00000000..9895aa39 --- /dev/null +++ b/azure-devops/azure/devops/released/cix/__init__.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.cix.models import * +from .cix_client import CixClient + +__all__ = [ + 'ConfigurationFile', + 'CreatedResources', + 'CreatePipelineConnectionInputs', + 'DetectedBuildFramework', + 'DetectedBuildTarget', + 'Operation', + 'OperationReference', + 'OperationResultReference', + 'PipelineConnection', + 'ReferenceLinks', + 'ResourceCreationParameter', + 'TeamProject', + 'TeamProjectReference', + 'WebApiTeamRef', + 'CixClient' +] diff --git a/azure-devops/azure/devops/released/cix/cix_client.py b/azure-devops/azure/devops/released/cix/cix_client.py new file mode 100644 index 00000000..1144bfc0 --- /dev/null +++ b/azure-devops/azure/devops/released/cix/cix_client.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.cix 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response)) + + def create_project_connection(self, create_connection_inputs, project): + """CreateProjectConnection. + Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created. + :param :class:` ` create_connection_inputs: + :param str project: + :rtype: :class:` ` + """ + 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='7.0', + 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. + 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='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) + + def create_resources(self, creation_parameters, project): + """CreateResources. + :param {ResourceCreationParameter} creation_parameters: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + 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='7.0', + route_values=route_values, + content=content) + return self._deserialize('CreatedResources', response) + diff --git a/azure-devops/azure/devops/released/client_factory.py b/azure-devops/azure/devops/released/client_factory.py index 3940d35b..5632b0e1 100644 --- a/azure-devops/azure/devops/released/client_factory.py +++ b/azure-devops/azure/devops/released/client_factory.py @@ -9,7 +9,7 @@ class ClientFactory(object): """ClientFactory. - A factory class to get the 5.1 released clients. + A factory class to get the 7.0 released clients. """ def __init__(self, connection): @@ -17,155 +17,400 @@ def __init__(self, connection): def get_accounts_client(self): """get_accounts_client. - Gets the 5.1 version of the AccountsClient - :rtype: :class:` ` + Gets the 7.0 version of the AccountsClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.accounts.accounts_client.AccountsClient') + return self._connection.get_client('azure.devops.v7_0.accounts.accounts_client.AccountsClient') + + def get_audit_client(self): + """get_audit_client. + Gets the 7.0 version of the AuditClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.audit.audit_client.AuditClient') def get_build_client(self): """get_build_client. - Gets the 5.1 version of the BuildClient - :rtype: :class:` ` + Gets the 7.0 version of the BuildClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.build.build_client.BuildClient') + return self._connection.get_client('azure.devops.v7_0.build.build_client.BuildClient') - def get_cloud_load_test_client(self): - """get_cloud_load_test_client. - Gets the 5.1 version of the CloudLoadTestClient - :rtype: :class:` ` + def get_cix_client(self): + """get_cix_client. + Gets the 7.0 version of the CixClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') + return self._connection.get_client('azure.devops.v7_0.cix.cix_client.CixClient') + + def get_client_trace_client(self): + """get_client_trace_client. + Gets the 7.0 version of the ClientTraceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.client_trace.client_trace_client.ClientTraceClient') + + def get_contributions_client(self): + """get_contributions_client. + Gets the 7.0 version of the ContributionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.contributions.contributions_client.ContributionsClient') def get_core_client(self): """get_core_client. - Gets the 5.1 version of the CoreClient - :rtype: :class:` ` + Gets the 7.0 version of the CoreClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.core.core_client.CoreClient') + + def get_customer_intelligence_client(self): + """get_customer_intelligence_client. + Gets the 7.0 version of the CustomerIntelligenceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') + + def get_dashboard_client(self): + """get_dashboard_client. + Gets the 7.0 version of the DashboardClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.dashboard.dashboard_client.DashboardClient') + + def get_elastic_client(self): + """get_elastic_client. + Gets the 7.0 version of the ElasticClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.elastic.elastic_client.ElasticClient') + + def get_extension_management_client(self): + """get_extension_management_client. + Gets the 7.0 version of the ExtensionManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.extension_management.extension_management_client.ExtensionManagementClient') + + def get_feature_availability_client(self): + """get_feature_availability_client. + Gets the 7.0 version of the FeatureAvailabilityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') + + def get_feature_management_client(self): + """get_feature_management_client. + Gets the 7.0 version of the FeatureManagementClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.core.core_client.CoreClient') + return self._connection.get_client('azure.devops.v7_0.feature_management.feature_management_client.FeatureManagementClient') + + def get_feed_client(self): + """get_feed_client. + Gets the 7.0 version of the FeedClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.feed.feed_client.FeedClient') + + def get_file_container_client(self): + """get_file_container_client. + Gets the 7.0 version of the FileContainerClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.file_container.file_container_client.FileContainerClient') + + def get_gallery_client(self): + """get_gallery_client. + Gets the 7.0 version of the GalleryClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.gallery.gallery_client.GalleryClient') def get_git_client(self): """get_git_client. - Gets the 5.1 version of the GitClient - :rtype: :class:` ` + Gets the 7.0 version of the GitClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.git.git_client.GitClient') + + def get_graph_client(self): + """get_graph_client. + Gets the 7.0 version of the GraphClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.git.git_client.GitClient') + return self._connection.get_client('azure.devops.v7_0.graph.graph_client.GraphClient') def get_identity_client(self): """get_identity_client. - Gets the 5.1 version of the IdentityClient - :rtype: :class:` ` + Gets the 7.0 version of the IdentityClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.identity.identity_client.IdentityClient') + return self._connection.get_client('azure.devops.v7_0.identity.identity_client.IdentityClient') + + def get_location_client(self): + """get_location_client. + Gets the 7.0 version of the LocationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.location.location_client.LocationClient') + + def get_maven_client(self): + """get_maven_client. + Gets the 7.0 version of the MavenClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.maven.maven_client.MavenClient') + + def get_member_entitlement_management_client(self): + """get_member_entitlement_management_client. + Gets the 7.0 version of the MemberEntitlementManagementClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') def get_notification_client(self): """get_notification_client. - Gets the 5.1 version of the NotificationClient - :rtype: :class:` ` + Gets the 7.0 version of the NotificationClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.notification.notification_client.NotificationClient') + + def get_npm_client(self): + """get_npm_client. + Gets the 7.0 version of the NpmClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.npm.npm_client.NpmClient') + + def get_nuget_client(self): + """get_nuget_client. + Gets the 7.0 version of the NuGetClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.notification.notification_client.NotificationClient') + return self._connection.get_client('azure.devops.v7_0.nuget.nuget_client.NuGetClient') def get_operations_client(self): """get_operations_client. - Gets the 5.1 version of the OperationsClient - :rtype: :class:` ` + Gets the 7.0 version of the OperationsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.operations.operations_client.OperationsClient') + + def get_pipeline_permissions_client(self): + """get_pipeline_permissions_client. + Gets the 7.0 version of the PipelinePermissionsClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient') + + def get_pipelines_client(self): + """get_pipelines_client. + Gets the 7.0 version of the PipelinesClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.operations.operations_client.OperationsClient') + return self._connection.get_client('azure.devops.v7_0.pipelines.pipelines_client.PipelinesClient') + + def get_pipelines_checks_client(self): + """get_pipelines_checks_client. + Gets the 7.0 version of the PipelinesChecksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.pipelines_checks.pipelines_checks_client.PipelinesChecksClient') def get_policy_client(self): """get_policy_client. - Gets the 5.1 version of the PolicyClient - :rtype: :class:` ` + Gets the 7.0 version of the PolicyClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.policy.policy_client.PolicyClient') + return self._connection.get_client('azure.devops.v7_0.policy.policy_client.PolicyClient') def get_profile_client(self): """get_profile_client. - Gets the 5.1 version of the ProfileClient - :rtype: :class:` ` + Gets the 7.0 version of the ProfileClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.profile.profile_client.ProfileClient') + + def get_profile_regions_client(self): + """get_profile_regions_client. + Gets the 7.0 version of the ProfileRegionsClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.profile.profile_client.ProfileClient') + return self._connection.get_client('azure.devops.v7_0.profile_regions.profile_regions_client.ProfileRegionsClient') + + def get_project_analysis_client(self): + """get_project_analysis_client. + Gets the 7.0 version of the ProjectAnalysisClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.project_analysis.project_analysis_client.ProjectAnalysisClient') + + def get_provenance_client(self): + """get_provenance_client. + Gets the 7.0 version of the ProvenanceClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.provenance.provenance_client.ProvenanceClient') + + def get_py_pi_api_client(self): + """get_py_pi_api_client. + Gets the 7.0 version of the PyPiApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.py_pi_api.py_pi_api_client.PyPiApiClient') def get_release_client(self): """get_release_client. - Gets the 5.1 version of the ReleaseClient - :rtype: :class:` ` + Gets the 7.0 version of the ReleaseClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.release.release_client.ReleaseClient') + + def get_sbom_client(self): + """get_sbom_client. + Gets the 7.0 version of the SBOMClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.release.release_client.ReleaseClient') + return self._connection.get_client('azure.devops.v7_0.sbom.sbom_client.SBOMClient') + + def get_search_client(self): + """get_search_client. + Gets the 7.0 version of the SearchClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.search.search_client.SearchClient') def get_security_client(self): """get_security_client. - Gets the 5.1 version of the SecurityClient - :rtype: :class:` ` + Gets the 7.0 version of the SecurityClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.security.security_client.SecurityClient') + + def get_service_endpoint_client(self): + """get_service_endpoint_client. + Gets the 7.0 version of the ServiceEndpointClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.security.security_client.SecurityClient') + return self._connection.get_client('azure.devops.v7_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') def get_service_hooks_client(self): """get_service_hooks_client. - Gets the 5.1 version of the ServiceHooksClient - :rtype: :class:` ` + Gets the 7.0 version of the ServiceHooksClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.service_hooks.service_hooks_client.ServiceHooksClient') + + def get_settings_client(self): + """get_settings_client. + Gets the 7.0 version of the SettingsClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.service_hooks.service_hooks_client.ServiceHooksClient') + return self._connection.get_client('azure.devops.v7_0.settings.settings_client.SettingsClient') + + def get_symbol_client(self): + """get_symbol_client. + Gets the 7.0 version of the SymbolClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.symbol.symbol_client.SymbolClient') def get_task_client(self): """get_task_client. - Gets the 5.1 version of the TaskClient - :rtype: :class:` ` + Gets the 7.0 version of the TaskClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.task.task_client.TaskClient') + return self._connection.get_client('azure.devops.v7_0.task.task_client.TaskClient') def get_task_agent_client(self): """get_task_agent_client. - Gets the 5.1 version of the TaskAgentClient - :rtype: :class:` ` + Gets the 7.0 version of the TaskAgentClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.task_agent.task_agent_client.TaskAgentClient') + return self._connection.get_client('azure.devops.v7_0.task_agent.task_agent_client.TaskAgentClient') def get_test_client(self): """get_test_client. - Gets the 5.1 version of the TestClient - :rtype: :class:` ` + Gets the 7.0 version of the TestClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.test.test_client.TestClient') + return self._connection.get_client('azure.devops.v7_0.test.test_client.TestClient') def get_test_plan_client(self): """get_test_plan_client. - Gets the 5.1 version of the TestPlanClient - :rtype: :class:` ` + Gets the 7.0 version of the TestPlanClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.test_plan.test_plan_client.TestPlanClient') + return self._connection.get_client('azure.devops.v7_0.test_plan.test_plan_client.TestPlanClient') def get_test_results_client(self): """get_test_results_client. - Gets the 5.1 version of the TestResultsClient - :rtype: :class:` ` + Gets the 7.0 version of the TestResultsClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.test_results.test_results_client.TestResultsClient') + return self._connection.get_client('azure.devops.v7_0.test_results.test_results_client.TestResultsClient') def get_tfvc_client(self): """get_tfvc_client. - Gets the 5.1 version of the TfvcClient - :rtype: :class:` ` + Gets the 7.0 version of the TfvcClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.tfvc.tfvc_client.TfvcClient') + + def get_token_admin_client(self): + """get_token_admin_client. + Gets the 7.0 version of the TokenAdminClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.tfvc.tfvc_client.TfvcClient') + return self._connection.get_client('azure.devops.v7_0.token_admin.token_admin_client.TokenAdminClient') + + def get_upack_api_client(self): + """get_upack_api_client. + Gets the 7.0 version of the UPackApiClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_api.upack_api_client.UPackApiClient') + + def get_upack_packaging_client(self): + """get_upack_packaging_client. + Gets the 7.0 version of the UPackPackagingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.upack_packaging.upack_packaging_client.UPackPackagingClient') def get_wiki_client(self): """get_wiki_client. - Gets the 5.1 version of the WikiClient - :rtype: :class:` ` + Gets the 7.0 version of the WikiClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.wiki.wiki_client.WikiClient') + return self._connection.get_client('azure.devops.v7_0.wiki.wiki_client.WikiClient') def get_work_client(self): """get_work_client. - Gets the 5.1 version of the WorkClient - :rtype: :class:` ` + Gets the 7.0 version of the WorkClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.work.work_client.WorkClient') + return self._connection.get_client('azure.devops.v7_0.work.work_client.WorkClient') def get_work_item_tracking_client(self): """get_work_item_tracking_client. - Gets the 5.1 version of the WorkItemTrackingClient - :rtype: :class:` ` + Gets the 7.0 version of the WorkItemTrackingClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') + + def get_work_item_tracking_process_client(self): + """get_work_item_tracking_process_client. + Gets the 7.0 version of the WorkItemTrackingProcessClient + :rtype: :class:` ` + """ + return self._connection.get_client('azure.devops.v7_0.work_item_tracking_process.work_item_tracking_process_client.WorkItemTrackingProcessClient') + + def get_work_item_tracking_process_template_client(self): + """get_work_item_tracking_process_template_client. + Gets the 7.0 version of the WorkItemTrackingProcessTemplateClient + :rtype: :class:` ` """ - return self._connection.get_client('azure.devops.released.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') + return self._connection.get_client('azure.devops.v7_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') diff --git a/azure-devops/azure/devops/released/cloud_load_test/__init__.py b/azure-devops/azure/devops/released/cloud_load_test/__init__.py deleted file mode 100644 index 0f19b61e..00000000 --- a/azure-devops/azure/devops/released/cloud_load_test/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...v5_1.cloud_load_test.models import * -from .cloud_load_test_client import CloudLoadTestClient - -__all__ = [ - 'AgentGroup', - 'AgentGroupAccessData', - 'Application', - 'ApplicationCounters', - 'ApplicationType', - 'BrowserMix', - 'CltCustomerIntelligenceData', - 'CounterGroup', - 'CounterInstanceSamples', - 'CounterSample', - 'CounterSampleQueryDetails', - 'CounterSamplesResult', - 'Diagnostics', - 'DropAccessData', - 'ErrorDetails', - 'GraphSubjectBase', - 'IdentityRef', - 'LoadGenerationGeoLocation', - 'LoadTest', - 'LoadTestDefinition', - 'LoadTestErrors', - 'LoadTestRunDetails', - 'LoadTestRunSettings', - 'OverridableRunSettings', - 'PageSummary', - 'ReferenceLinks', - 'RequestSummary', - 'ScenarioSummary', - 'StaticAgentRunSetting', - 'SubType', - 'SummaryPercentileData', - 'TenantDetails', - 'TestDefinition', - 'TestDefinitionBasic', - 'TestDrop', - 'TestDropRef', - 'TestResults', - 'TestResultsSummary', - 'TestRun', - 'TestRunAbortMessage', - 'TestRunBasic', - 'TestRunCounterInstance', - 'TestRunMessage', - 'TestSettings', - 'TestSummary', - 'TransactionSummary', - 'WebApiLoadTestMachineInput', - 'WebApiSetupParamaters', - 'WebApiTestMachine', - 'WebApiUserLoadTestMachineInput', - 'WebInstanceSummaryData', - 'CloudLoadTestClient' -] diff --git a/azure-devops/azure/devops/released/cloud_load_test/cloud_load_test_client.py b/azure-devops/azure/devops/released/cloud_load_test/cloud_load_test_client.py deleted file mode 100644 index d1554263..00000000 --- a/azure-devops/azure/devops/released/cloud_load_test/cloud_load_test_client.py +++ /dev/null @@ -1,432 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ...v5_1.cloud_load_test import models - - -class CloudLoadTestClient(Client): - """CloudLoadTest - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(CloudLoadTestClient, 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 = '7ae6d0a6-cda5-44cf-a261-28c392bed25c' - - def create_agent_group(self, group): - """CreateAgentGroup. - :param :class:` ` group: Agent group to be created - :rtype: :class:` ` - """ - content = self._serialize.body(group, 'AgentGroup') - response = self._send(http_method='POST', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='5.1', - content=content) - return self._deserialize('AgentGroup', response) - - def get_agent_groups(self, agent_group_id=None, machine_setup_input=None, machine_access_data=None, outgoing_request_urls=None, agent_group_name=None): - """GetAgentGroups. - :param str agent_group_id: The agent group identifier - :param bool machine_setup_input: - :param bool machine_access_data: - :param bool outgoing_request_urls: - :param str agent_group_name: Name of the agent group - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if machine_setup_input is not None: - query_parameters['machineSetupInput'] = self._serialize.query('machine_setup_input', machine_setup_input, 'bool') - if machine_access_data is not None: - query_parameters['machineAccessData'] = self._serialize.query('machine_access_data', machine_access_data, 'bool') - if outgoing_request_urls is not None: - query_parameters['outgoingRequestUrls'] = self._serialize.query('outgoing_request_urls', outgoing_request_urls, 'bool') - if agent_group_name is not None: - query_parameters['agentGroupName'] = self._serialize.query('agent_group_name', agent_group_name, 'str') - response = self._send(http_method='GET', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def delete_static_agent(self, agent_group_id, agent_name): - """DeleteStaticAgent. - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: str - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='DELETE', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def get_static_agents(self, agent_group_id, agent_name=None): - """GetStaticAgents. - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='GET', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_application(self, application_id): - """GetApplication. - :param str application_id: Filter by APM application identifier. - :rtype: :class:` ` - """ - route_values = {} - if application_id is not None: - route_values['applicationId'] = self._serialize.url('application_id', application_id, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='5.1', - route_values=route_values) - return self._deserialize('Application', response) - - def get_applications(self, type=None): - """GetApplications. - :param str type: Filters the results based on the plugin type. - :rtype: [Application] - """ - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[Application]', self._unwrap_collection(response)) - - def get_counters(self, test_run_id, group_names, include_summary=None): - """GetCounters. - :param str test_run_id: The test run identifier - :param str group_names: Comma separated names of counter groups, such as 'Application', 'Performance' and 'Throughput' - :param bool include_summary: - :rtype: [TestRunCounterInstance] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if group_names is not None: - query_parameters['groupNames'] = self._serialize.query('group_names', group_names, 'str') - if include_summary is not None: - query_parameters['includeSummary'] = self._serialize.query('include_summary', include_summary, 'bool') - response = self._send(http_method='GET', - location_id='29265ea4-b5a5-4b2e-b054-47f5f6f00183', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestRunCounterInstance]', self._unwrap_collection(response)) - - def get_application_counters(self, application_id=None, plugintype=None): - """GetApplicationCounters. - :param str application_id: Filter by APM application identifier. - :param str plugintype: Currently ApplicationInsights is the only available plugin type. - :rtype: [ApplicationCounters] - """ - query_parameters = {} - if application_id is not None: - query_parameters['applicationId'] = self._serialize.query('application_id', application_id, 'str') - if plugintype is not None: - query_parameters['plugintype'] = self._serialize.query('plugintype', plugintype, 'str') - response = self._send(http_method='GET', - location_id='c1275ce9-6d26-4bc6-926b-b846502e812d', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[ApplicationCounters]', self._unwrap_collection(response)) - - def get_counter_samples(self, counter_sample_query_details, test_run_id): - """GetCounterSamples. - :param :class:` ` counter_sample_query_details: - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(counter_sample_query_details, 'VssJsonCollectionWrapper') - response = self._send(http_method='POST', - location_id='bad18480-7193-4518-992a-37289c5bb92d', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('CounterSamplesResult', response) - - def get_load_test_run_errors(self, test_run_id, type=None, sub_type=None, detailed=None): - """GetLoadTestRunErrors. - :param str test_run_id: The test run identifier - :param str type: Filter for the particular type of errors. - :param str sub_type: Filter for a particular subtype of errors. You should not provide error subtype without error type. - :param bool detailed: To include the details of test errors such as messagetext, request, stacktrace, testcasename, scenarioname, and lasterrordate. - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if sub_type is not None: - query_parameters['subType'] = self._serialize.query('sub_type', sub_type, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - response = self._send(http_method='GET', - location_id='b52025a7-3fb4-4283-8825-7079e75bd402', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('LoadTestErrors', response) - - def get_test_run_messages(self, test_run_id): - """GetTestRunMessages. - :param str test_run_id: Id of the test run - :rtype: [TestRunMessage] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='2e7ba122-f522-4205-845b-2d270e59850a', - version='5.1', - route_values=route_values) - return self._deserialize('[TestRunMessage]', self._unwrap_collection(response)) - - def get_plugin(self, type): - """GetPlugin. - :param str type: Currently ApplicationInsights is the only available plugin type. - :rtype: :class:` ` - """ - route_values = {} - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='5.1', - route_values=route_values) - return self._deserialize('ApplicationType', response) - - def get_plugins(self): - """GetPlugins. - :rtype: [ApplicationType] - """ - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='5.1') - return self._deserialize('[ApplicationType]', self._unwrap_collection(response)) - - def get_load_test_result(self, test_run_id): - """GetLoadTestResult. - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='5ed69bd8-4557-4cec-9b75-1ad67d0c257b', - version='5.1', - route_values=route_values) - return self._deserialize('TestResults', response) - - def create_test_definition(self, test_definition): - """CreateTestDefinition. - :param :class:` ` test_definition: Test definition to be created - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='POST', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - content=content) - return self._deserialize('TestDefinition', response) - - def get_test_definition(self, test_definition_id): - """GetTestDefinition. - :param str test_definition_id: The test definition identifier - :rtype: :class:` ` - """ - route_values = {} - if test_definition_id is not None: - route_values['testDefinitionId'] = self._serialize.url('test_definition_id', test_definition_id, 'str') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - route_values=route_values) - return self._deserialize('TestDefinition', response) - - def get_test_definitions(self, from_date=None, to_date=None, top=None): - """GetTestDefinitions. - :param str from_date: Date after which test definitions were created - :param str to_date: Date before which test definitions were crated - :param int top: - :rtype: [TestDefinitionBasic] - """ - query_parameters = {} - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[TestDefinitionBasic]', self._unwrap_collection(response)) - - def update_test_definition(self, test_definition): - """UpdateTestDefinition. - :param :class:` ` test_definition: - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='PUT', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - content=content) - return self._deserialize('TestDefinition', response) - - def create_test_drop(self, web_test_drop): - """CreateTestDrop. - :param :class:` ` web_test_drop: Test drop to be created - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_drop, 'TestDrop') - response = self._send(http_method='POST', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='5.1', - content=content) - return self._deserialize('TestDrop', response) - - def get_test_drop(self, test_drop_id): - """GetTestDrop. - :param str test_drop_id: The test drop identifier - :rtype: :class:` ` - """ - route_values = {} - if test_drop_id is not None: - route_values['testDropId'] = self._serialize.url('test_drop_id', test_drop_id, 'str') - response = self._send(http_method='GET', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='5.1', - route_values=route_values) - return self._deserialize('TestDrop', response) - - def create_test_run(self, web_test_run): - """CreateTestRun. - :param :class:` ` web_test_run: - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_run, 'TestRun') - response = self._send(http_method='POST', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - content=content) - return self._deserialize('TestRun', response) - - def get_test_run(self, test_run_id): - """GetTestRun. - :param str test_run_id: Unique ID of the test run - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - route_values=route_values) - return self._deserialize('TestRun', response) - - def get_test_runs(self, name=None, requested_by=None, status=None, run_type=None, from_date=None, to_date=None, detailed=None, top=None, runsourceidentifier=None, retention_state=None): - """GetTestRuns. - Returns test runs based on the filter specified. Returns all runs of the tenant if there is no filter. - :param str name: Name for the test run. Names are not unique. Test runs with same name are assigned sequential rolling numbers. - :param str requested_by: Filter by the user who requested the test run. Here requestedBy should be the display name of the user. - :param str status: Filter by the test run status. - :param str run_type: Valid values include: null, one of TestRunType, or "*" - :param str from_date: Filter by the test runs that have been modified after the fromDate timestamp. - :param str to_date: Filter by the test runs that have been modified before the toDate timestamp. - :param bool detailed: Include the detailed test run attributes. - :param int top: The maximum number of test runs to return. - :param str runsourceidentifier: - :param str retention_state: - :rtype: object - """ - query_parameters = {} - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if requested_by is not None: - query_parameters['requestedBy'] = self._serialize.query('requested_by', requested_by, 'str') - if status is not None: - query_parameters['status'] = self._serialize.query('status', status, 'str') - if run_type is not None: - query_parameters['runType'] = self._serialize.query('run_type', run_type, 'str') - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if runsourceidentifier is not None: - query_parameters['runsourceidentifier'] = self._serialize.query('runsourceidentifier', runsourceidentifier, 'str') - if retention_state is not None: - query_parameters['retentionState'] = self._serialize.query('retention_state', retention_state, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('object', response) - - def update_test_run(self, web_test_run, test_run_id): - """UpdateTestRun. - :param :class:` ` web_test_run: - :param str test_run_id: - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(web_test_run, 'TestRun') - self._send(http_method='PATCH', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - route_values=route_values, - content=content) - diff --git a/azure-devops/azure/devops/released/core/__init__.py b/azure-devops/azure/devops/released/core/__init__.py index 193a2d3c..b02506cc 100644 --- a/azure-devops/azure/devops/released/core/__init__.py +++ b/azure-devops/azure/devops/released/core/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.core.models import * +from ...v7_0.core.models import * from .core_client import CoreClient __all__ = [ diff --git a/azure-devops/azure/devops/released/core/core_client.py b/azure-devops/azure/devops/released/core/core_client.py index d5ca0c16..d6a0823a 100644 --- a/azure-devops/azure/devops/released/core/core_client.py +++ b/azure-devops/azure/devops/released/core/core_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.core import models +from ...v7_0.core import models class CoreClient(Client): @@ -46,7 +46,7 @@ def get_team_members_with_extended_properties(self, project_id, team_id, top=Non query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='294c494c-2600-4d7e-b76c-3dd50c3c95be', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamMember]', self._unwrap_collection(response)) @@ -55,14 +55,14 @@ def get_process_by_id(self, process_id): """GetProcessById. Get a process by ID. :param str process_id: ID for a process. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Process', response) @@ -73,21 +73,21 @@ def get_processes(self): """ response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', - version='5.1') + version='7.0') return self._deserialize('[Process]', self._unwrap_collection(response)) def get_project_collection(self, collection_id): """GetProjectCollection. Get project collection with the specified id or name. :param str collection_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if collection_id is not None: route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamProjectCollection', response) @@ -105,7 +105,7 @@ def get_project_collections(self, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TeamProjectCollectionReference]', self._unwrap_collection(response)) @@ -115,7 +115,7 @@ def get_project(self, project_id, include_capabilities=None, include_history=Non :param str project_id: :param bool include_capabilities: Include capabilities (such as source control) in the team project result (default: false). :param bool include_history: Search within renamed projects (that had such name in the past). - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: @@ -127,7 +127,7 @@ def get_project(self, project_id, include_capabilities=None, include_history=Non query_parameters['includeHistory'] = self._serialize.query('include_history', include_history, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TeamProject', response) @@ -140,7 +140,7 @@ def get_projects(self, state_filter=None, top=None, skip=None, continuation_toke :param int skip: :param str continuation_token: :param bool get_default_team_image_url: - :rtype: :class:`` + :rtype: :class:`<[TeamProjectReference]> ` """ query_parameters = {} if state_filter is not None: @@ -155,35 +155,20 @@ def get_projects(self, state_filter=None, top=None, skip=None, continuation_toke query_parameters['getDefaultTeamImageUrl'] = self._serialize.query('get_default_team_image_url', get_default_team_image_url, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='5.1', + version='7.0', query_parameters=query_parameters) - response_value = self._deserialize('[TeamProjectReference]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetProjectsResponseValue(response_value, continuation_token) - - class GetProjectsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_projects method - - :param value: - :type value: :class:`<[TeamProjectReference]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[TeamProjectReference]', self._unwrap_collection(response)) def queue_create_project(self, project_to_create): """QueueCreateProject. Queues a project to be created. Use the [GetOperation](../../operations/operations/get) to periodically check for create project status. - :param :class:` ` project_to_create: The project to create. - :rtype: :class:` ` + :param :class:` ` project_to_create: The project to create. + :rtype: :class:` ` """ content = self._serialize.body(project_to_create, 'TeamProject') response = self._send(http_method='POST', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='5.1', + version='7.0', content=content) return self._deserialize('OperationReference', response) @@ -191,23 +176,23 @@ def queue_delete_project(self, project_id): """QueueDeleteProject. Queues a project to be deleted. Use the [GetOperation](../../operations/operations/get) to periodically check for delete project status. :param str project_id: The project id of the project to delete. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') response = self._send(http_method='DELETE', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('OperationReference', response) def update_project(self, project_update, project_id): """UpdateProject. Update an existing project's name, abbreviation, description, or restore a project. - :param :class:` ` project_update: The updates for the project. The state must be set to wellFormed to restore the project. + :param :class:` ` project_update: The updates for the project. The state must be set to wellFormed to restore the project. :param str project_id: The project id of the project to update. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: @@ -215,7 +200,7 @@ def update_project(self, project_update, project_id): content = self._serialize.body(project_update, 'TeamProject') response = self._send(http_method='PATCH', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('OperationReference', response) @@ -223,9 +208,9 @@ def update_project(self, project_update, project_id): def create_team(self, team, project_id): """CreateTeam. Create a team in a team project. - :param :class:` ` team: The team data used to create the team. + :param :class:` ` team: The team data used to create the team. :param str project_id: The name or ID (GUID) of the team project in which to create the team. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: @@ -233,7 +218,7 @@ def create_team(self, team, project_id): content = self._serialize.body(team, 'WebApiTeam') response = self._send(http_method='POST', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) @@ -251,7 +236,7 @@ def delete_team(self, project_id, team_id): route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') self._send(http_method='DELETE', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', - version='5.1', + version='7.0', route_values=route_values) def get_team(self, project_id, team_id, expand_identity=None): @@ -260,7 +245,7 @@ def get_team(self, project_id, team_id, expand_identity=None): :param str project_id: The name or ID (GUID) of the team project containing the team. :param str team_id: The name or ID (GUID) of the team. :param bool expand_identity: A value indicating whether or not to expand Identity information in the result WebApiTeam object. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: @@ -272,7 +257,7 @@ def get_team(self, project_id, team_id, expand_identity=None): query_parameters['$expandIdentity'] = self._serialize.query('expand_identity', expand_identity, 'bool') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WebApiTeam', response) @@ -301,7 +286,7 @@ def get_teams(self, project_id, mine=None, top=None, skip=None, expand_identity= query_parameters['$expandIdentity'] = self._serialize.query('expand_identity', expand_identity, 'bool') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) @@ -309,10 +294,10 @@ def get_teams(self, project_id, mine=None, top=None, skip=None, expand_identity= def update_team(self, team_data, project_id, team_id): """UpdateTeam. Update a team's name and/or description. - :param :class:` ` team_data: + :param :class:` ` team_data: :param str project_id: The name or ID (GUID) of the team project containing the team to update. :param str team_id: The name of ID of the team to update. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project_id is not None: @@ -322,7 +307,7 @@ def update_team(self, team_data, project_id, team_id): content = self._serialize.body(team_data, 'WebApiTeam') response = self._send(http_method='PATCH', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) diff --git a/azure-devops/azure/devops/released/elastic/__init__.py b/azure-devops/azure/devops/released/elastic/__init__.py new file mode 100644 index 00000000..4077e361 --- /dev/null +++ b/azure-devops/azure/devops/released/elastic/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.elastic.models import * +from .elastic_client import ElasticClient + +__all__ = [ + 'ElasticNode', + 'ElasticNodeSettings', + 'ElasticPool', + 'ElasticPoolCreationResult', + 'ElasticPoolLog', + 'ElasticPoolSettings', + 'GraphSubjectBase', + 'IdentityRef', + 'ReferenceLinks', + 'TaskAgentPool', + 'TaskAgentPoolReference', + 'TaskAgentQueue', + 'ElasticClient' +] diff --git a/azure-devops/azure/devops/released/elastic/elastic_client.py b/azure-devops/azure/devops/released/elastic/elastic_client.py new file mode 100644 index 00000000..dc44ed61 --- /dev/null +++ b/azure-devops/azure/devops/released/elastic/elastic_client.py @@ -0,0 +1,158 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.elastic import models + + +class ElasticClient(Client): + """Elastic + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ElasticClient, 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_elastic_pool_logs(self, pool_id, top=None): + """GetElasticPoolLogs. + Get elastic pool diagnostics logs for a specified Elastic Pool. + :param int pool_id: Pool Id of the Elastic Pool + :param int top: Number of elastic pool logs to retrieve + :rtype: [ElasticPoolLog] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='595b1769-61d5-4076-a72a-98a02105ca9a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticPoolLog]', self._unwrap_collection(response)) + + def create_elastic_pool(self, elastic_pool, pool_name, authorize_all_pipelines=None, auto_provision_project_pools=None, project_id=None): + """CreateElasticPool. + Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project. + :param :class:` ` elastic_pool: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool. + :param str pool_name: Name to use for the new TaskAgentPool + :param bool authorize_all_pipelines: Setting to determine if all pipelines are authorized to use this TaskAgentPool by default. + :param bool auto_provision_project_pools: Setting to automatically provision TaskAgentQueues in every project for the new pool. + :param str project_id: Optional: If provided, a new TaskAgentQueue will be created in the specified project. + :rtype: :class:` ` + """ + query_parameters = {} + if pool_name is not None: + query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') + if authorize_all_pipelines is not None: + query_parameters['authorizeAllPipelines'] = self._serialize.query('authorize_all_pipelines', authorize_all_pipelines, 'bool') + if auto_provision_project_pools is not None: + query_parameters['autoProvisionProjectPools'] = self._serialize.query('auto_provision_project_pools', auto_provision_project_pools, 'bool') + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + content = self._serialize.body(elastic_pool, 'ElasticPool') + response = self._send(http_method='POST', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('ElasticPoolCreationResult', response) + + def get_elastic_pool(self, pool_id): + """GetElasticPool. + Returns the Elastic Pool with the specified Pool Id. + :param int pool_id: Pool Id of the associated TaskAgentPool + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values) + return self._deserialize('ElasticPool', response) + + def get_elastic_pools(self): + """GetElasticPools. + Get a list of all Elastic Pools. + :rtype: [ElasticPool] + """ + response = self._send(http_method='GET', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0') + return self._deserialize('[ElasticPool]', self._unwrap_collection(response)) + + def update_elastic_pool(self, elastic_pool_settings, pool_id): + """UpdateElasticPool. + Update settings on a specified Elastic Pool. + :param :class:` ` elastic_pool_settings: New Elastic Pool settings data + :param int pool_id: + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + content = self._serialize.body(elastic_pool_settings, 'ElasticPoolSettings') + response = self._send(http_method='PATCH', + location_id='dd3c938f-835b-4971-b99a-db75a47aad43', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticPool', response) + + def get_elastic_nodes(self, pool_id, state=None): + """GetElasticNodes. + Get a list of ElasticNodes currently in the ElasticPool + :param int pool_id: Pool id of the ElasticPool + :param str state: Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState + :rtype: [ElasticNode] + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + query_parameters = {} + if state is not None: + query_parameters['$state'] = self._serialize.query('state', state, 'str') + response = self._send(http_method='GET', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ElasticNode]', self._unwrap_collection(response)) + + def update_elastic_node(self, elastic_node_settings, pool_id, elastic_node_id): + """UpdateElasticNode. + Update properties on a specified ElasticNode + :param :class:` ` elastic_node_settings: + :param int pool_id: + :param int elastic_node_id: + :rtype: :class:` ` + """ + route_values = {} + if pool_id is not None: + route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') + if elastic_node_id is not None: + route_values['elasticNodeId'] = self._serialize.url('elastic_node_id', elastic_node_id, 'int') + content = self._serialize.body(elastic_node_settings, 'ElasticNodeSettings') + response = self._send(http_method='PATCH', + location_id='1b232402-5ff0-42ad-9703-d76497835eb6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ElasticNode', response) + diff --git a/azure-devops/azure/devops/released/feed/__init__.py b/azure-devops/azure/devops/released/feed/__init__.py new file mode 100644 index 00000000..2939e52a --- /dev/null +++ b/azure-devops/azure/devops/released/feed/__init__.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.feed.models import * +from .feed_client import FeedClient + +__all__ = [ + 'Feed', + 'FeedBatchData', + 'FeedBatchOperationData', + 'FeedCore', + 'FeedChange', + 'FeedChangesResponse', + 'FeedPermission', + 'FeedRetentionPolicy', + 'FeedUpdate', + 'FeedView', + 'GlobalPermission', + 'JsonPatchOperation', + 'MinimalPackageVersion', + 'OperationReference', + 'Package', + 'PackageDependency', + 'PackageFile', + 'PackageChange', + 'PackageChangesResponse', + 'PackageMetrics', + 'PackageMetricsQuery', + 'PackageVersion', + 'PackageVersionChange', + 'PackageVersionMetrics', + 'PackageVersionMetricsQuery', + 'PackageVersionProvenance', + 'ProjectReference', + 'ProtocolMetadata', + 'Provenance', + 'RecycleBinPackageVersion', + 'ReferenceLinks', + 'UpstreamSource', + 'UpstreamStatusDetail', + 'FeedClient' +] diff --git a/azure-devops/azure/devops/v5_1/feed/feed_client.py b/azure-devops/azure/devops/released/feed/feed_client.py similarity index 83% rename from azure-devops/azure/devops/v5_1/feed/feed_client.py rename to azure-devops/azure/devops/released/feed/feed_client.py index f82a58f2..b7481e96 100644 --- a/azure-devops/azure/devops/v5_1/feed/feed_client.py +++ b/azure-devops/azure/devops/released/feed/feed_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from . import models +from ...v7_0.feed import models class FeedClient(Client): @@ -25,13 +25,13 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = '7ab4e64e-c4d8-4f50-ae73-5ef2e21642a5' - def get_badge(self, feed_id, package_id, project=None): + def get_badge(self, feed_id, package_id, project=None, **kwargs): """GetBadge. - [Preview API] Generate a SVG badge for the latest version of a package. The generated SVG is typically used as the image in an HTML link which takes users to the feed containing the package to accelerate discovery and consumption. + Generate a SVG badge for the latest version of a package. The generated SVG is typically used as the image in an HTML link which takes users to the feed containing the package to accelerate discovery and consumption. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param str project: Project ID or project name - :rtype: str + :rtype: object """ route_values = {} if project is not None: @@ -42,16 +42,21 @@ def get_badge(self, feed_id, package_id, project=None): route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') response = self._send(http_method='GET', location_id='61d885fd-10f3-4a55-82b6-476d866b673f', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) + version='7.0', + route_values=route_values, + accept_media_type='image/svg+xml') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) def get_feed_change(self, feed_id, project=None): """GetFeedChange. - [Preview API] Query a feed to determine its current state. + Query a feed to determine its current state. :param str feed_id: Name or ID of the feed. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -60,18 +65,18 @@ def get_feed_change(self, feed_id, project=None): route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='29ba2dad-389a-4661-b5d3-de76397ca05b', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('FeedChange', response) def get_feed_changes(self, project=None, include_deleted=None, continuation_token=None, batch_size=None): """GetFeedChanges. - [Preview API] Query to determine which feeds have changed since the last call, tracked through the provided continuationToken. Only changes to a feed itself are returned and impact the continuationToken, not additions or alterations to packages within the feeds. + Query to determine which feeds have changed since the last call, tracked through the provided continuationToken. Only changes to a feed itself are returned and impact the continuationToken, not additions or alterations to packages within the feeds. :param str project: Project ID or project name :param bool include_deleted: If true, get changes for all feeds including deleted feeds. The default value is false. :param long continuation_token: A continuation token which acts as a bookmark to a previously retrieved change. This token allows the user to continue retrieving changes in batches, picking up where the previous batch left off. If specified, all the changes that occur strictly after the token will be returned. If not specified or 0, iteration will start with the first change. :param int batch_size: Number of package changes to fetch. The default value is 1000. The maximum value is 2000. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -85,17 +90,66 @@ def get_feed_changes(self, project=None, include_deleted=None, continuation_toke query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') response = self._send(http_method='GET', location_id='29ba2dad-389a-4661-b5d3-de76397ca05b', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('FeedChangesResponse', response) + def get_feeds_from_recycle_bin(self, project=None): + """GetFeedsFromRecycleBin. + Query for feeds within the recycle bin. + :param str project: Project ID or project name + :rtype: [Feed] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + return self._deserialize('[Feed]', self._unwrap_collection(response)) + + def permanent_delete_feed(self, feed_id, project=None): + """PermanentDeleteFeed. + :param str feed_id: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + self._send(http_method='DELETE', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values) + + def restore_deleted_feed(self, patch_json, feed_id, project=None): + """RestoreDeletedFeed. + :param :class:`<[JsonPatchOperation]> ` patch_json: + :param str feed_id: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(patch_json, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='0cee643d-beb9-41f8-9368-3ada763a8344', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + def create_feed(self, feed, project=None): """CreateFeed. - [Preview API] Create a feed, a container for various package types. - :param :class:` ` feed: A JSON object containing both required and optional attributes for the feed. Name is the only required value. + Create a feed, a container for various package types. + :param :class:` ` feed: A JSON object containing both required and optional attributes for the feed. Name is the only required value. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -103,14 +157,14 @@ def create_feed(self, feed, project=None): content = self._serialize.body(feed, 'Feed') response = self._send(http_method='POST', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Feed', response) def delete_feed(self, feed_id, project=None): """DeleteFeed. - [Preview API] Remove a feed and all its packages. The action does not result in packages moving to the RecycleBin and is not reversible. + Remove a feed and all its packages. The feed moves to the recycle bin and is reversible. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name """ @@ -121,16 +175,16 @@ def delete_feed(self, feed_id, project=None): route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') self._send(http_method='DELETE', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', - version='5.1-preview.1', + version='7.0', route_values=route_values) def get_feed(self, feed_id, project=None, include_deleted_upstreams=None): """GetFeed. - [Preview API] Get the settings for a specific feed. + Get the settings for a specific feed. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -142,17 +196,18 @@ def get_feed(self, feed_id, project=None, include_deleted_upstreams=None): query_parameters['includeDeletedUpstreams'] = self._serialize.query('include_deleted_upstreams', include_deleted_upstreams, 'bool') response = self._send(http_method='GET', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Feed', response) - def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None): + def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None, include_urls=None): """GetFeeds. - [Preview API] Get all feeds in an account where you have the provided role access. + Get all feeds in an account where you have the provided role access. :param str project: Project ID or project name :param str feed_role: Filter by this role, either Administrator(4), Contributor(3), or Reader(2) level permissions. :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. + :param bool include_urls: Resolve names if true :rtype: [Feed] """ route_values = {} @@ -163,20 +218,22 @@ def get_feeds(self, project=None, feed_role=None, include_deleted_upstreams=None query_parameters['feedRole'] = self._serialize.query('feed_role', feed_role, 'str') if include_deleted_upstreams is not None: query_parameters['includeDeletedUpstreams'] = self._serialize.query('include_deleted_upstreams', include_deleted_upstreams, 'bool') + if include_urls is not None: + query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Feed]', self._unwrap_collection(response)) def update_feed(self, feed, feed_id, project=None): """UpdateFeed. - [Preview API] Change the attributes of a feed. - :param :class:` ` feed: A JSON object containing the feed settings to be updated. + Change the attributes of a feed. + :param :class:` ` feed: A JSON object containing the feed settings to be updated. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -186,14 +243,14 @@ def update_feed(self, feed, feed_id, project=None): content = self._serialize.body(feed, 'FeedUpdate') response = self._send(http_method='PATCH', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Feed', response) def get_global_permissions(self, include_ids=None): """GetGlobalPermissions. - [Preview API] Get all service-wide feed creation and administration permissions. + Get all service-wide feed creation and administration permissions. :param bool include_ids: Set to true to add IdentityIds to the permission objects. :rtype: [GlobalPermission] """ @@ -202,31 +259,31 @@ def get_global_permissions(self, include_ids=None): query_parameters['includeIds'] = self._serialize.query('include_ids', include_ids, 'bool') response = self._send(http_method='GET', location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', - version='5.1-preview.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) def set_global_permissions(self, global_permissions): """SetGlobalPermissions. - [Preview API] Set service-wide permissions that govern feed creation and administration. + Set service-wide permissions that govern feed creation and administration. :param [GlobalPermission] global_permissions: New permissions for the organization. :rtype: [GlobalPermission] """ content = self._serialize.body(global_permissions, '[GlobalPermission]') response = self._send(http_method='PATCH', location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', - version='5.1-preview.1', + version='7.0', content=content) return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) def get_package_changes(self, feed_id, project=None, continuation_token=None, batch_size=None): """GetPackageChanges. - [Preview API] Get a batch of package changes made to a feed. The changes returned are 'most recent change' so if an Add is followed by an Update before you begin enumerating, you'll only see one change in the batch. While consuming batches using the continuation token, you may see changes to the same package version multiple times if they are happening as you enumerate. + Get a batch of package changes made to a feed. The changes returned are 'most recent change' so if an Add is followed by an Update before you begin enumerating, you'll only see one change in the batch. While consuming batches using the continuation token, you may see changes to the same package version multiple times if they are happening as you enumerate. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :param long continuation_token: A continuation token which acts as a bookmark to a previously retrieved change. This token allows the user to continue retrieving changes in batches, picking up where the previous batch left off. If specified, all the changes that occur strictly after the token will be returned. If not specified or 0, iteration will start with the first change. :param int batch_size: Number of package changes to fetch. The default value is 1000. The maximum value is 2000. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -240,15 +297,14 @@ def get_package_changes(self, feed_id, project=None, continuation_token=None, ba query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') response = self._send(http_method='GET', location_id='323a0631-d083-4005-85ae-035114dfb681', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PackageChangesResponse', response) def query_package_metrics(self, package_id_query, feed_id, project=None): """QueryPackageMetrics. - [Preview API] - :param :class:` ` package_id_query: + :param :class:` ` package_id_query: :param str feed_id: :param str project: Project ID or project name :rtype: [PackageMetrics] @@ -261,14 +317,14 @@ def query_package_metrics(self, package_id_query, feed_id, project=None): content = self._serialize.body(package_id_query, 'PackageMetricsQuery') response = self._send(http_method='POST', location_id='bddc9b3c-8a59-4a9f-9b40-ee1dcaa2cc0d', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[PackageMetrics]', self._unwrap_collection(response)) def get_package(self, feed_id, package_id, project=None, include_all_versions=None, include_urls=None, is_listed=None, is_release=None, include_deleted=None, include_description=None): """GetPackage. - [Preview API] Get details about a specific package. + Get details about a specific package. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param str project: Project ID or project name @@ -278,7 +334,7 @@ def get_package(self, feed_id, package_id, project=None, include_all_versions=No :param bool is_release: Only applicable for Nuget packages. Use this to filter the response when includeAllVersions is set to true. Default is True (only return packages without prerelease versioning). :param bool include_deleted: Return deleted or unpublished versions of packages in the response. Default is False. :param bool include_description: Return the description for every version of each package in the response. Default is False. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -302,14 +358,14 @@ def get_package(self, feed_id, package_id, project=None, include_all_versions=No query_parameters['includeDescription'] = self._serialize.query('include_description', include_description, 'bool') response = self._send(http_method='GET', location_id='7a20d846-c929-4acc-9ea2-0d5a7df1b197', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def get_packages(self, feed_id, project=None, protocol_type=None, package_name_query=None, normalized_package_name=None, include_urls=None, include_all_versions=None, is_listed=None, get_top_package_versions=None, is_release=None, include_description=None, top=None, skip=None, include_deleted=None, is_cached=None, direct_upstream_id=None): """GetPackages. - [Preview API] Get details about all of the packages in the feed. Use the various filters to include or exclude information from the result set. + Get details about all of the packages in the feed. Use the various filters to include or exclude information from the result set. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :param str protocol_type: One of the supported artifact package types. @@ -364,19 +420,20 @@ def get_packages(self, feed_id, project=None, protocol_type=None, package_name_q query_parameters['directUpstreamId'] = self._serialize.query('direct_upstream_id', direct_upstream_id, 'str') response = self._send(http_method='GET', location_id='7a20d846-c929-4acc-9ea2-0d5a7df1b197', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Package]', self._unwrap_collection(response)) - def get_feed_permissions(self, feed_id, project=None, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None): + def get_feed_permissions(self, feed_id, project=None, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None, include_deleted_feeds=None): """GetFeedPermissions. - [Preview API] Get the permissions for a feed. + Get the permissions for a feed. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :param bool include_ids: True to include user Ids in the response. Default is false. :param bool exclude_inherited_permissions: True to only return explicitly set permissions on the feed. Default is false. :param str identity_descriptor: Filter permissions to the provided identity. + :param bool include_deleted_feeds: If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid. :rtype: [FeedPermission] """ route_values = {} @@ -391,16 +448,18 @@ def get_feed_permissions(self, feed_id, project=None, include_ids=None, exclude_ query_parameters['excludeInheritedPermissions'] = self._serialize.query('exclude_inherited_permissions', exclude_inherited_permissions, 'bool') if identity_descriptor is not None: query_parameters['identityDescriptor'] = self._serialize.query('identity_descriptor', identity_descriptor, 'str') + if include_deleted_feeds is not None: + query_parameters['includeDeletedFeeds'] = self._serialize.query('include_deleted_feeds', include_deleted_feeds, 'bool') response = self._send(http_method='GET', location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[FeedPermission]', self._unwrap_collection(response)) def set_feed_permissions(self, feed_permission, feed_id, project=None): """SetFeedPermissions. - [Preview API] Update the permissions on a feed. + Update the permissions on a feed. :param [FeedPermission] feed_permission: Permissions to set. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name @@ -414,43 +473,37 @@ def set_feed_permissions(self, feed_permission, feed_id, project=None): content = self._serialize.body(feed_permission, '[FeedPermission]') response = self._send(http_method='PATCH', location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[FeedPermission]', self._unwrap_collection(response)) - def get_package_version_provenance(self, feed_id, package_id, package_version_id, project=None): - """GetPackageVersionProvenance. - [Preview API] Gets provenance for a package version. - :param str feed_id: Name or Id of the feed. - :param str package_id: Id of the package (GUID Id, not name). - :param str package_version_id: Id of the package version (GUID Id, not name). + def empty_recycle_bin(self, feed_id, project=None): + """EmptyRecycleBin. + Queues a job to remove all package versions from a feed's recycle bin + :param str feed_id: Name or Id of the feed :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') - if package_id is not None: - route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') - if package_version_id is not None: - route_values['packageVersionId'] = self._serialize.url('package_version_id', package_version_id, 'str') - response = self._send(http_method='GET', - location_id='0aaeabd4-85cd-4686-8a77-8d31c15690b8', - version='5.1-preview.1', + response = self._send(http_method='DELETE', + location_id='2704e72c-f541-4141-99be-2004b50b05fa', + version='7.0', route_values=route_values) - return self._deserialize('PackageVersionProvenance', response) + return self._deserialize('OperationReference', response) def get_recycle_bin_package(self, feed_id, package_id, project=None, include_urls=None): """GetRecycleBinPackage. - [Preview API] Get information about a package and all its versions within the recycle bin. + Get information about a package and all its versions within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param str project: Project ID or project name :param bool include_urls: True to return REST Urls with the response. Default is True. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -464,14 +517,14 @@ def get_recycle_bin_package(self, feed_id, package_id, project=None, include_url query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='2704e72c-f541-4141-99be-2004b50b05fa', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def get_recycle_bin_packages(self, feed_id, project=None, protocol_type=None, package_name_query=None, include_urls=None, top=None, skip=None, include_all_versions=None): """GetRecycleBinPackages. - [Preview API] Query for packages within the recycle bin. + Query for packages within the recycle bin. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :param str protocol_type: Type of package (e.g. NuGet, npm, ...). @@ -502,20 +555,20 @@ def get_recycle_bin_packages(self, feed_id, project=None, protocol_type=None, pa query_parameters['includeAllVersions'] = self._serialize.query('include_all_versions', include_all_versions, 'bool') response = self._send(http_method='GET', location_id='2704e72c-f541-4141-99be-2004b50b05fa', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Package]', self._unwrap_collection(response)) def get_recycle_bin_package_version(self, feed_id, package_id, package_version_id, project=None, include_urls=None): """GetRecycleBinPackageVersion. - [Preview API] Get information about a package version within the recycle bin. + Get information about a package version within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param str package_version_id: The package version Id 9guid Id, not the version string). :param str project: Project ID or project name :param bool include_urls: True to return REST Urls with the response. Default is True. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -531,14 +584,14 @@ def get_recycle_bin_package_version(self, feed_id, package_id, package_version_i query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='aceb4be7-8737-4820-834c-4c549e10fdc7', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('RecycleBinPackageVersion', response) def get_recycle_bin_package_versions(self, feed_id, package_id, project=None, include_urls=None): """GetRecycleBinPackageVersions. - [Preview API] Get a list of package versions within the recycle bin. + Get a list of package versions within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param str project: Project ID or project name @@ -557,14 +610,14 @@ def get_recycle_bin_package_versions(self, feed_id, package_id, project=None, in query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='aceb4be7-8737-4820-834c-4c549e10fdc7', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RecycleBinPackageVersion]', self._unwrap_collection(response)) def delete_feed_retention_policies(self, feed_id, project=None): """DeleteFeedRetentionPolicies. - [Preview API] Delete the retention policy for a feed. + Delete the retention policy for a feed. :param str feed_id: Name or ID of the feed. :param str project: Project ID or project name """ @@ -575,15 +628,15 @@ def delete_feed_retention_policies(self, feed_id, project=None): route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') self._send(http_method='DELETE', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', - version='5.1-preview.1', + version='7.0', route_values=route_values) def get_feed_retention_policies(self, feed_id, project=None): """GetFeedRetentionPolicies. - [Preview API] Get the retention policy for a feed. + Get the retention policy for a feed. :param str feed_id: Name or ID of the feed. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -592,17 +645,17 @@ def get_feed_retention_policies(self, feed_id, project=None): route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('FeedRetentionPolicy', response) def set_feed_retention_policies(self, policy, feed_id, project=None): """SetFeedRetentionPolicies. - [Preview API] Set the retention policy for a feed. - :param :class:` ` policy: Feed retention policy. + Set the retention policy for a feed. + :param :class:` ` policy: Feed retention policy. :param str feed_id: Name or ID of the feed. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -612,15 +665,14 @@ def set_feed_retention_policies(self, policy, feed_id, project=None): content = self._serialize.body(policy, 'FeedRetentionPolicy') response = self._send(http_method='PUT', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('FeedRetentionPolicy', response) def query_package_version_metrics(self, package_version_id_query, feed_id, package_id, project=None): """QueryPackageVersionMetrics. - [Preview API] - :param :class:` ` package_version_id_query: + :param :class:` ` package_version_id_query: :param str feed_id: :param str package_id: :param str project: Project ID or project name @@ -636,14 +688,14 @@ def query_package_version_metrics(self, package_version_id_query, feed_id, packa content = self._serialize.body(package_version_id_query, 'PackageVersionMetricsQuery') response = self._send(http_method='POST', location_id='e6ae8caa-b6a8-4809-b840-91b2a42c19ad', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[PackageVersionMetrics]', self._unwrap_collection(response)) def get_package_version(self, feed_id, package_id, package_version_id, project=None, include_urls=None, is_listed=None, is_deleted=None): """GetPackageVersion. - [Preview API] Get details about a specific package version. + Get details about a specific package version. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param str package_version_id: Id of the package version (GUID Id, not name). @@ -651,7 +703,7 @@ def get_package_version(self, feed_id, package_id, package_version_id, project=N :param bool include_urls: True to include urls for each version. Default is true. :param bool is_listed: Only applicable for NuGet packages. If false, delisted package versions will be returned. :param bool is_deleted: This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions). - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -671,14 +723,14 @@ def get_package_version(self, feed_id, package_id, package_version_id, project=N query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') response = self._send(http_method='GET', location_id='3b331909-6a86-44cc-b9ec-c1834c35498f', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PackageVersion', response) def get_package_versions(self, feed_id, package_id, project=None, include_urls=None, is_listed=None, is_deleted=None): """GetPackageVersions. - [Preview API] Get a list of package versions, optionally filtering by state. + Get a list of package versions, optionally filtering by state. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param str project: Project ID or project name @@ -703,18 +755,18 @@ def get_package_versions(self, feed_id, package_id, project=None, include_urls=N query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') response = self._send(http_method='GET', location_id='3b331909-6a86-44cc-b9ec-c1834c35498f', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PackageVersion]', self._unwrap_collection(response)) def create_feed_view(self, view, feed_id, project=None): """CreateFeedView. - [Preview API] Create a new view on the referenced feed. - :param :class:` ` view: View to be created. + Create a new view on the referenced feed. + :param :class:` ` view: View to be created. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -724,14 +776,14 @@ def create_feed_view(self, view, feed_id, project=None): content = self._serialize.body(view, 'FeedView') response = self._send(http_method='POST', location_id='42a8502a-6785-41bc-8c16-89477d930877', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('FeedView', response) def delete_feed_view(self, feed_id, view_id, project=None): """DeleteFeedView. - [Preview API] Delete a feed view. + Delete a feed view. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. :param str project: Project ID or project name @@ -745,16 +797,16 @@ def delete_feed_view(self, feed_id, view_id, project=None): route_values['viewId'] = self._serialize.url('view_id', view_id, 'str') self._send(http_method='DELETE', location_id='42a8502a-6785-41bc-8c16-89477d930877', - version='5.1-preview.1', + version='7.0', route_values=route_values) def get_feed_view(self, feed_id, view_id, project=None): """GetFeedView. - [Preview API] Get a view by Id. + Get a view by Id. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -765,13 +817,13 @@ def get_feed_view(self, feed_id, view_id, project=None): route_values['viewId'] = self._serialize.url('view_id', view_id, 'str') response = self._send(http_method='GET', location_id='42a8502a-6785-41bc-8c16-89477d930877', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('FeedView', response) def get_feed_views(self, feed_id, project=None): """GetFeedViews. - [Preview API] Get all views for a feed. + Get all views for a feed. :param str feed_id: Name or Id of the feed. :param str project: Project ID or project name :rtype: [FeedView] @@ -783,18 +835,18 @@ def get_feed_views(self, feed_id, project=None): route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='42a8502a-6785-41bc-8c16-89477d930877', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('[FeedView]', self._unwrap_collection(response)) def update_feed_view(self, view, feed_id, view_id, project=None): """UpdateFeedView. - [Preview API] Update a view. - :param :class:` ` view: New settings to apply to the specified view. + Update a view. + :param :class:` ` view: New settings to apply to the specified view. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -806,7 +858,7 @@ def update_feed_view(self, view, feed_id, view_id, project=None): content = self._serialize.body(view, 'FeedView') response = self._send(http_method='PATCH', location_id='42a8502a-6785-41bc-8c16-89477d930877', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('FeedView', response) diff --git a/azure-devops/azure/devops/released/git/__init__.py b/azure-devops/azure/devops/released/git/__init__.py index 581a92e4..45b4942c 100644 --- a/azure-devops/azure/devops/released/git/__init__.py +++ b/azure-devops/azure/devops/released/git/__init__.py @@ -6,12 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.git.models import * +from ...v7_0.git.models import * from .git_client import GitClient __all__ = [ 'Attachment', - 'Change', 'Comment', 'CommentIterationContext', 'CommentPosition', @@ -30,10 +29,9 @@ 'GitBaseVersionDescriptor', 'GitBlobRef', 'GitBranchStats', - 'GitCherryPick', 'GitCommit', - 'GitCommitChanges', 'GitCommitDiffs', + 'GitCommitChanges', 'GitCommitRef', 'GitConflict', 'GitConflictUpdateResult', @@ -43,6 +41,7 @@ 'GitForkRef', 'GitForkSyncRequest', 'GitForkSyncRequestParameters', + 'GitCherryPick', 'GitImportGitSource', 'GitImportRequest', 'GitImportRequestParameters', @@ -58,10 +57,10 @@ 'GitObject', 'GitPolicyConfigurationResponse', 'GitPullRequest', - 'GitPullRequestChange', 'GitPullRequestCommentThread', 'GitPullRequestCommentThreadContext', 'GitPullRequestCompletionOptions', + 'GitPullRequestChange', 'GitPullRequestIteration', 'GitPullRequestIterationChanges', 'GitPullRequestMergeOptions', @@ -98,6 +97,7 @@ 'GitVersionDescriptor', 'GlobalGitRepositoryKey', 'GraphSubjectBase', + 'Change', 'IdentityRef', 'IdentityRefWithVote', 'ImportRepositoryValidation', diff --git a/azure-devops/azure/devops/released/git/git_client.py b/azure-devops/azure/devops/released/git/git_client.py deleted file mode 100644 index b2900002..00000000 --- a/azure-devops/azure/devops/released/git/git_client.py +++ /dev/null @@ -1,13 +0,0 @@ -# coding=utf-8 - -from .git_client_base import GitClientBase - - -class GitClient(GitClientBase): - """Git - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(GitClient, self).__init__(base_url, creds) diff --git a/azure-devops/azure/devops/released/git/git_client_base.py b/azure-devops/azure/devops/released/git/git_client_base.py index 38158300..0df755f7 100644 --- a/azure-devops/azure/devops/released/git/git_client_base.py +++ b/azure-devops/azure/devops/released/git/git_client_base.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.git import models +from ...v7_0.git import models class GitClientBase(Client): @@ -25,6 +25,48 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = '4e080c62-fa21-4fbc-8fef-2a10a2b38049' + def create_annotated_tag(self, tag_object, project, repository_id): + """CreateAnnotatedTag. + Create an annotated tag. + :param :class:` ` tag_object: Object containing details of tag to be created. + :param str project: Project ID or project name + :param str repository_id: ID or name of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + content = self._serialize.body(tag_object, 'GitAnnotatedTag') + response = self._send(http_method='POST', + location_id='5e8a8081-3851-4626-b677-9891cc04102e', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitAnnotatedTag', response) + + def get_annotated_tag(self, project, repository_id, object_id): + """GetAnnotatedTag. + Get an annotated tag. + :param str project: Project ID or project name + :param str repository_id: ID or name of the repository. + :param str object_id: ObjectId (Sha1Id) of tag to get. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if object_id is not None: + route_values['objectId'] = self._serialize.url('object_id', object_id, 'str') + response = self._send(http_method='GET', + location_id='5e8a8081-3851-4626-b677-9891cc04102e', + version='7.0', + route_values=route_values) + return self._deserialize('GitAnnotatedTag', response) + def get_blob(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None): """GetBlob. Get a single blob. @@ -34,7 +76,7 @@ def get_blob(self, repository_id, sha1, project=None, download=None, file_name=N :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -52,7 +94,7 @@ def get_blob(self, repository_id, sha1, project=None, download=None, file_name=N query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBlobRef', response) @@ -84,7 +126,7 @@ def get_blob_content(self, repository_id, sha1, project=None, download=None, fil query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -114,7 +156,7 @@ def get_blobs_zip(self, blob_ids, repository_id, project=None, filename=None, ** content = self._serialize.body(blob_ids, '[str]') response = self._send(http_method='POST', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, @@ -152,7 +194,7 @@ def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_na query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -168,8 +210,8 @@ def get_branch(self, repository_id, name, project=None, base_version_descriptor= :param str repository_id: The name or ID of the repository. :param str name: Name of the branch. :param str project: Project ID or project name - :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. - :rtype: :class:` ` + :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -188,7 +230,7 @@ def get_branch(self, repository_id, name, project=None, base_version_descriptor= query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBranchStats', response) @@ -198,7 +240,7 @@ def get_branches(self, repository_id, project=None, base_version_descriptor=None Retrieve statistics about all branches within a repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name - :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. + :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. :rtype: [GitBranchStats] """ route_values = {} @@ -216,40 +258,11 @@ def get_branches(self, repository_id, project=None, base_version_descriptor=None query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitBranchStats]', self._unwrap_collection(response)) - def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): - """GetChanges. - Retrieve changes for a particular commit. - :param str commit_id: The id of the commit. - :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - :param str project: Project ID or project name - :param int top: The maximum number of changes to return. - :param int skip: The number of changes to skip. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if commit_id is not None: - route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') - if repository_id is not None: - route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') - query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if skip is not None: - query_parameters['skip'] = self._serialize.query('skip', skip, 'int') - response = self._send(http_method='GET', - location_id='5bf884f5-3e07-42e9-afb8-1b872267bf16', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('GitCommitChanges', response) - def get_commit_diffs(self, repository_id, project=None, diff_common_commit=None, top=None, skip=None, base_version_descriptor=None, target_version_descriptor=None): """GetCommitDiffs. Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits. @@ -258,9 +271,9 @@ def get_commit_diffs(self, repository_id, project=None, diff_common_commit=None, :param bool diff_common_commit: If true, diff between common and target commits. If false, diff between base and target commits. :param int top: Maximum number of changes to return. Defaults to 100. :param int skip: Number of changes to skip - :param :class:` ` base_version_descriptor: Descriptor for base commit. - :param :class:` ` target_version_descriptor: Descriptor for target commit. - :rtype: :class:` ` + :param :class:` ` base_version_descriptor: Descriptor for base commit. + :param :class:` ` target_version_descriptor: Descriptor for target commit. + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -290,7 +303,7 @@ def get_commit_diffs(self, repository_id, project=None, diff_common_commit=None, query_parameters['targetVersionOptions'] = target_version_descriptor.target_version_options response = self._send(http_method='GET', location_id='615588d5-c0c7-4b88-88f8-e625306446e8', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommitDiffs', response) @@ -302,7 +315,7 @@ def get_commit(self, commit_id, repository_id, project=None, change_count=None): :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param str project: Project ID or project name :param int change_count: The number of changes to include in the result. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -316,7 +329,7 @@ def get_commit(self, commit_id, repository_id, project=None, change_count=None): query_parameters['changeCount'] = self._serialize.query('change_count', change_count, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommit', response) @@ -325,7 +338,7 @@ def get_commits(self, repository_id, search_criteria, project=None, skip=None, t """GetCommits. Retrieve git commits for a project :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - :param :class:` ` search_criteria: + :param :class:` ` search_criteria: :param str project: Project ID or project name :param int skip: :param int top: @@ -384,13 +397,15 @@ def get_commits(self, repository_id, search_criteria, project=None, skip=None, t query_parameters['searchCriteria.includePushData'] = search_criteria.include_push_data if search_criteria.history_mode is not None: query_parameters['searchCriteria.historyMode'] = search_criteria.history_mode + if search_criteria.show_oldest_commits_first is not None: + query_parameters['searchCriteria.showOldestCommitsFirst'] = search_criteria.show_oldest_commits_first if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) @@ -422,7 +437,7 @@ def get_push_commits(self, repository_id, push_id, project=None, top=None, skip= query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) @@ -430,7 +445,7 @@ def get_push_commits(self, repository_id, push_id, project=None, top=None, skip= def get_commits_batch(self, search_criteria, repository_id, project=None, skip=None, top=None, include_statuses=None): """GetCommitsBatch. Retrieve git commits for a project matching the search criteria - :param :class:` ` search_criteria: Search options + :param :class:` ` search_criteria: Search options :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param int skip: Number of commits to skip. @@ -453,13 +468,315 @@ def get_commits_batch(self, search_criteria, repository_id, project=None, skip=N content = self._serialize.body(search_criteria, 'GitQueryCommitsCriteria') response = self._send(http_method='POST', location_id='6400dfb2-0bcb-462b-b992-5a57f8f1416c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) - def get_item(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None): + def get_deleted_repositories(self, project): + """GetDeletedRepositories. + Retrieve deleted git repositories. + :param str project: Project ID or project name + :rtype: [GitDeletedRepository] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='2b6869c4-cb25-42b5-b7a3-0d3e6be0a11a', + version='7.0', + route_values=route_values) + return self._deserialize('[GitDeletedRepository]', self._unwrap_collection(response)) + + def get_forks(self, repository_name_or_id, collection_id, project=None, include_links=None): + """GetForks. + Retrieve all forks of a repository in the collection. + :param str repository_name_or_id: The name or ID of the repository. + :param str collection_id: Team project collection ID. + :param str project: Project ID or project name + :param bool include_links: True to include links. + :rtype: [GitRepositoryRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + if collection_id is not None: + route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str') + query_parameters = {} + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + response = self._send(http_method='GET', + location_id='158c0340-bf6f-489c-9625-d572a1480d57', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitRepositoryRef]', self._unwrap_collection(response)) + + def create_fork_sync_request(self, sync_params, repository_name_or_id, project=None, include_links=None): + """CreateForkSyncRequest. + Request that another repository's refs be fetched into this one. It syncs two existing forks. To create a fork, please see the repositories endpoint + :param :class:` ` sync_params: Source repository and ref mapping. + :param str repository_name_or_id: The name or ID of the repository. + :param str project: Project ID or project name + :param bool include_links: True to include links + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + query_parameters = {} + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + content = self._serialize.body(sync_params, 'GitForkSyncRequestParameters') + response = self._send(http_method='POST', + location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('GitForkSyncRequest', response) + + def get_fork_sync_request(self, repository_name_or_id, fork_sync_operation_id, project=None, include_links=None): + """GetForkSyncRequest. + Get a specific fork sync operation's details. + :param str repository_name_or_id: The name or ID of the repository. + :param int fork_sync_operation_id: OperationId of the sync request. + :param str project: Project ID or project name + :param bool include_links: True to include links. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + if fork_sync_operation_id is not None: + route_values['forkSyncOperationId'] = self._serialize.url('fork_sync_operation_id', fork_sync_operation_id, 'int') + query_parameters = {} + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + response = self._send(http_method='GET', + location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitForkSyncRequest', response) + + def get_fork_sync_requests(self, repository_name_or_id, project=None, include_abandoned=None, include_links=None): + """GetForkSyncRequests. + Retrieve all requested fork sync operations on this repository. + :param str repository_name_or_id: The name or ID of the repository. + :param str project: Project ID or project name + :param bool include_abandoned: True to include abandoned requests. + :param bool include_links: True to include links. + :rtype: [GitForkSyncRequest] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + query_parameters = {} + if include_abandoned is not None: + query_parameters['includeAbandoned'] = self._serialize.query('include_abandoned', include_abandoned, 'bool') + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + response = self._send(http_method='GET', + location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitForkSyncRequest]', self._unwrap_collection(response)) + + def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): + """GetChanges. + Retrieve changes for a particular commit. + :param str commit_id: The id of the commit. + :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + :param str project: Project ID or project name + :param int top: The maximum number of changes to return. + :param int skip: The number of changes to skip. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if commit_id is not None: + route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + query_parameters = {} + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + response = self._send(http_method='GET', + location_id='5bf884f5-3e07-42e9-afb8-1b872267bf16', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitCommitChanges', response) + + def create_cherry_pick(self, cherry_pick_to_create, project, repository_id): + """CreateCherryPick. + Cherry pick a specific commit or commits that are associated to a pull request into a new branch. + :param :class:` ` cherry_pick_to_create: + :param str project: Project ID or project name + :param str repository_id: ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + content = self._serialize.body(cherry_pick_to_create, 'GitAsyncRefOperationParameters') + response = self._send(http_method='POST', + location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick(self, project, cherry_pick_id, repository_id): + """GetCherryPick. + Retrieve information about a cherry pick operation by cherry pick Id. + :param str project: Project ID or project name + :param int cherry_pick_id: ID of the cherry pick. + :param str repository_id: ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if cherry_pick_id is not None: + route_values['cherryPickId'] = self._serialize.url('cherry_pick_id', cherry_pick_id, 'int') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + response = self._send(http_method='GET', + location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', + version='7.0', + route_values=route_values) + return self._deserialize('GitCherryPick', response) + + def get_cherry_pick_for_ref_name(self, project, repository_id, ref_name): + """GetCherryPickForRefName. + Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations. + :param str project: Project ID or project name + :param str repository_id: ID of the repository. + :param str ref_name: The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + query_parameters = {} + if ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + response = self._send(http_method='GET', + location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitCherryPick', response) + + def create_import_request(self, import_request, project, repository_id): + """CreateImportRequest. + Create an import request. + :param :class:` ` import_request: The import request to create. + :param str project: Project ID or project name + :param str repository_id: The name or ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + content = self._serialize.body(import_request, 'GitImportRequest') + response = self._send(http_method='POST', + location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitImportRequest', response) + + def get_import_request(self, project, repository_id, import_request_id): + """GetImportRequest. + Retrieve a particular import request. + :param str project: Project ID or project name + :param str repository_id: The name or ID of the repository. + :param int import_request_id: The unique identifier for the import request. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if import_request_id is not None: + route_values['importRequestId'] = self._serialize.url('import_request_id', import_request_id, 'int') + response = self._send(http_method='GET', + location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', + version='7.0', + route_values=route_values) + return self._deserialize('GitImportRequest', response) + + def query_import_requests(self, project, repository_id, include_abandoned=None): + """QueryImportRequests. + Retrieve import requests for a repository. + :param str project: Project ID or project name + :param str repository_id: The name or ID of the repository. + :param bool include_abandoned: True to include abandoned import requests in the results. + :rtype: [GitImportRequest] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + query_parameters = {} + if include_abandoned is not None: + query_parameters['includeAbandoned'] = self._serialize.query('include_abandoned', include_abandoned, 'bool') + response = self._send(http_method='GET', + location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitImportRequest]', self._unwrap_collection(response)) + + def update_import_request(self, import_request_to_update, project, repository_id, import_request_id): + """UpdateImportRequest. + Retry or abandon a failed import request. + :param :class:` ` import_request_to_update: The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned. + :param str project: Project ID or project name + :param str repository_id: The name or ID of the repository. + :param int import_request_id: The unique identifier for the import request to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if import_request_id is not None: + route_values['importRequestId'] = self._serialize.url('import_request_id', import_request_id, 'int') + content = self._serialize.body(import_request_to_update, 'GitImportRequest') + response = self._send(http_method='PATCH', + location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitImportRequest', response) + + def get_item(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, sanitize=None): """GetItem. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. @@ -470,10 +787,11 @@ def get_item(self, repository_id, path, project=None, scope_path=None, recursion :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. - :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. + :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. - :rtype: :class:` ` + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -504,14 +822,16 @@ def get_item(self, repository_id, path, project=None, scope_path=None, recursion query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitItem', response) - def get_item_content(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): + def get_item_content(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, sanitize=None, **kwargs): """GetItemContent. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. @@ -522,9 +842,10 @@ def get_item_content(self, repository_id, path, project=None, scope_path=None, r :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. - :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. + :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. :rtype: object """ route_values = {} @@ -556,9 +877,11 @@ def get_item_content(self, repository_id, path, project=None, scope_path=None, r query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -579,7 +902,7 @@ def get_items(self, repository_id, project=None, scope_path=None, recursion_leve :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param bool include_links: Set to true to include links to items. Default is false. - :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. + :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :rtype: [GitItem] """ route_values = {} @@ -609,12 +932,12 @@ def get_items(self, repository_id, project=None, scope_path=None, recursion_leve query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitItem]', self._unwrap_collection(response)) - def get_item_text(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): + def get_item_text(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, sanitize=None, **kwargs): """GetItemText. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. @@ -625,9 +948,10 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. - :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. + :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. :rtype: object """ route_values = {} @@ -659,9 +983,11 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -671,7 +997,7 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu callback = None return self._client.stream_download(response, callback=callback) - def get_item_zip(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): + def get_item_zip(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, sanitize=None, **kwargs): """GetItemZip. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. @@ -682,9 +1008,10 @@ def get_item_zip(self, repository_id, path, project=None, scope_path=None, recur :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. - :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. + :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. + :param bool sanitize: Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. :rtype: object """ route_values = {} @@ -716,9 +1043,11 @@ def get_item_zip(self, repository_id, path, project=None, scope_path=None, recur query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') + if sanitize is not None: + query_parameters['sanitize'] = self._serialize.query('sanitize', sanitize, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -731,7 +1060,7 @@ def get_item_zip(self, repository_id, path, project=None, scope_path=None, recur def get_items_batch(self, request_data, repository_id, project=None): """GetItemsBatch. Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path - :param :class:` ` request_data: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references. + :param :class:` ` request_data: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references. :param str repository_id: The name or ID of the repository :param str project: Project ID or project name :rtype: [[GitItem]] @@ -744,98 +1073,412 @@ def get_items_batch(self, request_data, repository_id, project=None): content = self._serialize.body(request_data, 'GitItemRequestData') response = self._send(http_method='POST', location_id='630fd2e4-fb88-4f85-ad21-13f3fd1fbca9', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[[GitItem]]', self._unwrap_collection(response)) - def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None): - """GetPullRequestIterationCommits. - Get the commits for the specified iteration of a pull request. - :param str repository_id: ID or name of the repository. - :param int pull_request_id: ID of the pull request. - :param int iteration_id: ID of the iteration from which to get the commits. + def get_merge_bases(self, repository_name_or_id, commit_id, other_commit_id, project=None, other_collection_id=None, other_repository_id=None): + """GetMergeBases. + Find the merge bases of two commits, optionally across forks. If otherRepositoryId is not specified, the merge bases will only be calculated within the context of the local repositoryNameOrId. + :param str repository_name_or_id: ID or name of the local repository. + :param str commit_id: First commit, usually the tip of the target branch of the potential merge. + :param str other_commit_id: Other commit, usually the tip of the source branch of the potential merge. :param str project: Project ID or project name - :param int top: Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500. - :param int skip: Number of commits to skip. + :param str other_collection_id: The collection ID where otherCommitId lives. + :param str other_repository_id: The repository ID where otherCommitId lives. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - if repository_id is not None: - route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') - if pull_request_id is not None: - route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') - if iteration_id is not None: - route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + if commit_id is not None: + route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if skip is not None: - query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + if other_commit_id is not None: + query_parameters['otherCommitId'] = self._serialize.query('other_commit_id', other_commit_id, 'str') + if other_collection_id is not None: + query_parameters['otherCollectionId'] = self._serialize.query('other_collection_id', other_collection_id, 'str') + if other_repository_id is not None: + query_parameters['otherRepositoryId'] = self._serialize.query('other_repository_id', other_repository_id, 'str') response = self._send(http_method='GET', - location_id='e7ea0883-095f-4926-b5fb-f24691c26fb9', - version='5.1', + location_id='7cf2abb6-c964-4f7e-9872-f78c66e72e9c', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) - def get_pull_request_commits(self, repository_id, pull_request_id, project=None, top=None, continuation_token=None): - """GetPullRequestCommits. - Get the commits for the specified pull request. - :param str repository_id: ID or name of the repository. - :param int pull_request_id: ID of the pull request. + def create_merge_request(self, merge_parameters, project, repository_name_or_id, include_links=None): + """CreateMergeRequest. + Request a git merge operation. Currently we support merging only 2 commits. + :param :class:` ` merge_parameters: Parents commitIds and merge commit messsage. :param str project: Project ID or project name - :param int top: Maximum number of commits to return. - :param str continuation_token: The continuation token used for pagination. - :rtype: :class:`` + :param str repository_name_or_id: The name or ID of the repository. + :param bool include_links: True to include links + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - if repository_id is not None: - route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') - if pull_request_id is not None: - route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') query_parameters = {} - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - response = self._send(http_method='GET', - location_id='52823034-34a8-4576-922c-8d8b77e9e4c4', - version='5.1', + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + content = self._serialize.body(merge_parameters, 'GitMergeParameters') + response = self._send(http_method='POST', + location_id='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('GitMerge', response) + + def get_merge_request(self, project, repository_name_or_id, merge_operation_id, include_links=None): + """GetMergeRequest. + Get a specific merge operation's details. + :param str project: Project ID or project name + :param str repository_name_or_id: The name or ID of the repository. + :param int merge_operation_id: OperationId of the merge request. + :param bool include_links: True to include links + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_name_or_id is not None: + route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') + if merge_operation_id is not None: + route_values['mergeOperationId'] = self._serialize.url('merge_operation_id', merge_operation_id, 'int') + query_parameters = {} + if include_links is not None: + query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') + response = self._send(http_method='GET', + location_id='985f7ae9-844f-4906-9897-7ef41516c0e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitMerge', response) + + def get_policy_configurations(self, project, repository_id=None, ref_name=None, policy_type=None, top=None, continuation_token=None): + """GetPolicyConfigurations. + Retrieve a list of policy configurations by a given set of scope/filtering criteria. + :param str project: Project ID or project name + :param str repository_id: The repository id. + :param str ref_name: The fully-qualified Git ref name (e.g. refs/heads/master). + :param str policy_type: The policy type filter. + :param int top: Maximum number of policies to return. + :param str continuation_token: Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + if policy_type is not None: + query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='2c420070-a0a2-49cc-9639-c9f271c5ff07', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.GitPolicyConfigurationResponse() + response_object.policy_configurations = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) + response_object.continuation_token = response.headers.get('x-ms-continuationtoken') + return response_object + + def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None, **kwargs): + """CreateAttachment. + Attach a new file to a pull request. + :param object upload_stream: Stream to upload + :param str file_name: The name of the file. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if file_name is not None: + route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + content = self._client.stream_upload(upload_stream, callback=callback) + response = self._send(http_method='POST', + location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', + version='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('Attachment', response) + + def delete_attachment(self, file_name, repository_id, pull_request_id, project=None): + """DeleteAttachment. + Delete a pull request attachment. + :param str file_name: The name of the attachment to delete. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if file_name is not None: + route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + self._send(http_method='DELETE', + location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', + version='7.0', + route_values=route_values) + + def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None, **kwargs): + """GetAttachmentContent. + Get the file content of a pull request attachment. + :param str file_name: The name of the attachment. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if file_name is not None: + route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + response = self._send(http_method='GET', + location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_attachments(self, repository_id, pull_request_id, project=None): + """GetAttachments. + Get a list of files attached to a given pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: [Attachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + response = self._send(http_method='GET', + location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', + version='7.0', + route_values=route_values) + return self._deserialize('[Attachment]', self._unwrap_collection(response)) + + def get_attachment_zip(self, file_name, repository_id, pull_request_id, project=None, **kwargs): + """GetAttachmentZip. + Get the file content of a pull request attachment. + :param str file_name: The name of the attachment. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if file_name is not None: + route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + response = self._send(http_method='GET', + location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', + version='7.0', + route_values=route_values, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def create_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """CreateLike. + Add a like on a comment. + :param str repository_id: The repository ID of the pull request's target branch. + :param int pull_request_id: ID of the pull request. + :param int thread_id: The ID of the thread that contains the comment. + :param int comment_id: The ID of the comment. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if thread_id is not None: + route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + self._send(http_method='POST', + location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', + version='7.0', + route_values=route_values) + + def delete_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """DeleteLike. + Delete a like on a comment. + :param str repository_id: The repository ID of the pull request's target branch. + :param int pull_request_id: ID of the pull request. + :param int thread_id: The ID of the thread that contains the comment. + :param int comment_id: The ID of the comment. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if thread_id is not None: + route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + self._send(http_method='DELETE', + location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', + version='7.0', + route_values=route_values) + + def get_likes(self, repository_id, pull_request_id, thread_id, comment_id, project=None): + """GetLikes. + Get likes for a comment. + :param str repository_id: The repository ID of the pull request's target branch. + :param int pull_request_id: ID of the pull request. + :param int thread_id: The ID of the thread that contains the comment. + :param int comment_id: The ID of the comment. + :param str project: Project ID or project name + :rtype: [IdentityRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if thread_id is not None: + route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') + if comment_id is not None: + route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') + response = self._send(http_method='GET', + location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', + version='7.0', + route_values=route_values) + return self._deserialize('[IdentityRef]', self._unwrap_collection(response)) + + def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None): + """GetPullRequestIterationCommits. + Get the commits for the specified iteration of a pull request. + :param str repository_id: ID or name of the repository. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the iteration from which to get the commits. + :param str project: Project ID or project name + :param int top: Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500. + :param int skip: Number of commits to skip. + :rtype: [GitCommitRef] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + query_parameters = {} + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + response = self._send(http_method='GET', + location_id='e7ea0883-095f-4926-b5fb-f24691c26fb9', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetPullRequestCommitsResponseValue(response_value, continuation_token) - - class GetPullRequestCommitsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_pull_request_commits method - - :param value: - :type value: :class:`<[GitCommitRef]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) + + def get_pull_request_commits(self, repository_id, pull_request_id, project=None, top=None, continuation_token=None): + """GetPullRequestCommits. + Get the commits for the specified pull request. + :param str repository_id: ID or name of the repository. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :param int top: Maximum number of commits to return. + :param str continuation_token: The continuation token used for pagination. + :rtype: :class:`<[GitCommitRef]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='52823034-34a8-4576-922c-8d8b77e9e4c4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_pull_request_iteration_changes(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None, compare_to=None): """GetPullRequestIterationChanges. Retrieve the changes made in a pull request between two iterations. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. - :param int iteration_id: ID of the pull request iteration.
Iteration IDs are zero-based with zero indicating the common commit between the source and target branches. Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. + :param int iteration_id: ID of the pull request iteration.
Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. Allowed values are between 1 and the maximum iteration on this pull request. :param str project: Project ID or project name :param int top: Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000. :param int skip: Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100. :param int compare_to: ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -855,7 +1498,7 @@ def get_pull_request_iteration_changes(self, repository_id, pull_request_id, ite query_parameters['$compareTo'] = self._serialize.query('compare_to', compare_to, 'int') response = self._send(http_method='GET', location_id='4216bdcf-b6b1-4d59-8b82-c34cc183fc8b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestIterationChanges', response) @@ -867,7 +1510,7 @@ def get_pull_request_iteration(self, repository_id, pull_request_id, iteration_i :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration to return. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -880,7 +1523,7 @@ def get_pull_request_iteration(self, repository_id, pull_request_id, iteration_i route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('GitPullRequestIteration', response) @@ -905,18 +1548,304 @@ def get_pull_request_iterations(self, repository_id, pull_request_id, project=No query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'bool') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestIteration]', self._unwrap_collection(response)) + def create_pull_request_iteration_status(self, status, repository_id, pull_request_id, iteration_id, project=None): + """CreatePullRequestIterationStatus. + Create a pull request status on the iteration. This operation will have the same result as Create status on pull request with specified iteration ID in the request body. + :param :class:` ` status: Pull request status to create. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the pull request iteration. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + content = self._serialize.body(status, 'GitPullRequestStatus') + response = self._send(http_method='POST', + location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitPullRequestStatus', response) + + def delete_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): + """DeletePullRequestIterationStatus. + Delete pull request iteration status. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the pull request iteration. + :param int status_id: ID of the pull request status. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + if status_id is not None: + route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') + self._send(http_method='DELETE', + location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', + version='7.0', + route_values=route_values) + + def get_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): + """GetPullRequestIterationStatus. + Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the pull request iteration. + :param int status_id: ID of the pull request status. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + if status_id is not None: + route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') + response = self._send(http_method='GET', + location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', + version='7.0', + route_values=route_values) + return self._deserialize('GitPullRequestStatus', response) + + def get_pull_request_iteration_statuses(self, repository_id, pull_request_id, iteration_id, project=None): + """GetPullRequestIterationStatuses. + Get all the statuses associated with a pull request iteration. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the pull request iteration. + :param str project: Project ID or project name + :rtype: [GitPullRequestStatus] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + response = self._send(http_method='GET', + location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', + version='7.0', + route_values=route_values) + return self._deserialize('[GitPullRequestStatus]', self._unwrap_collection(response)) + + def update_pull_request_iteration_statuses(self, patch_document, repository_id, pull_request_id, iteration_id, project=None): + """UpdatePullRequestIterationStatuses. + Update pull request iteration statuses collection. The only supported operation type is `remove`. + :param :class:`<[JsonPatchOperation]> ` patch_document: Operations to apply to the pull request statuses in JSON Patch format. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int iteration_id: ID of the pull request iteration. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') + content = self._serialize.body(patch_document, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + + def create_pull_request_label(self, label, repository_id, pull_request_id, project=None, project_id=None): + """CreatePullRequestLabel. + Create a label for a specified pull request. The only required field is the name of the new label. + :param :class:` ` label: Label to assign to the pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :param str project_id: Project ID or project name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + query_parameters = {} + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + content = self._serialize.body(label, 'WebApiCreateTagRequestData') + response = self._send(http_method='POST', + location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('WebApiTagDefinition', response) + + def delete_pull_request_labels(self, repository_id, pull_request_id, label_id_or_name, project=None, project_id=None): + """DeletePullRequestLabels. + Removes a label from the set of those assigned to the pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str label_id_or_name: The name or ID of the label requested. + :param str project: Project ID or project name + :param str project_id: Project ID or project name. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if label_id_or_name is not None: + route_values['labelIdOrName'] = self._serialize.url('label_id_or_name', label_id_or_name, 'str') + query_parameters = {} + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + self._send(http_method='DELETE', + location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_pull_request_label(self, repository_id, pull_request_id, label_id_or_name, project=None, project_id=None): + """GetPullRequestLabel. + Retrieves a single label that has been assigned to a pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str label_id_or_name: The name or ID of the label requested. + :param str project: Project ID or project name + :param str project_id: Project ID or project name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if label_id_or_name is not None: + route_values['labelIdOrName'] = self._serialize.url('label_id_or_name', label_id_or_name, 'str') + query_parameters = {} + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + response = self._send(http_method='GET', + location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WebApiTagDefinition', response) + + def get_pull_request_labels(self, repository_id, pull_request_id, project=None, project_id=None): + """GetPullRequestLabels. + Get all the labels assigned to a pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :param str project_id: Project ID or project name. + :rtype: [WebApiTagDefinition] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + query_parameters = {} + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + response = self._send(http_method='GET', + location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WebApiTagDefinition]', self._unwrap_collection(response)) + + def get_pull_request_properties(self, repository_id, pull_request_id, project=None): + """GetPullRequestProperties. + Get external properties of the pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + response = self._send(http_method='GET', + location_id='48a52185-5b9e-4736-9dc1-bb1e2feac80b', + version='7.0', + route_values=route_values) + return self._deserialize('object', response) + + def update_pull_request_properties(self, patch_document, repository_id, pull_request_id, project=None): + """UpdatePullRequestProperties. + Create or update pull request external properties. The patch operation can be `add`, `replace` or `remove`. For `add` operation, the path can be empty. If the path is empty, the value must be a list of key value pairs. For `replace` operation, the path cannot be empty. If the path does not exist, the property will be added to the collection. For `remove` operation, the path cannot be empty. If the path does not exist, no action will be performed. + :param :class:`<[JsonPatchOperation]> ` patch_document: Properties to add, replace or remove in JSON Patch format. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + content = self._serialize.body(patch_document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='48a52185-5b9e-4736-9dc1-bb1e2feac80b', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('object', response) + def get_pull_request_query(self, queries, repository_id, project=None): """GetPullRequestQuery. This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -> pull requests. - :param :class:` ` queries: The list of queries to perform. + :param :class:` ` queries: The list of queries to perform. :param str repository_id: ID of the repository. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -926,7 +1855,7 @@ def get_pull_request_query(self, queries, repository_id, project=None): content = self._serialize.body(queries, 'GitPullRequestQuery') response = self._send(http_method='POST', location_id='b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestQuery', response) @@ -934,12 +1863,12 @@ def get_pull_request_query(self, queries, repository_id, project=None): def create_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): """CreatePullRequestReviewer. Add a reviewer to a pull request or cast a vote. - :param :class:` ` reviewer: Reviewer's vote.
If the reviewer's ID is included here, it must match the reviewerID parameter.
Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero. - :param str repository_id: The repository ID of the pull request’s target branch. + :param :class:` ` reviewer: Reviewer's vote.
If the reviewer's ID is included here, it must match the reviewerID parameter.
Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -953,7 +1882,7 @@ def create_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, content = self._serialize.body(reviewer, 'IdentityRefWithVote') response = self._send(http_method='PUT', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('IdentityRefWithVote', response) @@ -962,7 +1891,7 @@ def create_pull_request_reviewers(self, reviewers, repository_id, pull_request_i """CreatePullRequestReviewers. Add reviewers to a pull request. :param [IdentityRef] reviewers: Reviewers to add to the pull request. - :param str repository_id: The repository ID of the pull request’s target branch. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] @@ -977,15 +1906,39 @@ def create_pull_request_reviewers(self, reviewers, repository_id, pull_request_i content = self._serialize.body(reviewers, '[IdentityRef]') response = self._send(http_method='POST', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + def create_unmaterialized_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, project=None): + """CreateUnmaterializedPullRequestReviewer. + Add an unmaterialized identity to the reviewers of a pull request. + :param :class:` ` reviewer: Reviewer to add to the pull request. + :param str repository_id: The repository ID of the pull request's target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + content = self._serialize.body(reviewer, 'IdentityRefWithVote') + response = self._send(http_method='PUT', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', response) + def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """DeletePullRequestReviewer. Remove a reviewer from a pull request. - :param str repository_id: The repository ID of the pull request’s target branch. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer to remove. :param str project: Project ID or project name @@ -1001,17 +1954,17 @@ def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_ route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') self._send(http_method='DELETE', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values) def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """GetPullRequestReviewer. Retrieve information about a particular reviewer on a pull request - :param str repository_id: The repository ID of the pull request’s target branch. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1024,14 +1977,14 @@ def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('IdentityRefWithVote', response) def get_pull_request_reviewers(self, repository_id, pull_request_id, project=None): """GetPullRequestReviewers. Retrieve the reviewers for a pull request - :param str repository_id: The repository ID of the pull request’s target branch. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] @@ -1045,15 +1998,42 @@ def get_pull_request_reviewers(self, repository_id, pull_request_id, project=Non route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) + def update_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): + """UpdatePullRequestReviewer. + Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined + :param :class:` ` reviewer: Reviewer data.
If the reviewer's ID is included here, it must match the reviewerID parameter. + :param str repository_id: The repository ID of the pull request's target branch. + :param int pull_request_id: ID of the pull request. + :param str reviewer_id: ID of the reviewer. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if reviewer_id is not None: + route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') + content = self._serialize.body(reviewer, 'IdentityRefWithVote') + response = self._send(http_method='PATCH', + location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('IdentityRefWithVote', response) + def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): """UpdatePullRequestReviewers. Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names. :param [IdentityRefWithVote] patch_votes: IDs of the reviewers whose votes will be reset to zero - :param str repository_id: The repository ID of the pull request’s target branch. + :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request :param str project: Project ID or project name """ @@ -1067,7 +2047,7 @@ def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request content = self._serialize.body(patch_votes, '[IdentityRefWithVote]') self._send(http_method='PATCH', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', - version='5.1', + version='7.0', route_values=route_values, content=content) @@ -1076,7 +2056,7 @@ def get_pull_request_by_id(self, pull_request_id, project=None): Retrieve a pull request. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1085,7 +2065,7 @@ def get_pull_request_by_id(self, pull_request_id, project=None): route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='01a46dea-7d46-4d40-bc84-319e7c260d99', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('GitPullRequest', response) @@ -1093,7 +2073,7 @@ def get_pull_requests_by_project(self, project, search_criteria, max_comment_len """GetPullRequestsByProject. Retrieve all pull requests matching a specified criteria. :param str project: Project ID or project name - :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. + :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param int top: The number of pull requests to retrieve. @@ -1128,7 +2108,7 @@ def get_pull_requests_by_project(self, project, search_criteria, max_comment_len query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a5d28130-9cd2-40fa-9f08-902e7daa9efb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) @@ -1136,11 +2116,11 @@ def get_pull_requests_by_project(self, project, search_criteria, max_comment_len def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None): """CreatePullRequest. Create a pull request. - :param :class:` ` git_pull_request_to_create: The pull request to create. + :param :class:` ` git_pull_request_to_create: The pull request to create. :param str repository_id: The repository ID of the pull request's target branch. :param str project: Project ID or project name :param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1153,7 +2133,7 @@ def create_pull_request(self, git_pull_request_to_create, repository_id, project content = self._serialize.body(git_pull_request_to_create, 'GitPullRequest') response = self._send(http_method='POST', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1170,7 +2150,7 @@ def get_pull_request(self, repository_id, pull_request_id, project=None, max_com :param int top: Not used. :param bool include_commits: If true, the pull request will be returned with the associated commits. :param bool include_work_item_refs: If true, the pull request will be returned with the associated work item references. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1192,7 +2172,7 @@ def get_pull_request(self, repository_id, pull_request_id, project=None, max_com query_parameters['includeWorkItemRefs'] = self._serialize.query('include_work_item_refs', include_work_item_refs, 'bool') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequest', response) @@ -1201,7 +2181,7 @@ def get_pull_requests(self, repository_id, search_criteria, project=None, max_co """GetPullRequests. Retrieve all pull requests matching a specified criteria. :param str repository_id: The repository ID of the pull request's target branch. - :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. + :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param str project: Project ID or project name :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. @@ -1239,7 +2219,7 @@ def get_pull_requests(self, repository_id, search_criteria, project=None, max_co query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) @@ -1247,11 +2227,11 @@ def get_pull_requests(self, repository_id, search_criteria, project=None, max_co def update_pull_request(self, git_pull_request_to_update, repository_id, pull_request_id, project=None): """UpdatePullRequest. Update a pull request - :param :class:` ` git_pull_request_to_update: The pull request content that should be updated. + :param :class:` ` git_pull_request_to_update: The pull request content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request to update. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1263,20 +2243,156 @@ def update_pull_request(self, git_pull_request_to_update, repository_id, pull_re content = self._serialize.body(git_pull_request_to_update, 'GitPullRequest') response = self._send(http_method='PATCH', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitPullRequest', response) + def share_pull_request(self, user_message, repository_id, pull_request_id, project=None): + """SharePullRequest. + Sends an e-mail notification about a specific pull request to a set of recipients + :param :class:` ` user_message: + :param str repository_id: ID of the git repository. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + content = self._serialize.body(user_message, 'ShareNotificationContext') + self._send(http_method='POST', + location_id='696f3a82-47c9-487f-9117-b9d00972ca84', + version='7.0', + route_values=route_values, + content=content) + + def create_pull_request_status(self, status, repository_id, pull_request_id, project=None): + """CreatePullRequestStatus. + Create a pull request status. + :param :class:` ` status: Pull request status to create. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + content = self._serialize.body(status, 'GitPullRequestStatus') + response = self._send(http_method='POST', + location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitPullRequestStatus', response) + + def delete_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): + """DeletePullRequestStatus. + Delete pull request status. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int status_id: ID of the pull request status. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if status_id is not None: + route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') + self._send(http_method='DELETE', + location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', + version='7.0', + route_values=route_values) + + def get_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): + """GetPullRequestStatus. + Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param int status_id: ID of the pull request status. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + if status_id is not None: + route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') + response = self._send(http_method='GET', + location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', + version='7.0', + route_values=route_values) + return self._deserialize('GitPullRequestStatus', response) + + def get_pull_request_statuses(self, repository_id, pull_request_id, project=None): + """GetPullRequestStatuses. + Get all the statuses associated with a pull request. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + :rtype: [GitPullRequestStatus] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + response = self._send(http_method='GET', + location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', + version='7.0', + route_values=route_values) + return self._deserialize('[GitPullRequestStatus]', self._unwrap_collection(response)) + + def update_pull_request_statuses(self, patch_document, repository_id, pull_request_id, project=None): + """UpdatePullRequestStatuses. + Update pull request statuses collection. The only supported operation type is `remove`. + :param :class:`<[JsonPatchOperation]> ` patch_document: Operations to apply to the pull request statuses in JSON Patch format. + :param str repository_id: The repository ID of the pull request’s target branch. + :param int pull_request_id: ID of the pull request. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + if pull_request_id is not None: + route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') + content = self._serialize.body(patch_document, '[JsonPatchOperation]') + self._send(http_method='PATCH', + location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', + version='7.0', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + def create_comment(self, comment, repository_id, pull_request_id, thread_id, project=None): """CreateComment. Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread). - :param :class:` ` comment: The comment to create. Comments can be up to 150,000 characters. + :param :class:` ` comment: The comment to create. Comments can be up to 150,000 characters. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1290,7 +2406,7 @@ def create_comment(self, comment, repository_id, pull_request_id, thread_id, pro content = self._serialize.body(comment, 'Comment') response = self._send(http_method='POST', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Comment', response) @@ -1317,7 +2433,7 @@ def delete_comment(self, repository_id, pull_request_id, thread_id, comment_id, route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') self._send(http_method='DELETE', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', - version='5.1', + version='7.0', route_values=route_values) def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): @@ -1328,7 +2444,7 @@ def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, pro :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1343,7 +2459,7 @@ def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, pro route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Comment', response) @@ -1367,20 +2483,20 @@ def get_comments(self, repository_id, pull_request_id, thread_id, project=None): route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[Comment]', self._unwrap_collection(response)) def update_comment(self, comment, repository_id, pull_request_id, thread_id, comment_id, project=None): """UpdateComment. Update a comment associated with a specific thread in a pull request. - :param :class:` ` comment: The comment content that should be updated. Comments can be up to 150,000 characters. + :param :class:` ` comment: The comment content that should be updated. Comments can be up to 150,000 characters. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment to update. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1396,7 +2512,7 @@ def update_comment(self, comment, repository_id, pull_request_id, thread_id, com content = self._serialize.body(comment, 'Comment') response = self._send(http_method='PATCH', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Comment', response) @@ -1404,11 +2520,11 @@ def update_comment(self, comment, repository_id, pull_request_id, thread_id, com def create_thread(self, comment_thread, repository_id, pull_request_id, project=None): """CreateThread. Create a thread in a pull request. - :param :class:` ` comment_thread: The thread to create. Thread must contain at least one comment. + :param :class:` ` comment_thread: The thread to create. Thread must contain at least one comment. :param str repository_id: Repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1420,7 +2536,7 @@ def create_thread(self, comment_thread, repository_id, pull_request_id, project= content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='POST', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) @@ -1434,7 +2550,7 @@ def get_pull_request_thread(self, repository_id, pull_request_id, thread_id, pro :param str project: Project ID or project name :param int iteration: If specified, thread position will be tracked using this iteration as the right side of the diff. :param int base_iteration: If specified, thread position will be tracked using this iteration as the left side of the diff. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1452,7 +2568,7 @@ def get_pull_request_thread(self, repository_id, pull_request_id, thread_id, pro query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestCommentThread', response) @@ -1481,7 +2597,7 @@ def get_threads(self, repository_id, pull_request_id, project=None, iteration=No query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestCommentThread]', self._unwrap_collection(response)) @@ -1489,12 +2605,12 @@ def get_threads(self, repository_id, pull_request_id, project=None, iteration=No def update_thread(self, comment_thread, repository_id, pull_request_id, thread_id, project=None): """UpdateThread. Update a thread in a pull request. - :param :class:` ` comment_thread: The thread content that should be updated. + :param :class:` ` comment_thread: The thread content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread to update. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1508,7 +2624,7 @@ def update_thread(self, comment_thread, repository_id, pull_request_id, thread_i content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='PATCH', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) @@ -1530,17 +2646,17 @@ def get_pull_request_work_item_refs(self, repository_id, pull_request_id, projec route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='0a637fcc-5370-4ce8-b0e8-98091f5f9482', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def create_push(self, push, repository_id, project=None): """CreatePush. Push changes to the repository. - :param :class:` ` push: + :param :class:` ` push: :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1550,7 +2666,7 @@ def create_push(self, push, repository_id, project=None): content = self._serialize.body(push, 'GitPush') response = self._send(http_method='POST', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitPush', response) @@ -1563,7 +2679,7 @@ def get_push(self, repository_id, push_id, project=None, include_commits=None, i :param str project: Project ID or project name :param int include_commits: The number of commits to include in the result. :param bool include_ref_updates: If true, include the list of refs that were updated by the push. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1579,7 +2695,7 @@ def get_push(self, repository_id, push_id, project=None, include_commits=None, i query_parameters['includeRefUpdates'] = self._serialize.query('include_ref_updates', include_ref_updates, 'bool') response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPush', response) @@ -1591,7 +2707,7 @@ def get_pushes(self, repository_id, project=None, skip=None, top=None, search_cr :param str project: Project ID or project name :param int skip: Number of pushes to skip. :param int top: Number of pushes to return. - :param :class:` ` search_criteria: Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references. + :param :class:` ` search_criteria: Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references. :rtype: [GitPush] """ route_values = {} @@ -1619,11 +2735,63 @@ def get_pushes(self, repository_id, project=None, skip=None, top=None, search_cr query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPush]', self._unwrap_collection(response)) + def delete_repository_from_recycle_bin(self, project, repository_id): + """DeleteRepositoryFromRecycleBin. + Destroy (hard delete) a soft-deleted Git repository. + :param str project: Project ID or project name + :param str repository_id: The ID of the repository. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + self._send(http_method='DELETE', + location_id='a663da97-81db-4eb3-8b83-287670f63073', + version='7.0', + route_values=route_values) + + def get_recycle_bin_repositories(self, project): + """GetRecycleBinRepositories. + Retrieve soft-deleted git repositories from the recycle bin. + :param str project: Project ID or project name + :rtype: [GitDeletedRepository] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='a663da97-81db-4eb3-8b83-287670f63073', + version='7.0', + route_values=route_values) + return self._deserialize('[GitDeletedRepository]', self._unwrap_collection(response)) + + def restore_repository_from_recycle_bin(self, repository_details, project, repository_id): + """RestoreRepositoryFromRecycleBin. + Recover a soft-deleted Git repository. Recently deleted repositories go into a soft-delete state for a period of time before they are hard deleted and become unrecoverable. + :param :class:` ` repository_details: + :param str project: Project ID or project name + :param str repository_id: The ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + content = self._serialize.body(repository_details, 'GitRecycleBinRepositoryDetails') + response = self._send(http_method='PATCH', + location_id='a663da97-81db-4eb3-8b83-287670f63073', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRepository', response) + def get_refs(self, repository_id, project=None, filter=None, include_links=None, include_statuses=None, include_my_branches=None, latest_statuses_only=None, peel_tags=None, filter_contains=None, top=None, continuation_token=None): """GetRefs. Queries the provided repository for its refs and returns them. @@ -1638,7 +2806,7 @@ def get_refs(self, repository_id, project=None, filter=None, include_links=None, :param str filter_contains: [optional] A filter to apply to the refs (contains). :param int top: [optional] Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. :param str continuation_token: The continuation token used for pagination. - :rtype: :class:`` + :rtype: :class:`<[GitRef]> ` """ route_values = {} if project is not None: @@ -1666,35 +2834,20 @@ def get_refs(self, repository_id, project=None, filter=None, include_links=None, query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[GitRef]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetRefsResponseValue(response_value, continuation_token) - - class GetRefsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_refs method - - :param value: - :type value: :class:`<[GitRef]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[GitRef]', self._unwrap_collection(response)) def update_ref(self, new_ref_info, repository_id, filter, project=None, project_id=None): """UpdateRef. Lock or Unlock a branch. - :param :class:` ` new_ref_info: The ref update action (lock/unlock) to perform + :param :class:` ` new_ref_info: The ref update action (lock/unlock) to perform :param str repository_id: The name or ID of the repository. :param str filter: The name of the branch to lock/unlock :param str project: Project ID or project name :param str project_id: ID or name of the team project. Optional if specifying an ID for repository. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1709,7 +2862,7 @@ def update_ref(self, new_ref_info, repository_id, filter, project=None, project_ content = self._serialize.body(new_ref_info, 'GitRefUpdate') response = self._send(http_method='PATCH', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1735,19 +2888,94 @@ def update_refs(self, ref_updates, repository_id, project=None, project_id=None) content = self._serialize.body(ref_updates, '[GitRefUpdate]') response = self._send(http_method='POST', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitRefUpdateResult]', self._unwrap_collection(response)) + def create_favorite(self, favorite, project): + """CreateFavorite. + Creates a ref favorite + :param :class:` ` favorite: The ref favorite to create. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(favorite, 'GitRefFavorite') + response = self._send(http_method='POST', + location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRefFavorite', response) + + def delete_ref_favorite(self, project, favorite_id): + """DeleteRefFavorite. + Deletes the refs favorite specified + :param str project: Project ID or project name + :param int favorite_id: The Id of the ref favorite to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if favorite_id is not None: + route_values['favoriteId'] = self._serialize.url('favorite_id', favorite_id, 'int') + self._send(http_method='DELETE', + location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', + version='7.0', + route_values=route_values) + + def get_ref_favorite(self, project, favorite_id): + """GetRefFavorite. + Gets the refs favorite for a favorite Id. + :param str project: Project ID or project name + :param int favorite_id: The Id of the requested ref favorite. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if favorite_id is not None: + route_values['favoriteId'] = self._serialize.url('favorite_id', favorite_id, 'int') + response = self._send(http_method='GET', + location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', + version='7.0', + route_values=route_values) + return self._deserialize('GitRefFavorite', response) + + def get_ref_favorites(self, project, repository_id=None, identity_id=None): + """GetRefFavorites. + Gets the refs favorites for a repo and an identity. + :param str project: Project ID or project name + :param str repository_id: The id of the repository. + :param str identity_id: The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used. + :rtype: [GitRefFavorite] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if repository_id is not None: + query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') + if identity_id is not None: + query_parameters['identityId'] = self._serialize.query('identity_id', identity_id, 'str') + response = self._send(http_method='GET', + location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[GitRefFavorite]', self._unwrap_collection(response)) + def create_repository(self, git_repository_to_create, project=None, source_ref=None): """CreateRepository. Create a git repository in a team project. - :param :class:` ` git_repository_to_create: Specify the repo name, team project and/or parent repository. Team project information can be omitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id). + :param :class:` ` git_repository_to_create: Specify the repo name, team project and/or parent repository. Team project information can be omitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id). :param str project: Project ID or project name :param str source_ref: [optional] Specify the source refs to use while creating a fork repo - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1758,7 +2986,7 @@ def create_repository(self, git_repository_to_create, project=None, source_ref=N content = self._serialize.body(git_repository_to_create, 'GitRepositoryCreateOptions') response = self._send(http_method='POST', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1767,7 +2995,7 @@ def create_repository(self, git_repository_to_create, project=None, source_ref=N def delete_repository(self, repository_id, project=None): """DeleteRepository. Delete a git repository - :param str repository_id: The name or ID of the repository. + :param str repository_id: The ID of the repository. :param str project: Project ID or project name """ route_values = {} @@ -1777,7 +3005,7 @@ def delete_repository(self, repository_id, project=None): route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') self._send(http_method='DELETE', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values) def get_repositories(self, project=None, include_links=None, include_all_urls=None, include_hidden=None): @@ -1801,7 +3029,7 @@ def get_repositories(self, project=None, include_links=None, include_all_urls=No query_parameters['includeHidden'] = self._serialize.query('include_hidden', include_hidden, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRepository]', self._unwrap_collection(response)) @@ -1811,7 +3039,7 @@ def get_repository(self, repository_id, project=None): Retrieve a git repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1820,7 +3048,7 @@ def get_repository(self, repository_id, project=None): route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('GitRepository', response) @@ -1830,7 +3058,7 @@ def get_repository_with_parent(self, repository_id, include_parent, project=None :param str repository_id: The name or ID of the repository. :param bool include_parent: True to include parent repository. Only available in authenticated calls. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1842,7 +3070,7 @@ def get_repository_with_parent(self, repository_id, include_parent, project=None query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitRepository', response) @@ -1850,10 +3078,10 @@ def get_repository_with_parent(self, repository_id, include_parent, project=None def update_repository(self, new_repository_info, repository_id, project=None): """UpdateRepository. Updates the Git repository with either a new repo name or a new default branch. - :param :class:` ` new_repository_info: Specify a new repo name or a new default branch of the repository - :param str repository_id: The name or ID of the repository. + :param :class:` ` new_repository_info: Specify a new repo name or a new default branch of the repository + :param str repository_id: The ID of the repository. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1863,19 +3091,102 @@ def update_repository(self, new_repository_info, repository_id, project=None): content = self._serialize.body(new_repository_info, 'GitRepository') response = self._send(http_method='PATCH', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitRepository', response) + def get_stats(self, project, repository_id): + """GetStats. + Retrieves statistics of a repository. + :param str project: Project ID or project name + :param str repository_id: Friendly name or guid of repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + response = self._send(http_method='GET', + location_id='616a5255-74b3-40f5-ae1d-bbae2eec8db5', + version='7.0', + route_values=route_values) + return self._deserialize('GitRepositoryStats', response) + + def create_revert(self, revert_to_create, project, repository_id): + """CreateRevert. + Starts the operation to create a new branch which reverts changes introduced by either a specific commit or commits that are associated to a pull request. + :param :class:` ` revert_to_create: + :param str project: Project ID or project name + :param str repository_id: ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + content = self._serialize.body(revert_to_create, 'GitAsyncRefOperationParameters') + response = self._send(http_method='POST', + location_id='bc866058-5449-4715-9cf1-a510b6ff193c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('GitRevert', response) + + def get_revert(self, project, revert_id, repository_id): + """GetRevert. + Retrieve information about a revert operation by revert Id. + :param str project: Project ID or project name + :param int revert_id: ID of the revert operation. + :param str repository_id: ID of the repository. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if revert_id is not None: + route_values['revertId'] = self._serialize.url('revert_id', revert_id, 'int') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + response = self._send(http_method='GET', + location_id='bc866058-5449-4715-9cf1-a510b6ff193c', + version='7.0', + route_values=route_values) + return self._deserialize('GitRevert', response) + + def get_revert_for_ref_name(self, project, repository_id, ref_name): + """GetRevertForRefName. + Retrieve information about a revert operation for a specific branch. + :param str project: Project ID or project name + :param str repository_id: ID of the repository. + :param str ref_name: The GitAsyncRefOperationParameters generatedRefName used for the revert operation. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + query_parameters = {} + if ref_name is not None: + query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') + response = self._send(http_method='GET', + location_id='bc866058-5449-4715-9cf1-a510b6ff193c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GitRevert', response) + def create_commit_status(self, git_commit_status_to_create, commit_id, repository_id, project=None): """CreateCommitStatus. Create Git commit status. - :param :class:` ` git_commit_status_to_create: Git commit status object to create. + :param :class:` ` git_commit_status_to_create: Git commit status object to create. :param str commit_id: ID of the Git commit. :param str repository_id: ID of the repository. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1887,7 +3198,7 @@ def create_commit_status(self, git_commit_status_to_create, commit_id, repositor content = self._serialize.body(git_commit_status_to_create, 'GitStatus') response = self._send(http_method='POST', location_id='428dd4fb-fda5-4722-af02-9313b80305da', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('GitStatus', response) @@ -1919,11 +3230,29 @@ def get_statuses(self, commit_id, repository_id, project=None, top=None, skip=No query_parameters['latestOnly'] = self._serialize.query('latest_only', latest_only, 'bool') response = self._send(http_method='GET', location_id='428dd4fb-fda5-4722-af02-9313b80305da', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitStatus]', self._unwrap_collection(response)) + def get_suggestions(self, repository_id, project=None): + """GetSuggestions. + Retrieve a pull request suggestion for a particular repository or team project. + :param str repository_id: ID of the git repository. + :param str project: Project ID or project name + :rtype: [GitSuggestion] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + response = self._send(http_method='GET', + location_id='9393b4fb-4445-4919-972b-9ad16f442d83', + version='7.0', + route_values=route_values) + return self._deserialize('[GitSuggestion]', self._unwrap_collection(response)) + def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None): """GetTree. The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository. @@ -1933,7 +3262,7 @@ def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive :param str project_id: Project Id. :param bool recursive: Search recursively. Include trees underneath this tree. Default is false. :param str file_name: Name to use if a .zip file is returned. Default is the object ID. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1951,7 +3280,7 @@ def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitTreeRef', response) @@ -1983,7 +3312,7 @@ def get_tree_zip(self, repository_id, sha1, project=None, project_id=None, recur query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') diff --git a/azure-devops/azure/devops/v5_1/graph/__init__.py b/azure-devops/azure/devops/released/graph/__init__.py similarity index 95% rename from azure-devops/azure/devops/v5_1/graph/__init__.py rename to azure-devops/azure/devops/released/graph/__init__.py index c0926e02..63889196 100644 --- a/azure-devops/azure/devops/v5_1/graph/__init__.py +++ b/azure-devops/azure/devops/released/graph/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .models import * +from ...v7_0.graph.models import * from .graph_client import GraphClient __all__ = [ @@ -28,6 +28,7 @@ 'GraphSubjectBase', 'GraphSubjectLookup', 'GraphSubjectLookupKey', + 'GraphSubjectQuery', 'GraphUser', 'GraphUserCreationContext', 'GraphUserUpdateContext', diff --git a/azure-devops/azure/devops/released/graph/graph_client.py b/azure-devops/azure/devops/released/graph/graph_client.py new file mode 100644 index 00000000..4c1583a3 --- /dev/null +++ b/azure-devops/azure/devops/released/graph/graph_client.py @@ -0,0 +1,120 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.graph import models + + +class GraphClient(Client): + """Graph + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(GraphClient, 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 = 'bb1e7ec9-e901-4b68-999a-de7012b920f8' + + def delete_avatar(self, subject_descriptor): + """DeleteAvatar. + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + self._send(http_method='DELETE', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values) + + def get_avatar(self, subject_descriptor, size=None, format=None): + """GetAvatar. + :param str subject_descriptor: + :param str size: + :param str format: + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + query_parameters = {} + if size is not None: + query_parameters['size'] = self._serialize.query('size', size, 'str') + if format is not None: + query_parameters['format'] = self._serialize.query('format', format, 'str') + response = self._send(http_method='GET', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Avatar', response) + + def set_avatar(self, avatar, subject_descriptor): + """SetAvatar. + :param :class:` ` avatar: + :param str subject_descriptor: + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + content = self._serialize.body(avatar, 'Avatar') + self._send(http_method='PUT', + location_id='801eaf9c-0585-4be8-9cdb-b0efa074de91', + version='7.0', + route_values=route_values, + content=content) + + def get_descriptor(self, storage_key): + """GetDescriptor. + Resolve a storage key to a descriptor + :param str storage_key: Storage key of the subject (user, group, scope, etc.) to resolve + :rtype: :class:` ` + """ + route_values = {} + if storage_key is not None: + route_values['storageKey'] = self._serialize.url('storage_key', storage_key, 'str') + response = self._send(http_method='GET', + location_id='048aee0a-7072-4cde-ab73-7af77b1e0b4e', + version='7.0', + route_values=route_values) + return self._deserialize('GraphDescriptorResult', response) + + def get_provider_info(self, user_descriptor): + """GetProviderInfo. + :param str user_descriptor: + :rtype: :class:` ` + """ + route_values = {} + if user_descriptor is not None: + route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') + response = self._send(http_method='GET', + location_id='1e377995-6fa2-4588-bd64-930186abdcfa', + version='7.0', + route_values=route_values) + return self._deserialize('GraphProviderInfo', response) + + def get_storage_key(self, subject_descriptor): + """GetStorageKey. + Resolve a descriptor to a storage key. + :param str subject_descriptor: + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + response = self._send(http_method='GET', + location_id='eb85f8cc-f0f6-4264-a5b1-ffe2e4d4801f', + version='7.0', + route_values=route_values) + return self._deserialize('GraphStorageKeyResult', response) + diff --git a/azure-devops/azure/devops/released/identity/__init__.py b/azure-devops/azure/devops/released/identity/__init__.py index 5cedcefb..132f3f76 100644 --- a/azure-devops/azure/devops/released/identity/__init__.py +++ b/azure-devops/azure/devops/released/identity/__init__.py @@ -6,26 +6,28 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.identity.models import * +from ...v7_0.identity.models import * from .identity_client import IdentityClient __all__ = [ 'AccessTokenResult', 'AuthorizationGrant', - 'ChangedIdentities', - 'ChangedIdentitiesContext', 'CreateScopeInfo', 'FrameworkIdentityInfo', 'GroupMembership', + 'ChangedIdentities', + 'ChangedIdentitiesContext', 'Identity', 'IdentityBase', 'IdentityBatchInfo', + 'IdentityRightsTransferData', 'IdentityScope', 'IdentitySelf', 'IdentitySnapshot', 'IdentityUpdateData', 'JsonPatchOperation', 'JsonWebToken', + 'PagedIdentities', 'RefreshTokenGrant', 'SwapIdentityInfo', 'TenantInfo', diff --git a/azure-devops/azure/devops/released/identity/identity_client.py b/azure-devops/azure/devops/released/identity/identity_client.py index fe0745b1..4e2652d6 100644 --- a/azure-devops/azure/devops/released/identity/identity_client.py +++ b/azure-devops/azure/devops/released/identity/identity_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.identity import models +from ...v7_0.identity import models class IdentityClient(Client): @@ -27,13 +27,13 @@ def __init__(self, base_url=None, creds=None): def create_groups(self, container): """CreateGroups. - :param :class:` ` container: + :param :class:` ` container: :rtype: [Identity] """ content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', - version='5.1', + version='7.0', content=content) return self._deserialize('[Identity]', self._unwrap_collection(response)) @@ -46,7 +46,7 @@ def delete_group(self, group_id): route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') self._send(http_method='DELETE', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', - version='5.1', + version='7.0', route_values=route_values) def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=None): @@ -68,7 +68,7 @@ def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=Non query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) @@ -79,7 +79,7 @@ def get_identity_changes(self, identity_sequence_id, group_sequence_id, organiza :param int organization_identity_sequence_id: :param int page_size: :param str scope_id: - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if identity_sequence_id is not None: @@ -94,7 +94,7 @@ def get_identity_changes(self, identity_sequence_id, group_sequence_id, organiza query_parameters['scopeId'] = self._serialize.query('scope_id', scope_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('ChangedIdentities', response) @@ -108,19 +108,20 @@ def get_user_identity_ids_by_domain_id(self, domain_id): query_parameters['domainId'] = self._serialize.query('domain_id', domain_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def read_identities(self, descriptors=None, identity_ids=None, subject_descriptors=None, social_descriptors=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): """ReadIdentities. - :param str descriptors: - :param str identity_ids: - :param str subject_descriptors: + Resolve legacy identity information for use with older APIs such as the Security APIs + :param str descriptors: A comma separated list of identity descriptors to resolve + :param str identity_ids: A comma seperated list of storage keys to resolve + :param str subject_descriptors: A comma seperated list of subject descriptors to resolve :param str social_descriptors: - :param str search_filter: - :param str filter_value: - :param str query_membership: + :param str search_filter: The type of search to perform. Values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups). + :param str filter_value: The search value, as specified by the searchFilter. + :param str query_membership: The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only) :param str properties: :param bool include_restricted_visibility: :param str options: @@ -149,7 +150,7 @@ def read_identities(self, descriptors=None, identity_ids=None, subject_descripto query_parameters['options'] = self._serialize.query('options', options, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) @@ -169,7 +170,7 @@ def read_identities_by_scope(self, scope_id, query_membership=None, properties=N query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) @@ -178,7 +179,7 @@ def read_identity(self, identity_id, query_membership=None, properties=None): :param str identity_id: :param str query_membership: :param str properties: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if identity_id is not None: @@ -190,26 +191,31 @@ def read_identity(self, identity_id, query_membership=None, properties=None): query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Identity', response) - def update_identities(self, identities): + def update_identities(self, identities, allow_meta_data_update=None): """UpdateIdentities. - :param :class:` ` identities: + :param :class:` ` identities: + :param bool allow_meta_data_update: :rtype: [IdentityUpdateData] """ + query_parameters = {} + if allow_meta_data_update is not None: + query_parameters['allowMetaDataUpdate'] = self._serialize.query('allow_meta_data_update', allow_meta_data_update, 'bool') content = self._serialize.body(identities, 'VssJsonCollectionWrapper') response = self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', + query_parameters=query_parameters, content=content) return self._deserialize('[IdentityUpdateData]', self._unwrap_collection(response)) def update_identity(self, identity, identity_id): """UpdateIdentity. - :param :class:` ` identity: + :param :class:` ` identity: :param str identity_id: """ route_values = {} @@ -218,19 +224,19 @@ def update_identity(self, identity, identity_id): content = self._serialize.body(identity, 'Identity') self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', - version='5.1', + version='7.0', route_values=route_values, content=content) def create_identity(self, framework_identity_info): """CreateIdentity. - :param :class:` ` framework_identity_info: - :rtype: :class:` ` + :param :class:` ` framework_identity_info: + :rtype: :class:` ` """ content = self._serialize.body(framework_identity_info, 'FrameworkIdentityInfo') response = self._send(http_method='PUT', location_id='dd55f0eb-6ea2-4fe4-9ebe-919e7dd1dfb4', - version='5.1', + version='7.0', content=content) return self._deserialize('Identity', response) @@ -241,16 +247,16 @@ def get_max_sequence_id(self): """ response = self._send(http_method='GET', location_id='e4a70778-cb2c-4e85-b7cc-3f3c7ae2d408', - version='5.1') + version='7.0') return self._deserialize('long', response) def get_self(self): """GetSelf. Read identity of the home tenant request user. - :rtype: :class:` ` + :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='4bb02b5b-c120-4be2-b68e-21f7c50a4b82', - version='5.1') + version='7.0') return self._deserialize('IdentitySelf', response) diff --git a/azure-devops/azure/devops/v6_0/member_entitlement_management/__init__.py b/azure-devops/azure/devops/released/member_entitlement_management/__init__.py similarity index 96% rename from azure-devops/azure/devops/v6_0/member_entitlement_management/__init__.py rename to azure-devops/azure/devops/released/member_entitlement_management/__init__.py index ebe2a1f5..a0105a5e 100644 --- a/azure-devops/azure/devops/v6_0/member_entitlement_management/__init__.py +++ b/azure-devops/azure/devops/released/member_entitlement_management/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .models import * +from ...v7_0.member_entitlement_management.models import * from .member_entitlement_management_client import MemberEntitlementManagementClient __all__ = [ diff --git a/azure-devops/azure/devops/v5_1/member_entitlement_management/member_entitlement_management_client.py b/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py similarity index 72% rename from azure-devops/azure/devops/v5_1/member_entitlement_management/member_entitlement_management_client.py rename to azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py index 3255111e..a20a21fe 100644 --- a/azure-devops/azure/devops/v5_1/member_entitlement_management/member_entitlement_management_client.py +++ b/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from . import models +from ...v7_0.member_entitlement_management import models class MemberEntitlementManagementClient(Client): @@ -27,10 +27,10 @@ def __init__(self, base_url=None, creds=None): def add_group_entitlement(self, group_entitlement, rule_option=None): """AddGroupEntitlement. - [Preview API] Create a group entitlement with license rule, extension rule. - :param :class:` ` group_entitlement: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups + Create a group entitlement with license rule, extension rule. + :param :class:` ` group_entitlement: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be created and applied to it’s members (default option) or just be tested - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if rule_option is not None: @@ -38,18 +38,18 @@ def add_group_entitlement(self, group_entitlement, rule_option=None): content = self._serialize.body(group_entitlement, 'GroupEntitlement') response = self._send(http_method='POST', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', - version='5.1-preview.1', + version='7.0', query_parameters=query_parameters, content=content) return self._deserialize('GroupEntitlementOperationReference', response) def delete_group_entitlement(self, group_id, rule_option=None, remove_group_membership=None): """DeleteGroupEntitlement. - [Preview API] Delete a group entitlement. + Delete a group entitlement. :param str group_id: ID of the group to delete. :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be deleted and the changes are applied to it’s members (default option) or just be tested :param bool remove_group_membership: Optional parameter that specifies whether the group with the given ID should be removed from all other groups - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if group_id is not None: @@ -61,43 +61,33 @@ def delete_group_entitlement(self, group_id, rule_option=None, remove_group_memb query_parameters['removeGroupMembership'] = self._serialize.query('remove_group_membership', remove_group_membership, 'bool') response = self._send(http_method='DELETE', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GroupEntitlementOperationReference', response) def get_group_entitlement(self, group_id): """GetGroupEntitlement. - [Preview API] Get a group entitlement. + Get a group entitlement. :param str group_id: ID of the group. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') response = self._send(http_method='GET', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('GroupEntitlement', response) - def get_group_entitlements(self): - """GetGroupEntitlements. - [Preview API] Get the group entitlements for an account. - :rtype: [GroupEntitlement] - """ - response = self._send(http_method='GET', - location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', - version='5.1-preview.1') - return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) - def update_group_entitlement(self, document, group_id, rule_option=None): """UpdateGroupEntitlement. - [Preview API] Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group. - :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the group. + Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the group. :param str group_id: ID of the group. :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be updated and the changes are applied to it’s members (default option) or just be tested - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if group_id is not None: @@ -108,16 +98,26 @@ def update_group_entitlement(self, document, group_id, rule_option=None): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('GroupEntitlementOperationReference', response) + def get_group_entitlements(self): + """GetGroupEntitlements. + Get the group entitlements for an account. + :rtype: [GroupEntitlement] + """ + response = self._send(http_method='GET', + location_id='9bce1f43-2629-419f-8f6c-7503be58a4f3', + version='7.0') + return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) + def add_member_to_group(self, group_id, member_id): """AddMemberToGroup. - [Preview API] Add a member to a Group. + Add a member to a Group. :param str group_id: Id of the Group. :param str member_id: Id of the member to add. """ @@ -128,16 +128,16 @@ def add_member_to_group(self, group_id, member_id): route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') self._send(http_method='PUT', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', - version='5.1-preview.1', + version='7.0', route_values=route_values) def get_group_members(self, group_id, max_results=None, paging_token=None): """GetGroupMembers. - [Preview API] Get direct members of a Group. + Get direct members of a Group. :param str group_id: Id of the Group. :param int max_results: Maximum number of results to retrieve. :param str paging_token: Paging Token from the previous page fetched. If the 'pagingToken' is null, the results would be fetched from the beginning of the Members List. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if group_id is not None: @@ -149,14 +149,14 @@ def get_group_members(self, group_id, max_results=None, paging_token=None): query_parameters['pagingToken'] = self._serialize.query('paging_token', paging_token, 'str') response = self._send(http_method='GET', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PagedGraphMemberList', response) def remove_member_from_group(self, group_id, member_id): """RemoveMemberFromGroup. - [Preview API] Remove a member from a Group. + Remove a member from a Group. :param str group_id: Id of the group. :param str member_id: Id of the member to remove. """ @@ -167,52 +167,52 @@ def remove_member_from_group(self, group_id, member_id): route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') self._send(http_method='DELETE', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', - version='5.1-preview.1', + version='7.0', route_values=route_values) def add_user_entitlement(self, user_entitlement): """AddUserEntitlement. - [Preview API] Add a user, assign license and extensions and make them a member of a project group in an account. - :param :class:` ` user_entitlement: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to. - :rtype: :class:` ` + Add a user, assign license and extensions and make them a member of a project group in an account. + :param :class:` ` user_entitlement: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to. + :rtype: :class:` ` """ content = self._serialize.body(user_entitlement, 'UserEntitlement') response = self._send(http_method='POST', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', - version='5.1-preview.2', + version='7.0', content=content) return self._deserialize('UserEntitlementsPostResponse', response) - def get_user_entitlements(self, top=None, skip=None, filter=None, sort_option=None): - """GetUserEntitlements. - [Preview API] Get a paged set of user entitlements matching the filter criteria. If no filter is is passed, a page from all the account users is returned. - :param int top: Maximum number of the user entitlements to return. Max value is 10000. Default value is 100 - :param int skip: Offset: Number of records to skip. Default value is 0 - :param str filter: Comma (",") separated list of properties and their values to filter on. Currently, the API only supports filtering by ExtensionId. An example parameter would be filter=extensionId eq search. - :param str sort_option: PropertyName and Order (separated by a space ( )) to sort on (e.g. LastAccessDate Desc) - :rtype: :class:` ` + def search_user_entitlements(self, continuation_token=None, select=None, filter=None, order_by=None): + """SearchUserEntitlements. + Get a paged set of user entitlements matching the filter and sort criteria built with properties that match the select input. + :param str continuation_token: Continuation token for getting the next page of data set. If null is passed, gets the first page. + :param str select: Comma (",") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'. + :param str filter: Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with "test" in email or displayname is "name eq 'test'". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'. + :param str order_by: PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name + :rtype: :class:` ` """ query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if skip is not None: - query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') if filter is not None: - query_parameters['filter'] = self._serialize.query('filter', filter, 'str') - if sort_option is not None: - query_parameters['sortOption'] = self._serialize.query('sort_option', sort_option, 'str') + query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') + if order_by is not None: + query_parameters['$orderBy'] = self._serialize.query('order_by', order_by, 'str') response = self._send(http_method='GET', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', - version='5.1-preview.2', + version='7.0', query_parameters=query_parameters) return self._deserialize('PagedGraphMemberList', response) def update_user_entitlements(self, document, do_not_send_invite_for_new_users=None): """UpdateUserEntitlements. - [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more users. - :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform. + Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more users. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform. :param bool do_not_send_invite_for_new_users: Whether to send email invites to new users or not - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if do_not_send_invite_for_new_users is not None: @@ -220,7 +220,7 @@ def update_user_entitlements(self, document, do_not_send_invite_for_new_users=No content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', - version='5.1-preview.2', + version='7.0', query_parameters=query_parameters, content=content, media_type='application/json-patch+json') @@ -228,7 +228,7 @@ def update_user_entitlements(self, document, do_not_send_invite_for_new_users=No def delete_user_entitlement(self, user_id): """DeleteUserEntitlement. - [Preview API] Delete a user from the account. + Delete a user from the account. :param str user_id: ID of the user. """ route_values = {} @@ -236,30 +236,30 @@ def delete_user_entitlement(self, user_id): route_values['userId'] = self._serialize.url('user_id', user_id, 'str') self._send(http_method='DELETE', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', - version='5.1-preview.2', + version='7.0', route_values=route_values) def get_user_entitlement(self, user_id): """GetUserEntitlement. - [Preview API] Get User Entitlement for a user. + Get User Entitlement for a user. :param str user_id: ID of the user. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') response = self._send(http_method='GET', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', - version='5.1-preview.2', + version='7.0', route_values=route_values) return self._deserialize('UserEntitlement', response) def update_user_entitlement(self, document, user_id): """UpdateUserEntitlement. - [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the user. + Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the user. :param str user_id: ID of the user. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if user_id is not None: @@ -267,7 +267,7 @@ def update_user_entitlement(self, document, user_id): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', - version='5.1-preview.2', + version='7.0', route_values=route_values, content=content, media_type='application/json-patch+json') @@ -275,16 +275,16 @@ def update_user_entitlement(self, document, user_id): def get_users_summary(self, select=None): """GetUsersSummary. - [Preview API] Get summary of Licenses, Extension, Projects, Groups and their assignments in the collection. - :param str select: Comma (",") separated list of properties to select. Supported property names are {AccessLevels, Licenses, Extensions, Projects, Groups}. - :rtype: :class:` ` + Get summary of Licenses, Extension, Projects, Groups and their assignments in the collection. + :param str select: Comma (",") separated list of properties to select. Supported property names are {AccessLevels, Licenses, Projects, Groups}. + :rtype: :class:` ` """ query_parameters = {} if select is not None: query_parameters['select'] = self._serialize.query('select', select, 'str') response = self._send(http_method='GET', location_id='5ae55b13-c9dd-49d1-957e-6e76c152e3d9', - version='5.1-preview.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('UsersSummary', response) diff --git a/azure-devops/azure/devops/released/notification/__init__.py b/azure-devops/azure/devops/released/notification/__init__.py index a6a19d06..60ff5e5d 100644 --- a/azure-devops/azure/devops/released/notification/__init__.py +++ b/azure-devops/azure/devops/released/notification/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.notification.models import * +from ...v7_0.notification.models import * from .notification_client import NotificationClient __all__ = [ @@ -30,8 +30,8 @@ 'InputValues', 'InputValuesError', 'InputValuesQuery', - 'ISubscriptionChannel', 'ISubscriptionFilter', + 'ISubscriptionChannel', 'NotificationAdminSettings', 'NotificationAdminSettingsUpdateParameters', 'NotificationDiagnosticLogMessage', @@ -57,11 +57,11 @@ 'OperatorConstraint', 'ReferenceLinks', 'SubscriptionAdminSettings', - 'SubscriptionChannelWithAddress', 'SubscriptionDiagnostics', 'SubscriptionEvaluationRequest', 'SubscriptionEvaluationResult', 'SubscriptionEvaluationSettings', + 'SubscriptionChannelWithAddress', 'SubscriptionManagement', 'SubscriptionQuery', 'SubscriptionQueryCondition', diff --git a/azure-devops/azure/devops/released/notification/notification_client.py b/azure-devops/azure/devops/released/notification/notification_client.py index 12a2656f..33b13f67 100644 --- a/azure-devops/azure/devops/released/notification/notification_client.py +++ b/azure-devops/azure/devops/released/notification/notification_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.notification import models +from ...v7_0.notification import models class NotificationClient(Client): @@ -46,7 +46,7 @@ def list_logs(self, source, entry_id=None, start_time=None, end_time=None): query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') response = self._send(http_method='GET', location_id='991842f3-eb16-4aea-ac81-81353ef2b75c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[INotificationDiagnosticLog]', self._unwrap_collection(response)) @@ -55,23 +55,23 @@ def get_subscription_diagnostics(self, subscription_id): """GetSubscriptionDiagnostics. Get the diagnostics settings for a subscription. :param str subscription_id: The id of the notifications subscription. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('SubscriptionDiagnostics', response) def update_subscription_diagnostics(self, update_parameters, subscription_id): """UpdateSubscriptionDiagnostics. Update the diagnostics settings for a subscription. - :param :class:` ` update_parameters: + :param :class:` ` update_parameters: :param str subscription_id: The id of the notifications subscription. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -79,7 +79,7 @@ def update_subscription_diagnostics(self, update_parameters, subscription_id): content = self._serialize.body(update_parameters, 'UpdateSubscripitonDiagnosticsParameters') response = self._send(http_method='PUT', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('SubscriptionDiagnostics', response) @@ -88,14 +88,14 @@ def get_event_type(self, event_type): """GetEventType. Get a specific event type. :param str event_type: The ID of the event type. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if event_type is not None: route_values['eventType'] = self._serialize.url('event_type', event_type, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('NotificationEventType', response) @@ -110,28 +110,28 @@ def list_event_types(self, publisher_id=None): query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[NotificationEventType]', self._unwrap_collection(response)) def get_settings(self): """GetSettings. - :rtype: :class:` ` + :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', - version='5.1') + version='7.0') return self._deserialize('NotificationAdminSettings', response) def update_settings(self, update_parameters): """UpdateSettings. - :param :class:` ` update_parameters: - :rtype: :class:` ` + :param :class:` ` update_parameters: + :rtype: :class:` ` """ content = self._serialize.body(update_parameters, 'NotificationAdminSettingsUpdateParameters') response = self._send(http_method='PATCH', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', - version='5.1', + version='7.0', content=content) return self._deserialize('NotificationAdminSettings', response) @@ -139,23 +139,23 @@ def get_subscriber(self, subscriber_id): """GetSubscriber. Get delivery preferences of a notifications subscriber. :param str subscriber_id: ID of the user or group. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str') response = self._send(http_method='GET', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('NotificationSubscriber', response) def update_subscriber(self, update_parameters, subscriber_id): """UpdateSubscriber. Update delivery preferences of a notifications subscriber. - :param :class:` ` update_parameters: + :param :class:` ` update_parameters: :param str subscriber_id: ID of the user or group. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: @@ -163,7 +163,7 @@ def update_subscriber(self, update_parameters, subscriber_id): content = self._serialize.body(update_parameters, 'NotificationSubscriberUpdateParameters') response = self._send(http_method='PATCH', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('NotificationSubscriber', response) @@ -171,26 +171,26 @@ def update_subscriber(self, update_parameters, subscriber_id): def query_subscriptions(self, subscription_query): """QuerySubscriptions. Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. - :param :class:` ` subscription_query: + :param :class:` ` subscription_query: :rtype: [NotificationSubscription] """ content = self._serialize.body(subscription_query, 'SubscriptionQuery') response = self._send(http_method='POST', location_id='6864db85-08c0-4006-8e8e-cc1bebe31675', - version='5.1', + version='7.0', content=content) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def create_subscription(self, create_parameters): """CreateSubscription. Create a new subscription. - :param :class:` ` create_parameters: - :rtype: :class:` ` + :param :class:` ` create_parameters: + :rtype: :class:` ` """ content = self._serialize.body(create_parameters, 'NotificationSubscriptionCreateParameters') response = self._send(http_method='POST', location_id='70f911d6-abac-488c-85b3-a206bf57e165', - version='5.1', + version='7.0', content=content) return self._deserialize('NotificationSubscription', response) @@ -204,7 +204,7 @@ def delete_subscription(self, subscription_id): route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='70f911d6-abac-488c-85b3-a206bf57e165', - version='5.1', + version='7.0', route_values=route_values) def get_subscription(self, subscription_id, query_flags=None): @@ -212,7 +212,7 @@ def get_subscription(self, subscription_id, query_flags=None): Get a notification subscription by its ID. :param str subscription_id: :param str query_flags: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -222,7 +222,7 @@ def get_subscription(self, subscription_id, query_flags=None): query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('NotificationSubscription', response) @@ -245,16 +245,16 @@ def list_subscriptions(self, target_id=None, ids=None, query_flags=None): query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def update_subscription(self, update_parameters, subscription_id): """UpdateSubscription. Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more. - :param :class:` ` update_parameters: + :param :class:` ` update_parameters: :param str subscription_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -262,7 +262,7 @@ def update_subscription(self, update_parameters, subscription_id): content = self._serialize.body(update_parameters, 'NotificationSubscriptionUpdateParameters') response = self._send(http_method='PATCH', location_id='70f911d6-abac-488c-85b3-a206bf57e165', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('NotificationSubscription', response) @@ -274,16 +274,16 @@ def get_subscription_templates(self): """ response = self._send(http_method='GET', location_id='fa5d24ba-7484-4f3d-888d-4ec6b1974082', - version='5.1') + version='7.0') return self._deserialize('[NotificationSubscriptionTemplate]', self._unwrap_collection(response)) def update_subscription_user_settings(self, user_settings, subscription_id, user_id): """UpdateSubscriptionUserSettings. Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions. - :param :class:` ` user_settings: + :param :class:` ` user_settings: :param str subscription_id: :param str user_id: ID of the user - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -293,7 +293,7 @@ def update_subscription_user_settings(self, user_settings, subscription_id, user content = self._serialize.body(user_settings, 'SubscriptionUserSettings') response = self._send(http_method='PUT', location_id='ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('SubscriptionUserSettings', response) diff --git a/azure-devops/azure/devops/released/npm/__init__.py b/azure-devops/azure/devops/released/npm/__init__.py new file mode 100644 index 00000000..54ce2d62 --- /dev/null +++ b/azure-devops/azure/devops/released/npm/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.npm.models import * +from .npm_client import NpmClient + +__all__ = [ + 'BatchDeprecateData', + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'NpmPackagesBatchRequest', + 'NpmPackageVersionDeletionState', + 'NpmRecycleBinPackageVersionDetails', + 'Package', + 'PackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NpmClient' +] diff --git a/azure-devops/azure/devops/released/npm/npm_client.py b/azure-devops/azure/devops/released/npm/npm_client.py new file mode 100644 index 00000000..0548842a --- /dev/null +++ b/azure-devops/azure/devops/released/npm/npm_client.py @@ -0,0 +1,586 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.npm import models + + +class NpmClient(Client): + """Npm + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(NpmClient, 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 = '4c83cfc1-f33a-477e-a789-29d38ffca52e' + + def get_content_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None, **kwargs): + """GetContentScopedPackage. + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='09a4eafd-123a-495c-979c-0eda7bdb9a14', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_content_unscoped_package(self, feed_id, package_name, package_version, project=None, **kwargs): + """GetContentUnscopedPackage. + Get an unscoped npm package. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='75caa482-cb1e-47cd-9f2c-c048a4b7a43e', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def update_packages(self, batch_request, feed_id, project=None): + """UpdatePackages. + Update several packages from a single feed in a single request. The updates to the packages do not happen atomically. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. + :param str feed_id: Name or ID of the feed. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'NpmPackagesBatchRequest') + self._send(http_method='POST', + location_id='06f34005-bbb2-41f4-88f5-23e03a99bb12', + version='7.0', + route_values=route_values, + content=content) + + def get_readme_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None, **kwargs): + """GetReadmeScopedPackage. + Get the Readme for a package version with an npm scope. + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope\name) + :param str unscoped_package_name: Name of the package (the 'name' part of @scope\name) + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='6d4db777-7e4a-43b2-afad-779a1d197301', + version='7.0', + route_values=route_values, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_readme_unscoped_package(self, feed_id, package_name, package_version, project=None, **kwargs): + """GetReadmeUnscopedPackage. + Get the Readme for a package version that has no npm scope. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='1099a396-b310-41d4-a4b6-33d134ce3fcf', + version='7.0', + route_values=route_values, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def update_recycle_bin_packages(self, batch_request, feed_id, project=None): + """UpdateRecycleBinPackages. + Delete or restore several package versions from the recycle bin. + :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. + :param str feed_id: Name or ID of the feed. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + content = self._serialize.body(batch_request, 'NpmPackagesBatchRequest') + self._send(http_method='POST', + location_id='eefe03ef-a6a2-4a7a-a0ec-2e65a5efd64c', + version='7.0', + route_values=route_values, + content=content) + + def delete_scoped_package_version_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """DeleteScopedPackageVersionFromRecycleBin. + Delete a package version with an npm scope from the recycle bin. + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope/name). + :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). + :param str package_version: Version of the package. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + self._send(http_method='DELETE', + location_id='220f45eb-94a5-432c-902a-5b8c6372e415', + version='7.0', + route_values=route_values) + + def get_scoped_package_version_metadata_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageVersionMetadataFromRecycleBin. + Get information about a scoped package version in the recycle bin. + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope/name) + :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='220f45eb-94a5-432c-902a-5b8c6372e415', + version='7.0', + route_values=route_values) + return self._deserialize('NpmPackageVersionDeletionState', response) + + def restore_scoped_package_version_from_recycle_bin(self, package_version_details, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """RestoreScopedPackageVersionFromRecycleBin. + Restore a package version with an npm scope from the recycle bin to its feed. + :param :class:` ` package_version_details: + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope/name). + :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). + :param str package_version: Version of the package. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + content = self._serialize.body(package_version_details, 'NpmRecycleBinPackageVersionDetails') + self._send(http_method='PATCH', + location_id='220f45eb-94a5-432c-902a-5b8c6372e415', + version='7.0', + route_values=route_values, + content=content) + + def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """DeletePackageVersionFromRecycleBin. + Delete a package version without an npm scope from the recycle bin. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + self._send(http_method='DELETE', + location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', + version='7.0', + route_values=route_values) + + def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version, project=None): + """GetPackageVersionMetadataFromRecycleBin. + Get information about an unscoped package version in the recycle bin. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', + version='7.0', + route_values=route_values) + return self._deserialize('NpmPackageVersionDeletionState', response) + + def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version, project=None): + """RestorePackageVersionFromRecycleBin. + Restore a package version without an npm scope from the recycle bin to its feed. + :param :class:` ` package_version_details: + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + content = self._serialize.body(package_version_details, 'NpmRecycleBinPackageVersionDetails') + self._send(http_method='PATCH', + location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', + version='7.0', + route_values=route_values, + content=content) + + def get_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, project=None): + """GetScopedUpstreamingBehavior. + Get the upstreaming behavior of the (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + response = self._send(http_method='GET', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_scoped_upstreaming_behavior(self, feed_id, package_scope, unscoped_package_name, behavior, project=None): + """SetScopedUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_scope: The scope of the package + :param str unscoped_package_name: The name of the scoped package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='9859c187-f6ec-41b0-862d-8003b3b404e0', + version='7.0', + route_values=route_values, + content=content) + + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of the (unscoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + response = self._send(http_method='GET', + location_id='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values) + return self._deserialize('UpstreamingBehavior', response) + + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a (scoped) package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the scoped package within the scope of the feed + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + content = self._serialize.body(behavior, 'UpstreamingBehavior') + self._send(http_method='PATCH', + location_id='e27a45d3-711b-41cb-a47a-ae669b6e9076', + version='7.0', + route_values=route_values, + content=content) + + def get_scoped_package_info(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """GetScopedPackageInfo. + Get information about a scoped package version (such as @scope/name). + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope/name). + :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', + version='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """UnpublishScopedPackage. + Unpublish a scoped package version (such as @scope/name). + :param str feed_id: Name or ID of the feed. + :param str package_scope: Scope of the package (the 'scope' part of @scope/name). + :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='DELETE', + location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', + version='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def update_scoped_package(self, package_version_details, feed_id, package_scope, unscoped_package_name, package_version, project=None): + """UpdateScopedPackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_scope: + :param str unscoped_package_name: + :param str package_version: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_scope is not None: + route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') + if unscoped_package_name is not None: + route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + content = self._serialize.body(package_version_details, 'PackageVersionDetails') + response = self._send(http_method='PATCH', + location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + + def get_package_info(self, feed_id, package_name, package_version, project=None): + """GetPackageInfo. + Get information about an unscoped package version. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='GET', + location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', + version='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def unpublish_package(self, feed_id, package_name, package_version, project=None): + """UnpublishPackage. + Unpublish an unscoped package version. + :param str feed_id: Name or ID of the feed. + :param str package_name: Name of the package. + :param str package_version: Version of the package. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + response = self._send(http_method='DELETE', + location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', + version='7.0', + route_values=route_values) + return self._deserialize('Package', response) + + def update_package(self, package_version_details, feed_id, package_name, package_version, project=None): + """UpdatePackage. + :param :class:` ` package_version_details: + :param str feed_id: + :param str package_name: + :param str package_version: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if feed_id is not None: + route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') + if package_name is not None: + route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') + if package_version is not None: + route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') + content = self._serialize.body(package_version_details, 'PackageVersionDetails') + response = self._send(http_method='PATCH', + location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Package', response) + diff --git a/azure-devops/azure/devops/released/nuget/__init__.py b/azure-devops/azure/devops/released/nuget/__init__.py new file mode 100644 index 00000000..487ff6c7 --- /dev/null +++ b/azure-devops/azure/devops/released/nuget/__init__.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.nuget.models import * +from .nuget_client import NuGetClient + +__all__ = [ + 'BatchListData', + 'BatchOperationData', + 'JsonPatchOperation', + 'MinimalPackageDetails', + 'NuGetPackagesBatchRequest', + 'NuGetPackageVersionDeletionState', + 'NuGetRecycleBinPackageVersionDetails', + 'Package', + 'PackageVersionDetails', + 'ReferenceLinks', + 'UpstreamingBehavior', + 'UpstreamSourceInfo', + 'NuGetClient' +] diff --git a/azure-devops/azure/devops/v5_1/upack_api/upack_api_client.py b/azure-devops/azure/devops/released/nuget/nuget_client.py similarity index 50% rename from azure-devops/azure/devops/v5_1/upack_api/upack_api_client.py rename to azure-devops/azure/devops/released/nuget/nuget_client.py index f1d7ca8e..e3e57c07 100644 --- a/azure-devops/azure/devops/v5_1/upack_api/upack_api_client.py +++ b/azure-devops/azure/devops/released/nuget/nuget_client.py @@ -8,94 +8,78 @@ from msrest import Serializer, Deserializer from ...client import Client -from . import models +from ...v7_0.nuget import models -class UPackApiClient(Client): - """UPackApi +class NuGetClient(Client): + """NuGet :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): - super(UPackApiClient, self).__init__(base_url, creds) + super(NuGetClient, 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 = 'd397749b-f115-4027-b6dd-77a65dd10d21' + resource_area_identifier = 'b3be7473-68ea-4a81-bfc7-9530baaa19ad' - def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version): - """DeletePackageVersionFromRecycleBin. - [Preview API] Delete a package version from the recycle bin. - :param str feed_id: Name or ID of the feed. - :param str package_name: Name of the package. - :param str package_version: Version of the package. - """ - route_values = {} - if feed_id is not None: - route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') - if package_name is not None: - route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') - if package_version is not None: - route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') - self._send(http_method='DELETE', - location_id='3ba455ae-31e6-409e-849f-56c66888d004', - version='5.1-preview.1', - route_values=route_values) - - def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version): - """GetPackageVersionMetadataFromRecycleBin. - [Preview API] Get information about a package version in the recycle bin. - :param str feed_id: Name or ID of the feed. - :param str package_name: Name of the package. - :param str package_version: Version of the package. - :rtype: :class:` ` + def get_upstreaming_behavior(self, feed_id, package_name, project=None): + """GetUpstreamingBehavior. + Get the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param str project: Project ID or project name + :rtype: :class:` ` """ route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') - if package_version is not None: - route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', - location_id='3ba455ae-31e6-409e-849f-56c66888d004', - version='5.1-preview.1', + location_id='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', route_values=route_values) - return self._deserialize('UPackPackageVersionDeletionState', response) + return self._deserialize('UpstreamingBehavior', response) - def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): - """RestorePackageVersionFromRecycleBin. - [Preview API] Restore a package version from the recycle bin to its associated feed. - :param :class:` ` package_version_details: Set the 'Deleted' property to 'false' to restore the package. - :param str feed_id: Name or ID of the feed. - :param str package_name: Name of the package. - :param str package_version: Version of the package. + def set_upstreaming_behavior(self, feed_id, package_name, behavior, project=None): + """SetUpstreamingBehavior. + Set the upstreaming behavior of a package within the context of a feed + :param str feed_id: The name or id of the feed + :param str package_name: The name of the package + :param :class:` ` behavior: The behavior to apply to the package within the scope of the feed + :param str project: Project ID or project name """ route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') - if package_version is not None: - route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') - content = self._serialize.body(package_version_details, 'UPackRecycleBinPackageVersionDetails') + content = self._serialize.body(behavior, 'UpstreamingBehavior') self._send(http_method='PATCH', - location_id='3ba455ae-31e6-409e-849f-56c66888d004', - version='5.1-preview.1', + location_id='b41eec47-6472-4efa-bcd5-a2c5607b66ec', + version='7.0', route_values=route_values, content=content) - def delete_package_version(self, feed_id, package_name, package_version): + def delete_package_version(self, feed_id, package_name, package_version, project=None): """DeletePackageVersion. - [Preview API] Delete a package version from a feed's recycle bin. + Send a package version from the feed to its paired recycle bin. :param str feed_id: Name or ID of the feed. - :param str package_name: Name of the package. - :param str package_version: Version of the package. - :rtype: :class:` ` + :param str package_name: Name of the package to delete. + :param str package_version: Version of the package to delete. + :param str project: Project ID or project name + :rtype: :class:` ` """ route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: @@ -103,21 +87,24 @@ def delete_package_version(self, feed_id, package_name, package_version): if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', - location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', - version='5.1-preview.1', + location_id='36c9353b-e250-4c57-b040-513c186c3905', + version='7.0', route_values=route_values) return self._deserialize('Package', response) - def get_package_version(self, feed_id, package_name, package_version, show_deleted=None): + def get_package_version(self, feed_id, package_name, package_version, project=None, show_deleted=None): """GetPackageVersion. - [Preview API] Show information about a package version. + Get information about a package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. - :param bool show_deleted: True to show information for deleted versions - :rtype: :class:` ` + :param str project: Project ID or project name + :param bool show_deleted: True to include deleted packages in the response. + :rtype: :class:` ` """ route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: @@ -128,21 +115,24 @@ def get_package_version(self, feed_id, package_name, package_version, show_delet if show_deleted is not None: query_parameters['showDeleted'] = self._serialize.query('show_deleted', show_deleted, 'bool') response = self._send(http_method='GET', - location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', - version='5.1-preview.1', + location_id='36c9353b-e250-4c57-b040-513c186c3905', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) - def update_package_version(self, package_version_details, feed_id, package_name, package_version): + def update_package_version(self, package_version_details, feed_id, package_name, package_version, project=None): """UpdatePackageVersion. - [Preview API] Update information for a package version. - :param :class:` ` package_version_details: + Set mutable state on a package version. + :param :class:` ` package_version_details: New state to apply to the referenced package. :param str feed_id: Name or ID of the feed. - :param str package_name: Name of the package. - :param str package_version: Version of the package. + :param str package_name: Name of the package to update. + :param str package_version: Version of the package to update. + :param str project: Project ID or project name """ route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: @@ -151,8 +141,8 @@ def update_package_version(self, package_version_details, feed_id, package_name, route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') self._send(http_method='PATCH', - location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', - version='5.1-preview.1', + location_id='36c9353b-e250-4c57-b040-513c186c3905', + version='7.0', route_values=route_values, content=content) diff --git a/azure-devops/azure/devops/released/operations/__init__.py b/azure-devops/azure/devops/released/operations/__init__.py index 3f90db75..167aaa0a 100644 --- a/azure-devops/azure/devops/released/operations/__init__.py +++ b/azure-devops/azure/devops/released/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.operations.models import * +from ...v7_0.operations.models import * from .operations_client import OperationsClient __all__ = [ diff --git a/azure-devops/azure/devops/released/operations/operations_client.py b/azure-devops/azure/devops/released/operations/operations_client.py index 257a8de2..0f89f7f0 100644 --- a/azure-devops/azure/devops/released/operations/operations_client.py +++ b/azure-devops/azure/devops/released/operations/operations_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.operations import models +from ...v7_0.operations import models class OperationsClient(Client): @@ -30,7 +30,7 @@ def get_operation(self, operation_id, plugin_id=None): Gets an operation from the the operationId using the given pluginId. :param str operation_id: The ID for the operation. :param str plugin_id: The ID for the plugin. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if operation_id is not None: @@ -40,7 +40,7 @@ def get_operation(self, operation_id, plugin_id=None): query_parameters['pluginId'] = self._serialize.query('plugin_id', plugin_id, 'str') response = self._send(http_method='GET', location_id='9a1b74b4-2ca8-4a9f-8470-c2f2e6fdc949', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Operation', response) diff --git a/azure-devops/azure/devops/v5_1/pipelines/__init__.py b/azure-devops/azure/devops/released/pipelines/__init__.py similarity index 82% rename from azure-devops/azure/devops/v5_1/pipelines/__init__.py rename to azure-devops/azure/devops/released/pipelines/__init__.py index 6409ef58..3ef4cab9 100644 --- a/azure-devops/azure/devops/v5_1/pipelines/__init__.py +++ b/azure-devops/azure/devops/released/pipelines/__init__.py @@ -6,18 +6,24 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .models import * +from ...v7_0.pipelines.models import * from .pipelines_client import PipelinesClient __all__ = [ + 'Artifact', + 'BuildResourceParameters', + 'ContainerResourceParameters', 'CreatePipelineConfigurationParameters', 'CreatePipelineParameters', 'Log', 'LogCollection', + 'PackageResourceParameters', 'Pipeline', 'PipelineBase', 'PipelineConfiguration', 'PipelineReference', + 'PipelineResourceParameters', + 'PreviewRun', 'ReferenceLinks', 'Repository', 'RepositoryResource', @@ -27,6 +33,7 @@ 'RunReference', 'RunResources', 'RunResourcesParameters', + 'SignalRConnection', 'SignedUrl', 'Variable', 'PipelinesClient' diff --git a/azure-devops/azure/devops/released/pipelines/pipelines_client.py b/azure-devops/azure/devops/released/pipelines/pipelines_client.py new file mode 100644 index 00000000..cf6e00c5 --- /dev/null +++ b/azure-devops/azure/devops/released/pipelines/pipelines_client.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.pipelines import models + + +class PipelinesClient(Client): + """Pipelines + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(PipelinesClient, 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_artifact(self, project, pipeline_id, run_id, artifact_name, expand=None): + """GetArtifact. + Get a specific artifact from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str artifact_name: Name of the artifact. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if artifact_name is not None: + query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='85023071-bd5e-4438-89b0-2a5bf362a19d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Artifact', response) + + def get_log(self, project, pipeline_id, run_id, log_id, expand=None): + """GetLog. + Get a specific log from a pipeline run + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param int log_id: ID of the log. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if log_id is not None: + route_values['logId'] = self._serialize.url('log_id', log_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Log', response) + + def list_logs(self, project, pipeline_id, run_id, expand=None): + """ListLogs. + Get a list of logs from a pipeline run. + :param str project: Project ID or project name + :param int pipeline_id: ID of the pipeline. + :param int run_id: ID of the run of that pipeline. + :param str expand: Expand options. Default is None. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='fb1b6d27-3957-43d5-a14b-a2d70403e545', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('LogCollection', response) + + def create_pipeline(self, input_parameters, project): + """CreatePipeline. + Create a pipeline. + :param :class:` ` input_parameters: Input parameters. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(input_parameters, 'CreatePipelineParameters') + response = self._send(http_method='POST', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Pipeline', response) + + def get_pipeline(self, project, pipeline_id, pipeline_version=None): + """GetPipeline. + Gets a pipeline, optionally at the specified version + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID + :param int pipeline_version: The pipeline version + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + response = self._send(http_method='GET', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('Pipeline', response) + + def list_pipelines(self, project, order_by=None, top=None, continuation_token=None): + """ListPipelines. + Get a list of pipelines. + :param str project: Project ID or project name + :param str order_by: A sort expression. Defaults to "name asc" + :param int top: The maximum number of pipelines to return + :param str continuation_token: A continuation token from a previous request, to retrieve the next page of results + :rtype: [Pipeline] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query('order_by', order_by, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Pipeline]', self._unwrap_collection(response)) + + def preview(self, run_parameters, project, pipeline_id, pipeline_version=None): + """Preview. + Queues a dry run of the pipeline and returns an object containing the final yaml. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='53df2d18-29ea-46a9-bee0-933540f80abf', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('PreviewRun', response) + + def get_run(self, project, pipeline_id, run_id): + """GetRun. + Gets a run for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :param int run_id: The run id + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('Run', response) + + def list_runs(self, project, pipeline_id): + """ListRuns. + Gets top 10000 runs for a particular pipeline. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline id + :rtype: [Run] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + response = self._send(http_method='GET', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values) + return self._deserialize('[Run]', self._unwrap_collection(response)) + + def run_pipeline(self, run_parameters, project, pipeline_id, pipeline_version=None): + """RunPipeline. + Runs a pipeline. + :param :class:` ` run_parameters: Optional additional parameters for this run. + :param str project: Project ID or project name + :param int pipeline_id: The pipeline ID. + :param int pipeline_version: The pipeline version. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if pipeline_id is not None: + route_values['pipelineId'] = self._serialize.url('pipeline_id', pipeline_id, 'int') + query_parameters = {} + if pipeline_version is not None: + query_parameters['pipelineVersion'] = self._serialize.query('pipeline_version', pipeline_version, 'int') + content = self._serialize.body(run_parameters, 'RunPipelineParameters') + response = self._send(http_method='POST', + location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Run', response) + diff --git a/azure-devops/azure/devops/released/policy/__init__.py b/azure-devops/azure/devops/released/policy/__init__.py index 4e5b9b52..b8e725b4 100644 --- a/azure-devops/azure/devops/released/policy/__init__.py +++ b/azure-devops/azure/devops/released/policy/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.policy.models import * +from ...v7_0.policy.models import * from .policy_client import PolicyClient __all__ = [ diff --git a/azure-devops/azure/devops/released/policy/policy_client.py b/azure-devops/azure/devops/released/policy/policy_client.py index 31feca13..d64f936f 100644 --- a/azure-devops/azure/devops/released/policy/policy_client.py +++ b/azure-devops/azure/devops/released/policy/policy_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.policy import models +from ...v7_0.policy import models class PolicyClient(Client): @@ -28,10 +28,10 @@ def __init__(self, base_url=None, creds=None): def create_policy_configuration(self, configuration, project, configuration_id=None): """CreatePolicyConfiguration. Create a policy configuration of a given policy type. - :param :class:` ` configuration: The policy configuration to create. + :param :class:` ` configuration: The policy configuration to create. :param str project: Project ID or project name :param int configuration_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -41,7 +41,7 @@ def create_policy_configuration(self, configuration, project, configuration_id=N content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='POST', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) @@ -59,7 +59,7 @@ def delete_policy_configuration(self, project, configuration_id): route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') self._send(http_method='DELETE', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='5.1', + version='7.0', route_values=route_values) def get_policy_configuration(self, project, configuration_id): @@ -67,7 +67,7 @@ def get_policy_configuration(self, project, configuration_id): Get a policy configuration by its ID. :param str project: Project ID or project name :param int configuration_id: ID of the policy configuration - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -76,7 +76,7 @@ def get_policy_configuration(self, project, configuration_id): route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('PolicyConfiguration', response) @@ -88,7 +88,7 @@ def get_policy_configurations(self, project, scope=None, top=None, continuation_ :param int top: Maximum number of policies to return. :param str continuation_token: The continuation token used for pagination. :param str policy_type: Filter returned policies to only this type - :rtype: :class:`` + :rtype: :class:`<[PolicyConfiguration]> ` """ route_values = {} if project is not None: @@ -104,33 +104,18 @@ def get_policy_configurations(self, project, scope=None, top=None, continuation_ query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, 'str') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetPolicyConfigurationsResponseValue(response_value, continuation_token) - - class GetPolicyConfigurationsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_policy_configurations method - - :param value: - :type value: :class:`<[PolicyConfiguration]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) def update_policy_configuration(self, configuration, project, configuration_id): """UpdatePolicyConfiguration. Update a policy configuration by its ID. - :param :class:` ` configuration: The policy configuration to update. + :param :class:` ` configuration: The policy configuration to update. :param str project: Project ID or project name :param int configuration_id: ID of the existing policy configuration to be updated. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -140,7 +125,7 @@ def update_policy_configuration(self, configuration, project, configuration_id): content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='PUT', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) @@ -151,7 +136,7 @@ def get_policy_configuration_revision(self, project, configuration_id, revision_ :param str project: Project ID or project name :param int configuration_id: The policy configuration ID. :param int revision_id: The revision ID. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -162,7 +147,7 @@ def get_policy_configuration_revision(self, project, configuration_id, revision_ route_values['revisionId'] = self._serialize.url('revision_id', revision_id, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('PolicyConfiguration', response) @@ -187,7 +172,7 @@ def get_policy_configuration_revisions(self, project, configuration_id, top=None query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) @@ -197,7 +182,7 @@ def get_policy_type(self, project, type_id): Retrieve a specific policy type by ID. :param str project: Project ID or project name :param str type_id: The policy ID. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -206,7 +191,7 @@ def get_policy_type(self, project, type_id): route_values['typeId'] = self._serialize.url('type_id', type_id, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('PolicyType', response) @@ -221,7 +206,7 @@ def get_policy_types(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[PolicyType]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/released/profile/__init__.py b/azure-devops/azure/devops/released/profile/__init__.py index fc3a3f65..9b4c6462 100644 --- a/azure-devops/azure/devops/released/profile/__init__.py +++ b/azure-devops/azure/devops/released/profile/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.profile.models import * +from ...v7_0.profile.models import * from .profile_client import ProfileClient __all__ = [ diff --git a/azure-devops/azure/devops/released/profile/profile_client.py b/azure-devops/azure/devops/released/profile/profile_client.py index 40c7e3f0..1f542536 100644 --- a/azure-devops/azure/devops/released/profile/profile_client.py +++ b/azure-devops/azure/devops/released/profile/profile_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.profile import models +from ...v7_0.profile import models class ProfileClient(Client): @@ -34,7 +34,7 @@ def get_profile(self, id, details=None, with_attributes=None, partition=None, co :param str partition: The partition (named group) of attributes to return. :param str core_attributes: A comma-delimited list of core profile attributes to return. Valid values are Email, Avatar, DisplayName, and ContactWithOffers. :param bool force_refresh: Not used in this version of the API. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if id is not None: @@ -52,7 +52,7 @@ def get_profile(self, id, details=None, with_attributes=None, partition=None, co query_parameters['forceRefresh'] = self._serialize.query('force_refresh', force_refresh, 'bool') response = self._send(http_method='GET', location_id='f83735dc-483f-4238-a291-d45f6080a9af', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Profile', response) diff --git a/azure-devops/azure/devops/released/project_analysis/__init__.py b/azure-devops/azure/devops/released/project_analysis/__init__.py new file mode 100644 index 00000000..16a943ff --- /dev/null +++ b/azure-devops/azure/devops/released/project_analysis/__init__.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.project_analysis.models import * +from .project_analysis_client import ProjectAnalysisClient + +__all__ = [ + 'CodeChangeTrendItem', + 'LanguageMetricsSecuredObject', + 'LanguageStatistics', + 'ProjectActivityMetrics', + 'ProjectLanguageAnalytics', + 'RepositoryActivityMetrics', + 'RepositoryLanguageAnalytics', + 'ProjectAnalysisClient' +] diff --git a/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py b/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py new file mode 100644 index 00000000..c2ecf05c --- /dev/null +++ b/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py @@ -0,0 +1,117 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.project_analysis import models + + +class ProjectAnalysisClient(Client): + """ProjectAnalysis + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ProjectAnalysisClient, 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 = '7658fa33-b1bf-4580-990f-fac5896773d3' + + def get_project_language_analytics(self, project): + """GetProjectLanguageAnalytics. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='5b02a779-1867-433f-90b7-d23ed5e33e57', + version='7.0', + route_values=route_values) + return self._deserialize('ProjectLanguageAnalytics', response) + + def get_project_activity_metrics(self, project, from_date, aggregation_type): + """GetProjectActivityMetrics. + :param str project: Project ID or project name + :param datetime from_date: + :param str aggregation_type: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if from_date is not None: + query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') + if aggregation_type is not None: + query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') + response = self._send(http_method='GET', + location_id='e40ae584-9ea6-4f06-a7c7-6284651b466b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProjectActivityMetrics', response) + + def get_git_repositories_activity_metrics(self, project, from_date, aggregation_type, skip, top): + """GetGitRepositoriesActivityMetrics. + Retrieves git activity metrics for repositories matching a specified criteria. + :param str project: Project ID or project name + :param datetime from_date: Date from which, the trends are to be fetched. + :param str aggregation_type: Bucket size on which, trends are to be aggregated. + :param int skip: The number of repositories to ignore. + :param int top: The number of repositories for which activity metrics are to be retrieved. + :rtype: [RepositoryActivityMetrics] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if from_date is not None: + query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') + if aggregation_type is not None: + query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='df7fbbca-630a-40e3-8aa3-7a3faf66947e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RepositoryActivityMetrics]', self._unwrap_collection(response)) + + def get_repository_activity_metrics(self, project, repository_id, from_date, aggregation_type): + """GetRepositoryActivityMetrics. + :param str project: Project ID or project name + :param str repository_id: + :param datetime from_date: + :param str aggregation_type: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository_id is not None: + route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') + query_parameters = {} + if from_date is not None: + query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') + if aggregation_type is not None: + query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') + response = self._send(http_method='GET', + location_id='df7fbbca-630a-40e3-8aa3-7a3faf66947e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('RepositoryActivityMetrics', response) + diff --git a/azure-devops/azure/devops/released/release/__init__.py b/azure-devops/azure/devops/released/release/__init__.py index 24436a3f..39b637fe 100644 --- a/azure-devops/azure/devops/released/release/__init__.py +++ b/azure-devops/azure/devops/released/release/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.release.models import * +from ...v7_0.release.models import * from .release_client import ReleaseClient __all__ = [ @@ -22,7 +22,6 @@ 'AuthorizationHeader', 'AutoTriggerIssue', 'BuildVersion', - 'Change', 'ComplianceSettings', 'Condition', 'ConfigurationVariableValue', @@ -41,6 +40,7 @@ 'Folder', 'GateUpdateMetadata', 'GraphSubjectBase', + 'Change', 'IdentityRef', 'IgnoredGate', 'InputDescriptor', @@ -54,8 +54,12 @@ 'ManualIntervention', 'ManualInterventionUpdateMetadata', 'Metric', + 'OrgPipelineReleaseSettings', + 'OrgPipelineReleaseSettingsUpdateParameters', 'PipelineProcess', 'ProcessParameters', + 'ProjectPipelineReleaseSettings', + 'ProjectPipelineReleaseSettingsUpdateParameters', 'ProjectReference', 'QueuedReleaseData', 'ReferenceLinks', @@ -85,9 +89,9 @@ 'ReleaseGates', 'ReleaseReference', 'ReleaseRevision', - 'ReleaseSchedule', 'ReleaseSettings', 'ReleaseShallowReference', + 'ReleaseSchedule', 'ReleaseStartEnvironmentMetadata', 'ReleaseStartMetadata', 'ReleaseTask', @@ -102,6 +106,7 @@ 'TaskInputValidation', 'TaskSourceDefinitionBase', 'VariableGroup', + 'VariableGroupProjectReference', 'VariableGroupProviderData', 'VariableValue', 'WorkflowTask', diff --git a/azure-devops/azure/devops/released/release/release_client.py b/azure-devops/azure/devops/released/release/release_client.py index bf611a2d..9f691ce7 100644 --- a/azure-devops/azure/devops/released/release/release_client.py +++ b/azure-devops/azure/devops/released/release/release_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.release import models +from ...v7_0.release import models class ReleaseClient(Client): @@ -37,7 +37,7 @@ def get_approvals(self, project, assigned_to_filter=None, status_filter=None, re :param int continuation_token: Gets the approvals after the continuation token provided. :param str query_order: Gets the results in the defined order of created approvals. Default is 'descending'. :param bool include_my_group_approvals: 'true' to include my group approvals. Default is 'false'. - :rtype: :class:`` + :rtype: :class:`<[ReleaseApproval]> ` """ route_values = {} if project is not None: @@ -62,33 +62,18 @@ def get_approvals(self, project, assigned_to_filter=None, status_filter=None, re query_parameters['includeMyGroupApprovals'] = self._serialize.query('include_my_group_approvals', include_my_group_approvals, 'bool') response = self._send(http_method='GET', location_id='b47c6458-e73b-47cb-a770-4df1e8813a91', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetApprovalsResponseValue(response_value, continuation_token) - - class GetApprovalsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_approvals method - - :param value: - :type value: :class:`<[ReleaseApproval]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) def update_release_approval(self, approval, project, approval_id): """UpdateReleaseApproval. Update status of an approval - :param :class:` ` approval: ReleaseApproval object having status, approver and comments. + :param :class:` ` approval: ReleaseApproval object having status, approver and comments. :param str project: Project ID or project name :param int approval_id: Id of the approval. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -98,17 +83,91 @@ def update_release_approval(self, approval, project, approval_id): content = self._serialize.body(approval, 'ReleaseApproval') response = self._send(http_method='PATCH', location_id='9328e074-59fb-465a-89d9-b09c82ee5109', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('ReleaseApproval', response) + def get_release_task_attachment_content(self, project, release_id, environment_id, attempt_id, plan_id, timeline_id, record_id, type, name, **kwargs): + """GetReleaseTaskAttachmentContent. + Get a release task attachment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str timeline_id: Timeline Id of the task. + :param str record_id: Record Id of attachment. + :param str type: Type of the attachment. + :param str name: Name of the attachment. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if attempt_id is not None: + route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + response = self._send(http_method='GET', + location_id='60b86efb-7b8c-4853-8f9f-aa142b77b479', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_release_task_attachments(self, project, release_id, environment_id, attempt_id, plan_id, type): + """GetReleaseTaskAttachments. + Get the release task attachments. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param int attempt_id: Attempt number of deployment. + :param str plan_id: Plan Id of the deploy phase. + :param str type: Type of the attachment. + :rtype: [ReleaseTaskAttachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if attempt_id is not None: + route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='a4d06688-0dfa-4895-82a5-f43ec9452306', + version='7.0', + route_values=route_values) + return self._deserialize('[ReleaseTaskAttachment]', self._unwrap_collection(response)) + def create_release_definition(self, release_definition, project): """CreateReleaseDefinition. Create a release definition - :param :class:` ` release_definition: release definition object to create. + :param :class:` ` release_definition: release definition object to create. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -116,7 +175,7 @@ def create_release_definition(self, release_definition, project): content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='POST', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) @@ -141,7 +200,7 @@ def delete_release_definition(self, project, definition_id, comment=None, force_ query_parameters['forceDelete'] = self._serialize.query('force_delete', force_delete, 'bool') self._send(http_method='DELETE', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) @@ -151,7 +210,7 @@ def get_release_definition(self, project, definition_id, property_filters=None): :param str project: Project ID or project name :param int definition_id: Id of the release definition. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -164,7 +223,7 @@ def get_release_definition(self, project, definition_id, property_filters=None): query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReleaseDefinition', response) @@ -187,7 +246,7 @@ def get_release_definitions(self, project, search_text=None, expand=None, artifa :param [str] definition_id_filter: A comma-delimited list of release definitions to retrieve. :param bool is_deleted: 'true' to get release definitions that has been deleted. Default is 'false' :param bool search_text_contains_folder_name: 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. - :rtype: :class:`` + :rtype: :class:`<[ReleaseDefinition]> ` """ route_values = {} if project is not None: @@ -226,32 +285,17 @@ def get_release_definitions(self, project, search_text=None, expand=None, artifa query_parameters['searchTextContainsFolderName'] = self._serialize.query('search_text_contains_folder_name', search_text_contains_folder_name, 'bool') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetReleaseDefinitionsResponseValue(response_value, continuation_token) - - class GetReleaseDefinitionsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_release_definitions method - - :param value: - :type value: :class:`<[ReleaseDefinition]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) def update_release_definition(self, release_definition, project): """UpdateReleaseDefinition. Update a release definition. - :param :class:` ` release_definition: Release definition object to update. + :param :class:` ` release_definition: Release definition object to update. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -259,7 +303,7 @@ def update_release_definition(self, release_definition, project): content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='PUT', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) @@ -282,7 +326,7 @@ def get_deployments(self, project, definition_id=None, definition_environment_id :param datetime min_started_time: :param datetime max_started_time: :param str source_branch: - :rtype: :class:`` + :rtype: :class:`<[Deployment]> ` """ route_values = {} if project is not None: @@ -320,25 +364,204 @@ def get_deployments(self, project, definition_id=None, definition_environment_id query_parameters['sourceBranch'] = self._serialize.query('source_branch', source_branch, 'str') response = self._send(http_method='GET', location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', - version='5.1', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Deployment]', self._unwrap_collection(response)) + + def get_release_environment(self, project, release_id, environment_id, expand=None): + """GetReleaseEnvironment. + Get a release environment. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of the release environment. + :param str expand: A property that should be expanded in the environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReleaseEnvironment', response) + + def update_release_environment(self, environment_update_data, project, release_id, environment_id): + """UpdateReleaseEnvironment. + Update the status of a release environment + :param :class:` ` environment_update_data: Environment update meta data. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of release environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(environment_update_data, 'ReleaseEnvironmentUpdateMetadata') + response = self._send(http_method='PATCH', + location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseEnvironment', response) + + def delete_folder(self, project, path): + """DeleteFolder. + Deletes a definition folder for given folder name and path and all it's existing definitions. + :param str project: Project ID or project name + :param str path: Path of the folder to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if path is not None: + route_values['path'] = self._serialize.url('path', path, 'str') + self._send(http_method='DELETE', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values) + + def get_folders(self, project, path=None, query_order=None): + """GetFolders. + Gets folders. + :param str project: Project ID or project name + :param str path: Path of the folder. + :param str query_order: Gets the results in the defined order. Default is 'None'. + :rtype: [Folder] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if path is not None: + route_values['path'] = self._serialize.url('path', path, 'str') + query_parameters = {} + if query_order is not None: + query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') + response = self._send(http_method='GET', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[Deployment]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetDeploymentsResponseValue(response_value, continuation_token) - - class GetDeploymentsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_deployments method - - :param value: - :type value: :class:`<[Deployment]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[Folder]', self._unwrap_collection(response)) + + def update_folder(self, folder, project, path): + """UpdateFolder. + Updates an existing folder at given existing path. + :param :class:` ` folder: folder. + :param str project: Project ID or project name + :param str path: Path of the folder to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if path is not None: + route_values['path'] = self._serialize.url('path', path, 'str') + content = self._serialize.body(folder, 'Folder') + response = self._send(http_method='PATCH', + location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Folder', response) + + def update_gates(self, gate_update_metadata, project, gate_step_id): + """UpdateGates. + Updates the gate for a deployment. + :param :class:` ` gate_update_metadata: Metadata to patch the Release Gates. + :param str project: Project ID or project name + :param int gate_step_id: Gate step Id. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if gate_step_id is not None: + route_values['gateStepId'] = self._serialize.url('gate_step_id', gate_step_id, 'int') + content = self._serialize.body(gate_update_metadata, 'GateUpdateMetadata') + response = self._send(http_method='PATCH', + location_id='2666a539-2001-4f80-bcc7-0379956749d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ReleaseGates', response) + + def get_logs(self, project, release_id, **kwargs): + """GetLogs. + Get logs for a release Id. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + response = self._send(http_method='GET', + location_id='c37fbab5-214b-48e4-a55b-cb6b4f6e4038', + version='7.0', + route_values=route_values, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): + """GetTaskLog. + Gets the task log of a release as a plain text file. + :param str project: Project ID or project name + :param int release_id: Id of the release. + :param int environment_id: Id of release environment. + :param int release_deploy_phase_id: Release deploy phase Id. + :param int task_id: ReleaseTask Id for the log. + :param long start_line: Starting line number for logs + :param long end_line: Ending line number for logs + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if release_id is not None: + route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if release_deploy_phase_id is not None: + route_values['releaseDeployPhaseId'] = self._serialize.url('release_deploy_phase_id', release_deploy_phase_id, 'int') + if task_id is not None: + route_values['taskId'] = self._serialize.url('task_id', task_id, 'int') + query_parameters = {} + if start_line is not None: + query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') + if end_line is not None: + query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') + response = self._send(http_method='GET', + location_id='17c91af7-09fd-4256-bff1-c24ee4f73bc0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) def get_manual_intervention(self, project, release_id, manual_intervention_id): """GetManualIntervention. @@ -346,7 +569,7 @@ def get_manual_intervention(self, project, release_id, manual_intervention_id): :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -357,7 +580,7 @@ def get_manual_intervention(self, project, release_id, manual_intervention_id): route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('ManualIntervention', response) @@ -375,18 +598,18 @@ def get_manual_interventions(self, project, release_id): route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[ManualIntervention]', self._unwrap_collection(response)) def update_manual_intervention(self, manual_intervention_update_metadata, project, release_id, manual_intervention_id): """UpdateManualIntervention. Update manual intervention. - :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. + :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -398,7 +621,7 @@ def update_manual_intervention(self, manual_intervention_update_metadata, projec content = self._serialize.body(manual_intervention_update_metadata, 'ManualInterventionUpdateMetadata') response = self._send(http_method='PATCH', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('ManualIntervention', response) @@ -428,7 +651,7 @@ def get_releases(self, project=None, definition_id=None, definition_environment_ :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. :param [int] release_id_filter: A comma-delimited list of releases Ids. Only releases with these Ids will be returned. :param str path: Releases under this folder path will be returned - :rtype: :class:`` + :rtype: :class:`<[Release]> ` """ route_values = {} if project is not None: @@ -481,32 +704,17 @@ def get_releases(self, project=None, definition_id=None, definition_environment_ query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[Release]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetReleasesResponseValue(response_value, continuation_token) - - class GetReleasesResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_releases method - - :param value: - :type value: :class:`<[Release]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[Release]', self._unwrap_collection(response)) def create_release(self, release_start_metadata, project): """CreateRelease. Create a release. - :param :class:` ` release_start_metadata: Metadata to create a release. + :param :class:` ` release_start_metadata: Metadata to create a release. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -514,7 +722,7 @@ def create_release(self, release_start_metadata, project): content = self._serialize.body(release_start_metadata, 'ReleaseStartMetadata') response = self._send(http_method='POST', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Release', response) @@ -528,7 +736,7 @@ def get_release(self, project, release_id, approval_filters=None, property_filte :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. :param str expand: A property that should be expanded in the release. :param int top_gate_records: Number of release gate records to get. Default is 5. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -547,7 +755,7 @@ def get_release(self, project, release_id, approval_filters=None, property_filte query_parameters['$topGateRecords'] = self._serialize.query('top_gate_records', top_gate_records, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Release', response) @@ -570,7 +778,7 @@ def get_release_revision(self, project, release_id, definition_snapshot_revision query_parameters['definitionSnapshotRevision'] = self._serialize.query('definition_snapshot_revision', definition_snapshot_revision, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -583,10 +791,10 @@ def get_release_revision(self, project, release_id, definition_snapshot_revision def update_release(self, release, project, release_id): """UpdateRelease. Update a complete release object. - :param :class:` ` release: Release object for update. + :param :class:` ` release: Release object for update. :param str project: Project ID or project name :param int release_id: Id of the release to update. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -596,7 +804,7 @@ def update_release(self, release, project, release_id): content = self._serialize.body(release, 'Release') response = self._send(http_method='PUT', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Release', response) @@ -604,10 +812,10 @@ def update_release(self, release, project, release_id): def update_release_resource(self, release_update_metadata, project, release_id): """UpdateReleaseResource. Update few properties of a release. - :param :class:` ` release_update_metadata: Properties of release to update. + :param :class:` ` release_update_metadata: Properties of release to update. :param str project: Project ID or project name :param int release_id: Id of the release to update. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -617,8 +825,52 @@ def update_release_resource(self, release_update_metadata, project, release_id): content = self._serialize.body(release_update_metadata, 'ReleaseUpdateMetadata') response = self._send(http_method='PATCH', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Release', response) + def get_definition_revision(self, project, definition_id, revision, **kwargs): + """GetDefinitionRevision. + Get release definition for a given definitionId and revision + :param str project: Project ID or project name + :param int definition_id: Id of the definition. + :param int revision: Id of the revision. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + if revision is not None: + route_values['revision'] = self._serialize.url('revision', revision, 'int') + response = self._send(http_method='GET', + location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', + version='7.0', + route_values=route_values, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_release_definition_history(self, project, definition_id): + """GetReleaseDefinitionHistory. + Get revision history for a release definition + :param str project: Project ID or project name + :param int definition_id: Id of the definition. + :rtype: [ReleaseDefinitionRevision] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + response = self._send(http_method='GET', + location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', + version='7.0', + route_values=route_values) + return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/search/__init__.py b/azure-devops/azure/devops/released/search/__init__.py new file mode 100644 index 00000000..853ed4db --- /dev/null +++ b/azure-devops/azure/devops/released/search/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.search.models import * +from .search_client import SearchClient + +__all__ = [ + 'BoardResult', + 'BoardSearchRequest', + 'BoardSearchResponse', + 'BranchInfo', + 'CodeResult', + 'CodeSearchRequest', + 'CodeSearchResponse', + 'Collection', + 'CustomRepositoryBranchStatusResponse', + 'CustomRepositoryStatusResponse', + 'DepotInfo', + 'EntitySearchRequest', + 'EntitySearchRequestBase', + 'EntitySearchResponse', + 'FeedInfo', + 'Filter', + 'Hit', + 'PackageHit', + 'PackageResult', + 'PackageSearchRequest', + 'PackageSearchResponse', + 'PackageSearchResponseContent', + 'Project', + 'ProjectReference', + 'Repository', + 'RepositoryStatusResponse', + 'ScrollSearchRequest', + 'SettingResult', + 'SettingSearchRequest', + 'SettingSearchResponse', + 'SortOption', + 'Team', + 'TfvcRepositoryStatusResponse', + 'Version', + 'Wiki', + 'WikiHit', + 'WikiResult', + 'WikiSearchRequest', + 'WikiSearchResponse', + 'WorkItemHit', + 'WorkItemResult', + 'WorkItemSearchRequest', + 'WorkItemSearchResponse', + 'SearchClient' +] diff --git a/azure-devops/azure/devops/released/search/search_client.py b/azure-devops/azure/devops/released/search/search_client.py new file mode 100644 index 00000000..07a7ffb2 --- /dev/null +++ b/azure-devops/azure/devops/released/search/search_client.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.search import models + + +class SearchClient(Client): + """Search + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(SearchClient, 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 = 'ea48a0a1-269c-42d8-b8ad-ddc8fcdcf578' + + def fetch_scroll_code_search_results(self, request, project=None): + """FetchScrollCodeSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Code Search Request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(request, 'ScrollSearchRequest') + response = self._send(http_method='POST', + location_id='852dac94-e8f7-45a2-9910-927ae35766a2', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_code_search_results(self, request, project=None): + """FetchCodeSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Code Search Request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(request, 'CodeSearchRequest') + response = self._send(http_method='POST', + location_id='e7f29993-5b82-4fca-9386-f5cfe683d524', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CodeSearchResponse', response) + + def fetch_package_search_results(self, request): + """FetchPackageSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Package Search Request. + :rtype: :class:` ` + """ + content = self._serialize.body(request, 'PackageSearchRequest') + response = self._send(http_method='POST', + location_id='f62ada48-eedc-4c8e-93f0-de870e4ecce0', + version='7.0', + content=content) + response_object = models.PackageSearchResponse() + response_object.content = self._deserialize('PackageSearchResponseContent', response) + response_object.activity_id = response.headers.get('ActivityId') + return response_object + + def get_repository_status(self, project, repository): + """GetRepositoryStatus. + Provides status of Repository. + :param str project: Project ID or project name + :param str repository: Repository ID or repository name. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if repository is not None: + route_values['repository'] = self._serialize.url('repository', repository, 'str') + response = self._send(http_method='GET', + location_id='1f60303c-7261-4387-80f1-742a2ecf2964', + version='7.0', + route_values=route_values) + return self._deserialize('RepositoryStatusResponse', response) + + def get_tfvc_repository_status(self, project): + """GetTfvcRepositoryStatus. + Provides status of TFVC Repository. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='d5bf4e52-e0af-4626-8c50-8a80b18fa69f', + version='7.0', + route_values=route_values) + return self._deserialize('TfvcRepositoryStatusResponse', response) + + def fetch_wiki_search_results(self, request, project=None): + """FetchWikiSearchResults. + Provides a set of results for the search request. + :param :class:` ` request: The Wiki Search Request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(request, 'WikiSearchRequest') + response = self._send(http_method='POST', + location_id='e90e7664-7049-4100-9a86-66b161d81080', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WikiSearchResponse', response) + + def fetch_work_item_search_results(self, request, project=None): + """FetchWorkItemSearchResults. + Provides a set of results for the search text. + :param :class:` ` request: The Work Item Search Request. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(request, 'WorkItemSearchRequest') + response = self._send(http_method='POST', + location_id='73b2c9e2-ff9e-4447-8cda-5f5b21ff7cae', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemSearchResponse', response) + diff --git a/azure-devops/azure/devops/released/security/__init__.py b/azure-devops/azure/devops/released/security/__init__.py index 90e045e2..e6e0c12f 100644 --- a/azure-devops/azure/devops/released/security/__init__.py +++ b/azure-devops/azure/devops/released/security/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.security.models import * +from ...v7_0.security.models import * from .security_client import SecurityClient __all__ = [ diff --git a/azure-devops/azure/devops/released/security/security_client.py b/azure-devops/azure/devops/released/security/security_client.py index e380a4ba..d2209467 100644 --- a/azure-devops/azure/devops/released/security/security_client.py +++ b/azure-devops/azure/devops/released/security/security_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.security import models +from ...v7_0.security import models class SecurityClient(Client): @@ -43,7 +43,7 @@ def remove_access_control_entries(self, security_namespace_id, token=None, descr query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') response = self._send(http_method='DELETE', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) @@ -51,7 +51,7 @@ def remove_access_control_entries(self, security_namespace_id, token=None, descr def set_access_control_entries(self, container, security_namespace_id): """SetAccessControlEntries. Add or update ACEs in the ACL for the provided token. The request body contains the target token, a list of [ACEs](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries/set%20access%20control%20entries?#accesscontrolentry) and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - :param :class:` ` container: + :param :class:` ` container: :param str security_namespace_id: Security namespace identifier. :rtype: [AccessControlEntry] """ @@ -61,7 +61,7 @@ def set_access_control_entries(self, container, security_namespace_id): content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[AccessControlEntry]', self._unwrap_collection(response)) @@ -90,7 +90,7 @@ def query_access_control_lists(self, security_namespace_id, token=None, descript query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='GET', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[AccessControlList]', self._unwrap_collection(response)) @@ -113,7 +113,7 @@ def remove_access_control_lists(self, security_namespace_id, tokens=None, recurs query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='DELETE', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) @@ -121,7 +121,7 @@ def remove_access_control_lists(self, security_namespace_id, tokens=None, recurs def set_access_control_lists(self, access_control_lists, security_namespace_id): """SetAccessControlLists. Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten. - :param :class:` ` access_control_lists: A list of ACLs to create or update. + :param :class:` ` access_control_lists: A list of ACLs to create or update. :param str security_namespace_id: Security namespace identifier. """ route_values = {} @@ -130,20 +130,20 @@ def set_access_control_lists(self, access_control_lists, security_namespace_id): content = self._serialize.body(access_control_lists, 'VssJsonCollectionWrapper') self._send(http_method='POST', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', - version='5.1', + version='7.0', route_values=route_values, content=content) def has_permissions_batch(self, eval_batch): """HasPermissionsBatch. Evaluates multiple permissions for the calling user. Note: This method does not aggregate the results, nor does it short-circuit if one of the permissions evaluates to false. - :param :class:` ` eval_batch: The set of evaluation requests. - :rtype: :class:` ` + :param :class:` ` eval_batch: The set of evaluation requests. + :rtype: :class:` ` """ content = self._serialize.body(eval_batch, 'PermissionEvaluationBatch') response = self._send(http_method='POST', location_id='cf1faa59-1b63-4448-bf04-13d981a46f5d', - version='5.1', + version='7.0', content=content) return self._deserialize('PermissionEvaluationBatch', response) @@ -171,7 +171,7 @@ def has_permissions(self, security_namespace_id, permissions=None, tokens=None, query_parameters['delimiter'] = self._serialize.query('delimiter', delimiter, 'str') response = self._send(http_method='GET', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[bool]', self._unwrap_collection(response)) @@ -183,7 +183,7 @@ def remove_permission(self, security_namespace_id, descriptor, permissions=None, :param str descriptor: Identity descriptor of the user to remove permissions for. :param int permissions: Permissions to remove. :param str token: Security token to remove permissions for. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if security_namespace_id is not None: @@ -197,7 +197,7 @@ def remove_permission(self, security_namespace_id, descriptor, permissions=None, query_parameters['token'] = self._serialize.query('token', token, 'str') response = self._send(http_method='DELETE', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AccessControlEntry', response) @@ -217,7 +217,7 @@ def query_security_namespaces(self, security_namespace_id=None, local_only=None) query_parameters['localOnly'] = self._serialize.query('local_only', local_only, 'bool') response = self._send(http_method='GET', location_id='ce7b9f95-fde9-4be8-a86d-83b366f0b87a', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/released/service_endpoint/__init__.py b/azure-devops/azure/devops/released/service_endpoint/__init__.py new file mode 100644 index 00000000..79f1e526 --- /dev/null +++ b/azure-devops/azure/devops/released/service_endpoint/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.service_endpoint.models import * +from .service_endpoint_client import ServiceEndpointClient + +__all__ = [ + 'AadOauthTokenRequest', + 'AadOauthTokenResult', + 'AuthenticationSchemeReference', + 'AuthorizationHeader', + 'AzureManagementGroup', + 'AzureManagementGroupQueryResult', + 'AzureSubscription', + 'AzureSubscriptionQueryResult', + 'ClientCertificate', + 'DataSource', + 'DataSourceBinding', + 'DataSourceBindingBase', + 'DataSourceDetails', + 'DependencyBinding', + 'DependencyData', + 'DependsOn', + 'EndpointAuthorization', + 'EndpointUrl', + 'GraphSubjectBase', + 'HelpLink', + 'IdentityRef', + 'InputDescriptor', + 'InputValidation', + 'InputValue', + 'InputValues', + 'InputValuesError', + 'OAuthConfiguration', + 'OAuthConfigurationParams', + 'ProjectReference', + 'ReferenceLinks', + 'RefreshAuthenticationParameters', + 'ResultTransformationDetails', + 'ServiceEndpoint', + 'ServiceEndpointAuthenticationScheme', + 'ServiceEndpointDetails', + 'ServiceEndpointExecutionData', + 'ServiceEndpointExecutionOwner', + 'ServiceEndpointExecutionRecord', + 'ServiceEndpointExecutionRecordsInput', + 'ServiceEndpointProjectReference', + 'ServiceEndpointRequest', + 'ServiceEndpointRequestResult', + 'ServiceEndpointType', + 'ServiceEndpointClient' +] diff --git a/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py b/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py new file mode 100644 index 00000000..6509fd8c --- /dev/null +++ b/azure-devops/azure/devops/released/service_endpoint/service_endpoint_client.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.service_endpoint import models + + +class ServiceEndpointClient(Client): + """ServiceEndpoint + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(ServiceEndpointClient, 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 = '1814ab31-2f4f-4a9f-8761-f4d77dc5a5d7' + + def execute_service_endpoint_request(self, service_endpoint_request, project, endpoint_id): + """ExecuteServiceEndpointRequest. + Proxy for a GET request defined by a service endpoint. + :param :class:` ` service_endpoint_request: Service endpoint request. + :param str project: Project ID or project name + :param str endpoint_id: Id of the service endpoint. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_id is not None: + query_parameters['endpointId'] = self._serialize.query('endpoint_id', endpoint_id, 'str') + content = self._serialize.body(service_endpoint_request, 'ServiceEndpointRequest') + response = self._send(http_method='POST', + location_id='cc63bb57-2a5f-4a7a-b79c-c142d308657e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpointRequestResult', response) + + def create_service_endpoint(self, endpoint): + """CreateServiceEndpoint. + Creates a new service endpoint + :param :class:` ` endpoint: Service endpoint to create + :rtype: :class:` ` + """ + content = self._serialize.body(endpoint, 'ServiceEndpoint') + response = self._send(http_method='POST', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('ServiceEndpoint', response) + + def delete_service_endpoint(self, endpoint_id, project_ids, deep=None): + """DeleteServiceEndpoint. + Delete a service endpoint + :param str endpoint_id: Endpoint Id of endpoint to delete + :param [str] project_ids: project Ids from which endpoint needs to be deleted + :param bool deep: delete the spn created by endpoint + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + if deep is not None: + query_parameters['deep'] = self._serialize.query('deep', deep, 'bool') + self._send(http_method='DELETE', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_service_endpoint(self, endpoint_project_references, endpoint_id): + """ShareServiceEndpoint. + Share service endpoint across projects + :param [ServiceEndpointProjectReference] endpoint_project_references: Project reference details of the target project + :param str endpoint_id: Endpoint Id of the endpoint to share + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + content = self._serialize.body(endpoint_project_references, '[ServiceEndpointProjectReference]') + self._send(http_method='PATCH', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + content=content) + + def update_service_endpoint(self, endpoint, endpoint_id, operation=None): + """UpdateServiceEndpoint. + Update the service endpoint + :param :class:` ` endpoint: Updated data for the endpoint + :param str endpoint_id: Endpoint Id of the endpoint to update + :param str operation: operation type + :rtype: :class:` ` + """ + route_values = {} + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if operation is not None: + query_parameters['operation'] = self._serialize.query('operation', operation, 'str') + content = self._serialize.body(endpoint, 'ServiceEndpoint') + response = self._send(http_method='PUT', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('ServiceEndpoint', response) + + def update_service_endpoints(self, endpoints): + """UpdateServiceEndpoints. + Update the service endpoints. + :param [ServiceEndpoint] endpoints: Names of the service endpoints to update. + :rtype: [ServiceEndpoint] + """ + content = self._serialize.body(endpoints, '[ServiceEndpoint]') + response = self._send(http_method='PUT', + location_id='14e48fdc-2c8b-41ce-a0c3-e26f6cc55bd0', + version='7.0', + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_details(self, project, endpoint_id, action_filter=None): + """GetServiceEndpointDetails. + Get the service endpoint details. + :param str project: Project ID or project name + :param str endpoint_id: Id of the service endpoint. + :param str action_filter: Action filter for the service connection. It specifies the action which can be performed on the service connection. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ServiceEndpoint', response) + + def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, owner=None, include_failed=None, include_details=None): + """GetServiceEndpoints. + Get the service endpoints. + :param str project: Project ID or project name + :param str type: Type of the service endpoints. + :param [str] auth_schemes: Authorization schemes used for service endpoints. + :param [str] endpoint_ids: Ids of the service endpoints. + :param str owner: Owner for service endpoints. + :param bool include_failed: Failed flag for service endpoints. + :param bool include_details: Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if auth_schemes is not None: + auth_schemes = ",".join(auth_schemes) + query_parameters['authSchemes'] = self._serialize.query('auth_schemes', auth_schemes, 'str') + if endpoint_ids is not None: + endpoint_ids = ",".join(endpoint_ids) + query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') + if owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, 'str') + if include_failed is not None: + query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') + if include_details is not None: + query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoints_by_names(self, project, endpoint_names, type=None, auth_schemes=None, owner=None, include_failed=None, include_details=None): + """GetServiceEndpointsByNames. + Get the service endpoints by name. + :param str project: Project ID or project name + :param [str] endpoint_names: Names of the service endpoints. + :param str type: Type of the service endpoints. + :param [str] auth_schemes: Authorization schemes used for service endpoints. + :param str owner: Owner for service endpoints. + :param bool include_failed: Failed flag for service endpoints. + :param bool include_details: Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_names is not None: + endpoint_names = ",".join(endpoint_names) + query_parameters['endpointNames'] = self._serialize.query('endpoint_names', endpoint_names, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if auth_schemes is not None: + auth_schemes = ",".join(auth_schemes) + query_parameters['authSchemes'] = self._serialize.query('auth_schemes', auth_schemes, 'str') + if owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, 'str') + if include_failed is not None: + query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') + if include_details is not None: + query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') + response = self._send(http_method='GET', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoints_with_refreshed_authentication(self, refresh_authentication_parameters, project, endpoint_ids): + """GetServiceEndpointsWithRefreshedAuthentication. + Gets the service endpoints and patch new authorization parameters + :param [RefreshAuthenticationParameters] refresh_authentication_parameters: Scope, Validity of Token requested. + :param str project: Project ID or project name + :param [str] endpoint_ids: Ids of the service endpoints. + :rtype: [ServiceEndpoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if endpoint_ids is not None: + endpoint_ids = ",".join(endpoint_ids) + query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') + content = self._serialize.body(refresh_authentication_parameters, '[RefreshAuthenticationParameters]') + response = self._send(http_method='POST', + location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) + + def get_service_endpoint_execution_records(self, project, endpoint_id, top=None, continuation_token=None): + """GetServiceEndpointExecutionRecords. + Get service endpoint execution records. + :param str project: Project ID or project name + :param str endpoint_id: Id of the service endpoint. + :param int top: Number of service endpoint execution records to get. + :param long continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of records + :rtype: :class:`<[ServiceEndpointExecutionRecord]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if endpoint_id is not None: + route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') + query_parameters = {} + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') + response = self._send(http_method='GET', + location_id='10a16738-9299-4cd1-9a81-fd23ad6200d0', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpointExecutionRecord]', self._unwrap_collection(response)) + + def get_service_endpoint_types(self, type=None, scheme=None): + """GetServiceEndpointTypes. + Get service endpoint types. + :param str type: Type of service endpoint. + :param str scheme: Scheme of service endpoint. + :rtype: [ServiceEndpointType] + """ + query_parameters = {} + if type is not None: + query_parameters['type'] = self._serialize.query('type', type, 'str') + if scheme is not None: + query_parameters['scheme'] = self._serialize.query('scheme', scheme, 'str') + response = self._send(http_method='GET', + location_id='5a7938a4-655e-486c-b562-b78c54a7e87b', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[ServiceEndpointType]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/service_hooks/__init__.py b/azure-devops/azure/devops/released/service_hooks/__init__.py index 043375c0..cd0624cf 100644 --- a/azure-devops/azure/devops/released/service_hooks/__init__.py +++ b/azure-devops/azure/devops/released/service_hooks/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.service_hooks.models import * +from ...v7_0.service_hooks.models import * from .service_hooks_client import ServiceHooksClient __all__ = [ diff --git a/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py b/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py index b6849b6c..45d64dd1 100644 --- a/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py +++ b/azure-devops/azure/devops/released/service_hooks/service_hooks_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.service_hooks import models +from ...v7_0.service_hooks import models class ServiceHooksClient(Client): @@ -31,7 +31,7 @@ def get_consumer_action(self, consumer_id, consumer_action_id, publisher_id=None :param str consumer_id: ID for a consumer. :param str consumer_action_id: ID for a consumerActionId. :param str publisher_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if consumer_id is not None: @@ -43,7 +43,7 @@ def get_consumer_action(self, consumer_id, consumer_action_id, publisher_id=None query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ConsumerAction', response) @@ -63,7 +63,7 @@ def list_consumer_actions(self, consumer_id, publisher_id=None): query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ConsumerAction]', self._unwrap_collection(response)) @@ -73,7 +73,7 @@ def get_consumer(self, consumer_id, publisher_id=None): Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher. :param str consumer_id: ID for a consumer. :param str publisher_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if consumer_id is not None: @@ -83,7 +83,7 @@ def get_consumer(self, consumer_id, publisher_id=None): query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Consumer', response) @@ -99,16 +99,47 @@ def list_consumers(self, publisher_id=None): query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Consumer]', self._unwrap_collection(response)) + def get_subscription_diagnostics(self, subscription_id): + """GetSubscriptionDiagnostics. + :param str subscription_id: + :rtype: :class:` ` + """ + route_values = {} + if subscription_id is not None: + route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') + response = self._send(http_method='GET', + location_id='3b36bcb5-02ad-43c6-bbfa-6dfc6f8e9d68', + version='7.0', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + :param :class:` ` update_parameters: + :param str subscription_id: + :rtype: :class:` ` + """ + route_values = {} + if subscription_id is not None: + route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') + content = self._serialize.body(update_parameters, 'UpdateSubscripitonDiagnosticsParameters') + response = self._send(http_method='PUT', + location_id='3b36bcb5-02ad-43c6-bbfa-6dfc6f8e9d68', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionDiagnostics', response) + def get_event_type(self, publisher_id, event_type_id): """GetEventType. Get a specific event type. :param str publisher_id: ID for a publisher. :param str event_type_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if publisher_id is not None: @@ -117,7 +148,7 @@ def get_event_type(self, publisher_id, event_type_id): route_values['eventTypeId'] = self._serialize.url('event_type_id', event_type_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('EventTypeDescriptor', response) @@ -132,7 +163,7 @@ def list_event_types(self, publisher_id): route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[EventTypeDescriptor]', self._unwrap_collection(response)) @@ -141,7 +172,7 @@ def get_notification(self, subscription_id, notification_id): Get a specific notification for a subscription. :param str subscription_id: ID for a subscription. :param int notification_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -150,7 +181,7 @@ def get_notification(self, subscription_id, notification_id): route_values['notificationId'] = self._serialize.url('notification_id', notification_id, 'int') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Notification', response) @@ -175,7 +206,7 @@ def get_notifications(self, subscription_id, max_results=None, status=None, resu query_parameters['result'] = self._serialize.query('result', result, 'str') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Notification]', self._unwrap_collection(response)) @@ -183,21 +214,21 @@ def get_notifications(self, subscription_id, max_results=None, status=None, resu def query_notifications(self, query): """QueryNotifications. Query for notifications. A notification includes details about the event, the request to and the response from the consumer service. - :param :class:` ` query: - :rtype: :class:` ` + :param :class:` ` query: + :rtype: :class:` ` """ content = self._serialize.body(query, 'NotificationsQuery') response = self._send(http_method='POST', location_id='1a57562f-160a-4b5c-9185-905e95b39d36', - version='5.1', + version='7.0', content=content) return self._deserialize('NotificationsQuery', response) def query_input_values(self, input_values_query, publisher_id): """QueryInputValues. - :param :class:` ` input_values_query: + :param :class:` ` input_values_query: :param str publisher_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if publisher_id is not None: @@ -205,7 +236,7 @@ def query_input_values(self, input_values_query, publisher_id): content = self._serialize.body(input_values_query, 'InputValuesQuery') response = self._send(http_method='POST', location_id='d815d352-a566-4dc1-a3e3-fd245acf688c', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('InputValuesQuery', response) @@ -214,14 +245,14 @@ def get_publisher(self, publisher_id): """GetPublisher. Get a specific service hooks publisher. :param str publisher_id: ID for a publisher. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Publisher', response) @@ -232,32 +263,32 @@ def list_publishers(self): """ response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', - version='5.1') + version='7.0') return self._deserialize('[Publisher]', self._unwrap_collection(response)) def query_publishers(self, query): """QueryPublishers. Query for service hook publishers. - :param :class:` ` query: - :rtype: :class:` ` + :param :class:` ` query: + :rtype: :class:` ` """ content = self._serialize.body(query, 'PublishersQuery') response = self._send(http_method='POST', location_id='99b44a8a-65a8-4670-8f3e-e7f7842cce64', - version='5.1', + version='7.0', content=content) return self._deserialize('PublishersQuery', response) def create_subscription(self, subscription): """CreateSubscription. Create a subscription. - :param :class:` ` subscription: Subscription to be created. - :rtype: :class:` ` + :param :class:` ` subscription: Subscription to be created. + :rtype: :class:` ` """ content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='POST', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', - version='5.1', + version='7.0', content=content) return self._deserialize('Subscription', response) @@ -271,21 +302,21 @@ def delete_subscription(self, subscription_id): route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', - version='5.1', + version='7.0', route_values=route_values) def get_subscription(self, subscription_id): """GetSubscription. Get a specific service hooks subscription. :param str subscription_id: ID for a subscription. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Subscription', response) @@ -309,16 +340,16 @@ def list_subscriptions(self, publisher_id=None, event_type=None, consumer_id=Non query_parameters['consumerActionId'] = self._serialize.query('consumer_action_id', consumer_action_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Subscription]', self._unwrap_collection(response)) def replace_subscription(self, subscription, subscription_id=None): """ReplaceSubscription. Update a subscription. ID for a subscription that you wish to update. - :param :class:` ` subscription: + :param :class:` ` subscription: :param str subscription_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if subscription_id is not None: @@ -326,7 +357,7 @@ def replace_subscription(self, subscription, subscription_id=None): content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='PUT', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Subscription', response) @@ -334,22 +365,22 @@ def replace_subscription(self, subscription, subscription_id=None): def create_subscriptions_query(self, query): """CreateSubscriptionsQuery. Query for service hook subscriptions. - :param :class:` ` query: - :rtype: :class:` ` + :param :class:` ` query: + :rtype: :class:` ` """ content = self._serialize.body(query, 'SubscriptionsQuery') response = self._send(http_method='POST', location_id='c7c3c1cf-9e05-4c0d-a425-a0f922c2c6ed', - version='5.1', + version='7.0', content=content) return self._deserialize('SubscriptionsQuery', response) def create_test_notification(self, test_notification, use_real_data=None): """CreateTestNotification. Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription. - :param :class:` ` test_notification: + :param :class:` ` test_notification: :param bool use_real_data: Only allow testing with real data in existing subscriptions. - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if use_real_data is not None: @@ -357,7 +388,7 @@ def create_test_notification(self, test_notification, use_real_data=None): content = self._serialize.body(test_notification, 'Notification') response = self._send(http_method='POST', location_id='1139462c-7e27-4524-a997-31b9b73551fe', - version='5.1', + version='7.0', query_parameters=query_parameters, content=content) return self._deserialize('Notification', response) diff --git a/azure-devops/azure/devops/released/symbol/__init__.py b/azure-devops/azure/devops/released/symbol/__init__.py new file mode 100644 index 00000000..d7cae595 --- /dev/null +++ b/azure-devops/azure/devops/released/symbol/__init__.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.symbol.models import * +from .symbol_client import SymbolClient + +__all__ = [ + 'DebugEntry', + 'DebugEntryCreateBatch', + 'IDomainId', + 'JsonBlobBlockHash', + 'JsonBlobIdentifier', + 'JsonBlobIdentifierWithBlocks', + 'Request', + 'ResourceBase', + 'SymbolClient' +] diff --git a/azure-devops/azure/devops/released/symbol/symbol_client.py b/azure-devops/azure/devops/released/symbol/symbol_client.py new file mode 100644 index 00000000..f3c4498f --- /dev/null +++ b/azure-devops/azure/devops/released/symbol/symbol_client.py @@ -0,0 +1,244 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.symbol import models + + +class SymbolClient(Client): + """Symbol + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(SymbolClient, 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 = 'af607f94-69ba-4821-8159-f04e37b66350' + + def check_availability(self): + """CheckAvailability. + Check the availability of symbol service. This includes checking for feature flag, and possibly license in future. Note this is NOT an anonymous endpoint, and the caller will be redirected to authentication before hitting it. + """ + self._send(http_method='GET', + location_id='97c893cc-e861-4ef4-8c43-9bad4a963dee', + version='7.0') + + def get_client(self, client_type): + """GetClient. + Get the client package. + :param str client_type: Either "EXE" for a zip file containing a Windows symbol client (a.k.a. symbol.exe) along with dependencies, or "TASK" for a VSTS task that can be run on a VSTS build agent. All the other values are invalid. The parameter is case-insensitive. + :rtype: object + """ + route_values = {} + if client_type is not None: + route_values['clientType'] = self._serialize.url('client_type', client_type, 'str') + response = self._send(http_method='GET', + location_id='79c83865-4de3-460c-8a16-01be238e0818', + version='7.0', + route_values=route_values) + return self._deserialize('object', response) + + def head_client(self): + """HeadClient. + Get client version information. + """ + self._send(http_method='HEAD', + location_id='79c83865-4de3-460c-8a16-01be238e0818', + version='7.0') + + def get_debug_entry_content(self, request_id, debug_entry_id): + """GetDebugEntryContent. + Get a stitched debug entry for a symbol request as specified by symbol request identifier and debug entry identifier. + :param str request_id: The symbol request identifier. + :param str debug_entry_id: The debug entry identifier. + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + if debug_entry_id is not None: + route_values['debugEntryId'] = self._serialize.url('debug_entry_id', debug_entry_id, 'str') + self._send(http_method='GET', + location_id='0f98d9f5-caf7-44fd-a5c9-55f3a9b34399', + version='7.0', + route_values=route_values) + + def create_requests(self, request_to_create): + """CreateRequests. + Create a new symbol request. + :param :class:` ` request_to_create: The symbol request to create. + :rtype: :class:` ` + """ + content = self._serialize.body(request_to_create, 'Request') + response = self._send(http_method='POST', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + content=content) + return self._deserialize('Request', response) + + def create_requests_request_id_debug_entries(self, batch, request_id, collection): + """CreateRequestsRequestIdDebugEntries. + Create debug entries for a symbol request as specified by its identifier. + :param :class:` ` batch: A batch that contains debug entries to create. + :param str request_id: The symbol request identifier. + :param str collection: A valid debug entry collection name. Must be "debugentries". + :rtype: [DebugEntry] + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + query_parameters = {} + if collection is not None: + query_parameters['collection'] = self._serialize.query('collection', collection, 'str') + content = self._serialize.body(batch, 'DebugEntryCreateBatch') + response = self._send(http_method='POST', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[DebugEntry]', self._unwrap_collection(response)) + + def create_requests_request_name_debug_entries(self, batch, request_name, collection): + """CreateRequestsRequestNameDebugEntries. + Create debug entries for a symbol request as specified by its name. + :param :class:` ` batch: A batch that contains debug entries to create. + :param str request_name: The symbol request name. + :param str collection: A valid debug entry collection name. Must be "debugentries". + :rtype: [DebugEntry] + """ + query_parameters = {} + if request_name is not None: + query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') + if collection is not None: + query_parameters['collection'] = self._serialize.query('collection', collection, 'str') + content = self._serialize.body(batch, 'DebugEntryCreateBatch') + response = self._send(http_method='POST', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('[DebugEntry]', self._unwrap_collection(response)) + + def delete_requests_request_id(self, request_id, synchronous=None): + """DeleteRequestsRequestId. + Delete a symbol request by request identifier. + :param str request_id: The symbol request identifier. + :param bool synchronous: If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system. + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + query_parameters = {} + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query('synchronous', synchronous, 'bool') + self._send(http_method='DELETE', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def delete_requests_request_name(self, request_name, synchronous=None): + """DeleteRequestsRequestName. + Delete a symbol request by request name. + :param str request_name: The symbol request name. + :param bool synchronous: If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system. + """ + query_parameters = {} + if request_name is not None: + query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query('synchronous', synchronous, 'bool') + self._send(http_method='DELETE', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + query_parameters=query_parameters) + + def get_requests_request_id(self, request_id): + """GetRequestsRequestId. + Get a symbol request by request identifier. + :param str request_id: The symbol request identifier. + :rtype: :class:` ` + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + response = self._send(http_method='GET', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + route_values=route_values) + return self._deserialize('Request', response) + + def get_requests_request_name(self, request_name): + """GetRequestsRequestName. + Get a symbol request by request name. + :param str request_name: The symbol request name. + :rtype: :class:` ` + """ + query_parameters = {} + if request_name is not None: + query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') + response = self._send(http_method='GET', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('Request', response) + + def update_requests_request_id(self, update_request, request_id): + """UpdateRequestsRequestId. + Update a symbol request by request identifier. + :param :class:` ` update_request: The symbol request. + :param str request_id: The symbol request identifier. + :rtype: :class:` ` + """ + route_values = {} + if request_id is not None: + route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') + content = self._serialize.body(update_request, 'Request') + response = self._send(http_method='PATCH', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Request', response) + + def update_requests_request_name(self, update_request, request_name): + """UpdateRequestsRequestName. + Update a symbol request by request name. + :param :class:` ` update_request: The symbol request. + :param str request_name: The symbol request name. + :rtype: :class:` ` + """ + query_parameters = {} + if request_name is not None: + query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') + content = self._serialize.body(update_request, 'Request') + response = self._send(http_method='PATCH', + location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', + version='7.0', + query_parameters=query_parameters, + content=content) + return self._deserialize('Request', response) + + def get_sym_srv_debug_entry_client_key(self, debug_entry_client_key): + """GetSymSrvDebugEntryClientKey. + Given a client key, returns the best matched debug entry. + :param str debug_entry_client_key: A "client key" used by both ends of Microsoft's symbol protocol to identify a debug entry. The semantics of client key is governed by symsrv and is beyond the scope of this documentation. + """ + route_values = {} + if debug_entry_client_key is not None: + route_values['debugEntryClientKey'] = self._serialize.url('debug_entry_client_key', debug_entry_client_key, 'str') + self._send(http_method='GET', + location_id='9648e256-c9f9-4f16-8a27-630b06396942', + version='7.0', + route_values=route_values) + diff --git a/azure-devops/azure/devops/released/task/__init__.py b/azure-devops/azure/devops/released/task/__init__.py index 5c3ad971..25e84ac5 100644 --- a/azure-devops/azure/devops/released/task/__init__.py +++ b/azure-devops/azure/devops/released/task/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.task.models import * +from ...v7_0.task.models import * from .task_client import TaskClient __all__ = [ diff --git a/azure-devops/azure/devops/released/task/task_client.py b/azure-devops/azure/devops/released/task/task_client.py index 000ea769..35f8448f 100644 --- a/azure-devops/azure/devops/released/task/task_client.py +++ b/azure-devops/azure/devops/released/task/task_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.task import models +from ...v7_0.task import models class TaskClient(Client): @@ -25,6 +25,207 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = None + def get_plan_attachments(self, scope_identifier, hub_name, plan_id, type): + """GetPlanAttachments. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str type: + :rtype: [TaskAttachment] + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='eb55e5d6-2f30-4295-b5ed-38da50b1fc52', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskAttachment]', self._unwrap_collection(response)) + + def create_attachment(self, upload_stream, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, **kwargs): + """CreateAttachment. + :param object upload_stream: Stream to upload + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :rtype: :class:` ` + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + content = self._client.stream_upload(upload_stream, callback=callback) + response = self._send(http_method='PUT', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values, + content=content, + media_type='application/octet-stream') + return self._deserialize('TaskAttachment', response) + + def create_attachment_from_artifact(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, artifact_hash, length): + """CreateAttachmentFromArtifact. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :param str artifact_hash: + :param long length: + :rtype: :class:` ` + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + query_parameters = {} + if artifact_hash is not None: + query_parameters['artifactHash'] = self._serialize.query('artifact_hash', artifact_hash, 'str') + if length is not None: + query_parameters['length'] = self._serialize.query('length', length, 'long') + response = self._send(http_method='PUT', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAttachment', response) + + def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): + """GetAttachment. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :rtype: :class:` ` + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + response = self._send(http_method='GET', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values) + return self._deserialize('TaskAttachment', response) + + def get_attachment_content(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, **kwargs): + """GetAttachmentContent. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :rtype: object + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + response = self._send(http_method='GET', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_attachments(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type): + """GetAttachments. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param str timeline_id: + :param str record_id: + :param str type: + :rtype: [TaskAttachment] + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if record_id is not None: + route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='7898f959-9cdf-4096-b29e-7f293031629e', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskAttachment]', self._unwrap_collection(response)) + def append_log_content(self, upload_stream, scope_identifier, hub_name, plan_id, log_id, **kwargs): """AppendLogContent. :param object upload_stream: Stream to upload @@ -32,7 +233,7 @@ def append_log_content(self, upload_stream, scope_identifier, hub_name, plan_id, :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param int log_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: @@ -50,19 +251,50 @@ def append_log_content(self, upload_stream, scope_identifier, hub_name, plan_id, content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', - version='5.1', + version='7.0', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('TaskLog', response) + def associate_log(self, scope_identifier, hub_name, plan_id, log_id, serialized_blob_id, line_count): + """AssociateLog. + :param str scope_identifier: The project GUID to scope the request + :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server + :param str plan_id: + :param int log_id: + :param str serialized_blob_id: + :param int line_count: + :rtype: :class:` ` + """ + route_values = {} + if scope_identifier is not None: + route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') + if hub_name is not None: + route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') + if log_id is not None: + route_values['logId'] = self._serialize.url('log_id', log_id, 'int') + query_parameters = {} + if serialized_blob_id is not None: + query_parameters['serializedBlobId'] = self._serialize.query('serialized_blob_id', serialized_blob_id, 'str') + if line_count is not None: + query_parameters['lineCount'] = self._serialize.query('line_count', line_count, 'int') + response = self._send(http_method='POST', + location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskLog', response) + def create_log(self, log, scope_identifier, hub_name, plan_id): """CreateLog. - :param :class:` ` log: + :param :class:` ` log: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: @@ -74,7 +306,7 @@ def create_log(self, log, scope_identifier, hub_name, plan_id): content = self._serialize.body(log, 'TaskLog') response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TaskLog', response) @@ -105,7 +337,7 @@ def get_log(self, scope_identifier, hub_name, plan_id, log_id, start_line=None, query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -126,7 +358,7 @@ def get_logs(self, scope_identifier, hub_name, plan_id): route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[TaskLog]', self._unwrap_collection(response)) @@ -153,14 +385,14 @@ def get_records(self, scope_identifier, hub_name, plan_id, timeline_id, change_i query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') response = self._send(http_method='GET', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def update_records(self, records, scope_identifier, hub_name, plan_id, timeline_id): """UpdateRecords. - :param :class:` ` records: + :param :class:` ` records: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: @@ -179,18 +411,18 @@ def update_records(self, records, scope_identifier, hub_name, plan_id, timeline_ content = self._serialize.body(records, 'VssJsonCollectionWrapper') response = self._send(http_method='PATCH', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def create_timeline(self, timeline, scope_identifier, hub_name, plan_id): """CreateTimeline. - :param :class:` ` timeline: + :param :class:` ` timeline: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: @@ -202,7 +434,7 @@ def create_timeline(self, timeline, scope_identifier, hub_name, plan_id): content = self._serialize.body(timeline, 'Timeline') response = self._send(http_method='POST', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Timeline', response) @@ -225,7 +457,7 @@ def delete_timeline(self, scope_identifier, hub_name, plan_id, timeline_id): route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') self._send(http_method='DELETE', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', - version='5.1', + version='7.0', route_values=route_values) def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None, include_records=None): @@ -236,7 +468,7 @@ def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_ :param str timeline_id: :param int change_id: :param bool include_records: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: @@ -254,7 +486,7 @@ def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_ query_parameters['includeRecords'] = self._serialize.query('include_records', include_records, 'bool') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) @@ -275,7 +507,7 @@ def get_timelines(self, scope_identifier, hub_name, plan_id): route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[Timeline]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/released/task_agent/__init__.py b/azure-devops/azure/devops/released/task_agent/__init__.py index 3fd6378d..2322e8cf 100644 --- a/azure-devops/azure/devops/released/task_agent/__init__.py +++ b/azure-devops/azure/devops/released/task_agent/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.task_agent.models import * +from ...v7_0.task_agent.models import * from .task_agent_client import TaskAgentClient __all__ = [ @@ -57,7 +57,6 @@ 'InputValuesError', 'KubernetesResource', 'KubernetesResourceCreateParameters', - 'MarketplacePurchasedLicense', 'MetricsColumnMetaData', 'MetricsColumnsHeader', 'MetricsRow', @@ -84,7 +83,6 @@ 'TaskAgentCloud', 'TaskAgentCloudRequest', 'TaskAgentCloudType', - 'TaskAgentDelaySource', 'TaskAgentJobRequest', 'TaskAgentMessage', 'TaskAgentPool', @@ -102,6 +100,7 @@ 'TaskAgentSessionKey', 'TaskAgentUpdate', 'TaskAgentUpdateReason', + 'TaskCommandRestrictions', 'TaskDefinition', 'TaskDefinitionEndpoint', 'TaskDefinitionReference', @@ -112,6 +111,7 @@ 'TaskGroupRevision', 'TaskGroupStep', 'TaskGroupUpdateParameter', + 'TaskGroupUpdatePropertiesBase', 'TaskHubLicenseDetails', 'TaskInputDefinition', 'TaskInputDefinitionBase', @@ -120,12 +120,15 @@ 'TaskOutputVariable', 'TaskPackageMetadata', 'TaskReference', + 'TaskRestrictions', 'TaskSourceDefinition', 'TaskSourceDefinitionBase', + 'TaskVariableRestrictions', 'TaskVersion', 'ValidationItem', 'VariableGroup', 'VariableGroupParameters', + 'VariableGroupProjectReference', 'VariableGroupProviderData', 'VariableValue', 'VirtualMachine', diff --git a/azure-devops/azure/devops/released/task_agent/task_agent_client.py b/azure-devops/azure/devops/released/task_agent/task_agent_client.py index 4550fde4..5f2a296b 100644 --- a/azure-devops/azure/devops/released/task_agent/task_agent_client.py +++ b/azure-devops/azure/devops/released/task_agent/task_agent_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.task_agent import models +from ...v7_0.task_agent import models class TaskAgentClient(Client): @@ -25,12 +25,78 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = 'a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd' + def add_agent_cloud(self, agent_cloud): + """AddAgentCloud. + :param :class:` ` agent_cloud: + :rtype: :class:` ` + """ + content = self._serialize.body(agent_cloud, 'TaskAgentCloud') + response = self._send(http_method='POST', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + content=content) + return self._deserialize('TaskAgentCloud', response) + + def delete_agent_cloud(self, agent_cloud_id): + """DeleteAgentCloud. + :param int agent_cloud_id: + :rtype: :class:` ` + """ + route_values = {} + if agent_cloud_id is not None: + route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') + response = self._send(http_method='DELETE', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_cloud(self, agent_cloud_id): + """GetAgentCloud. + :param int agent_cloud_id: + :rtype: :class:` ` + """ + route_values = {} + if agent_cloud_id is not None: + route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') + response = self._send(http_method='GET', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + route_values=route_values) + return self._deserialize('TaskAgentCloud', response) + + def get_agent_clouds(self): + """GetAgentClouds. + :rtype: [TaskAgentCloud] + """ + response = self._send(http_method='GET', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0') + return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) + + def update_agent_cloud(self, updated_cloud, agent_cloud_id): + """UpdateAgentCloud. + :param :class:` ` updated_cloud: + :param int agent_cloud_id: + :rtype: :class:` ` + """ + route_values = {} + if agent_cloud_id is not None: + route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') + content = self._serialize.body(updated_cloud, 'TaskAgentCloud') + response = self._send(http_method='PATCH', + location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskAgentCloud', response) + def add_agent(self, agent, pool_id): """AddAgent. Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. - :param :class:` ` agent: Details about the agent being added + :param :class:` ` agent: Details about the agent being added :param int pool_id: The agent pool in which to add the agent - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -38,7 +104,7 @@ def add_agent(self, agent, pool_id): content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='POST', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) @@ -56,7 +122,7 @@ def delete_agent(self, pool_id, agent_id): route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') self._send(http_method='DELETE', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values) def get_agent(self, pool_id, agent_id, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, property_filters=None): @@ -68,7 +134,7 @@ def get_agent(self, pool_id, agent_id, include_capabilities=None, include_assign :param bool include_assigned_request: Whether to include details about the agent's current work :param bool include_last_completed_request: Whether to include details about the agents' most recent completed work :param [str] property_filters: Filter which custom properties will be returned - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -87,7 +153,7 @@ def get_agent(self, pool_id, agent_id, include_capabilities=None, include_assign query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TaskAgent', response) @@ -124,7 +190,7 @@ def get_agents(self, pool_id, agent_name=None, include_capabilities=None, includ query_parameters['demands'] = self._serialize.query('demands', demands, 'str') response = self._send(http_method='GET', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TaskAgent]', self._unwrap_collection(response)) @@ -132,10 +198,10 @@ def get_agents(self, pool_id, agent_name=None, include_capabilities=None, includ def replace_agent(self, agent, pool_id, agent_id): """ReplaceAgent. Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. - :param :class:` ` agent: Updated details about the replacing agent + :param :class:` ` agent: Updated details about the replacing agent :param int pool_id: The agent pool to use :param int agent_id: The agent to replace - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -145,7 +211,7 @@ def replace_agent(self, agent, pool_id, agent_id): content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='PUT', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) @@ -153,10 +219,10 @@ def replace_agent(self, agent, pool_id, agent_id): def update_agent(self, agent, pool_id, agent_id): """UpdateAgent. Update agent details. - :param :class:` ` agent: Updated details about the agent + :param :class:` ` agent: Updated details about the agent :param int pool_id: The agent pool to use :param int agent_id: The agent to update - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -166,21 +232,326 @@ def update_agent(self, agent, pool_id, agent_id): content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='PATCH', location_id='e298ef32-5878-4cab-993c-043836571f42', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) + def add_deployment_group(self, deployment_group, project): + """AddDeploymentGroup. + Create a deployment group. + :param :class:` ` deployment_group: Deployment group to create. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(deployment_group, 'DeploymentGroupCreateParameter') + response = self._send(http_method='POST', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def delete_deployment_group(self, project, deployment_group_id): + """DeleteDeploymentGroup. + Delete a deployment group. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group to be deleted. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + self._send(http_method='DELETE', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='7.0', + route_values=route_values) + + def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): + """GetDeploymentGroup. + Get a deployment group by its ID. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group. + :param str action_filter: Get the deployment group only if this action can be performed on it. + :param str expand: Include these additional details in the returned object. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + query_parameters = {} + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeploymentGroup', response) + + def get_deployment_groups(self, project, name=None, action_filter=None, expand=None, continuation_token=None, top=None, ids=None): + """GetDeploymentGroups. + Get a list of deployment groups by name or IDs. + :param str project: Project ID or project name + :param str name: Name of the deployment group. + :param str action_filter: Get only deployment groups on which this action can be performed. + :param str expand: Include these additional details in the returned objects. + :param str continuation_token: Get deployment groups with names greater than this continuationToken lexicographically. + :param int top: Maximum number of deployment groups to return. Default is **1000**. + :param [int] ids: Comma separated list of IDs of the deployment groups. + :rtype: :class:`<[DeploymentGroup]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if name is not None: + query_parameters['name'] = self._serialize.query('name', name, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + response = self._send(http_method='GET', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DeploymentGroup]', self._unwrap_collection(response)) + + def update_deployment_group(self, deployment_group, project, deployment_group_id): + """UpdateDeploymentGroup. + Update a deployment group. + :param :class:` ` deployment_group: Deployment group to update. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + content = self._serialize.body(deployment_group, 'DeploymentGroupUpdateParameter') + response = self._send(http_method='PATCH', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('DeploymentGroup', response) + + def get_environment_deployment_execution_records(self, project, environment_id, continuation_token=None, top=None): + """GetEnvironmentDeploymentExecutionRecords. + Get environment deployment execution history + :param str project: Project ID or project name + :param int environment_id: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentDeploymentExecutionRecord]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='51bb5d21-4305-4ea6-9dbb-b7488af73334', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentDeploymentExecutionRecord]', self._unwrap_collection(response)) + + def add_environment(self, environment_create_parameter, project): + """AddEnvironment. + Create an environment. + :param :class:` ` environment_create_parameter: Environment to create. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(environment_create_parameter, 'EnvironmentCreateParameter') + response = self._send(http_method='POST', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def delete_environment(self, project, environment_id): + """DeleteEnvironment. + Delete the specified environment. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + self._send(http_method='DELETE', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values) + + def get_environment_by_id(self, project, environment_id, expands=None): + """GetEnvironmentById. + Get an environment by its ID. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :param str expands: Include these additional details in the returned objects. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + query_parameters = {} + if expands is not None: + query_parameters['expands'] = self._serialize.query('expands', expands, 'str') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('EnvironmentInstance', response) + + def get_environments(self, project, name=None, continuation_token=None, top=None): + """GetEnvironments. + Get all environments. + :param str project: Project ID or project name + :param str name: + :param str continuation_token: + :param int top: + :rtype: :class:`<[EnvironmentInstance]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if name is not None: + query_parameters['name'] = self._serialize.query('name', name, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[EnvironmentInstance]', self._unwrap_collection(response)) + + def update_environment(self, environment_update_parameter, project, environment_id): + """UpdateEnvironment. + Update the specified environment. + :param :class:` ` environment_update_parameter: Environment data to update. + :param str project: Project ID or project name + :param int environment_id: ID of the environment. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(environment_update_parameter, 'EnvironmentUpdateParameter') + response = self._send(http_method='PATCH', + location_id='8572b1fc-2482-47fa-8f74-7e3ed53ee54b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('EnvironmentInstance', response) + + def add_kubernetes_resource(self, create_parameters, project, environment_id): + """AddKubernetesResource. + :param :class:` ` create_parameters: + :param str project: Project ID or project name + :param int environment_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + content = self._serialize.body(create_parameters, 'KubernetesResourceCreateParameters') + response = self._send(http_method='POST', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('KubernetesResource', response) + + def delete_kubernetes_resource(self, project, environment_id, resource_id): + """DeleteKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + self._send(http_method='DELETE', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + + def get_kubernetes_resource(self, project, environment_id, resource_id): + """GetKubernetesResource. + :param str project: Project ID or project name + :param int environment_id: + :param int resource_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if environment_id is not None: + route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') + if resource_id is not None: + route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'int') + response = self._send(http_method='GET', + location_id='73fba52f-15ab-42b3-a538-ce67a9223a04', + version='7.0', + route_values=route_values) + return self._deserialize('KubernetesResource', response) + def add_agent_pool(self, pool): """AddAgentPool. Create an agent pool. - :param :class:` ` pool: Details about the new agent pool - :rtype: :class:` ` + :param :class:` ` pool: Details about the new agent pool + :rtype: :class:` ` """ content = self._serialize.body(pool, 'TaskAgentPool') response = self._send(http_method='POST', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', content=content) return self._deserialize('TaskAgentPool', response) @@ -194,7 +565,7 @@ def delete_agent_pool(self, pool_id): route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') self._send(http_method='DELETE', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', route_values=route_values) def get_agent_pool(self, pool_id, properties=None, action_filter=None): @@ -203,7 +574,7 @@ def get_agent_pool(self, pool_id, properties=None, action_filter=None): :param int pool_id: An agent pool ID :param [str] properties: Agent pool properties (comma-separated) :param str action_filter: Filter by whether the calling user has use or manage permissions - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -216,7 +587,7 @@ def get_agent_pool(self, pool_id, properties=None, action_filter=None): query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TaskAgentPool', response) @@ -242,7 +613,7 @@ def get_agent_pools(self, pool_name=None, properties=None, pool_type=None, actio query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TaskAgentPool]', self._unwrap_collection(response)) @@ -261,16 +632,16 @@ def get_agent_pools_by_ids(self, pool_ids, action_filter=None): query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TaskAgentPool]', self._unwrap_collection(response)) def update_agent_pool(self, pool, pool_id): """UpdateAgentPool. Update properties on an agent pool - :param :class:` ` pool: Updated agent pool details + :param :class:` ` pool: Updated agent pool details :param int pool_id: The agent pool to update - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if pool_id is not None: @@ -278,17 +649,547 @@ def update_agent_pool(self, pool, pool_id): content = self._serialize.body(pool, 'TaskAgentPool') response = self._send(http_method='PATCH', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TaskAgentPool', response) - def get_yaml_schema(self): + def add_agent_queue(self, queue, project=None, authorize_pipelines=None): + """AddAgentQueue. + Create a new agent queue to connect a project to an agent pool. + :param :class:` ` queue: Details about the queue to create + :param str project: Project ID or project name + :param bool authorize_pipelines: Automatically authorize this queue when using YAML + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if authorize_pipelines is not None: + query_parameters['authorizePipelines'] = self._serialize.query('authorize_pipelines', authorize_pipelines, 'bool') + content = self._serialize.body(queue, 'TaskAgentQueue') + response = self._send(http_method='POST', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TaskAgentQueue', response) + + def delete_agent_queue(self, queue_id, project=None): + """DeleteAgentQueue. + Removes an agent queue from a project. + :param int queue_id: The agent queue to remove + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + self._send(http_method='DELETE', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values) + + def get_agent_queue(self, queue_id, project=None, action_filter=None): + """GetAgentQueue. + Get information about an agent queue. + :param int queue_id: The agent queue to get information about + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if queue_id is not None: + route_values['queueId'] = self._serialize.url('queue_id', queue_id, 'int') + query_parameters = {} + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TaskAgentQueue', response) + + def get_agent_queues(self, project=None, queue_name=None, action_filter=None): + """GetAgentQueues. + Get a list of agent queues. + :param str project: Project ID or project name + :param str queue_name: Filter on the agent queue name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_name is not None: + query_parameters['queueName'] = self._serialize.query('queue_name', queue_name, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_ids(self, queue_ids, project=None, action_filter=None): + """GetAgentQueuesByIds. + Get a list of agent queues by their IDs + :param [int] queue_ids: A comma-separated list of agent queue IDs to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_ids is not None: + queue_ids = ",".join(map(str, queue_ids)) + query_parameters['queueIds'] = self._serialize.query('queue_ids', queue_ids, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_by_names(self, queue_names, project=None, action_filter=None): + """GetAgentQueuesByNames. + Get a list of agent queues by their names + :param [str] queue_names: A comma-separated list of agent names to retrieve + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if queue_names is not None: + queue_names = ",".join(queue_names) + query_parameters['queueNames'] = self._serialize.query('queue_names', queue_names, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_queues_for_pools(self, pool_ids, project=None, action_filter=None): + """GetAgentQueuesForPools. + Get a list of agent queues by pool ids + :param [int] pool_ids: A comma-separated list of pool ids to get the corresponding queues for + :param str project: Project ID or project name + :param str action_filter: Filter by whether the calling user has use or manage permissions + :rtype: [TaskAgentQueue] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if pool_ids is not None: + pool_ids = ",".join(map(str, pool_ids)) + query_parameters['poolIds'] = self._serialize.query('pool_ids', pool_ids, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + response = self._send(http_method='GET', + location_id='900fa995-c559-4923-aae7-f8424fe4fbea', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskAgentQueue]', self._unwrap_collection(response)) + + def get_agent_cloud_requests(self, agent_cloud_id): + """GetAgentCloudRequests. + :param int agent_cloud_id: + :rtype: [TaskAgentCloudRequest] + """ + route_values = {} + if agent_cloud_id is not None: + route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') + response = self._send(http_method='GET', + location_id='20189bd7-5134-49c2-b8e9-f9e856eea2b2', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskAgentCloudRequest]', self._unwrap_collection(response)) + + def delete_deployment_target(self, project, deployment_group_id, target_id): + """DeleteDeploymentTarget. + Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group in which deployment target is deleted. + :param int target_id: ID of the deployment target to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + if target_id is not None: + route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') + self._send(http_method='DELETE', + location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + route_values=route_values) + + def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): + """GetDeploymentTarget. + Get a deployment target by its ID in a deployment group + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group to which deployment target belongs. + :param int target_id: ID of the deployment target to return. + :param str expand: Include these additional details in the returned objects. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + if target_id is not None: + route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeploymentMachine', response) + + def get_deployment_targets(self, project, deployment_group_id, tags=None, name=None, partial_name_match=None, expand=None, agent_status=None, agent_job_result=None, continuation_token=None, top=None, enabled=None, property_filters=None): + """GetDeploymentTargets. + Get a list of deployment targets in a deployment group. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group. + :param [str] tags: Get only the deployment targets that contain all these comma separted list of tags. + :param str name: Name pattern of the deployment targets to return. + :param bool partial_name_match: When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. + :param str expand: Include these additional details in the returned objects. + :param str agent_status: Get only deployment targets that have this status. + :param str agent_job_result: Get only deployment targets that have this last job result. + :param str continuation_token: Get deployment targets with names greater than this continuationToken lexicographically. + :param int top: Maximum number of deployment targets to return. Default is **1000**. + :param bool enabled: Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. + :param [str] property_filters: + :rtype: :class:`<[DeploymentMachine]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + query_parameters = {} + if tags is not None: + tags = ",".join(tags) + query_parameters['tags'] = self._serialize.query('tags', tags, 'str') + if name is not None: + query_parameters['name'] = self._serialize.query('name', name, 'str') + if partial_name_match is not None: + query_parameters['partialNameMatch'] = self._serialize.query('partial_name_match', partial_name_match, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + if agent_status is not None: + query_parameters['agentStatus'] = self._serialize.query('agent_status', agent_status, 'str') + if agent_job_result is not None: + query_parameters['agentJobResult'] = self._serialize.query('agent_job_result', agent_job_result, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if enabled is not None: + query_parameters['enabled'] = self._serialize.query('enabled', enabled, 'bool') + if property_filters is not None: + property_filters = ",".join(property_filters) + query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') + response = self._send(http_method='GET', + location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) + + def update_deployment_targets(self, machines, project, deployment_group_id): + """UpdateDeploymentTargets. + Update tags of a list of deployment targets in a deployment group. + :param [DeploymentTargetUpdateParameter] machines: Deployment targets with tags to udpdate. + :param str project: Project ID or project name + :param int deployment_group_id: ID of the deployment group in which deployment targets are updated. + :rtype: [DeploymentMachine] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if deployment_group_id is not None: + route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') + content = self._serialize.body(machines, '[DeploymentTargetUpdateParameter]') + response = self._send(http_method='PATCH', + location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) + + def add_task_group(self, task_group, project): + """AddTaskGroup. + Create a task group. + :param :class:` ` task_group: Task group object to create. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(task_group, 'TaskGroupCreateParameter') + response = self._send(http_method='POST', + location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def delete_task_group(self, project, task_group_id, comment=None): + """DeleteTaskGroup. + Delete a task group. + :param str project: Project ID or project name + :param str task_group_id: Id of the task group to be deleted. + :param str comment: Comments to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if task_group_id is not None: + route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + self._send(http_method='DELETE', + location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_task_groups(self, project, task_group_id=None, expanded=None, task_id_filter=None, deleted=None, top=None, continuation_token=None, query_order=None): + """GetTaskGroups. + List task groups. + :param str project: Project ID or project name + :param str task_group_id: Id of the task group. + :param bool expanded: 'true' to recursively expand task groups. Default is 'false'. + :param str task_id_filter: Guid of the taskId to filter. + :param bool deleted: 'true'to include deleted task groups. Default is 'false'. + :param int top: Number of task groups to get. + :param datetime continuation_token: Gets the task groups after the continuation token provided. + :param str query_order: Gets the results in the defined order. Default is 'CreatedOnDescending'. + :rtype: [TaskGroup] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if task_group_id is not None: + route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') + query_parameters = {} + if expanded is not None: + query_parameters['expanded'] = self._serialize.query('expanded', expanded, 'bool') + if task_id_filter is not None: + query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') + if deleted is not None: + query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'iso-8601') + if query_order is not None: + query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') + response = self._send(http_method='GET', + location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TaskGroup]', self._unwrap_collection(response)) + + def update_task_group(self, task_group, project, task_group_id=None): + """UpdateTaskGroup. + Update a task group. + :param :class:` ` task_group: Task group to update. + :param str project: Project ID or project name + :param str task_group_id: Id of the task group to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if task_group_id is not None: + route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') + content = self._serialize.body(task_group, 'TaskGroupUpdateParameter') + response = self._send(http_method='PUT', + location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskGroup', response) + + def add_variable_group(self, variable_group_parameters): + """AddVariableGroup. + Add a variable group. + :param :class:` ` variable_group_parameters: + :rtype: :class:` ` + """ + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='POST', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + content=content) + return self._deserialize('VariableGroup', response) + + def delete_variable_group(self, group_id, project_ids): + """DeleteVariableGroup. + Delete a variable group + :param int group_id: Id of the variable group. + :param [str] project_ids: + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + query_parameters = {} + if project_ids is not None: + project_ids = ",".join(project_ids) + query_parameters['projectIds'] = self._serialize.query('project_ids', project_ids, 'str') + self._send(http_method='DELETE', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def share_variable_group(self, variable_group_project_references, variable_group_id): + """ShareVariableGroup. + Add a variable group. + :param [VariableGroupProjectReference] variable_group_project_references: + :param int variable_group_id: + """ + query_parameters = {} + if variable_group_id is not None: + query_parameters['variableGroupId'] = self._serialize.query('variable_group_id', variable_group_id, 'int') + content = self._serialize.body(variable_group_project_references, '[VariableGroupProjectReference]') + self._send(http_method='PATCH', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + query_parameters=query_parameters, + content=content) + + def update_variable_group(self, variable_group_parameters, group_id): + """UpdateVariableGroup. + Update a variable group. + :param :class:` ` variable_group_parameters: + :param int group_id: Id of the variable group to update. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + content = self._serialize.body(variable_group_parameters, 'VariableGroupParameters') + response = self._send(http_method='PUT', + location_id='ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('VariableGroup', response) + + def get_variable_group(self, project, group_id): + """GetVariableGroup. + Get a variable group. + :param str project: Project ID or project name + :param int group_id: Id of the variable group. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') + response = self._send(http_method='GET', + location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', + version='7.0', + route_values=route_values) + return self._deserialize('VariableGroup', response) + + def get_variable_groups(self, project, group_name=None, action_filter=None, top=None, continuation_token=None, query_order=None): + """GetVariableGroups. + Get variable groups. + :param str project: Project ID or project name + :param str group_name: Name of variable group. + :param str action_filter: Action filter for the variable group. It specifies the action which can be performed on the variable groups. + :param int top: Number of variable groups to get. + :param int continuation_token: Gets the variable groups after the continuation token provided. + :param str query_order: Gets the results in the defined order. Default is 'IdDescending'. + :rtype: [VariableGroup] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if group_name is not None: + query_parameters['groupName'] = self._serialize.query('group_name', group_name, 'str') + if action_filter is not None: + query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') + if query_order is not None: + query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') + response = self._send(http_method='GET', + location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) + + def get_variable_groups_by_id(self, project, group_ids): + """GetVariableGroupsById. + Get variable groups by ids. + :param str project: Project ID or project name + :param [int] group_ids: Comma separated list of Ids of variable groups. + :rtype: [VariableGroup] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if group_ids is not None: + group_ids = ",".join(map(str, group_ids)) + query_parameters['groupIds'] = self._serialize.query('group_ids', group_ids, 'str') + response = self._send(http_method='GET', + location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) + + def get_yaml_schema(self, validate_task_names=None): """GetYamlSchema. + GET the Yaml schema used for Yaml file validation. + :param bool validate_task_names: Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). :rtype: object """ + query_parameters = {} + if validate_task_names is not None: + query_parameters['validateTaskNames'] = self._serialize.query('validate_task_names', validate_task_names, 'bool') response = self._send(http_method='GET', location_id='1f9990b9-1dba-441f-9c2e-6485888c42b6', - version='5.1') + version='7.0', + query_parameters=query_parameters) return self._deserialize('object', response) diff --git a/azure-devops/azure/devops/released/test/__init__.py b/azure-devops/azure/devops/released/test/__init__.py index d333f47f..1f0b9122 100644 --- a/azure-devops/azure/devops/released/test/__init__.py +++ b/azure-devops/azure/devops/released/test/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.test.models import * +from ...v7_0.test.models import * from .test_client import TestClient __all__ = [ diff --git a/azure-devops/azure/devops/released/test/test_client.py b/azure-devops/azure/devops/released/test/test_client.py index e5546c11..c4412112 100644 --- a/azure-devops/azure/devops/released/test/test_client.py +++ b/azure-devops/azure/devops/released/test/test_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.test import models +from ...v7_0.test import models class TestClient(Client): @@ -25,15 +25,14 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = 'c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e' - def get_action_results(self, project, run_id, test_case_result_id, iteration_id, action_path=None): - """GetActionResults. - Gets the action results for an iteration in a test result. + def create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id): + """CreateTestResultAttachment. + Attach a file to a test result. + :param :class:` ` attachment_request_model: Attachment details TestAttachmentRequestModel :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. - :param int test_case_result_id: ID of the test result that contains the iterations. - :param int iteration_id: ID of the iteration that contains the actions. - :param str action_path: Path of a specific action, used to get just that action. - :rtype: [TestActionResultModel] + :param int test_case_result_id: ID of the test result against which attachment has to be uploaded. + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -42,15 +41,352 @@ def get_action_results(self, project, run_id, test_case_result_id, iteration_id, route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if iteration_id is not None: - route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') - if action_path is not None: - route_values['actionPath'] = self._serialize.url('action_path', action_path, 'str') + content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') + response = self._send(http_method='POST', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestAttachmentReference', response) + + def create_test_sub_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id, test_sub_result_id): + """CreateTestSubResultAttachment. + Attach a file to a test result + :param :class:` ` attachment_request_model: Attachment Request Model. + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the result. + :param int test_case_result_id: ID of the test results that contains sub result. + :param int test_sub_result_id: ID of the test sub results against which attachment has to be uploaded. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + query_parameters = {} + if test_sub_result_id is not None: + query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') + content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') + response = self._send(http_method='POST', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestAttachmentReference', response) + + def get_test_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, **kwargs): + """GetTestResultAttachmentContent. + Download a test result attachment by its ID. + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the testCaseResultId. + :param int test_case_result_id: ID of the test result whose attachment has to be downloaded. + :param int attachment_id: ID of the test result attachment to be downloaded. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') response = self._send(http_method='GET', - location_id='eaf40c31-ff84-4062-aafd-d5664be11a37', - version='5.1', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_test_result_attachments(self, project, run_id, test_case_result_id): + """GetTestResultAttachments. + Get list of test result attachments reference. + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the result. + :param int test_case_result_id: ID of the test result. + :rtype: [TestAttachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + response = self._send(http_method='GET', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', route_values=route_values) - return self._deserialize('[TestActionResultModel]', self._unwrap_collection(response)) + return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) + + def get_test_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, **kwargs): + """GetTestResultAttachmentZip. + Download a test result attachment by its ID. + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the testCaseResultId. + :param int test_case_result_id: ID of the test result whose attachment has to be downloaded. + :param int attachment_id: ID of the test result attachment to be downloaded. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') + response = self._send(http_method='GET', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): + """GetTestSubResultAttachmentContent. + Download a test sub result attachment + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the result. + :param int test_case_result_id: ID of the test results that contains sub result. + :param int attachment_id: ID of the test result attachment to be downloaded + :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') + query_parameters = {} + if test_sub_result_id is not None: + query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') + response = self._send(http_method='GET', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id): + """GetTestSubResultAttachments. + Get list of test sub result attachments + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the result. + :param int test_case_result_id: ID of the test results that contains sub result. + :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded + :rtype: [TestAttachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + query_parameters = {} + if test_sub_result_id is not None: + query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') + response = self._send(http_method='GET', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) + + def get_test_sub_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): + """GetTestSubResultAttachmentZip. + Download a test sub result attachment + :param str project: Project ID or project name + :param int run_id: ID of the test run that contains the result. + :param int test_case_result_id: ID of the test results that contains sub result. + :param int attachment_id: ID of the test result attachment to be downloaded + :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if test_case_result_id is not None: + route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') + query_parameters = {} + if test_sub_result_id is not None: + query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') + response = self._send(http_method='GET', + location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def create_test_run_attachment(self, attachment_request_model, project, run_id): + """CreateTestRunAttachment. + Attach a file to a test run. + :param :class:` ` attachment_request_model: Attachment details TestAttachmentRequestModel + :param str project: Project ID or project name + :param int run_id: ID of the test run against which attachment has to be uploaded. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') + response = self._send(http_method='POST', + location_id='4f004af4-a507-489c-9b13-cb62060beb11', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestAttachmentReference', response) + + def get_test_run_attachment_content(self, project, run_id, attachment_id, **kwargs): + """GetTestRunAttachmentContent. + Download a test run attachment by its ID. + :param str project: Project ID or project name + :param int run_id: ID of the test run whose attachment has to be downloaded. + :param int attachment_id: ID of the test run attachment to be downloaded. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') + response = self._send(http_method='GET', + location_id='4f004af4-a507-489c-9b13-cb62060beb11', + version='7.0', + route_values=route_values, + accept_media_type='application/octet-stream') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_test_run_attachments(self, project, run_id): + """GetTestRunAttachments. + Get list of test run attachments reference. + :param str project: Project ID or project name + :param int run_id: ID of the test run. + :rtype: [TestAttachment] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='4f004af4-a507-489c-9b13-cb62060beb11', + version='7.0', + route_values=route_values) + return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) + + def get_test_run_attachment_zip(self, project, run_id, attachment_id, **kwargs): + """GetTestRunAttachmentZip. + Download a test run attachment by its ID. + :param str project: Project ID or project name + :param int run_id: ID of the test run whose attachment has to be downloaded. + :param int attachment_id: ID of the test run attachment to be downloaded. + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + if attachment_id is not None: + route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') + response = self._send(http_method='GET', + location_id='4f004af4-a507-489c-9b13-cb62060beb11', + version='7.0', + route_values=route_values, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_build_code_coverage(self, project, build_id, flags): + """GetBuildCodeCoverage. + Get code coverage data for a build. + :param str project: Project ID or project name + :param int build_id: ID of the build for which code coverage data needs to be fetched. + :param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. + :rtype: [BuildCoverage] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if build_id is not None: + query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') + if flags is not None: + query_parameters['flags'] = self._serialize.query('flags', flags, 'int') + response = self._send(http_method='GET', + location_id='77560e8a-4e8c-4d59-894e-a5f264c24444', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[BuildCoverage]', self._unwrap_collection(response)) + + def get_test_run_code_coverage(self, project, run_id, flags): + """GetTestRunCodeCoverage. + Get code coverage data for a test run + :param str project: Project ID or project name + :param int run_id: ID of the test run for which code coverage data needs to be fetched. + :param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. + :rtype: [TestRunCoverage] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if run_id is not None: + route_values['runId'] = self._serialize.url('run_id', run_id, 'int') + query_parameters = {} + if flags is not None: + query_parameters['flags'] = self._serialize.query('flags', flags, 'int') + response = self._send(http_method='GET', + location_id='9629116f-3b89-4ed8-b358-d4694efda160', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestRunCoverage]', self._unwrap_collection(response)) def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, include_action_results=None): """GetTestIteration. @@ -60,7 +396,7 @@ def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: Id of the test results Iteration. :param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -76,7 +412,7 @@ def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestIterationDetailsModel', response) @@ -102,40 +438,11 @@ def get_test_iterations(self, project, run_id, test_case_result_id, include_acti query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestIterationDetailsModel]', self._unwrap_collection(response)) - def get_result_parameters(self, project, run_id, test_case_result_id, iteration_id, param_name=None): - """GetResultParameters. - Get a list of parameterized results - :param str project: Project ID or project name - :param int run_id: ID of the test run that contains the result. - :param int test_case_result_id: ID of the test result that contains the iterations. - :param int iteration_id: ID of the iteration that contains the parameterized results. - :param str param_name: Name of the parameter. - :rtype: [TestResultParameterModel] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if iteration_id is not None: - route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') - query_parameters = {} - if param_name is not None: - query_parameters['paramName'] = self._serialize.query('param_name', param_name, 'str') - response = self._send(http_method='GET', - location_id='7c69810d-3354-4af3-844a-180bd25db08a', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestResultParameterModel]', self._unwrap_collection(response)) - def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): """GetPoint. Get a test point. @@ -144,7 +451,7 @@ def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): :param int suite_id: ID of the suite that contains the point. :param int point_ids: ID of the test point to get. :param str wit_fields: Comma-separated list of work item field names. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -160,7 +467,7 @@ def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestPoint', response) @@ -204,7 +511,7 @@ def get_points(self, project, plan_id, suite_id, wit_fields=None, configuration_ query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) @@ -212,7 +519,7 @@ def get_points(self, project, plan_id, suite_id, wit_fields=None, configuration_ def update_test_points(self, point_update_model, project, plan_id, suite_id, point_ids): """UpdateTestPoints. Update test points. - :param :class:` ` point_update_model: Data to update. + :param :class:` ` point_update_model: Data to update. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the points. @@ -231,11 +538,70 @@ def update_test_points(self, point_update_model, project, plan_id, suite_id, poi content = self._serialize.body(point_update_model, 'PointUpdateModel') response = self._send(http_method='PATCH', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + def get_points_by_query(self, query, project, skip=None, top=None): + """GetPointsByQuery. + Get test points using query. + :param :class:` ` query: TestPointsQuery to get test points. + :param str project: Project ID or project name + :param int skip: Number of test points to skip.. + :param int top: Number of test points to return. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if skip is not None: + query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + content = self._serialize.body(query, 'TestPointsQuery') + response = self._send(http_method='POST', + location_id='b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestPointsQuery', response) + + def get_result_retention_settings(self, project): + """GetResultRetentionSettings. + Get test result retention settings + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde', + version='7.0', + route_values=route_values) + return self._deserialize('ResultRetentionSettings', response) + + def update_result_retention_settings(self, retention_settings, project): + """UpdateResultRetentionSettings. + Update test result retention settings + :param :class:` ` retention_settings: Test result retention settings details to be updated + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(retention_settings, 'ResultRetentionSettings') + response = self._send(http_method='PATCH', + location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ResultRetentionSettings', response) + def add_test_results_to_test_run(self, results, project, run_id): """AddTestResultsToTestRun. Add test results to a test run. @@ -252,7 +618,7 @@ def add_test_results_to_test_run(self, results, project, run_id): content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='POST', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) @@ -264,7 +630,7 @@ def get_test_result_by_id(self, project, run_id, test_case_result_id, details_to :param int run_id: Test run ID of a test result to fetch. :param int test_case_result_id: Test result ID. :param str details_to_include: Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -278,7 +644,7 @@ def get_test_result_by_id(self, project, run_id, test_case_result_id, details_to query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestCaseResult', response) @@ -311,7 +677,7 @@ def get_test_results(self, project, run_id, details_to_include=None, skip=None, query_parameters['outcomes'] = self._serialize.query('outcomes', outcomes, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) @@ -332,7 +698,7 @@ def update_test_results(self, results, project, run_id): content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='PATCH', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) @@ -342,7 +708,7 @@ def get_test_run_statistics(self, project, run_id): Get test run statistics , used when we want to get summary of a run by outcome. :param str project: Project ID or project name :param int run_id: ID of the run to get. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -351,16 +717,16 @@ def get_test_run_statistics(self, project, run_id): route_values['runId'] = self._serialize.url('run_id', run_id, 'int') response = self._send(http_method='GET', location_id='0a42c424-d764-4a16-a2d5-5c85f87d0ae8', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TestRunStatistic', response) def create_test_run(self, test_run, project): """CreateTestRun. Create new test run. - :param :class:` ` test_run: Run details RunCreateModel + :param :class:` ` test_run: Run details RunCreateModel :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -368,7 +734,7 @@ def create_test_run(self, test_run, project): content = self._serialize.body(test_run, 'RunCreateModel') response = self._send(http_method='POST', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TestRun', response) @@ -386,7 +752,7 @@ def delete_test_run(self, project, run_id): route_values['runId'] = self._serialize.url('run_id', run_id, 'int') self._send(http_method='DELETE', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values) def get_test_run_by_id(self, project, run_id, include_details=None): @@ -395,7 +761,7 @@ def get_test_run_by_id(self, project, run_id, include_details=None): :param str project: Project ID or project name :param int run_id: ID of the run to get. :param bool include_details: Default value is true. It includes details like run statistics, release, build, test environment, post process state, and more. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -407,7 +773,7 @@ def get_test_run_by_id(self, project, run_id, include_details=None): query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestRun', response) @@ -448,7 +814,7 @@ def get_test_runs(self, project, build_uri=None, owner=None, tmi_run_id=None, pl query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRun]', self._unwrap_collection(response)) @@ -473,7 +839,7 @@ def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, :param str run_title: Run Title of the Runs to be queried. :param int top: Number of runs to be queried. Limit is 100 :param str continuation_token: continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. - :rtype: :class:`` + :rtype: :class:`<[TestRun]> ` """ route_values = {} if project is not None: @@ -520,33 +886,18 @@ def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[TestRun]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.QueryTestRunsResponseValue(response_value, continuation_token) - - class QueryTestRunsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the query_test_runs method - - :param value: - :type value: :class:`<[TestRun]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[TestRun]', self._unwrap_collection(response)) def update_test_run(self, run_update_model, project, run_id): """UpdateTestRun. Update test run by its ID. - :param :class:` ` run_update_model: Run details RunUpdateModel + :param :class:` ` run_update_model: Run details RunUpdateModel :param str project: Project ID or project name :param int run_id: ID of the run to update. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -556,11 +907,121 @@ def update_test_run(self, run_update_model, project, run_id): content = self._serialize.body(run_update_model, 'RunUpdateModel') response = self._send(http_method='PATCH', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TestRun', response) + def create_test_session(self, test_session, team_context): + """CreateTestSession. + Create a test session + :param :class:` ` test_session: Test session details for creation + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(test_session, 'TestSession') + response = self._send(http_method='POST', + location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSession', response) + + def get_test_sessions(self, team_context, period=None, all_sessions=None, include_all_properties=None, source=None, include_only_completed_sessions=None): + """GetTestSessions. + Get a list of test sessions + :param :class:` ` team_context: The team context for the operation + :param int period: Period in days from now, for which test sessions are fetched. + :param bool all_sessions: If false, returns test sessions for current user. Otherwise, it returns test sessions for all users + :param bool include_all_properties: If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version. + :param str source: Source of the test session. + :param bool include_only_completed_sessions: If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states + :rtype: [TestSession] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + query_parameters = {} + if period is not None: + query_parameters['period'] = self._serialize.query('period', period, 'int') + if all_sessions is not None: + query_parameters['allSessions'] = self._serialize.query('all_sessions', all_sessions, 'bool') + if include_all_properties is not None: + query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') + if source is not None: + query_parameters['source'] = self._serialize.query('source', source, 'str') + if include_only_completed_sessions is not None: + query_parameters['includeOnlyCompletedSessions'] = self._serialize.query('include_only_completed_sessions', include_only_completed_sessions, 'bool') + response = self._send(http_method='GET', + location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestSession]', self._unwrap_collection(response)) + + def update_test_session(self, test_session, team_context): + """UpdateTestSession. + Update a test session + :param :class:` ` test_session: Test session details for update + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(test_session, 'TestSession') + response = self._send(http_method='PATCH', + location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSession', response) + def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): """AddTestCasesToSuite. Add test cases to suite. @@ -582,7 +1043,7 @@ def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): route_values['action'] = 'TestCases' response = self._send(http_method='POST', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) @@ -593,7 +1054,7 @@ def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids): :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite that contains the test case. :param int test_case_ids: ID of the test case to get. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -607,7 +1068,7 @@ def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids): route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('SuiteTestCase', response) @@ -629,7 +1090,7 @@ def get_test_cases(self, project, plan_id, suite_id): route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) @@ -653,13 +1114,13 @@ def remove_test_cases_from_suite_url(self, project, plan_id, suite_id, test_case route_values['action'] = 'TestCases' self._send(http_method='DELETE', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='5.1', + version='7.0', route_values=route_values) def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id, suite_id, test_case_ids): """UpdateSuiteTestCases. Updates the properties of the test case association in a suite. - :param :class:` ` suite_test_case_update_model: Model for updation of the properties of test case suite association. + :param :class:` ` suite_test_case_update_model: Model for updation of the properties of test case suite association. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to which the test cases must be added. @@ -679,8 +1140,42 @@ def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id content = self._serialize.body(suite_test_case_update_model, 'SuiteTestCaseUpdateModel') response = self._send(http_method='PATCH', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + Delete a test case. + :param str project: Project ID or project name + :param int test_case_id: Id of test case to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_case_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'int') + self._send(http_method='DELETE', + location_id='4d472e0f-e32c-4ef8-adf4-a4078772889c', + version='7.0', + route_values=route_values) + + def query_test_history(self, filter, project): + """QueryTestHistory. + Get history of a test method using TestHistoryQuery + :param :class:` ` filter: TestHistoryQuery to get history + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(filter, 'TestHistoryQuery') + response = self._send(http_method='POST', + location_id='929fd86c-3e38-4d8c-b4b6-90df256e5971', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestHistoryQuery', response) + diff --git a/azure-devops/azure/devops/released/test_plan/__init__.py b/azure-devops/azure/devops/released/test_plan/__init__.py index 8cb4bb05..269ae715 100644 --- a/azure-devops/azure/devops/released/test_plan/__init__.py +++ b/azure-devops/azure/devops/released/test_plan/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.test_plan.models import * +from ...v7_0.test_plan.models import * from .test_plan_client import TestPlanClient __all__ = [ @@ -14,6 +14,9 @@ 'CloneOperationCommonResponse', 'CloneOptions', 'CloneStatistics', + 'CloneTestCaseOperationInformation', + 'CloneTestCaseOptions', + 'CloneTestCaseParams', 'CloneTestPlanOperationInformation', 'CloneTestPlanParams', 'CloneTestSuiteOperationInformation', @@ -24,6 +27,8 @@ 'GraphSubjectBase', 'IdentityRef', 'LastResultDetails', + 'LibraryWorkItemsData', + 'LibraryWorkItemsDataProviderRequest', 'NameValuePair', 'PointAssignment', 'ReferenceLinks', @@ -32,15 +37,19 @@ 'SourceTestPlanInfo', 'SourceTestplanResponse', 'SourceTestSuiteInfo', + 'SourceTestSuiteResponse', 'SuiteEntry', 'SuiteEntryUpdateParams', 'SuiteTestCaseCreateUpdateParameters', 'TeamProjectReference', 'TestCase', + 'TestCaseAssociatedResult', 'TestCaseReference', + 'TestCaseResultsData', 'TestConfiguration', 'TestConfigurationCreateUpdateParameters', 'TestConfigurationReference', + 'TestEntityCount', 'TestEnvironment', 'TestOutcomeSettings', 'TestPlan', @@ -48,9 +57,10 @@ 'TestPlanDetailedReference', 'TestPlanReference', 'TestPlansHubRefreshData', + 'TestPlansLibraryWorkItemFilter', 'TestPlanUpdateParams', 'TestPoint', - 'TestPointCount', + 'TestPointDetailedReference', 'TestPointResults', 'TestPointUpdateParams', 'TestSettings', diff --git a/azure-devops/azure/devops/released/test_plan/test_plan_client.py b/azure-devops/azure/devops/released/test_plan/test_plan_client.py index 660441a8..d562675f 100644 --- a/azure-devops/azure/devops/released/test_plan/test_plan_client.py +++ b/azure-devops/azure/devops/released/test_plan/test_plan_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.test_plan import models +from ...v7_0.test_plan import models class TestPlanClient(Client): @@ -25,6 +25,368 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = None + def create_test_configuration(self, test_configuration_create_update_parameters, project): + """CreateTestConfiguration. + Create a test configuration. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(test_configuration_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestConfiguration', response) + + def delete_test_confguration(self, project, test_configuartion_id): + """DeleteTestConfguration. + Delete a test configuration by its ID. + :param str project: Project ID or project name + :param int test_configuartion_id: ID of the test configuration to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + self._send(http_method='DELETE', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_test_configuration_by_id(self, project, test_configuration_id): + """GetTestConfigurationById. + Get a test configuration + :param str project: Project ID or project name + :param int test_configuration_id: ID of the test configuration to get. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_configuration_id is not None: + route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int') + response = self._send(http_method='GET', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values) + return self._deserialize('TestConfiguration', response) + + def get_test_configurations(self, project, continuation_token=None): + """GetTestConfigurations. + Get a list of test configurations. + :param str project: Project ID or project name + :param str continuation_token: If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations. + :rtype: :class:`<[TestConfiguration]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestConfiguration]', self._unwrap_collection(response)) + + def update_test_configuration(self, test_configuration_create_update_parameters, project, test_configuartion_id): + """UpdateTestConfiguration. + Update a test configuration by its ID. + :param :class:` ` test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters + :param str project: Project ID or project name + :param int test_configuartion_id: ID of the test configuration to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if test_configuartion_id is not None: + query_parameters['testConfiguartionId'] = self._serialize.query('test_configuartion_id', test_configuartion_id, 'int') + content = self._serialize.body(test_configuration_create_update_parameters, 'TestConfigurationCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='8369318e-38fa-4e84-9043-4b2a75d2c256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('TestConfiguration', response) + + def create_test_plan(self, test_plan_create_params, project): + """CreateTestPlan. + Create a test plan. + :param :class:` ` test_plan_create_params: A testPlanCreateParams object.TestPlanCreateParams + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(test_plan_create_params, 'TestPlanCreateParams') + response = self._send(http_method='POST', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def delete_test_plan(self, project, plan_id): + """DeleteTestPlan. + Delete a test plan. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to be deleted. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + self._send(http_method='DELETE', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + + def get_test_plan_by_id(self, project, plan_id): + """GetTestPlanById. + Get a test plan by Id. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to get. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + response = self._send(http_method='GET', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values) + return self._deserialize('TestPlan', response) + + def get_test_plans(self, project, owner=None, continuation_token=None, include_plan_details=None, filter_active_plans=None): + """GetTestPlans. + Get a list of test plans + :param str project: Project ID or project name + :param str owner: Filter for test plan by owner ID or name + :param str continuation_token: If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. + :param bool include_plan_details: Get all properties of the test plan + :param bool filter_active_plans: Get just the active plans + :rtype: :class:`<[TestPlan]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner is not None: + query_parameters['owner'] = self._serialize.query('owner', owner, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if include_plan_details is not None: + query_parameters['includePlanDetails'] = self._serialize.query('include_plan_details', include_plan_details, 'bool') + if filter_active_plans is not None: + query_parameters['filterActivePlans'] = self._serialize.query('filter_active_plans', filter_active_plans, 'bool') + response = self._send(http_method='GET', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + + def update_test_plan(self, test_plan_update_params, project, plan_id): + """UpdateTestPlan. + Update a test plan. + :param :class:` ` test_plan_update_params: A testPlanUpdateParams object.TestPlanUpdateParams + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to be updated. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + content = self._serialize.body(test_plan_update_params, 'TestPlanUpdateParams') + response = self._send(http_method='PATCH', + location_id='0e292477-a0c2-47f3-a9b6-34f153d627f4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestPlan', response) + + def get_suite_entries(self, project, suite_id, suite_entry_type=None): + """GetSuiteEntries. + Get a list of test suite entries in the test suite. + :param str project: Project ID or project name + :param int suite_id: Id of the parent suite. + :param str suite_entry_type: + :rtype: [SuiteEntry] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if suite_entry_type is not None: + query_parameters['suiteEntryType'] = self._serialize.query('suite_entry_type', suite_entry_type, 'str') + response = self._send(http_method='GET', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def reorder_suite_entries(self, suite_entries, project, suite_id): + """ReorderSuiteEntries. + Reorder test suite entries in the test suite. + :param [SuiteEntryUpdateParams] suite_entries: List of SuiteEntry to reorder. + :param str project: Project ID or project name + :param int suite_id: Id of the parent test suite. + :rtype: [SuiteEntry] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + content = self._serialize.body(suite_entries, '[SuiteEntryUpdateParams]') + response = self._send(http_method='PATCH', + location_id='d6733edf-72f1-4252-925b-c560dfe9b75a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) + + def create_test_suite(self, test_suite_create_params, project, plan_id): + """CreateTestSuite. + Create test suite. + :param :class:` ` test_suite_create_params: Parameters for suite creation + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + content = self._serialize.body(test_suite_create_params, 'TestSuiteCreateParams') + response = self._send(http_method='POST', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', response) + + def delete_test_suite(self, project, plan_id, suite_id): + """DeleteTestSuite. + Delete test suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suite. + :param int suite_id: ID of the test suite to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + self._send(http_method='DELETE', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values) + + def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None): + """GetTestSuiteById. + Get test suite by suite id. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :param int suite_id: ID of the suite to get. + :param str expand: Include the children suites and testers details + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TestSuite', response) + + def get_test_suites_for_plan(self, project, plan_id, expand=None, continuation_token=None, as_tree_view=None): + """GetTestSuitesForPlan. + Get test suites for plan. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which suites are requested. + :param str expand: Include the children suites and testers details. + :param str continuation_token: If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + :param bool as_tree_view: If the suites returned should be in a tree structure. + :rtype: :class:`<[TestSuite]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + query_parameters = {} + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if as_tree_view is not None: + query_parameters['asTreeView'] = self._serialize.query('as_tree_view', as_tree_view, 'bool') + response = self._send(http_method='GET', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + + def update_test_suite(self, test_suite_update_params, project, plan_id, suite_id): + """UpdateTestSuite. + Update test suite. + :param :class:` ` test_suite_update_params: Parameters for suite updation + :param str project: Project ID or project name + :param int plan_id: ID of the test plan that contains the suites. + :param int suite_id: ID of the parent suite. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + content = self._serialize.body(test_suite_update_params, 'TestSuiteUpdateParams') + response = self._send(http_method='PATCH', + location_id='1046d5d3-ab61-4ca7-a65a-36118a978256', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestSuite', response) + def get_suites_by_test_case_id(self, test_case_id): """GetSuitesByTestCaseId. Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case. @@ -36,7 +398,513 @@ def get_suites_by_test_case_id(self, test_case_id): query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'int') response = self._send(http_method='GET', location_id='a4080e84-f17b-4fad-84f1-7960b6525bf2', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TestSuite]', self._unwrap_collection(response)) + def add_test_cases_to_suite(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """AddTestCasesToSuite. + Add test cases to a suite with specified configurations + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be added. + :param int suite_id: ID of the test suite to which test cases are to be added. + :rtype: [TestCase] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + content = self._serialize.body(suite_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='POST', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case(self, project, plan_id, suite_id, test_case_id, wit_fields=None, return_identity_ref=None): + """GetTestCase. + Get a particular Test Case from a Suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_case_id: Test Case Id to be fetched. + :param str wit_fields: Get the list of witFields. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :rtype: [TestCase] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + if test_case_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'str') + query_parameters = {} + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def get_test_case_list(self, project, plan_id, suite_id, test_ids=None, configuration_ids=None, wit_fields=None, continuation_token=None, return_identity_ref=None, expand=None, exclude_flags=None, is_recursive=None): + """GetTestCaseList. + Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test cases are requested. + :param int suite_id: ID of the test suite for which test cases are requested. + :param str test_ids: Test Case Ids to be fetched. + :param str configuration_ids: Fetch Test Cases which contains all the configuration Ids specified. + :param str wit_fields: Get the list of witFields. + :param str continuation_token: If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases. + :param bool return_identity_ref: If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + :param bool expand: If set to false, will get a smaller payload containing only basic details about the suite test case object + :param str exclude_flags: Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2). + :param bool is_recursive: + :rtype: :class:`<[TestCase]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + if configuration_ids is not None: + query_parameters['configurationIds'] = self._serialize.query('configuration_ids', configuration_ids, 'str') + if wit_fields is not None: + query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if expand is not None: + query_parameters['expand'] = self._serialize.query('expand', expand, 'bool') + if exclude_flags is not None: + query_parameters['excludeFlags'] = self._serialize.query('exclude_flags', exclude_flags, 'str') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def remove_test_cases_from_suite(self, project, plan_id, suite_id, test_case_ids): + """RemoveTestCasesFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_case_ids: Test Case Ids to be removed. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if test_case_ids is not None: + query_parameters['testCaseIds'] = self._serialize.query('test_case_ids', test_case_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def remove_test_cases_list_from_suite(self, project, plan_id, suite_id, test_ids): + """RemoveTestCasesListFromSuite. + Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan from which test cases are to be removed. + :param int suite_id: ID of the test suite from which test cases are to be removed. + :param str test_ids: Comma separated string of Test Case Ids to be removed. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if test_ids is not None: + query_parameters['testIds'] = self._serialize.query('test_ids', test_ids, 'str') + self._send(http_method='DELETE', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def update_suite_test_cases(self, suite_test_case_create_update_parameters, project, plan_id, suite_id): + """UpdateSuiteTestCases. + Update the configurations for test cases + :param [SuiteTestCaseCreateUpdateParameters] suite_test_case_create_update_parameters: A SuiteTestCaseCreateUpdateParameters object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan to which test cases are to be updated. + :param int suite_id: ID of the test suite to which test cases are to be updated. + :rtype: [TestCase] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + content = self._serialize.body(suite_test_case_create_update_parameters, '[SuiteTestCaseCreateUpdateParameters]') + response = self._send(http_method='PATCH', + location_id='a9bd61ac-45cf-4d13-9441-43dcd01edf8d', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[TestCase]', self._unwrap_collection(response)) + + def clone_test_case(self, clone_request_body, project): + """CloneTestCase. + :param :class:` ` clone_request_body: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(clone_request_body, 'CloneTestCaseParams') + response = self._send(http_method='POST', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def get_test_case_clone_information(self, project, clone_operation_id): + """GetTestCaseCloneInformation. + Get clone information. + :param str project: Project ID or project name + :param int clone_operation_id: Operation ID returned when we queue a clone operation + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if clone_operation_id is not None: + route_values['cloneOperationId'] = self._serialize.url('clone_operation_id', clone_operation_id, 'int') + response = self._send(http_method='GET', + location_id='529b2b8d-82f4-4893-b1e4-1e74ea534673', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestCaseOperationInformation', response) + + def delete_test_case(self, project, test_case_id): + """DeleteTestCase. + Delete a test case. + :param str project: Project ID or project name + :param int test_case_id: Id of test case to be deleted. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_case_id is not None: + route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'int') + self._send(http_method='DELETE', + location_id='29006fb5-816b-4ff7-a329-599943569229', + version='7.0', + route_values=route_values) + + def clone_test_plan(self, clone_request_body, project, deep_clone=None): + """CloneTestPlan. + Clone test plan + :param :class:` ` clone_request_body: Plan Clone Request Body detail TestPlanCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestPlanParams') + response = self._send(http_method='POST', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_clone_information(self, project, clone_operation_id): + """GetCloneInformation. + Get clone information. + :param str project: Project ID or project name + :param int clone_operation_id: Operation ID returned when we queue a clone operation + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if clone_operation_id is not None: + route_values['cloneOperationId'] = self._serialize.url('clone_operation_id', clone_operation_id, 'int') + response = self._send(http_method='GET', + location_id='e65df662-d8a3-46c7-ae1c-14e2d4df57e1', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestPlanOperationInformation', response) + + def get_points(self, project, plan_id, suite_id, point_id, return_identity_ref=None, include_point_details=None): + """GetPoints. + Get a particular Test Point from a suite. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param str point_id: ID of test point to be fetched. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :rtype: [TestPoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if point_id is not None: + query_parameters['pointId'] = self._serialize.query('point_id', point_id, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def get_points_list(self, project, plan_id, suite_id, test_point_ids=None, test_case_id=None, continuation_token=None, return_identity_ref=None, include_point_details=None, is_recursive=None): + """GetPointsList. + Get all the points inside a suite based on some filters + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested + :param str test_point_ids: ID of test points to fetch. + :param str test_case_id: Get Test Points for specific test case Ids. + :param str continuation_token: If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points. + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool is_recursive: If set to true, will also fetch test points belonging to child suites recursively. + :rtype: :class:`<[TestPoint]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if test_point_ids is not None: + query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') + if test_case_id is not None: + query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if is_recursive is not None: + query_parameters['isRecursive'] = self._serialize.query('is_recursive', is_recursive, 'bool') + response = self._send(http_method='GET', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def update_test_points(self, test_point_update_params, project, plan_id, suite_id, include_point_details=None, return_identity_ref=None): + """UpdateTestPoints. + Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point + :param [TestPointUpdateParams] test_point_update_params: A TestPointUpdateParams Object. + :param str project: Project ID or project name + :param int plan_id: ID of the test plan for which test points are requested. + :param int suite_id: ID of the test suite for which test points are requested. + :param bool include_point_details: If set to false, will get a smaller payload containing only basic details about the test point object + :param bool return_identity_ref: If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + :rtype: [TestPoint] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if plan_id is not None: + route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') + if suite_id is not None: + route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') + query_parameters = {} + if include_point_details is not None: + query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') + if return_identity_ref is not None: + query_parameters['returnIdentityRef'] = self._serialize.query('return_identity_ref', return_identity_ref, 'bool') + content = self._serialize.body(test_point_update_params, '[TestPointUpdateParams]') + response = self._send(http_method='PATCH', + location_id='52df686e-bae4-4334-b0ee-b6cf4e6f6b73', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[TestPoint]', self._unwrap_collection(response)) + + def clone_test_suite(self, clone_request_body, project, deep_clone=None): + """CloneTestSuite. + Clone test suite + :param :class:` ` clone_request_body: Suite Clone Request Body detail TestSuiteCloneRequest + :param str project: Project ID or project name + :param bool deep_clone: Clones all the associated test cases as well + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if deep_clone is not None: + query_parameters['deepClone'] = self._serialize.query('deep_clone', deep_clone, 'bool') + content = self._serialize.body(clone_request_body, 'CloneTestSuiteParams') + response = self._send(http_method='POST', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def get_suite_clone_information(self, project, clone_operation_id): + """GetSuiteCloneInformation. + Get clone information. + :param str project: Project ID or project name + :param int clone_operation_id: Operation ID returned when we queue a clone operation + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if clone_operation_id is not None: + route_values['cloneOperationId'] = self._serialize.url('clone_operation_id', clone_operation_id, 'int') + response = self._send(http_method='GET', + location_id='181d4c97-0e98-4ee2-ad6a-4cada675e555', + version='7.0', + route_values=route_values) + return self._deserialize('CloneTestSuiteOperationInformation', response) + + def create_test_variable(self, test_variable_create_update_parameters, project): + """CreateTestVariable. + Create a test variable. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(test_variable_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='POST', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + + def delete_test_variable(self, project, test_variable_id): + """DeleteTestVariable. + Delete a test variable by its ID. + :param str project: Project ID or project name + :param int test_variable_id: ID of the test variable to delete. + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_variable_id is not None: + route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') + self._send(http_method='DELETE', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + + def get_test_variable_by_id(self, project, test_variable_id): + """GetTestVariableById. + Get a test variable by its ID. + :param str project: Project ID or project name + :param int test_variable_id: ID of the test variable to get. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_variable_id is not None: + route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') + response = self._send(http_method='GET', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values) + return self._deserialize('TestVariable', response) + + def get_test_variables(self, project, continuation_token=None): + """GetTestVariables. + Get a list of test variables. + :param str project: Project ID or project name + :param str continuation_token: If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables. + :rtype: :class:`<[TestVariable]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + response = self._send(http_method='GET', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[TestVariable]', self._unwrap_collection(response)) + + def update_test_variable(self, test_variable_create_update_parameters, project, test_variable_id): + """UpdateTestVariable. + Update a test variable by its ID. + :param :class:` ` test_variable_create_update_parameters: TestVariableCreateUpdateParameters + :param str project: Project ID or project name + :param int test_variable_id: ID of the test variable to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if test_variable_id is not None: + route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') + content = self._serialize.body(test_variable_create_update_parameters, 'TestVariableCreateUpdateParameters') + response = self._send(http_method='PATCH', + location_id='2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TestVariable', response) + diff --git a/azure-devops/azure/devops/released/test_results/__init__.py b/azure-devops/azure/devops/released/test_results/__init__.py index 27388e6d..e25398f2 100644 --- a/azure-devops/azure/devops/released/test_results/__init__.py +++ b/azure-devops/azure/devops/released/test_results/__init__.py @@ -6,11 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.test_results.models import * +from ...v7_0.test_results.models import * from .test_results_client import TestResultsClient __all__ = [ 'AggregatedDataForResultTrend', + 'AggregatedResultDetailsByOutcome', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', @@ -36,15 +37,21 @@ 'IdentityRef', 'JobReference', 'ModuleCoverage', + 'NewTestResultLoggingSettings', 'PhaseReference', 'PipelineReference', + 'PipelineTestMetrics', 'QueryModel', 'ReferenceLinks', 'ReleaseReference', + 'ResultsAnalysis', 'ResultsFilter', + 'ResultsSummaryByOutcome', + 'ResultSummary', 'RunCreateModel', 'RunFilter', 'RunStatistic', + 'RunSummary', 'RunSummaryModel', 'RunUpdateModel', 'ShallowReference', @@ -73,6 +80,7 @@ 'TestOperationReference', 'TestResolutionState', 'TestResultDocument', + 'TestResultFailuresAnalysis', 'TestResultHistory', 'TestResultHistoryDetailsForGroup', 'TestResultHistoryForGroup', diff --git a/azure-devops/azure/devops/released/test_results/test_results_client.py b/azure-devops/azure/devops/released/test_results/test_results_client.py index c533accd..b714a4c7 100644 --- a/azure-devops/azure/devops/released/test_results/test_results_client.py +++ b/azure-devops/azure/devops/released/test_results/test_results_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.test_results import models +from ...v7_0.test_results import models class TestResultsClient(Client): @@ -23,23 +23,5 @@ def __init__(self, base_url=None, creds=None): self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - resource_area_identifier = None - - def get_test_run_statistics(self, project, run_id): - """GetTestRunStatistics. - Get test run statistics , used when we want to get summary of a run by outcome. - :param str project: Project ID or project name - :param int run_id: ID of the run to get. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - response = self._send(http_method='GET', - location_id='82b986e8-ca9e-4a89-b39e-f65c69bc104a', - version='5.1', - route_values=route_values) - return self._deserialize('TestRunStatistic', response) + resource_area_identifier = 'c83eaf52-edf3-4034-ae11-17d38f25404c' diff --git a/azure-devops/azure/devops/released/tfvc/__init__.py b/azure-devops/azure/devops/released/tfvc/__init__.py index 34f51057..f75f215b 100644 --- a/azure-devops/azure/devops/released/tfvc/__init__.py +++ b/azure-devops/azure/devops/released/tfvc/__init__.py @@ -6,17 +6,17 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.tfvc.models import * +from ...v7_0.tfvc.models import * from .tfvc_client import TfvcClient __all__ = [ 'AssociatedWorkItem', - 'Change', - 'CheckinNote', 'FileContentMetadata', 'GitRepository', 'GitRepositoryRef', 'GraphSubjectBase', + 'Change', + 'CheckinNote', 'IdentityRef', 'ItemContent', 'ItemModel', diff --git a/azure-devops/azure/devops/released/tfvc/tfvc_client.py b/azure-devops/azure/devops/released/tfvc/tfvc_client.py index eccd9eef..233ac158 100644 --- a/azure-devops/azure/devops/released/tfvc/tfvc_client.py +++ b/azure-devops/azure/devops/released/tfvc/tfvc_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.tfvc import models +from ...v7_0.tfvc import models class TfvcClient(Client): @@ -32,7 +32,7 @@ def get_branch(self, path, project=None, include_parent=None, include_children=N :param str project: Project ID or project name :param bool include_parent: Return the parent branch, if there is one. Default: False :param bool include_children: Return child branches, if there are any. Default: False - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -46,7 +46,7 @@ def get_branch(self, path, project=None, include_parent=None, include_children=N query_parameters['includeChildren'] = self._serialize.query('include_children', include_children, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcBranch', response) @@ -75,7 +75,7 @@ def get_branches(self, project=None, include_parent=None, include_children=None, query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranch]', self._unwrap_collection(response)) @@ -101,7 +101,7 @@ def get_branch_refs(self, scope_path, project=None, include_deleted=None, includ query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranchRef]', self._unwrap_collection(response)) @@ -113,7 +113,7 @@ def get_changeset_changes(self, id=None, skip=None, top=None, continuation_token :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str continuation_token: Return the next page of results. Default: null - :rtype: :class:`` + :rtype: :class:`<[TfvcChange]> ` """ route_values = {} if id is not None: @@ -127,32 +127,17 @@ def get_changeset_changes(self, id=None, skip=None, top=None, continuation_token query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='f32b86f2-15b9-4fe6-81b1-6f8938617ee5', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[TfvcChange]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetChangesetChangesResponseValue(response_value, continuation_token) - - class GetChangesetChangesResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_changeset_changes method - - :param value: - :type value: :class:`<[TfvcChange]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) def create_changeset(self, changeset, project=None): """CreateChangeset. Create a new changeset. - :param :class:` ` changeset: + :param :class:` ` changeset: :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -160,7 +145,7 @@ def create_changeset(self, changeset, project=None): content = self._serialize.body(changeset, 'TfvcChangeset') response = self._send(http_method='POST', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TfvcChangesetRef', response) @@ -178,8 +163,8 @@ def get_changeset(self, id, project=None, max_change_count=None, include_details :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. - :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null - :rtype: :class:` ` + :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -224,7 +209,7 @@ def get_changeset(self, id, project=None, max_change_count=None, include_details query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcChangeset', response) @@ -237,7 +222,7 @@ def get_changesets(self, project=None, max_comment_length=None, skip=None, top=N :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. - :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null + :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null :rtype: [TfvcChangesetRef] """ route_values = {} @@ -273,7 +258,7 @@ def get_changesets(self, project=None, max_comment_length=None, skip=None, top=N query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) @@ -281,20 +266,20 @@ def get_changesets(self, project=None, max_comment_length=None, skip=None, top=N def get_batched_changesets(self, changesets_request_data): """GetBatchedChangesets. Returns changesets for a given list of changeset Ids. - :param :class:` ` changesets_request_data: List of changeset IDs. + :param :class:` ` changesets_request_data: List of changeset IDs. :rtype: [TfvcChangesetRef] """ content = self._serialize.body(changesets_request_data, 'TfvcChangesetsRequestData') response = self._send(http_method='POST', location_id='b7e7c173-803c-4fea-9ec8-31ee35c5502a', - version='5.1', + version='7.0', content=content) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) def get_changeset_work_items(self, id=None): """GetChangesetWorkItems. Retrieves the work items associated with a particular changeset. - :param int id: ID of the changeset. Default: null + :param int id: ID of the changeset. :rtype: [AssociatedWorkItem] """ route_values = {} @@ -302,14 +287,14 @@ def get_changeset_work_items(self, id=None): route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) def get_items_batch(self, item_request_data, project=None): """GetItemsBatch. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - :param :class:` ` item_request_data: + :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: [[TfvcItem]] """ @@ -319,7 +304,7 @@ def get_items_batch(self, item_request_data, project=None): content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[[TfvcItem]]', self._unwrap_collection(response)) @@ -327,7 +312,7 @@ def get_items_batch(self, item_request_data, project=None): def get_items_batch_zip(self, item_request_data, project=None, **kwargs): """GetItemsBatchZip. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - :param :class:` ` item_request_data: + :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: object """ @@ -337,7 +322,7 @@ def get_items_batch_zip(self, item_request_data, project=None, **kwargs): content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', - version='5.1', + version='7.0', route_values=route_values, content=content, accept_media_type='application/zip') @@ -356,9 +341,9 @@ def get_item(self, path, project=None, file_name=None, download=None, scope_path :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). - :param :class:` ` version_descriptor: Version descriptor. Default is null. + :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -385,7 +370,7 @@ def get_item(self, path, project=None, file_name=None, download=None, scope_path query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcItem', response) @@ -399,7 +384,7 @@ def get_item_content(self, path, project=None, file_name=None, download=None, sc :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). - :param :class:` ` version_descriptor: Version descriptor. Default is null. + :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ @@ -428,7 +413,7 @@ def get_item_content(self, path, project=None, file_name=None, download=None, sc query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -445,7 +430,7 @@ def get_items(self, project=None, scope_path=None, recursion_level=None, include :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param bool include_links: True to include links. - :param :class:` ` version_descriptor: + :param :class:` ` version_descriptor: :rtype: [TfvcItem] """ route_values = {} @@ -467,7 +452,7 @@ def get_items(self, project=None, scope_path=None, recursion_level=None, include query_parameters['versionDescriptor.version'] = version_descriptor.version response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) @@ -481,7 +466,7 @@ def get_item_text(self, path, project=None, file_name=None, download=None, scope :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). - :param :class:` ` version_descriptor: Version descriptor. Default is null. + :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ @@ -510,7 +495,7 @@ def get_item_text(self, path, project=None, file_name=None, download=None, scope query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -529,7 +514,7 @@ def get_item_zip(self, path, project=None, file_name=None, download=None, scope_ :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). - :param :class:` ` version_descriptor: Version descriptor. Default is null. + :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ @@ -558,7 +543,7 @@ def get_item_zip(self, path, project=None, file_name=None, download=None, scope_ query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -586,7 +571,7 @@ def get_label_items(self, label_id, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='06166e34-de17-4b60-8cd1-23182a346fda', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) @@ -595,9 +580,9 @@ def get_label(self, label_id, request_data, project=None): """GetLabel. Get a single deep label. :param str label_id: Unique identifier of label - :param :class:` ` request_data: maxItemCount + :param :class:` ` request_data: maxItemCount :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -620,7 +605,7 @@ def get_label(self, label_id, request_data, project=None): query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcLabel', response) @@ -628,7 +613,7 @@ def get_label(self, label_id, request_data, project=None): def get_labels(self, request_data, project=None, top=None, skip=None): """GetLabels. Get a collection of shallow label references. - :param :class:` ` request_data: labelScope, name, owner, and itemLabelFilter + :param :class:` ` request_data: labelScope, name, owner, and itemLabelFilter :param str project: Project ID or project name :param int top: Max number of labels to return, defaults to 100 when undefined :param int skip: Number of labels to skip @@ -657,7 +642,7 @@ def get_labels(self, request_data, project=None, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcLabelRef]', self._unwrap_collection(response)) @@ -679,7 +664,7 @@ def get_shelveset_changes(self, shelveset_id, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='dbaf075b-0445-4c34-9e5b-82292f856522', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) @@ -687,8 +672,8 @@ def get_shelveset(self, shelveset_id, request_data=None): """GetShelveset. Get a single deep shelveset. :param str shelveset_id: Shelveset's unique ID - :param :class:` ` request_data: includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength - :rtype: :class:` ` + :param :class:` ` request_data: includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength + :rtype: :class:` ` """ query_parameters = {} if shelveset_id is not None: @@ -710,14 +695,14 @@ def get_shelveset(self, shelveset_id, request_data=None): query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('TfvcShelveset', response) def get_shelvesets(self, request_data=None, top=None, skip=None): """GetShelvesets. Return a collection of shallow shelveset references. - :param :class:` ` request_data: name, owner, and maxCommentLength + :param :class:` ` request_data: name, owner, and maxCommentLength :param int top: Max number of shelvesets to return :param int skip: Number of shelvesets to skip :rtype: [TfvcShelvesetRef] @@ -744,7 +729,7 @@ def get_shelvesets(self, request_data=None, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[TfvcShelvesetRef]', self._unwrap_collection(response)) @@ -759,7 +744,7 @@ def get_shelveset_work_items(self, shelveset_id): query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') response = self._send(http_method='GET', location_id='a7a0c1c1-373e-425a-b031-a519474d743d', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/v5_1/token_administration/__init__.py b/azure-devops/azure/devops/released/token_admin/__init__.py similarity index 79% rename from azure-devops/azure/devops/v5_1/token_administration/__init__.py rename to azure-devops/azure/devops/released/token_admin/__init__.py index d0c5658b..3a008541 100644 --- a/azure-devops/azure/devops/v5_1/token_administration/__init__.py +++ b/azure-devops/azure/devops/released/token_admin/__init__.py @@ -6,13 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .models import * -from .token_administration_client import TokenAdministrationClient +from ...v7_0.token_admin.models import * +from .token_admin_client import TokenAdminClient __all__ = [ 'SessionToken', - 'TokenAdministrationRevocation', + 'SessionTokenResult', 'TokenAdminPagedSessionTokens', 'TokenAdminRevocation', - 'TokenAdministrationClient' + 'TokenAdminRevocationRule', + 'TokenAdminClient' ] diff --git a/azure-devops/azure/devops/released/token_admin/token_admin_client.py b/azure-devops/azure/devops/released/token_admin/token_admin_client.py new file mode 100644 index 00000000..4874ad52 --- /dev/null +++ b/azure-devops/azure/devops/released/token_admin/token_admin_client.py @@ -0,0 +1,80 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.token_admin import models + + +class TokenAdminClient(Client): + """TokenAdmin + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(TokenAdminClient, 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 = 'af68438b-ed04-4407-9eb6-f1dbae3f922e' + + def list_personal_access_tokens(self, subject_descriptor, page_size=None, continuation_token=None, is_public=None): + """ListPersonalAccessTokens. + Lists of all the session token details of the personal access tokens (PATs) for a particular user. + :param :class:` ` subject_descriptor: The descriptor of the target user. + :param int page_size: The maximum number of results to return on each page. + :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. + :param bool is_public: Set to false for PAT tokens and true for SSH tokens. + :rtype: :class:` ` + """ + route_values = {} + if subject_descriptor is not None: + route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') + query_parameters = {} + if page_size is not None: + query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if is_public is not None: + query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') + response = self._send(http_method='GET', + location_id='af68438b-ed04-4407-9eb6-f1dbae3f922e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('TokenAdminPagedSessionTokens', response) + + def create_revocation_rule(self, revocation_rule): + """CreateRevocationRule. + Creates a revocation rule to prevent the further usage of any OAuth authorizations that were created before the current point in time and which match the conditions in the rule. + :param :class:` ` revocation_rule: The revocation rule to create. The rule must specify a space-separated list of scopes, after which preexisting OAuth authorizations that match that any of the scopes will be rejected. For a list of all OAuth scopes supported by VSTS, see: https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts#scopes The rule may also specify the time before which to revoke tokens. + """ + content = self._serialize.body(revocation_rule, 'TokenAdminRevocationRule') + self._send(http_method='POST', + location_id='ee4afb16-e7ab-4ed8-9d4b-4ef3e78f97e4', + version='7.0', + content=content) + + def revoke_authorizations(self, revocations, is_public=None): + """RevokeAuthorizations. + Revokes the listed OAuth authorizations. + :param [TokenAdminRevocation] revocations: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked. + :param bool is_public: Set to false for PAT tokens and true for SSH tokens. + """ + query_parameters = {} + if is_public is not None: + query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') + content = self._serialize.body(revocations, '[TokenAdminRevocation]') + self._send(http_method='POST', + location_id='a9c08b2c-5466-4e22-8626-1ff304ffdf0f', + version='7.0', + query_parameters=query_parameters, + content=content) + diff --git a/azure-devops/azure/devops/released/wiki/__init__.py b/azure-devops/azure/devops/released/wiki/__init__.py index c75bf8e3..1342a5a7 100644 --- a/azure-devops/azure/devops/released/wiki/__init__.py +++ b/azure-devops/azure/devops/released/wiki/__init__.py @@ -6,13 +6,23 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.wiki.models import * +from ...v7_0.wiki.models import * from .wiki_client import WikiClient __all__ = [ + 'Comment', + 'CommentAttachment', + 'CommentCreateParameters', + 'CommentList', + 'CommentMention', + 'CommentReaction', + 'CommentResourceReference', + 'CommentUpdateParameters', 'GitRepository', 'GitRepositoryRef', 'GitVersionDescriptor', + 'GraphSubjectBase', + 'IdentityRef', 'ReferenceLinks', 'TeamProjectCollectionReference', 'TeamProjectReference', @@ -22,10 +32,13 @@ 'WikiCreateParametersV2', 'WikiPage', 'WikiPageCreateOrUpdateParameters', + 'WikiPageDetail', 'WikiPageMove', 'WikiPageMoveParameters', 'WikiPageMoveResponse', 'WikiPageResponse', + 'WikiPagesBatchRequest', + 'WikiPageStat', 'WikiPageViewStats', 'WikiUpdateParameters', 'WikiV2', diff --git a/azure-devops/azure/devops/released/wiki/wiki_client.py b/azure-devops/azure/devops/released/wiki/wiki_client.py index 92cf8916..4787836d 100644 --- a/azure-devops/azure/devops/released/wiki/wiki_client.py +++ b/azure-devops/azure/devops/released/wiki/wiki_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.wiki import models +from ...v7_0.wiki import models class WikiClient(Client): @@ -30,10 +30,10 @@ def create_attachment(self, upload_stream, project, wiki_identifier, name, versi Creates an attachment in the wiki. :param object upload_stream: Stream to upload :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str name: Wiki attachment name. - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). - :rtype: :class:` ` + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -57,7 +57,7 @@ def create_attachment(self, upload_stream, project, wiki_identifier, name, versi content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='c4382d8d-fefc-40e0-92c5-49852e9e17c0', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, @@ -70,12 +70,12 @@ def create_attachment(self, upload_stream, project, wiki_identifier, name, versi def create_page_move(self, page_move_parameters, project, wiki_identifier, comment=None, version_descriptor=None): """CreatePageMove. Creates a page move operation that updates the path and order of the page as provided in the parameters. - :param :class:` ` page_move_parameters: Page more operation parameters. + :param :class:` ` page_move_parameters: Page more operation parameters. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str comment: Comment that is to be associated with this page move. - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). - :rtype: :class:` ` + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -95,7 +95,7 @@ def create_page_move(self, page_move_parameters, project, wiki_identifier, comme content = self._serialize.body(page_move_parameters, 'WikiPageMoveParameters') response = self._send(http_method='POST', location_id='e37bbe71-cbae-49e5-9a4e-949143b9d910', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -107,14 +107,14 @@ def create_page_move(self, page_move_parameters, project, wiki_identifier, comme def create_or_update_page(self, parameters, project, wiki_identifier, path, version, comment=None, version_descriptor=None): """CreateOrUpdatePage. Creates or edits a wiki page. - :param :class:` ` parameters: Wiki create or update operation parameters. + :param :class:` ` parameters: Wiki create or update operation parameters. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str path: Wiki page path. :param String version: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request. :param str comment: Comment to be associated with the page operation. - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). - :rtype: :class:` ` + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -139,7 +139,7 @@ def create_or_update_page(self, parameters, project, wiki_identifier, path, vers content = self._serialize.body(parameters, 'WikiPageCreateOrUpdateParameters') response = self._send(http_method='PUT', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, @@ -153,11 +153,11 @@ def delete_page(self, project, wiki_identifier, path, comment=None, version_desc """DeletePage. Deletes a wiki page. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str path: Wiki page path. :param str comment: Comment to be associated with this page delete. - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). - :rtype: :class:` ` + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -178,7 +178,7 @@ def delete_page(self, project, wiki_identifier, path, comment=None, version_desc query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options response = self._send(http_method='DELETE', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() @@ -190,12 +190,12 @@ def get_page(self, project, wiki_identifier, path=None, recursion_level=None, ve """GetPage. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -218,7 +218,7 @@ def get_page(self, project, wiki_identifier, path=None, recursion_level=None, ve query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() @@ -230,10 +230,10 @@ def get_page_text(self, project, wiki_identifier, path=None, recursion_level=Non """GetPageText. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ @@ -258,7 +258,7 @@ def get_page_text(self, project, wiki_identifier, path=None, recursion_level=Non query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -272,10 +272,10 @@ def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None """GetPageZip. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name - :param str wiki_identifier: Wiki Id or name. + :param str wiki_identifier: Wiki ID or wiki name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). - :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ @@ -300,7 +300,7 @@ def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -310,12 +310,235 @@ def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None callback = None return self._client.stream_download(response, callback=callback) + def delete_page_by_id(self, project, wiki_identifier, id, comment=None): + """DeletePageById. + Deletes a wiki page. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :param str comment: Comment to be associated with this page delete. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + response = self._send(http_method='DELETE', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.WikiPageResponse() + response_object.page = self._deserialize('WikiPage', response) + response_object.eTag = response.headers.get('ETag') + return response_object + + def get_page_by_id(self, project, wiki_identifier, id, recursion_level=None, include_content=None): + """GetPageById. + Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). + :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + if include_content is not None: + query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') + response = self._send(http_method='GET', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + response_object = models.WikiPageResponse() + response_object.page = self._deserialize('WikiPage', response) + response_object.eTag = response.headers.get('ETag') + return response_object + + def get_page_by_id_text(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdText. + Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). + :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + if include_content is not None: + query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') + response = self._send(http_method='GET', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='text/plain') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def get_page_by_id_zip(self, project, wiki_identifier, id, recursion_level=None, include_content=None, **kwargs): + """GetPageByIdZip. + Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name.. + :param int id: Wiki page ID. + :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). + :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) + :rtype: object + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if recursion_level is not None: + query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') + if include_content is not None: + query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') + response = self._send(http_method='GET', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def update_page_by_id(self, parameters, project, wiki_identifier, id, version, comment=None): + """UpdatePageById. + Edits a wiki page. + :param :class:` ` parameters: Wiki update operation parameters. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int id: Wiki page ID. + :param String version: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request. + :param str comment: Comment to be associated with the page operation. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'int') + query_parameters = {} + if comment is not None: + query_parameters['comment'] = self._serialize.query('comment', comment, 'str') + additional_headers = {} + if version is not None: + additional_headers['If-Match'] = version + content = self._serialize.body(parameters, 'WikiPageCreateOrUpdateParameters') + response = self._send(http_method='PATCH', + location_id='ceddcf75-1068-452d-8b13-2d4d76e1f970', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + additional_headers=additional_headers, + content=content) + response_object = models.WikiPageResponse() + response_object.page = self._deserialize('WikiPage', response) + response_object.eTag = response.headers.get('ETag') + return response_object + + def get_pages_batch(self, pages_batch_request, project, wiki_identifier, version_descriptor=None): + """GetPagesBatch. + Returns pageable list of Wiki Pages + :param :class:` ` pages_batch_request: Wiki batch page request. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + :rtype: :class:`<[WikiPageDetail]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + query_parameters = {} + if version_descriptor is not None: + if version_descriptor.version_type is not None: + query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type + if version_descriptor.version is not None: + query_parameters['versionDescriptor.version'] = version_descriptor.version + if version_descriptor.version_options is not None: + query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options + content = self._serialize.body(pages_batch_request, 'WikiPagesBatchRequest') + response = self._send(http_method='POST', + location_id='71323c46-2592-4398-8771-ced73dd87207', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('[WikiPageDetail]', self._unwrap_collection(response)) + + def get_page_data(self, project, wiki_identifier, page_id, page_views_for_days=None): + """GetPageData. + Returns page detail corresponding to Page ID. + :param str project: Project ID or project name + :param str wiki_identifier: Wiki ID or wiki name. + :param int page_id: Wiki page ID. + :param int page_views_for_days: last N days from the current day for which page views is to be returned. It's inclusive of current day. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if wiki_identifier is not None: + route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'int') + query_parameters = {} + if page_views_for_days is not None: + query_parameters['pageViewsForDays'] = self._serialize.query('page_views_for_days', page_views_for_days, 'int') + response = self._send(http_method='GET', + location_id='81c4e0fe-7663-4d62-ad46-6ab78459f274', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WikiPageDetail', response) + def create_wiki(self, wiki_create_params, project=None): """CreateWiki. Creates the wiki resource. - :param :class:` ` wiki_create_params: Parameters for the wiki creation. + :param :class:` ` wiki_create_params: Parameters for the wiki creation. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -323,17 +546,17 @@ def create_wiki(self, wiki_create_params, project=None): content = self._serialize.body(wiki_create_params, 'WikiCreateParametersV2') response = self._send(http_method='POST', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WikiV2', response) def delete_wiki(self, wiki_identifier, project=None): """DeleteWiki. - Deletes the wiki corresponding to the wiki name or Id provided. - :param str wiki_identifier: Wiki name or Id. + Deletes the wiki corresponding to the wiki ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki name. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -342,7 +565,7 @@ def delete_wiki(self, wiki_identifier, project=None): route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='DELETE', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WikiV2', response) @@ -357,16 +580,16 @@ def get_all_wikis(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[WikiV2]', self._unwrap_collection(response)) def get_wiki(self, wiki_identifier, project=None): """GetWiki. - Gets the wiki corresponding to the wiki name or Id provided. - :param str wiki_identifier: Wiki name or id. + Gets the wiki corresponding to the wiki ID or wiki name provided. + :param str wiki_identifier: Wiki ID or wiki name. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -375,17 +598,17 @@ def get_wiki(self, wiki_identifier, project=None): route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WikiV2', response) def update_wiki(self, update_parameters, wiki_identifier, project=None): """UpdateWiki. - Updates the wiki corresponding to the wiki Id or name provided using the update parameters. - :param :class:` ` update_parameters: Update parameters. - :param str wiki_identifier: Wiki name or Id. + Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters. + :param :class:` ` update_parameters: Update parameters. + :param str wiki_identifier: Wiki ID or wiki name. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -395,7 +618,7 @@ def update_wiki(self, update_parameters, wiki_identifier, project=None): content = self._serialize.body(update_parameters, 'WikiUpdateParameters') response = self._send(http_method='PATCH', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WikiV2', response) diff --git a/azure-devops/azure/devops/released/work/__init__.py b/azure-devops/azure/devops/released/work/__init__.py index 80fb2ca9..32d93b11 100644 --- a/azure-devops/azure/devops/released/work/__init__.py +++ b/azure-devops/azure/devops/released/work/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.work.models import * +from ...v7_0.work.models import * from .work_client import WorkClient __all__ = [ @@ -21,10 +21,10 @@ 'BoardBadge', 'BoardCardRuleSettings', 'BoardCardSettings', - 'BoardChart', - 'BoardChartReference', 'BoardColumn', 'BoardFields', + 'BoardChart', + 'BoardChartReference', 'BoardReference', 'BoardRow', 'BoardSuggestedValue', @@ -39,6 +39,8 @@ 'FilterClause', 'GraphSubjectBase', 'IdentityRef', + 'ITaskboardColumnMapping', + 'IterationCapacity', 'IterationWorkItems', 'Link', 'Member', @@ -51,6 +53,12 @@ 'ReorderOperation', 'ReorderResult', 'Rule', + 'TaskboardColumn', + 'TaskboardColumnMapping', + 'TaskboardColumns', + 'TaskboardWorkItemColumn', + 'TeamCapacity', + 'TeamCapacityTotals', 'TeamContext', 'TeamFieldValue', 'TeamFieldValues', @@ -70,6 +78,8 @@ 'TimelineTeamIteration', 'TimelineTeamStatus', 'UpdatePlan', + 'UpdateTaskboardColumn', + 'UpdateTaskboardWorkItemColumn', 'WorkItem', 'WorkItemColor', 'WorkItemCommentVersionRef', diff --git a/azure-devops/azure/devops/released/work/work_client.py b/azure-devops/azure/devops/released/work/work_client.py index ca53c38d..1a84747e 100644 --- a/azure-devops/azure/devops/released/work/work_client.py +++ b/azure-devops/azure/devops/released/work/work_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.work import models +from ...v7_0.work import models class WorkClient(Client): @@ -28,8 +28,8 @@ def __init__(self, base_url=None, creds=None): def get_backlog_configurations(self, team_context): """GetBacklogConfigurations. Gets backlog configuration for a team - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -50,10 +50,103 @@ def get_backlog_configurations(self, team_context): route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='7799f497-3cb5-4f16-ad4f-5cd06012db64', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BacklogConfiguration', response) + def get_backlog_level_work_items(self, team_context, backlog_id): + """GetBacklogLevelWorkItems. + Get a list of work items within a backlog level + :param :class:` ` team_context: The team context for the operation + :param str backlog_id: + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if backlog_id is not None: + route_values['backlogId'] = self._serialize.url('backlog_id', backlog_id, 'str') + response = self._send(http_method='GET', + location_id='7c468d96-ab1d-4294-a360-92f07e9ccd98', + version='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelWorkItems', response) + + def get_backlog(self, team_context, id): + """GetBacklog. + Get a backlog level + :param :class:` ` team_context: The team context for the operation + :param str id: The id of the backlog level + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'str') + response = self._send(http_method='GET', + location_id='a93726f9-7867-4e38-b4f2-0bfafc2f6a94', + version='7.0', + route_values=route_values) + return self._deserialize('BacklogLevelConfiguration', response) + + def get_backlogs(self, team_context): + """GetBacklogs. + List all backlog levels + :param :class:` ` team_context: The team context for the operation + :rtype: [BacklogLevelConfiguration] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + response = self._send(http_method='GET', + location_id='a93726f9-7867-4e38-b4f2-0bfafc2f6a94', + version='7.0', + route_values=route_values) + return self._deserialize('[BacklogLevelConfiguration]', self._unwrap_collection(response)) + def get_column_suggested_values(self, project=None): """GetColumnSuggestedValues. Get available board columns in a project @@ -65,10 +158,48 @@ def get_column_suggested_values(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) + def get_board_mapping_parent_items(self, team_context, child_backlog_context_category_ref_name, workitem_ids): + """GetBoardMappingParentItems. + Returns the list of parent field filter model for the given list of workitem ids + :param :class:` ` team_context: The team context for the operation + :param str child_backlog_context_category_ref_name: + :param [int] workitem_ids: + :rtype: [ParentChildWIMap] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + query_parameters = {} + if child_backlog_context_category_ref_name is not None: + query_parameters['childBacklogContextCategoryRefName'] = self._serialize.query('child_backlog_context_category_ref_name', child_backlog_context_category_ref_name, 'str') + if workitem_ids is not None: + workitem_ids = ",".join(map(str, workitem_ids)) + query_parameters['workitemIds'] = self._serialize.query('workitem_ids', workitem_ids, 'str') + response = self._send(http_method='GET', + location_id='186abea3-5c35-432f-9e28-7a15b4312a0e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ParentChildWIMap]', self._unwrap_collection(response)) + def get_row_suggested_values(self, project=None): """GetRowSuggestedValues. Get available board rows in a project @@ -80,16 +211,16 @@ def get_row_suggested_values(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) def get_board(self, team_context, id): """GetBoard. Get board - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either board's backlog level name (Eg:"Stories") or Id - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -112,14 +243,14 @@ def get_board(self, team_context, id): route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Board', response) def get_boards(self, team_context): """GetBoards. Get boards - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :rtype: [BoardReference] """ project = None @@ -141,7 +272,7 @@ def get_boards(self, team_context): route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BoardReference]', self._unwrap_collection(response)) @@ -149,7 +280,7 @@ def set_board_options(self, options, team_context, id): """SetBoardOptions. Update board options :param {str} options: options to updated - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either category plural name (Eg:"Stories") or guid :rtype: {str} """ @@ -175,17 +306,84 @@ def set_board_options(self, options, team_context, id): content = self._serialize.body(options, '{str}') response = self._send(http_method='PUT', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('{str}', self._unwrap_collection(response)) - def get_capacities_with_identity_ref(self, team_context, iteration_id): - """GetCapacitiesWithIdentityRef. - Get a team's capacity - :param :class:` ` team_context: The team context for the operation + def get_board_user_settings(self, team_context, board): + """GetBoardUserSettings. + Get board user settings for a board id + :param :class:` ` team_context: The team context for the operation + :param str board: Board ID or Name + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if board is not None: + route_values['board'] = self._serialize.url('board', board, 'str') + response = self._send(http_method='GET', + location_id='b30d9f58-1891-4b0a-b168-c46408f919b0', + version='7.0', + route_values=route_values) + return self._deserialize('BoardUserSettings', response) + + def update_board_user_settings(self, board_user_settings, team_context, board): + """UpdateBoardUserSettings. + Update board user settings for the board id + :param {str} board_user_settings: + :param :class:` ` team_context: The team context for the operation + :param str board: + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if board is not None: + route_values['board'] = self._serialize.url('board', board, 'str') + content = self._serialize.body(board_user_settings, '{str}') + response = self._send(http_method='PATCH', + location_id='b30d9f58-1891-4b0a-b168-c46408f919b0', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('BoardUserSettings', response) + + def get_capacities_with_identity_ref_and_totals(self, team_context, iteration_id): + """GetCapacitiesWithIdentityRefAndTotals. + Get a team's capacity including total capacity and days off + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration - :rtype: [TeamMemberCapacityIdentityRef] + :rtype: :class:` ` """ project = None team = None @@ -208,17 +406,17 @@ def get_capacities_with_identity_ref(self, team_context, iteration_id): route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', - version='5.1', + version='7.0', route_values=route_values) - return self._deserialize('[TeamMemberCapacityIdentityRef]', self._unwrap_collection(response)) + return self._deserialize('TeamCapacity', response) def get_capacity_with_identity_ref(self, team_context, iteration_id, team_member_id): """GetCapacityWithIdentityRef. Get a team member's capacity - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -243,7 +441,7 @@ def get_capacity_with_identity_ref(self, team_context, iteration_id, team_member route_values['teamMemberId'] = self._serialize.url('team_member_id', team_member_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamMemberCapacityIdentityRef', response) @@ -251,7 +449,7 @@ def replace_capacities_with_identity_ref(self, capacities, team_context, iterati """ReplaceCapacitiesWithIdentityRef. Replace a team's capacity :param [TeamMemberCapacityIdentityRef] capacities: Team capacity to replace - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: [TeamMemberCapacityIdentityRef] """ @@ -277,7 +475,7 @@ def replace_capacities_with_identity_ref(self, capacities, team_context, iterati content = self._serialize.body(capacities, '[TeamMemberCapacityIdentityRef]') response = self._send(http_method='PUT', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[TeamMemberCapacityIdentityRef]', self._unwrap_collection(response)) @@ -285,11 +483,11 @@ def replace_capacities_with_identity_ref(self, capacities, team_context, iterati def update_capacity_with_identity_ref(self, patch, team_context, iteration_id, team_member_id): """UpdateCapacityWithIdentityRef. Update a team member's capacity - :param :class:` ` patch: Updated capacity - :param :class:` ` team_context: The team context for the operation + :param :class:` ` patch: Updated capacity + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -315,7 +513,7 @@ def update_capacity_with_identity_ref(self, patch, team_context, iteration_id, t content = self._serialize.body(patch, 'CapacityPatch') response = self._send(http_method='PATCH', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TeamMemberCapacityIdentityRef', response) @@ -323,9 +521,9 @@ def update_capacity_with_identity_ref(self, patch, team_context, iteration_id, t def get_board_card_rule_settings(self, team_context, board): """GetBoardCardRuleSettings. Get board card Rule settings for the board id or board by name - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str board: - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -348,17 +546,17 @@ def get_board_card_rule_settings(self, team_context, board): route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BoardCardRuleSettings', response) def update_board_card_rule_settings(self, board_card_rule_settings, team_context, board): """UpdateBoardCardRuleSettings. Update board card Rule settings for the board id or board by name - :param :class:` ` board_card_rule_settings: - :param :class:` ` team_context: The team context for the operation + :param :class:` ` board_card_rule_settings: + :param :class:` ` team_context: The team context for the operation :param str board: - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -382,17 +580,47 @@ def update_board_card_rule_settings(self, board_card_rule_settings, team_context content = self._serialize.body(board_card_rule_settings, 'BoardCardRuleSettings') response = self._send(http_method='PATCH', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BoardCardRuleSettings', response) + def update_taskboard_card_rule_settings(self, board_card_rule_settings, team_context): + """UpdateTaskboardCardRuleSettings. + Update taskboard card Rule settings + :param :class:` ` board_card_rule_settings: + :param :class:` ` team_context: The team context for the operation + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(board_card_rule_settings, 'BoardCardRuleSettings') + self._send(http_method='PATCH', + location_id='3f84a8d1-1aab-423e-a94b-6dcbdcca511f', + version='7.0', + route_values=route_values, + content=content) + def get_board_card_settings(self, team_context, board): """GetBoardCardSettings. Get board card settings for the board id or board by name - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str board: - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -415,17 +643,17 @@ def get_board_card_settings(self, team_context, board): route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BoardCardSettings', response) def update_board_card_settings(self, board_card_settings_to_save, team_context, board): """UpdateBoardCardSettings. Update board card settings for the board id or board by name - :param :class:` ` board_card_settings_to_save: - :param :class:` ` team_context: The team context for the operation + :param :class:` ` board_card_settings_to_save: + :param :class:` ` team_context: The team context for the operation :param str board: - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -449,18 +677,47 @@ def update_board_card_settings(self, board_card_settings_to_save, team_context, content = self._serialize.body(board_card_settings_to_save, 'BoardCardSettings') response = self._send(http_method='PUT', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BoardCardSettings', response) - def get_board_chart(self, team_context, board, name): - """GetBoardChart. - Get a board chart - :param :class:` ` team_context: The team context for the operation - :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id - :param str name: The chart name - :rtype: :class:` ` + def update_taskboard_card_settings(self, board_card_settings_to_save, team_context): + """UpdateTaskboardCardSettings. + Update taskboard card settings + :param :class:` ` board_card_settings_to_save: + :param :class:` ` team_context: The team context for the operation + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(board_card_settings_to_save, 'BoardCardSettings') + self._send(http_method='PUT', + location_id='0d63745f-31f3-4cf3-9056-2a064e567637', + version='7.0', + route_values=route_values, + content=content) + + def get_board_columns(self, team_context, board): + """GetBoardColumns. + Get columns on a board + :param :class:` ` team_context: The team context for the operation + :param str board: Name or ID of the specific board + :rtype: [BoardColumn] """ project = None team = None @@ -481,20 +738,19 @@ def get_board_chart(self, team_context, board, name): route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') - if name is not None: - route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', - location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', - version='5.1', + location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', + version='7.0', route_values=route_values) - return self._deserialize('BoardChart', response) + return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) - def get_board_charts(self, team_context, board): - """GetBoardCharts. - Get board charts - :param :class:` ` team_context: The team context for the operation - :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id - :rtype: [BoardChartReference] + def update_board_columns(self, board_columns, team_context, board): + """UpdateBoardColumns. + Update columns on a board + :param [BoardColumn] board_columns: List of board columns to update + :param :class:` ` team_context: The team context for the operation + :param str board: Name or ID of the specific board + :rtype: [BoardColumn] """ project = None team = None @@ -515,20 +771,50 @@ def get_board_charts(self, team_context, board): route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') + content = self._serialize.body(board_columns, '[BoardColumn]') + response = self._send(http_method='PUT', + location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) + + def get_delivery_timeline_data(self, project, id, revision=None, start_date=None, end_date=None): + """GetDeliveryTimelineData. + Get Delivery View Data + :param str project: Project ID or project name + :param str id: Identifier for delivery view + :param int revision: Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. + :param datetime start_date: The start date of timeline + :param datetime end_date: The end date of timeline + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'str') + query_parameters = {} + if revision is not None: + query_parameters['revision'] = self._serialize.query('revision', revision, 'int') + if start_date is not None: + query_parameters['startDate'] = self._serialize.query('start_date', start_date, 'iso-8601') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query('end_date', end_date, 'iso-8601') response = self._send(http_method='GET', - location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', - version='5.1', - route_values=route_values) - return self._deserialize('[BoardChartReference]', self._unwrap_collection(response)) + location_id='bdd0834e-101f-49f0-a6ae-509f384a12b4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('DeliveryViewData', response) - def update_board_chart(self, chart, team_context, board, name): - """UpdateBoardChart. - Update a board chart - :param :class:` ` chart: - :param :class:` ` team_context: The team context for the operation + def get_board_chart(self, team_context, board, name): + """GetBoardChart. + Get a board chart + :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :param str name: The chart name - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -551,20 +837,18 @@ def update_board_chart(self, chart, team_context, board, name): route_values['board'] = self._serialize.url('board', board, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') - content = self._serialize.body(chart, 'BoardChart') - response = self._send(http_method='PATCH', + response = self._send(http_method='GET', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', - version='5.1', - route_values=route_values, - content=content) + version='7.0', + route_values=route_values) return self._deserialize('BoardChart', response) - def get_board_columns(self, team_context, board): - """GetBoardColumns. - Get columns on a board - :param :class:` ` team_context: The team context for the operation - :param str board: Name or ID of the specific board - :rtype: [BoardColumn] + def get_board_charts(self, team_context, board): + """GetBoardCharts. + Get board charts + :param :class:` ` team_context: The team context for the operation + :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id + :rtype: [BoardChartReference] """ project = None team = None @@ -586,18 +870,19 @@ def get_board_columns(self, team_context, board): if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', - location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', - version='5.1', + location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', + version='7.0', route_values=route_values) - return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) + return self._deserialize('[BoardChartReference]', self._unwrap_collection(response)) - def update_board_columns(self, board_columns, team_context, board): - """UpdateBoardColumns. - Update columns on a board - :param [BoardColumn] board_columns: List of board columns to update - :param :class:` ` team_context: The team context for the operation - :param str board: Name or ID of the specific board - :rtype: [BoardColumn] + def update_board_chart(self, chart, team_context, board, name): + """UpdateBoardChart. + Update a board chart + :param :class:` ` chart: + :param :class:` ` team_context: The team context for the operation + :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id + :param str name: The chart name + :rtype: :class:` ` """ project = None team = None @@ -618,47 +903,38 @@ def update_board_columns(self, board_columns, team_context, board): route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') - content = self._serialize.body(board_columns, '[BoardColumn]') - response = self._send(http_method='PUT', - location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', - version='5.1', + if name is not None: + route_values['name'] = self._serialize.url('name', name, 'str') + content = self._serialize.body(chart, 'BoardChart') + response = self._send(http_method='PATCH', + location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', + version='7.0', route_values=route_values, content=content) - return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) + return self._deserialize('BoardChart', response) - def get_delivery_timeline_data(self, project, id, revision=None, start_date=None, end_date=None): - """GetDeliveryTimelineData. - Get Delivery View Data + def get_total_iteration_capacities(self, project, iteration_id): + """GetTotalIterationCapacities. + Get an iteration's capacity for all teams in iteration :param str project: Project ID or project name - :param str id: Identifier for delivery view - :param int revision: Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. - :param datetime start_date: The start date of timeline - :param datetime end_date: The end date of timeline - :rtype: :class:` ` + :param str iteration_id: ID of the iteration + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - if id is not None: - route_values['id'] = self._serialize.url('id', id, 'str') - query_parameters = {} - if revision is not None: - query_parameters['revision'] = self._serialize.query('revision', revision, 'int') - if start_date is not None: - query_parameters['startDate'] = self._serialize.query('start_date', start_date, 'iso-8601') - if end_date is not None: - query_parameters['endDate'] = self._serialize.query('end_date', end_date, 'iso-8601') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', - location_id='bdd0834e-101f-49f0-a6ae-509f384a12b4', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('DeliveryViewData', response) + location_id='1e385ce0-396b-4273-8171-d64562c18d37', + version='7.0', + route_values=route_values) + return self._deserialize('IterationCapacity', response) def delete_team_iteration(self, team_context, id): """DeleteTeamIteration. Delete a team's iteration by iterationId - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration """ project = None @@ -682,15 +958,15 @@ def delete_team_iteration(self, team_context, id): route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', - version='5.1', + version='7.0', route_values=route_values) def get_team_iteration(self, team_context, id): """GetTeamIteration. Get team's iteration by iterationId - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -713,14 +989,14 @@ def get_team_iteration(self, team_context, id): route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamSettingsIteration', response) def get_team_iterations(self, team_context, timeframe=None): """GetTeamIterations. Get a team's iterations using timeframe filter - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str timeframe: A filter for which iterations are returned based on relative time. Only Current is supported currently. :rtype: [TeamSettingsIteration] """ @@ -746,7 +1022,7 @@ def get_team_iterations(self, team_context, timeframe=None): query_parameters['$timeframe'] = self._serialize.query('timeframe', timeframe, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamSettingsIteration]', self._unwrap_collection(response)) @@ -754,9 +1030,9 @@ def get_team_iterations(self, team_context, timeframe=None): def post_team_iteration(self, iteration, team_context): """PostTeamIteration. Add an iteration to the team - :param :class:` ` iteration: Iteration to add - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` iteration: Iteration to add + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -778,7 +1054,7 @@ def post_team_iteration(self, iteration, team_context): content = self._serialize.body(iteration, 'TeamSettingsIteration') response = self._send(http_method='POST', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TeamSettingsIteration', response) @@ -786,9 +1062,9 @@ def post_team_iteration(self, iteration, team_context): def create_plan(self, posted_plan, project): """CreatePlan. Add a new plan for the team - :param :class:` ` posted_plan: Plan definition + :param :class:` ` posted_plan: Plan definition :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -796,7 +1072,7 @@ def create_plan(self, posted_plan, project): content = self._serialize.body(posted_plan, 'CreatePlan') response = self._send(http_method='POST', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Plan', response) @@ -814,7 +1090,7 @@ def delete_plan(self, project, id): route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', - version='5.1', + version='7.0', route_values=route_values) def get_plan(self, project, id): @@ -822,7 +1098,7 @@ def get_plan(self, project, id): Get the information for the specified plan :param str project: Project ID or project name :param str id: Identifier of the plan - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -831,7 +1107,7 @@ def get_plan(self, project, id): route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('Plan', response) @@ -846,17 +1122,17 @@ def get_plans(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[Plan]', self._unwrap_collection(response)) def update_plan(self, updated_plan, project, id): """UpdatePlan. Update the information for the specified plan - :param :class:` ` updated_plan: Plan definition to be updated + :param :class:` ` updated_plan: Plan definition to be updated :param str project: Project ID or project name :param str id: Identifier of the plan - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -866,15 +1142,30 @@ def update_plan(self, updated_plan, project, id): content = self._serialize.body(updated_plan, 'UpdatePlan') response = self._send(http_method='PUT', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('Plan', response) + def get_process_configuration(self, project): + """GetProcessConfiguration. + Get process configuration + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='f901ba42-86d2-4b0c-89c1-3f86d06daa84', + version='7.0', + route_values=route_values) + return self._deserialize('ProcessConfiguration', response) + def get_board_rows(self, team_context, board): """GetBoardRows. Get rows on a board - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ @@ -899,7 +1190,7 @@ def get_board_rows(self, team_context, board): route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) @@ -907,7 +1198,7 @@ def update_board_rows(self, board_rows, team_context, board): """UpdateBoardRows. Update rows on a board :param [BoardRow] board_rows: List of board rows to update - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ @@ -933,17 +1224,142 @@ def update_board_rows(self, board_rows, team_context, board): content = self._serialize.body(board_rows, '[BoardRow]') response = self._send(http_method='PUT', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) + def get_columns(self, team_context): + """GetColumns. + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + response = self._send(http_method='GET', + location_id='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values) + return self._deserialize('TaskboardColumns', response) + + def update_columns(self, update_columns, team_context): + """UpdateColumns. + :param [UpdateTaskboardColumn] update_columns: + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(update_columns, '[UpdateTaskboardColumn]') + response = self._send(http_method='PUT', + location_id='c6815dbe-8e7e-4ffe-9a79-e83ee712aa92', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('TaskboardColumns', response) + + def get_work_item_columns(self, team_context, iteration_id): + """GetWorkItemColumns. + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :rtype: [TaskboardWorkItemColumn] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + response = self._send(http_method='GET', + location_id='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values) + return self._deserialize('[TaskboardWorkItemColumn]', self._unwrap_collection(response)) + + def update_work_item_column(self, update_column, team_context, iteration_id, work_item_id): + """UpdateWorkItemColumn. + :param :class:` ` update_column: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: + :param int work_item_id: + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + if work_item_id is not None: + route_values['workItemId'] = self._serialize.url('work_item_id', work_item_id, 'int') + content = self._serialize.body(update_column, 'UpdateTaskboardWorkItemColumn') + self._send(http_method='PATCH', + location_id='1be23c36-8872-4abc-b57d-402cd6c669d9', + version='7.0', + route_values=route_values, + content=content) + def get_team_days_off(self, team_context, iteration_id): """GetTeamDaysOff. Get team's days off for an iteration - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -966,17 +1382,17 @@ def get_team_days_off(self, team_context, iteration_id): route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamSettingsDaysOff', response) def update_team_days_off(self, days_off_patch, team_context, iteration_id): """UpdateTeamDaysOff. Set a team's days off for an iteration - :param :class:` ` days_off_patch: Team's days off patch containing a list of start and end dates - :param :class:` ` team_context: The team context for the operation + :param :class:` ` days_off_patch: Team's days off patch containing a list of start and end dates + :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -1000,7 +1416,7 @@ def update_team_days_off(self, days_off_patch, team_context, iteration_id): content = self._serialize.body(days_off_patch, 'TeamSettingsDaysOffPatch') response = self._send(http_method='PATCH', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TeamSettingsDaysOff', response) @@ -1008,8 +1424,8 @@ def update_team_days_off(self, days_off_patch, team_context, iteration_id): def get_team_field_values(self, team_context): """GetTeamFieldValues. Get a collection of team field values - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -1030,16 +1446,16 @@ def get_team_field_values(self, team_context): route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamFieldValues', response) def update_team_field_values(self, patch, team_context): """UpdateTeamFieldValues. Update team field values - :param :class:` ` patch: - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` patch: + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -1061,7 +1477,7 @@ def update_team_field_values(self, patch, team_context): content = self._serialize.body(patch, 'TeamFieldValuesPatch') response = self._send(http_method='PATCH', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TeamFieldValues', response) @@ -1069,8 +1485,8 @@ def update_team_field_values(self, patch, team_context): def get_team_settings(self, team_context): """GetTeamSettings. Get a team's settings - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -1091,16 +1507,16 @@ def get_team_settings(self, team_context): route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('TeamSetting', response) def update_team_settings(self, team_settings_patch, team_context): """UpdateTeamSettings. Update a team's settings - :param :class:` ` team_settings_patch: TeamSettings changes - :param :class:` ` team_context: The team context for the operation - :rtype: :class:` ` + :param :class:` ` team_settings_patch: TeamSettings changes + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` """ project = None team = None @@ -1122,8 +1538,107 @@ def update_team_settings(self, team_settings_patch, team_context): content = self._serialize.body(team_settings_patch, 'TeamSettingsPatch') response = self._send(http_method='PATCH', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('TeamSetting', response) + def get_iteration_work_items(self, team_context, iteration_id): + """GetIterationWorkItems. + Get work items for iteration + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: ID of the iteration + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + response = self._send(http_method='GET', + location_id='5b3ef1a6-d3ab-44cd-bafd-c7f45db850fa', + version='7.0', + route_values=route_values) + return self._deserialize('IterationWorkItems', response) + + def reorder_backlog_work_items(self, operation, team_context): + """ReorderBacklogWorkItems. + Reorder Product Backlog/Boards Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :rtype: [ReorderResult] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='1c22b714-e7e4-41b9-85e0-56ee13ef55ed', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + + def reorder_iteration_work_items(self, operation, team_context, iteration_id): + """ReorderIterationWorkItems. + Reorder Sprint Backlog/Taskboard Work Items + :param :class:` ` operation: + :param :class:` ` team_context: The team context for the operation + :param str iteration_id: The id of the iteration + :rtype: [ReorderResult] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if iteration_id is not None: + route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') + content = self._serialize.body(operation, 'ReorderOperation') + response = self._send(http_method='PATCH', + location_id='47755db2-d7eb-405a-8c25-675401525fc9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[ReorderResult]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/work_item_tracking/__init__.py b/azure-devops/azure/devops/released/work_item_tracking/__init__.py index 40999905..4c7bc854 100644 --- a/azure-devops/azure/devops/released/work_item_tracking/__init__.py +++ b/azure-devops/azure/devops/released/work_item_tracking/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from ...v5_1.work_item_tracking.models import * +from ...v7_0.work_item_tracking.models import * from .work_item_tracking_client import WorkItemTrackingClient __all__ = [ @@ -26,13 +26,19 @@ 'CommentReaction', 'CommentUpdate', 'CommentVersion', + 'EmailRecipients', + 'ExternalDeployment', + 'ExternalEnvironment', + 'ExternalPipeline', 'FieldDependentRule', - 'FieldsToEvaluate', 'GraphSubjectBase', 'IdentityRef', 'IdentityReference', 'JsonPatchOperation', 'Link', + 'MailMessage', + 'ProcessIdModel', + 'ProcessMigrationResultModel', 'ProjectWorkItemStateColors', 'ProvisioningResult', 'QueryBatchGetRequest', @@ -42,8 +48,10 @@ 'ReportingWorkItemLinksBatch', 'ReportingWorkItemRevisionsBatch', 'ReportingWorkItemRevisionsFilter', + 'SendMailBody', 'StreamedBatch', 'TeamContext', + 'UpdateWorkItemField', 'Wiql', 'WorkArtifactLink', 'WorkItem', @@ -73,6 +81,7 @@ 'WorkItemRelationUpdates', 'WorkItemStateColor', 'WorkItemStateTransition', + 'WorkItemTagDefinition', 'WorkItemTemplate', 'WorkItemTemplateReference', 'WorkItemTrackingReference', diff --git a/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py b/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py index 8e2675ce..6a8344f0 100644 --- a/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py +++ b/azure-devops/azure/devops/released/work_item_tracking/work_item_tracking_client.py @@ -8,7 +8,7 @@ from msrest import Serializer, Deserializer from ...client import Client -from ...v5_1.work_item_tracking import models +from ...v7_0.work_item_tracking import models class WorkItemTrackingClient(Client): @@ -25,6 +25,44 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' + def get_recent_activity_data(self): + """GetRecentActivityData. + Gets recent work item activities + :rtype: [AccountRecentActivityWorkItemModel2] + """ + response = self._send(http_method='GET', + location_id='1bc988f4-c15f-4072-ad35-497c87e3a909', + version='7.0') + return self._deserialize('[AccountRecentActivityWorkItemModel2]', self._unwrap_collection(response)) + + def get_work_artifact_link_types(self): + """GetWorkArtifactLinkTypes. + Get the list of work item tracking outbound artifact link types. + :rtype: [WorkArtifactLink] + """ + response = self._send(http_method='GET', + location_id='1a31de40-e318-41cd-a6c6-881077df52e3', + version='7.0') + return self._deserialize('[WorkArtifactLink]', self._unwrap_collection(response)) + + def query_work_items_for_artifact_uris(self, artifact_uri_query, project=None): + """QueryWorkItemsForArtifactUris. + Queries work items linked to a given list of artifact URI. + :param :class:` ` artifact_uri_query: Defines a list of artifact URI for querying work items. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(artifact_uri_query, 'ArtifactUriQuery') + response = self._send(http_method='POST', + location_id='a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ArtifactUriQueryResult', response) + def create_attachment(self, upload_stream, project=None, file_name=None, upload_type=None, area_path=None, **kwargs): """CreateAttachment. Uploads an attachment. @@ -33,7 +71,7 @@ def create_attachment(self, upload_stream, project=None, file_name=None, upload_ :param str file_name: The name of the file :param str upload_type: Attachment upload type: Simple or Chunked :param str area_path: Target project Area Path - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -52,7 +90,7 @@ def create_attachment(self, upload_stream, project=None, file_name=None, upload_ content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, @@ -80,7 +118,7 @@ def get_attachment_content(self, id, project=None, file_name=None, download=None query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -111,7 +149,7 @@ def get_attachment_zip(self, id, project=None, file_name=None, download=None, ** query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -143,7 +181,7 @@ def get_classification_nodes(self, project, ids, depth=None, error_policy=None): query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) @@ -163,7 +201,7 @@ def get_root_nodes(self, project, depth=None): query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) @@ -171,11 +209,11 @@ def get_root_nodes(self, project, depth=None): def create_or_update_classification_node(self, posted_node, project, structure_group, path=None): """CreateOrUpdateClassificationNode. Create new or update an existing classification node. - :param :class:` ` posted_node: Node to create or update. + :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -187,7 +225,7 @@ def create_or_update_classification_node(self, posted_node, project, structure_g content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='POST', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) @@ -212,7 +250,7 @@ def delete_classification_node(self, project, structure_group, path=None, reclas query_parameters['$reclassifyId'] = self._serialize.query('reclassify_id', reclassify_id, 'int') self._send(http_method='DELETE', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) @@ -223,7 +261,7 @@ def get_classification_node(self, project, structure_group, path=None, depth=Non :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :param int depth: Depth of children to fetch. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -237,7 +275,7 @@ def get_classification_node(self, project, structure_group, path=None, depth=Non query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemClassificationNode', response) @@ -245,11 +283,11 @@ def get_classification_node(self, project, structure_group, path=None, depth=Non def update_classification_node(self, posted_node, project, structure_group, path=None): """UpdateClassificationNode. Update an existing classification node. - :param :class:` ` posted_node: Node to create or update. + :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -261,7 +299,7 @@ def update_classification_node(self, posted_node, project, structure_group, path content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='PATCH', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) @@ -269,9 +307,9 @@ def update_classification_node(self, posted_node, project, structure_group, path def create_field(self, work_item_field, project=None): """CreateField. Create a new field. - :param :class:` ` work_item_field: New field definition + :param :class:` ` work_item_field: New field definition :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -279,14 +317,14 @@ def create_field(self, work_item_field, project=None): content = self._serialize.body(work_item_field, 'WorkItemField') response = self._send(http_method='POST', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WorkItemField', response) def delete_field(self, field_name_or_ref_name, project=None): """DeleteField. - Deletes the field. + Deletes the field. To undelete a filed, see "Update Field" API. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name """ @@ -297,7 +335,7 @@ def delete_field(self, field_name_or_ref_name, project=None): route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') self._send(http_method='DELETE', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='5.1', + version='7.0', route_values=route_values) def get_field(self, field_name_or_ref_name, project=None): @@ -305,7 +343,7 @@ def get_field(self, field_name_or_ref_name, project=None): Gets information on a specific field. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -314,13 +352,13 @@ def get_field(self, field_name_or_ref_name, project=None): route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemField', response) def get_fields(self, project=None, expand=None): """GetFields. - Returns information for all fields. + Returns information for all fields. The project ID/name parameter is optional. :param str project: Project ID or project name :param str expand: Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included. :rtype: [WorkItemField] @@ -333,19 +371,58 @@ def get_fields(self, project=None, expand=None): query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemField]', self._unwrap_collection(response)) + def update_field(self, payload, field_name_or_ref_name, project=None): + """UpdateField. + Update a field. + :param :class:` ` payload: Payload contains desired value of the field's properties + :param str field_name_or_ref_name: Name/reference name of the field to be updated + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if field_name_or_ref_name is not None: + route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') + content = self._serialize.body(payload, 'UpdateWorkItemField') + response = self._send(http_method='PATCH', + location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemField', response) + + def migrate_projects_process(self, new_process, project): + """MigrateProjectsProcess. + Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + :param :class:` ` new_process: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_process, 'ProcessIdModel') + response = self._send(http_method='POST', + location_id='19801631-d4e5-47e9-8166-0330de0ff1e6', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessMigrationResultModel', response) + def create_query(self, posted_query, project, query, validate_wiql_only=None): """CreateQuery. Creates a query, or moves a query. - :param :class:` ` posted_query: The query to create. + :param :class:` ` posted_query: The query to create. :param str project: Project ID or project name :param str query: The parent id or path under which the query is to be created. :param bool validate_wiql_only: If you only want to validate your WIQL query without actually creating one, set it to true. Default is false. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -358,7 +435,7 @@ def create_query(self, posted_query, project, query, validate_wiql_only=None): content = self._serialize.body(posted_query, 'QueryHierarchyItem') response = self._send(http_method='POST', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -377,7 +454,7 @@ def delete_query(self, project, query): route_values['query'] = self._serialize.url('query', query, 'str') self._send(http_method='DELETE', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values) def get_queries(self, project, expand=None, depth=None, include_deleted=None): @@ -401,12 +478,12 @@ def get_queries(self, project, expand=None, depth=None, include_deleted=None): query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) - def get_query(self, project, query, expand=None, depth=None, include_deleted=None): + def get_query(self, project, query, expand=None, depth=None, include_deleted=None, use_iso_date_format=None): """GetQuery. Retrieves an individual query and its children :param str project: Project ID or project name @@ -414,7 +491,8 @@ def get_query(self, project, query, expand=None, depth=None, include_deleted=Non :param str expand: Include the query string (wiql), clauses, query result columns, and sort options in the results. :param int depth: In the folder of queries, return child queries and folders to this depth. :param bool include_deleted: Include deleted queries and folders - :rtype: :class:` ` + :param bool use_iso_date_format: DateTime query clauses will be formatted using a ISO 8601 compliant format + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -428,9 +506,11 @@ def get_query(self, project, query, expand=None, depth=None, include_deleted=Non query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') + if use_iso_date_format is not None: + query_parameters['$useIsoDateFormat'] = self._serialize.query('use_iso_date_format', use_iso_date_format, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItem', response) @@ -443,7 +523,7 @@ def search_queries(self, project, filter, top=None, expand=None, include_deleted :param int top: The number of queries to return (Default is 50 and maximum is 200). :param str expand: :param bool include_deleted: Include deleted queries and folders - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -459,7 +539,7 @@ def search_queries(self, project, filter, top=None, expand=None, include_deleted query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItemsResult', response) @@ -467,11 +547,11 @@ def search_queries(self, project, filter, top=None, expand=None, include_deleted def update_query(self, query_update, project, query, undelete_descendants=None): """UpdateQuery. Update a query or a folder. This allows you to update, rename and move queries and folders. - :param :class:` ` query_update: The query to update. + :param :class:` ` query_update: The query to update. :param str project: Project ID or project name :param str query: The ID or path for the query to update. :param bool undelete_descendants: Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -484,7 +564,7 @@ def update_query(self, query_update, project, query, undelete_descendants=None): content = self._serialize.body(query_update, 'QueryHierarchyItem') response = self._send(http_method='PATCH', location_id='a67d190c-c41f-424b-814d-0e906f659301', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -493,7 +573,7 @@ def update_query(self, query_update, project, query, undelete_descendants=None): def get_queries_batch(self, query_get_request, project): """GetQueriesBatch. Gets a list of queries by ids (Maximum 1000) - :param :class:` ` query_get_request: + :param :class:` ` query_get_request: :param str project: Project ID or project name :rtype: [QueryHierarchyItem] """ @@ -503,7 +583,7 @@ def get_queries_batch(self, query_get_request, project): content = self._serialize.body(query_get_request, 'QueryBatchGetRequest') response = self._send(http_method='POST', location_id='549816f9-09b0-4e75-9e81-01fbfcd07426', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) @@ -521,7 +601,7 @@ def destroy_work_item(self, id, project=None): route_values['id'] = self._serialize.url('id', id, 'int') self._send(http_method='DELETE', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='5.1', + version='7.0', route_values=route_values) def get_deleted_work_item(self, id, project=None): @@ -529,7 +609,7 @@ def get_deleted_work_item(self, id, project=None): Gets a deleted work item from Recycle Bin. :param int id: ID of the work item to be returned :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -538,7 +618,7 @@ def get_deleted_work_item(self, id, project=None): route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemDelete', response) @@ -558,7 +638,7 @@ def get_deleted_work_items(self, ids, project=None): query_parameters['ids'] = self._serialize.query('ids', ids, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemDeleteReference]', self._unwrap_collection(response)) @@ -574,17 +654,17 @@ def get_deleted_work_item_shallow_references(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[WorkItemDeleteShallowReference]', self._unwrap_collection(response)) def restore_work_item(self, payload, id, project=None): """RestoreWorkItem. Restores the deleted work item from Recycle Bin. - :param :class:` ` payload: Paylod with instructions to update the IsDeleted flag to false + :param :class:` ` payload: Paylod with instructions to update the IsDeleted flag to false :param int id: ID of the work item to be restored :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -594,7 +674,7 @@ def restore_work_item(self, payload, id, project=None): content = self._serialize.body(payload, 'WorkItemDeleteUpdate') response = self._send(http_method='PATCH', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('WorkItemDelete', response) @@ -606,7 +686,7 @@ def get_revision(self, id, revision_number, project=None, expand=None): :param int revision_number: :param str project: Project ID or project name :param str expand: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -620,7 +700,7 @@ def get_revision(self, id, revision_number, project=None, expand=None): query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) @@ -649,18 +729,263 @@ def get_revisions(self, id, project=None, top=None, skip=None, expand=None): query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + def send_mail(self, body, project=None): + """SendMail. + RESTful method to send mail for selected/queried work items. + :param :class:` ` body: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(body, 'SendMailBody') + self._send(http_method='POST', + location_id='12438500-2f84-4fa7-9f1a-c31871b4959d', + version='7.0', + route_values=route_values, + content=content) + + def delete_tag(self, project, tag_id_or_name): + """DeleteTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + self._send(http_method='DELETE', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + + def get_tag(self, project, tag_id_or_name): + """GetTag. + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemTagDefinition', response) + + def get_tags(self, project): + """GetTags. + :param str project: Project ID or project name + :rtype: [WorkItemTagDefinition] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemTagDefinition]', self._unwrap_collection(response)) + + def update_tag(self, tag_data, project, tag_id_or_name): + """UpdateTag. + :param :class:` ` tag_data: + :param str project: Project ID or project name + :param str tag_id_or_name: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag_id_or_name is not None: + route_values['tagIdOrName'] = self._serialize.url('tag_id_or_name', tag_id_or_name, 'str') + content = self._serialize.body(tag_data, 'WorkItemTagDefinition') + response = self._send(http_method='PATCH', + location_id='bc15bc60-e7a8-43cb-ab01-2106be3983a1', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTagDefinition', response) + + def create_template(self, template, team_context): + """CreateTemplate. + Creates a template + :param :class:` ` template: Template contents + :param :class:` ` team_context: The team context for the operation + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + content = self._serialize.body(template, 'WorkItemTemplate') + response = self._send(http_method='POST', + location_id='6a90345f-a676-4969-afce-8e163e1d5642', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTemplate', response) + + def get_templates(self, team_context, workitemtypename=None): + """GetTemplates. + Gets template + :param :class:` ` team_context: The team context for the operation + :param str workitemtypename: Optional, When specified returns templates for given Work item type. + :rtype: [WorkItemTemplateReference] + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + query_parameters = {} + if workitemtypename is not None: + query_parameters['workitemtypename'] = self._serialize.query('workitemtypename', workitemtypename, 'str') + response = self._send(http_method='GET', + location_id='6a90345f-a676-4969-afce-8e163e1d5642', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[WorkItemTemplateReference]', self._unwrap_collection(response)) + + def delete_template(self, team_context, template_id): + """DeleteTemplate. + Deletes the template with given id + :param :class:` ` team_context: The team context for the operation + :param str template_id: Template id + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if template_id is not None: + route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') + self._send(http_method='DELETE', + location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', + version='7.0', + route_values=route_values) + + def get_template(self, team_context, template_id): + """GetTemplate. + Gets the template with specified id + :param :class:` ` team_context: The team context for the operation + :param str template_id: Template Id + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if template_id is not None: + route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') + response = self._send(http_method='GET', + location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemTemplate', response) + + def replace_template(self, template_content, team_context, template_id): + """ReplaceTemplate. + Replace template contents + :param :class:` ` template_content: Template contents to replace with + :param :class:` ` team_context: The team context for the operation + :param str template_id: Template id + :rtype: :class:` ` + """ + project = None + team = None + if team_context is not None: + if team_context.project_id: + project = team_context.project_id + else: + project = team_context.project + if team_context.team_id: + team = team_context.team_id + else: + team = team_context.team + + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'string') + if team is not None: + route_values['team'] = self._serialize.url('team', team, 'string') + if template_id is not None: + route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') + content = self._serialize.body(template_content, 'WorkItemTemplate') + response = self._send(http_method='PUT', + location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTemplate', response) + def get_update(self, id, update_number, project=None): """GetUpdate. Returns a single update for a work item :param int id: :param int update_number: :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -671,7 +996,7 @@ def get_update(self, id, update_number, project=None): route_values['updateNumber'] = self._serialize.url('update_number', update_number, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemUpdate', response) @@ -696,7 +1021,7 @@ def get_updates(self, id, project=None, top=None, skip=None): query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemUpdate]', self._unwrap_collection(response)) @@ -704,11 +1029,11 @@ def get_updates(self, id, project=None, top=None, skip=None): def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): """QueryByWiql. Gets the results of the query given its WIQL. - :param :class:` ` wiql: The query containing the WIQL. - :param :class:` ` team_context: The team context for the operation + :param :class:` ` wiql: The query containing the WIQL. + :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -735,7 +1060,7 @@ def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): content = self._serialize.body(wiql, 'Wiql') response = self._send(http_method='POST', location_id='1a9c53f7-f243-4447-b110-35ef023636e4', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -745,7 +1070,7 @@ def get_query_result_count(self, id, team_context=None, time_precision=None, top """GetQueryResultCount. Gets the results of the query given the query ID. :param str id: The query ID. - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: int @@ -776,7 +1101,7 @@ def get_query_result_count(self, id, team_context=None, time_precision=None, top query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='HEAD', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('int', response) @@ -785,10 +1110,10 @@ def query_by_id(self, id, team_context=None, time_precision=None, top=None): """QueryById. Gets the results of the query given the query ID. :param str id: The query ID. - :param :class:` ` team_context: The team context for the operation + :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. - :rtype: :class:` ` + :rtype: :class:` ` """ project = None team = None @@ -816,7 +1141,7 @@ def query_by_id(self, id, team_context=None, time_precision=None, top=None): query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemQueryResult', response) @@ -827,7 +1152,7 @@ def get_work_item_icon_json(self, icon, color=None, v=None): :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if icon is not None: @@ -839,7 +1164,7 @@ def get_work_item_icon_json(self, icon, color=None, v=None): query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemIcon', response) @@ -851,7 +1176,7 @@ def get_work_item_icons(self): """ response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', - version='5.1') + version='7.0') return self._deserialize('[WorkItemIcon]', self._unwrap_collection(response)) def get_work_item_icon_svg(self, icon, color=None, v=None, **kwargs): @@ -872,7 +1197,7 @@ def get_work_item_icon_svg(self, icon, color=None, v=None, **kwargs): query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/svg+xml') @@ -900,7 +1225,7 @@ def get_work_item_icon_xaml(self, icon, color=None, v=None, **kwargs): query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/xaml+xml') @@ -918,7 +1243,7 @@ def get_reporting_links_by_link_type(self, project=None, link_types=None, types= :param [str] types: A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. :param str continuation_token: Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. :param datetime start_date_time: Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -936,7 +1261,7 @@ def get_reporting_links_by_link_type(self, project=None, link_types=None, types= query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') response = self._send(http_method='GET', location_id='b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemLinksBatch', response) @@ -945,14 +1270,14 @@ def get_relation_type(self, relation): """GetRelationType. Gets the work item relation type definition. :param str relation: The relation name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if relation is not None: route_values['relation'] = self._serialize.url('relation', relation, 'str') response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemRelationType', response) @@ -963,7 +1288,7 @@ def get_relation_types(self): """ response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', - version='5.1') + version='7.0') return self._deserialize('[WorkItemRelationType]', self._unwrap_collection(response)) def read_reporting_revisions_get(self, project=None, fields=None, types=None, continuation_token=None, start_date_time=None, include_identity_ref=None, include_deleted=None, include_tag_ref=None, include_latest_only=None, expand=None, include_discussion_changes_only=None, max_page_size=None): @@ -981,7 +1306,7 @@ def read_reporting_revisions_get(self, project=None, fields=None, types=None, co :param str expand: Return all the fields in work item revisions, including long text fields which are not returned by default :param bool include_discussion_changes_only: Return only the those revisions of work items, where only history field was changed :param int max_page_size: The maximum number of results to return in this batch - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1013,7 +1338,7 @@ def read_reporting_revisions_get(self, project=None, fields=None, types=None, co query_parameters['$maxPageSize'] = self._serialize.query('max_page_size', max_page_size, 'int') response = self._send(http_method='GET', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemRevisionsBatch', response) @@ -1021,12 +1346,12 @@ def read_reporting_revisions_get(self, project=None, fields=None, types=None, co def read_reporting_revisions_post(self, filter, project=None, continuation_token=None, start_date_time=None, expand=None): """ReadReportingRevisionsPost. Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit. - :param :class:` ` filter: An object that contains request settings: field filter, type filter, identity format + :param :class:` ` filter: An object that contains request settings: field filter, type filter, identity format :param str project: Project ID or project name :param str continuation_token: Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. :param datetime start_date_time: Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. :param str expand: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1041,23 +1366,45 @@ def read_reporting_revisions_post(self, filter, project=None, continuation_token content = self._serialize.body(filter, 'ReportingWorkItemRevisionsFilter') response = self._send(http_method='POST', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ReportingWorkItemRevisionsBatch', response) + def read_reporting_discussions(self, project=None, continuation_token=None, max_page_size=None): + """ReadReportingDiscussions. + :param str project: Project ID or project name + :param str continuation_token: + :param int max_page_size: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if max_page_size is not None: + query_parameters['$maxPageSize'] = self._serialize.query('max_page_size', max_page_size, 'int') + response = self._send(http_method='GET', + location_id='4a644469-90c5-4fcc-9a9f-be0827d369ec', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ReportingWorkItemRevisionsBatch', response) + def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None, expand=None): """CreateWorkItem. Creates a single work item. - :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the work item + :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the work item :param str project: Project ID or project name :param str type: The work item type of the work item to create :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1076,7 +1423,7 @@ def create_work_item(self, document, project, type, validate_only=None, bypass_r content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='POST', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, @@ -1091,7 +1438,7 @@ def get_work_item_template(self, project, type, fields=None, as_of=None, expand= :param str fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1107,7 +1454,7 @@ def get_work_item_template(self, project, type, fields=None, as_of=None, expand= query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) @@ -1118,7 +1465,7 @@ def delete_work_item(self, id, project=None, destroy=None): :param int id: ID of the work item to be deleted :param str project: Project ID or project name :param bool destroy: Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1130,7 +1477,7 @@ def delete_work_item(self, id, project=None, destroy=None): query_parameters['destroy'] = self._serialize.query('destroy', destroy, 'bool') response = self._send(http_method='DELETE', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemDelete', response) @@ -1143,7 +1490,7 @@ def get_work_item(self, id, project=None, fields=None, as_of=None, expand=None): :param [str] fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1160,7 +1507,7 @@ def get_work_item(self, id, project=None, fields=None, as_of=None, expand=None): query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) @@ -1194,7 +1541,7 @@ def get_work_items(self, ids, project=None, fields=None, as_of=None, expand=None query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) @@ -1202,14 +1549,14 @@ def get_work_items(self, ids, project=None, fields=None, as_of=None, expand=None def update_work_item(self, document, id, project=None, validate_only=None, bypass_rules=None, suppress_notifications=None, expand=None): """UpdateWorkItem. Updates a single work item. - :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the update + :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the update :param int id: The id of the work item to update :param str project: Project ID or project name :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1228,7 +1575,7 @@ def update_work_item(self, document, id, project=None, validate_only=None, bypas content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content, @@ -1238,7 +1585,7 @@ def update_work_item(self, document, id, project=None, validate_only=None, bypas def get_work_items_batch(self, work_item_get_request, project=None): """GetWorkItemsBatch. Gets work items for a list of work item ids (Maximum 200) - :param :class:` ` work_item_get_request: + :param :class:` ` work_item_get_request: :param str project: Project ID or project name :rtype: [WorkItem] """ @@ -1248,11 +1595,30 @@ def get_work_items_batch(self, work_item_get_request, project=None): content = self._serialize.body(work_item_get_request, 'WorkItemBatchGetRequest') response = self._send(http_method='POST', location_id='908509b6-4248-4475-a1cd-829139ba419f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) + def get_work_item_next_states_on_checkin_action(self, ids, action=None): + """GetWorkItemNextStatesOnCheckinAction. + Returns the next state on the given work item IDs. + :param [int] ids: list of work item ids + :param str action: possible actions. Currently only supports checkin + :rtype: [WorkItemNextStateOnTransition] + """ + query_parameters = {} + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + if action is not None: + query_parameters['action'] = self._serialize.query('action', action, 'str') + response = self._send(http_method='GET', + location_id='afae844b-e2f6-44c2-8053-17b3bb936a40', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[WorkItemNextStateOnTransition]', self._unwrap_collection(response)) + def get_work_item_type_categories(self, project): """GetWorkItemTypeCategories. Get all work item type categories. @@ -1264,7 +1630,7 @@ def get_work_item_type_categories(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[WorkItemTypeCategory]', self._unwrap_collection(response)) @@ -1273,7 +1639,7 @@ def get_work_item_type_category(self, project, category): Get specific work item type category by name. :param str project: Project ID or project name :param str category: The category name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1282,7 +1648,7 @@ def get_work_item_type_category(self, project, category): route_values['category'] = self._serialize.url('category', category, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemTypeCategory', response) @@ -1291,7 +1657,7 @@ def get_work_item_type(self, project, type): Returns a work item type definition. :param str project: Project ID or project name :param str type: Work item type name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1300,7 +1666,7 @@ def get_work_item_type(self, project, type): route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('WorkItemType', response) @@ -1315,7 +1681,7 @@ def get_work_item_types(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[WorkItemType]', self._unwrap_collection(response)) @@ -1337,7 +1703,7 @@ def get_work_item_type_fields_with_references(self, project, type, expand=None): query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemTypeFieldWithReferences]', self._unwrap_collection(response)) @@ -1349,7 +1715,7 @@ def get_work_item_type_field_with_references(self, project, type, field, expand= :param str type: Work item type. :param str field: :param str expand: Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1363,8 +1729,26 @@ def get_work_item_type_field_with_references(self, project, type, field, expand= query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemTypeFieldWithReferences', response) + def get_work_item_type_states(self, project, type): + """GetWorkItemTypeStates. + Returns the state names and colors for a work item type. + :param str project: Project ID or project name + :param str type: The state name + :rtype: [WorkItemStateColor] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='7c9d7a76-4a09-43e8-b5df-bd792f4ac6aa', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemStateColor]', self._unwrap_collection(response)) + diff --git a/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py b/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py new file mode 100644 index 00000000..6de73a2a --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process/__init__.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process.models import * +from .work_item_tracking_process_client import WorkItemTrackingProcessClient + +__all__ = [ + 'AddProcessWorkItemTypeFieldRequest', + 'Control', + 'CreateProcessModel', + 'CreateProcessRuleRequest', + 'CreateProcessWorkItemTypeRequest', + 'Extension', + 'FieldModel', + 'FieldRuleModel', + 'FormLayout', + 'Group', + 'HideStateModel', + 'Page', + 'PickList', + 'PickListMetadata', + 'ProcessBehavior', + 'ProcessBehaviorCreateRequest', + 'ProcessBehaviorField', + 'ProcessBehaviorReference', + 'ProcessBehaviorUpdateRequest', + 'ProcessInfo', + 'ProcessModel', + 'ProcessProperties', + 'ProcessRule', + 'ProcessWorkItemType', + 'ProcessWorkItemTypeField', + 'ProjectReference', + 'RuleAction', + 'RuleActionModel', + 'RuleCondition', + 'RuleConditionModel', + 'Section', + 'UpdateProcessModel', + 'UpdateProcessRuleRequest', + 'UpdateProcessWorkItemTypeFieldRequest', + 'UpdateProcessWorkItemTypeRequest', + 'WitContribution', + 'WorkItemBehavior', + 'WorkItemBehaviorField', + 'WorkItemBehaviorReference', + 'WorkItemStateInputModel', + 'WorkItemStateResultModel', + 'WorkItemTypeBehavior', + 'WorkItemTypeModel', + 'WorkItemTrackingProcessClient' +] diff --git a/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py b/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py new file mode 100644 index 00000000..c5435d82 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process/work_item_tracking_process_client.py @@ -0,0 +1,1211 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process import models + + +class WorkItemTrackingProcessClient(Client): + """WorkItemTrackingProcess + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(WorkItemTrackingProcessClient, 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 = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' + + def create_process_behavior(self, behavior, process_id): + """CreateProcessBehavior. + Creates a single behavior in the given process. + :param :class:` ` behavior: + :param str process_id: The ID of the process + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + content = self._serialize.body(behavior, 'ProcessBehaviorCreateRequest') + response = self._send(http_method='POST', + location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessBehavior', response) + + def delete_process_behavior(self, process_id, behavior_ref_name): + """DeleteProcessBehavior. + Removes a behavior in the process. + :param str process_id: The ID of the process + :param str behavior_ref_name: The reference name of the behavior + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if behavior_ref_name is not None: + route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') + self._send(http_method='DELETE', + location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', + version='7.0', + route_values=route_values) + + def get_process_behavior(self, process_id, behavior_ref_name, expand=None): + """GetProcessBehavior. + Returns a behavior of the process. + :param str process_id: The ID of the process + :param str behavior_ref_name: The reference name of the behavior + :param str expand: + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if behavior_ref_name is not None: + route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessBehavior', response) + + def get_process_behaviors(self, process_id, expand=None): + """GetProcessBehaviors. + Returns a list of all behaviors in the process. + :param str process_id: The ID of the process + :param str expand: + :rtype: [ProcessBehavior] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ProcessBehavior]', self._unwrap_collection(response)) + + def update_process_behavior(self, behavior_data, process_id, behavior_ref_name): + """UpdateProcessBehavior. + Replaces a behavior in the process. + :param :class:` ` behavior_data: + :param str process_id: The ID of the process + :param str behavior_ref_name: The reference name of the behavior + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if behavior_ref_name is not None: + route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') + content = self._serialize.body(behavior_data, 'ProcessBehaviorUpdateRequest') + response = self._send(http_method='PUT', + location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessBehavior', response) + + def create_control_in_group(self, control, process_id, wit_ref_name, group_id): + """CreateControlInGroup. + Creates a control in a group. + :param :class:` ` control: The control. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str group_id: The ID of the group to add the control to. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + content = self._serialize.body(control, 'Control') + response = self._send(http_method='POST', + location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Control', response) + + def move_control_to_group(self, control, process_id, wit_ref_name, group_id, control_id, remove_from_group_id=None): + """MoveControlToGroup. + Moves a control to a specified group. + :param :class:` ` control: The control. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str group_id: The ID of the group to move the control to. + :param str control_id: The ID of the control. + :param str remove_from_group_id: The group ID to remove the control from. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + if control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + query_parameters = {} + if remove_from_group_id is not None: + query_parameters['removeFromGroupId'] = self._serialize.query('remove_from_group_id', remove_from_group_id, 'str') + content = self._serialize.body(control, 'Control') + response = self._send(http_method='PUT', + location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Control', response) + + def remove_control_from_group(self, process_id, wit_ref_name, group_id, control_id): + """RemoveControlFromGroup. + Removes a control from the work item form. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str group_id: The ID of the group. + :param str control_id: The ID of the control to remove. + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + if control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + self._send(http_method='DELETE', + location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', + version='7.0', + route_values=route_values) + + def update_control(self, control, process_id, wit_ref_name, group_id, control_id): + """UpdateControl. + Updates a control on the work item form. + :param :class:` ` control: The updated control. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str group_id: The ID of the group. + :param str control_id: The ID of the control. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + if control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + content = self._serialize.body(control, 'Control') + response = self._send(http_method='PATCH', + location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Control', response) + + def add_field_to_work_item_type(self, field, process_id, wit_ref_name): + """AddFieldToWorkItemType. + Adds a field to a work item type. + :param :class:` ` field: + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(field, 'AddProcessWorkItemTypeFieldRequest') + response = self._send(http_method='POST', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemTypeField', response) + + def get_all_work_item_type_fields(self, process_id, wit_ref_name): + """GetAllWorkItemTypeFields. + Returns a list of all fields in a work item type. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: [ProcessWorkItemTypeField] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + response = self._send(http_method='GET', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values) + return self._deserialize('[ProcessWorkItemTypeField]', self._unwrap_collection(response)) + + def get_work_item_type_field(self, process_id, wit_ref_name, field_ref_name, expand=None): + """GetWorkItemTypeField. + Returns a field in a work item type. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str field_ref_name: The reference name of the field. + :param str expand: + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if field_ref_name is not None: + route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessWorkItemTypeField', response) + + def remove_work_item_type_field(self, process_id, wit_ref_name, field_ref_name): + """RemoveWorkItemTypeField. + Removes a field from a work item type. Does not permanently delete the field. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str field_ref_name: The reference name of the field. + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if field_ref_name is not None: + route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') + self._send(http_method='DELETE', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values) + + def update_work_item_type_field(self, field, process_id, wit_ref_name, field_ref_name): + """UpdateWorkItemTypeField. + Updates a field in a work item type. + :param :class:` ` field: + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str field_ref_name: The reference name of the field. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if field_ref_name is not None: + route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') + content = self._serialize.body(field, 'UpdateProcessWorkItemTypeFieldRequest') + response = self._send(http_method='PATCH', + location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemTypeField', response) + + def add_group(self, group, process_id, wit_ref_name, page_id, section_id): + """AddGroup. + Adds a group to the work item form. + :param :class:` ` group: The group. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str page_id: The ID of the page to add the group to. + :param str section_id: The ID of the section to add the group to. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + if section_id is not None: + route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') + content = self._serialize.body(group, 'Group') + response = self._send(http_method='POST', + location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Group', response) + + def move_group_to_page(self, group, process_id, wit_ref_name, page_id, section_id, group_id, remove_from_page_id, remove_from_section_id): + """MoveGroupToPage. + Moves a group to a different page and section. + :param :class:` ` group: The updated group. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str page_id: The ID of the page the group is in. + :param str section_id: The ID of the section the group is i.n + :param str group_id: The ID of the group. + :param str remove_from_page_id: ID of the page to remove the group from. + :param str remove_from_section_id: ID of the section to remove the group from. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + if section_id is not None: + route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if remove_from_page_id is not None: + query_parameters['removeFromPageId'] = self._serialize.query('remove_from_page_id', remove_from_page_id, 'str') + if remove_from_section_id is not None: + query_parameters['removeFromSectionId'] = self._serialize.query('remove_from_section_id', remove_from_section_id, 'str') + content = self._serialize.body(group, 'Group') + response = self._send(http_method='PUT', + location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Group', response) + + def move_group_to_section(self, group, process_id, wit_ref_name, page_id, section_id, group_id, remove_from_section_id): + """MoveGroupToSection. + Moves a group to a different section. + :param :class:` ` group: The updated group. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str page_id: The ID of the page the group is in. + :param str section_id: The ID of the section the group is in. + :param str group_id: The ID of the group. + :param str remove_from_section_id: ID of the section to remove the group from. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + if section_id is not None: + route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if remove_from_section_id is not None: + query_parameters['removeFromSectionId'] = self._serialize.query('remove_from_section_id', remove_from_section_id, 'str') + content = self._serialize.body(group, 'Group') + response = self._send(http_method='PUT', + location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content) + return self._deserialize('Group', response) + + def remove_group(self, process_id, wit_ref_name, page_id, section_id, group_id): + """RemoveGroup. + Removes a group from the work item form. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str page_id: The ID of the page the group is in + :param str section_id: The ID of the section to the group is in + :param str group_id: The ID of the group + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + if section_id is not None: + route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + self._send(http_method='DELETE', + location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', + version='7.0', + route_values=route_values) + + def update_group(self, group, process_id, wit_ref_name, page_id, section_id, group_id): + """UpdateGroup. + Updates a group in the work item form. + :param :class:` ` group: The updated group. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str page_id: The ID of the page the group is in. + :param str section_id: The ID of the section the group is in. + :param str group_id: The ID of the group. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + if section_id is not None: + route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + content = self._serialize.body(group, 'Group') + response = self._send(http_method='PATCH', + location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Group', response) + + def get_form_layout(self, process_id, wit_ref_name): + """GetFormLayout. + Gets the form layout. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + response = self._send(http_method='GET', + location_id='fa8646eb-43cd-4b71-9564-40106fd63e40', + version='7.0', + route_values=route_values) + return self._deserialize('FormLayout', response) + + def create_list(self, picklist): + """CreateList. + Creates a picklist. + :param :class:` ` picklist: Picklist + :rtype: :class:` ` + """ + content = self._serialize.body(picklist, 'PickList') + response = self._send(http_method='POST', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0', + content=content) + return self._deserialize('PickList', response) + + def delete_list(self, list_id): + """DeleteList. + Removes a picklist. + :param str list_id: The ID of the list + """ + route_values = {} + if list_id is not None: + route_values['listId'] = self._serialize.url('list_id', list_id, 'str') + self._send(http_method='DELETE', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0', + route_values=route_values) + + def get_list(self, list_id): + """GetList. + Returns a picklist. + :param str list_id: The ID of the list + :rtype: :class:` ` + """ + route_values = {} + if list_id is not None: + route_values['listId'] = self._serialize.url('list_id', list_id, 'str') + response = self._send(http_method='GET', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0', + route_values=route_values) + return self._deserialize('PickList', response) + + def get_lists_metadata(self): + """GetListsMetadata. + Returns meta data of the picklist. + :rtype: [PickListMetadata] + """ + response = self._send(http_method='GET', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0') + return self._deserialize('[PickListMetadata]', self._unwrap_collection(response)) + + def update_list(self, picklist, list_id): + """UpdateList. + Updates a list. + :param :class:` ` picklist: + :param str list_id: The ID of the list + :rtype: :class:` ` + """ + route_values = {} + if list_id is not None: + route_values['listId'] = self._serialize.url('list_id', list_id, 'str') + content = self._serialize.body(picklist, 'PickList') + response = self._send(http_method='PUT', + location_id='01e15468-e27c-4e20-a974-bd957dcccebc', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('PickList', response) + + def add_page(self, page, process_id, wit_ref_name): + """AddPage. + Adds a page to the work item form. + :param :class:` ` page: The page. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(page, 'Page') + response = self._send(http_method='POST', + location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def remove_page(self, process_id, wit_ref_name, page_id): + """RemovePage. + Removes a page from the work item form + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str page_id: The ID of the page + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if page_id is not None: + route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') + self._send(http_method='DELETE', + location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', + version='7.0', + route_values=route_values) + + def update_page(self, page, process_id, wit_ref_name): + """UpdatePage. + Updates a page on the work item form + :param :class:` ` page: The page + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(page, 'Page') + response = self._send(http_method='PATCH', + location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Page', response) + + def create_new_process(self, create_request): + """CreateNewProcess. + Creates a process. + :param :class:` ` create_request: CreateProcessModel. + :rtype: :class:` ` + """ + content = self._serialize.body(create_request, 'CreateProcessModel') + response = self._send(http_method='POST', + location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', + version='7.0', + content=content) + return self._deserialize('ProcessInfo', response) + + def delete_process_by_id(self, process_type_id): + """DeleteProcessById. + Removes a process of a specific ID. + :param str process_type_id: + """ + route_values = {} + if process_type_id is not None: + route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') + self._send(http_method='DELETE', + location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', + version='7.0', + route_values=route_values) + + def edit_process(self, update_request, process_type_id): + """EditProcess. + Edit a process of a specific ID. + :param :class:` ` update_request: + :param str process_type_id: + :rtype: :class:` ` + """ + route_values = {} + if process_type_id is not None: + route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') + content = self._serialize.body(update_request, 'UpdateProcessModel') + response = self._send(http_method='PATCH', + location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessInfo', response) + + def get_list_of_processes(self, expand=None): + """GetListOfProcesses. + Get list of all processes including system and inherited. + :param str expand: + :rtype: [ProcessInfo] + """ + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('[ProcessInfo]', self._unwrap_collection(response)) + + def get_process_by_its_id(self, process_type_id, expand=None): + """GetProcessByItsId. + Get a single process of a specified ID. + :param str process_type_id: + :param str expand: + :rtype: :class:` ` + """ + route_values = {} + if process_type_id is not None: + route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessInfo', response) + + def add_process_work_item_type_rule(self, process_rule_create, process_id, wit_ref_name): + """AddProcessWorkItemTypeRule. + Adds a rule to work item type in the process. + :param :class:` ` process_rule_create: + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(process_rule_create, 'CreateProcessRuleRequest') + response = self._send(http_method='POST', + location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessRule', response) + + def delete_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): + """DeleteProcessWorkItemTypeRule. + Removes a rule from the work item type in the process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str rule_id: The ID of the rule + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if rule_id is not None: + route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') + self._send(http_method='DELETE', + location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', + version='7.0', + route_values=route_values) + + def get_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): + """GetProcessWorkItemTypeRule. + Returns a single rule in the work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str rule_id: The ID of the rule + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if rule_id is not None: + route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') + response = self._send(http_method='GET', + location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', + version='7.0', + route_values=route_values) + return self._deserialize('ProcessRule', response) + + def get_process_work_item_type_rules(self, process_id, wit_ref_name): + """GetProcessWorkItemTypeRules. + Returns a list of all rules in the work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: [ProcessRule] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + response = self._send(http_method='GET', + location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', + version='7.0', + route_values=route_values) + return self._deserialize('[ProcessRule]', self._unwrap_collection(response)) + + def update_process_work_item_type_rule(self, process_rule, process_id, wit_ref_name, rule_id): + """UpdateProcessWorkItemTypeRule. + Updates a rule in the work item type of the process. + :param :class:` ` process_rule: + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str rule_id: The ID of the rule + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if rule_id is not None: + route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') + content = self._serialize.body(process_rule, 'UpdateProcessRuleRequest') + response = self._send(http_method='PUT', + location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessRule', response) + + def create_state_definition(self, state_model, process_id, wit_ref_name): + """CreateStateDefinition. + Creates a state definition in the work item type of the process. + :param :class:` ` state_model: + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(state_model, 'WorkItemStateInputModel') + response = self._send(http_method='POST', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_state_definition(self, process_id, wit_ref_name, state_id): + """DeleteStateDefinition. + Removes a state definition in the work item type of the process. + :param str process_id: ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str state_id: ID of the state + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if state_id is not None: + route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') + self._send(http_method='DELETE', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values) + + def get_state_definition(self, process_id, wit_ref_name, state_id): + """GetStateDefinition. + Returns a single state definition in a work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str state_id: The ID of the state + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if state_id is not None: + route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') + response = self._send(http_method='GET', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemStateResultModel', response) + + def get_state_definitions(self, process_id, wit_ref_name): + """GetStateDefinitions. + Returns a list of all state definitions in a work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: [WorkItemStateResultModel] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + response = self._send(http_method='GET', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemStateResultModel]', self._unwrap_collection(response)) + + def hide_state_definition(self, hide_state_model, process_id, wit_ref_name, state_id): + """HideStateDefinition. + Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden. + :param :class:` ` hide_state_model: + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str state_id: The ID of the state + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if state_id is not None: + route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') + content = self._serialize.body(hide_state_model, 'HideStateModel') + response = self._send(http_method='PUT', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def update_state_definition(self, state_model, process_id, wit_ref_name, state_id): + """UpdateStateDefinition. + Updates a given state definition in the work item type of the process. + :param :class:` ` state_model: + :param str process_id: ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str state_id: ID of the state + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if state_id is not None: + route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') + content = self._serialize.body(state_model, 'WorkItemStateInputModel') + response = self._send(http_method='PATCH', + location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemStateResultModel', response) + + def delete_system_control(self, process_id, wit_ref_name, control_id): + """DeleteSystemControl. + Deletes a system control modification on the work item form. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str control_id: The ID of the control. + :rtype: [Control] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + response = self._send(http_method='DELETE', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def get_system_controls(self, process_id, wit_ref_name): + """GetSystemControls. + Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :rtype: [Control] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + response = self._send(http_method='GET', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values) + return self._deserialize('[Control]', self._unwrap_collection(response)) + + def update_system_control(self, control, process_id, wit_ref_name, control_id): + """UpdateSystemControl. + Updates/adds a system control on the work item form. + :param :class:` ` control: + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + :param str control_id: The ID of the control. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + if control_id is not None: + route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') + content = self._serialize.body(control, 'Control') + response = self._send(http_method='PATCH', + location_id='ff9a3d2c-32b7-4c6c-991c-d5a251fb9098', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('Control', response) + + def create_process_work_item_type(self, work_item_type, process_id): + """CreateProcessWorkItemType. + Creates a work item type in the process. + :param :class:` ` work_item_type: + :param str process_id: The ID of the process on which to create work item type. + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + content = self._serialize.body(work_item_type, 'CreateProcessWorkItemTypeRequest') + response = self._send(http_method='POST', + location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemType', response) + + def delete_process_work_item_type(self, process_id, wit_ref_name): + """DeleteProcessWorkItemType. + Removes a work itewm type in the process. + :param str process_id: The ID of the process. + :param str wit_ref_name: The reference name of the work item type. + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + self._send(http_method='DELETE', + location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', + version='7.0', + route_values=route_values) + + def get_process_work_item_type(self, process_id, wit_ref_name, expand=None): + """GetProcessWorkItemType. + Returns a single work item type in a process. + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :param str expand: Flag to determine what properties of work item type to return + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ProcessWorkItemType', response) + + def get_process_work_item_types(self, process_id, expand=None): + """GetProcessWorkItemTypes. + Returns a list of all work item types in a process. + :param str process_id: The ID of the process + :param str expand: Flag to determine what properties of work item type to return + :rtype: [ProcessWorkItemType] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[ProcessWorkItemType]', self._unwrap_collection(response)) + + def update_process_work_item_type(self, work_item_type_update, process_id, wit_ref_name): + """UpdateProcessWorkItemType. + Updates a work item type of the process. + :param :class:` ` work_item_type_update: + :param str process_id: The ID of the process + :param str wit_ref_name: The reference name of the work item type + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name is not None: + route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') + content = self._serialize.body(work_item_type_update, 'UpdateProcessWorkItemTypeRequest') + response = self._send(http_method='PATCH', + location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProcessWorkItemType', response) + + def add_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): + """AddBehaviorToWorkItemType. + Adds a behavior to the work item type of the process. + :param :class:` ` behavior: + :param str process_id: The ID of the process + :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name_for_behaviors is not None: + route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') + content = self._serialize.body(behavior, 'WorkItemTypeBehavior') + response = self._send(http_method='POST', + location_id='6d765a2e-4e1b-4b11-be93-f953be676024', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTypeBehavior', response) + + def get_behavior_for_work_item_type(self, process_id, wit_ref_name_for_behaviors, behavior_ref_name): + """GetBehaviorForWorkItemType. + Returns a behavior for the work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior + :param str behavior_ref_name: The reference name of the behavior + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name_for_behaviors is not None: + route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') + if behavior_ref_name is not None: + route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') + response = self._send(http_method='GET', + location_id='6d765a2e-4e1b-4b11-be93-f953be676024', + version='7.0', + route_values=route_values) + return self._deserialize('WorkItemTypeBehavior', response) + + def get_behaviors_for_work_item_type(self, process_id, wit_ref_name_for_behaviors): + """GetBehaviorsForWorkItemType. + Returns a list of all behaviors for the work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior + :rtype: [WorkItemTypeBehavior] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name_for_behaviors is not None: + route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') + response = self._send(http_method='GET', + location_id='6d765a2e-4e1b-4b11-be93-f953be676024', + version='7.0', + route_values=route_values) + return self._deserialize('[WorkItemTypeBehavior]', self._unwrap_collection(response)) + + def remove_behavior_from_work_item_type(self, process_id, wit_ref_name_for_behaviors, behavior_ref_name): + """RemoveBehaviorFromWorkItemType. + Removes a behavior for the work item type of the process. + :param str process_id: The ID of the process + :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior + :param str behavior_ref_name: The reference name of the behavior + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name_for_behaviors is not None: + route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') + if behavior_ref_name is not None: + route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') + self._send(http_method='DELETE', + location_id='6d765a2e-4e1b-4b11-be93-f953be676024', + version='7.0', + route_values=route_values) + + def update_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): + """UpdateBehaviorToWorkItemType. + Updates a behavior for the work item type of the process. + :param :class:` ` behavior: + :param str process_id: The ID of the process + :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + if wit_ref_name_for_behaviors is not None: + route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') + content = self._serialize.body(behavior, 'WorkItemTypeBehavior') + response = self._send(http_method='PATCH', + location_id='6d765a2e-4e1b-4b11-be93-f953be676024', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('WorkItemTypeBehavior', response) + diff --git a/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py b/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py new file mode 100644 index 00000000..61161f99 --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process_template/__init__.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process_template.models import * +from .work_item_tracking_process_template_client import WorkItemTrackingProcessTemplateClient + +__all__ = [ + 'AdminBehavior', + 'AdminBehaviorField', + 'CheckTemplateExistenceResult', + 'ProcessImportResult', + 'ProcessPromoteStatus', + 'ValidationIssue', + 'WorkItemTrackingProcessTemplateClient' +] diff --git a/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py b/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py new file mode 100644 index 00000000..8184330f --- /dev/null +++ b/azure-devops/azure/devops/released/work_item_tracking_process_template/work_item_tracking_process_template_client.py @@ -0,0 +1,128 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...v7_0.work_item_tracking_process_template import models + + +class WorkItemTrackingProcessTemplateClient(Client): + """WorkItemTrackingProcessTemplate + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(WorkItemTrackingProcessTemplateClient, 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 = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' + + def get_behavior(self, process_id, behavior_ref_name): + """GetBehavior. + Returns a behavior for the process. + :param str process_id: The ID of the process + :param str behavior_ref_name: The reference name of the behavior + :rtype: :class:` ` + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + query_parameters = {} + if behavior_ref_name is not None: + query_parameters['behaviorRefName'] = self._serialize.query('behavior_ref_name', behavior_ref_name, 'str') + response = self._send(http_method='GET', + location_id='90bf9317-3571-487b-bc8c-a523ba0e05d7', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('AdminBehavior', response) + + def get_behaviors(self, process_id): + """GetBehaviors. + Returns a list of behaviors for the process. + :param str process_id: The ID of the process + :rtype: [AdminBehavior] + """ + route_values = {} + if process_id is not None: + route_values['processId'] = self._serialize.url('process_id', process_id, 'str') + response = self._send(http_method='GET', + location_id='90bf9317-3571-487b-bc8c-a523ba0e05d7', + version='7.0', + route_values=route_values) + return self._deserialize('[AdminBehavior]', self._unwrap_collection(response)) + + def export_process_template(self, id, **kwargs): + """ExportProcessTemplate. + Returns requested process template. + :param str id: The ID of the process + :rtype: object + """ + route_values = {} + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'str') + route_values['action'] = 'Export' + response = self._send(http_method='GET', + location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', + version='7.0', + route_values=route_values, + accept_media_type='application/zip') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + return self._client.stream_download(response, callback=callback) + + def import_process_template(self, upload_stream, ignore_warnings=None, replace_existing_template=None, **kwargs): + """ImportProcessTemplate. + Imports a process from zip file. + :param object upload_stream: Stream to upload + :param bool ignore_warnings: Ignores validation warnings. Default value is false. + :param bool replace_existing_template: Replaces the existing template. Default value is true. + :rtype: :class:` ` + """ + route_values = {} + route_values['action'] = 'Import' + query_parameters = {} + if ignore_warnings is not None: + query_parameters['ignoreWarnings'] = self._serialize.query('ignore_warnings', ignore_warnings, 'bool') + if replace_existing_template is not None: + query_parameters['replaceExistingTemplate'] = self._serialize.query('replace_existing_template', replace_existing_template, 'bool') + if "callback" in kwargs: + callback = kwargs["callback"] + else: + callback = None + content = self._client.stream_upload(upload_stream, callback=callback) + response = self._send(http_method='POST', + location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', + version='7.0', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/octet-stream') + return self._deserialize('ProcessImportResult', response) + + def import_process_template_status(self, id): + """ImportProcessTemplateStatus. + Tells whether promote has completed for the specified promote job ID. + :param str id: The ID of the promote job operation + :rtype: :class:` ` + """ + route_values = {} + if id is not None: + route_values['id'] = self._serialize.url('id', id, 'str') + route_values['action'] = 'Status' + response = self._send(http_method='GET', + location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', + version='7.0', + route_values=route_values) + return self._deserialize('ProcessPromoteStatus', response) + diff --git a/azure-devops/azure/devops/v5_1/audit/audit_client.py b/azure-devops/azure/devops/v5_1/audit/audit_client.py deleted file mode 100644 index 0a726d7b..00000000 --- a/azure-devops/azure/devops/v5_1/audit/audit_client.py +++ /dev/null @@ -1,80 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 AuditClient(Client): - """Audit - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(AuditClient, 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 = '94ff054d-5ee1-413d-9341-3f4a7827de2e' - - def query_log(self, start_time=None, end_time=None, batch_size=None, continuation_token=None, skip_aggregation=None): - """QueryLog. - [Preview API] Queries audit log entries - :param datetime start_time: Start time of download window. Optional - :param datetime end_time: End time of download window. Optional - :param int batch_size: Max number of results to return. Optional - :param str continuation_token: Token used for returning next set of results from previous query. Optional - :param bool skip_aggregation: Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog. - :rtype: :class:` ` - """ - query_parameters = {} - if start_time is not None: - query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') - if end_time is not None: - query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') - if batch_size is not None: - query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if skip_aggregation is not None: - query_parameters['skipAggregation'] = self._serialize.query('skip_aggregation', skip_aggregation, 'bool') - response = self._send(http_method='GET', - location_id='4e5fa14f-7097-4b73-9c85-00abc7353c61', - version='5.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('AuditLogQueryResult', response) - - def download_log(self, format, start_time=None, end_time=None, **kwargs): - """DownloadLog. - [Preview API] Downloads audit log entries. - :param str format: File format for download. Can be "json" or "csv". - :param datetime start_time: Start time of download window. Optional - :param datetime end_time: End time of download window. Optional - :rtype: object - """ - query_parameters = {} - if format is not None: - query_parameters['format'] = self._serialize.query('format', format, 'str') - if start_time is not None: - query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') - if end_time is not None: - query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') - response = self._send(http_method='GET', - location_id='b7b98a76-04e8-4f4d-ac72-9d46492caaac', - version='5.1-preview.1', - query_parameters=query_parameters, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - diff --git a/azure-devops/azure/devops/v5_1/client_factory.py b/azure-devops/azure/devops/v5_1/client_factory.py deleted file mode 100644 index 1df0e0fb..00000000 --- a/azure-devops/azure/devops/v5_1/client_factory.py +++ /dev/null @@ -1,409 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- - - -class ClientFactoryV5_1(object): - """ClientFactoryV5_1. - A factory class to get the 5.1 clients. - """ - - def __init__(self, connection): - self._connection = connection - - def get_accounts_client(self): - """get_accounts_client. - Gets the 5.1 version of the AccountsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.accounts.accounts_client.AccountsClient') - - def get_audit_client(self): - """get_audit_client. - Gets the 5.1 version of the AuditClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.audit.audit_client.AuditClient') - - def get_build_client(self): - """get_build_client. - Gets the 5.1 version of the BuildClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.build.build_client.BuildClient') - - def get_cix_client(self): - """get_cix_client. - Gets the 5.1 version of the CixClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.cix.cix_client.CixClient') - - def get_client_trace_client(self): - """get_client_trace_client. - Gets the 5.1 version of the ClientTraceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.client_trace.client_trace_client.ClientTraceClient') - - def get_cloud_load_test_client(self): - """get_cloud_load_test_client. - Gets the 5.1 version of the CloudLoadTestClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') - - def get_contributions_client(self): - """get_contributions_client. - Gets the 5.1 version of the ContributionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.contributions.contributions_client.ContributionsClient') - - def get_core_client(self): - """get_core_client. - Gets the 5.1 version of the CoreClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.core.core_client.CoreClient') - - def get_customer_intelligence_client(self): - """get_customer_intelligence_client. - Gets the 5.1 version of the CustomerIntelligenceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') - - def get_dashboard_client(self): - """get_dashboard_client. - Gets the 5.1 version of the DashboardClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.dashboard.dashboard_client.DashboardClient') - - def get_extension_management_client(self): - """get_extension_management_client. - Gets the 5.1 version of the ExtensionManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.extension_management.extension_management_client.ExtensionManagementClient') - - def get_feature_availability_client(self): - """get_feature_availability_client. - Gets the 5.1 version of the FeatureAvailabilityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.feature_availability.feature_availability_client.FeatureAvailabilityClient') - - def get_feature_management_client(self): - """get_feature_management_client. - Gets the 5.1 version of the FeatureManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.feature_management.feature_management_client.FeatureManagementClient') - - def get_feed_client(self): - """get_feed_client. - Gets the 5.1 version of the FeedClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.feed.feed_client.FeedClient') - - def get_feed_token_client(self): - """get_feed_token_client. - Gets the 5.1 version of the FeedTokenClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.feed_token.feed_token_client.FeedTokenClient') - - def get_file_container_client(self): - """get_file_container_client. - Gets the 5.1 version of the FileContainerClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.file_container.file_container_client.FileContainerClient') - - def get_gallery_client(self): - """get_gallery_client. - Gets the 5.1 version of the GalleryClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.gallery.gallery_client.GalleryClient') - - def get_git_client(self): - """get_git_client. - Gets the 5.1 version of the GitClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.git.git_client.GitClient') - - def get_graph_client(self): - """get_graph_client. - Gets the 5.1 version of the GraphClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.graph.graph_client.GraphClient') - - def get_identity_client(self): - """get_identity_client. - Gets the 5.1 version of the IdentityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.identity.identity_client.IdentityClient') - - def get_location_client(self): - """get_location_client. - Gets the 5.1 version of the LocationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.location.location_client.LocationClient') - - def get_maven_client(self): - """get_maven_client. - Gets the 5.1 version of the MavenClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.maven.maven_client.MavenClient') - - def get_member_entitlement_management_client(self): - """get_member_entitlement_management_client. - Gets the 5.1 version of the MemberEntitlementManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') - - def get_notification_client(self): - """get_notification_client. - Gets the 5.1 version of the NotificationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.notification.notification_client.NotificationClient') - - def get_npm_client(self): - """get_npm_client. - Gets the 5.1 version of the NpmClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.npm.npm_client.NpmClient') - - def get_nuget_client(self): - """get_nuget_client. - Gets the 5.1 version of the NuGetClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.nuget.nuget_client.NuGetClient') - - def get_operations_client(self): - """get_operations_client. - Gets the 5.1 version of the OperationsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.operations.operations_client.OperationsClient') - - def get_pipelines_client(self): - """get_pipelines_client. - Gets the 5.1 version of the PipelinesClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.pipelines.pipelines_client.PipelinesClient') - - def get_policy_client(self): - """get_policy_client. - Gets the 5.1 version of the PolicyClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.policy.policy_client.PolicyClient') - - def get_profile_client(self): - """get_profile_client. - Gets the 5.1 version of the ProfileClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.profile.profile_client.ProfileClient') - - def get_profile_regions_client(self): - """get_profile_regions_client. - Gets the 5.1 version of the ProfileRegionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.profile_regions.profile_regions_client.ProfileRegionsClient') - - def get_project_analysis_client(self): - """get_project_analysis_client. - Gets the 5.1 version of the ProjectAnalysisClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.project_analysis.project_analysis_client.ProjectAnalysisClient') - - def get_provenance_client(self): - """get_provenance_client. - Gets the 5.1 version of the ProvenanceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.provenance.provenance_client.ProvenanceClient') - - def get_py_pi_api_client(self): - """get_py_pi_api_client. - Gets the 5.1 version of the PyPiApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.py_pi_api.py_pi_api_client.PyPiApiClient') - - def get_release_client(self): - """get_release_client. - Gets the 5.1 version of the ReleaseClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.release.release_client.ReleaseClient') - - def get_search_client(self): - """get_search_client. - Gets the 5.1 version of the SearchClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.search.search_client.SearchClient') - - def get_security_client(self): - """get_security_client. - Gets the 5.1 version of the SecurityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.security.security_client.SecurityClient') - - def get_service_endpoint_client(self): - """get_service_endpoint_client. - Gets the 5.1 version of the ServiceEndpointClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.service_endpoint.service_endpoint_client.ServiceEndpointClient') - - def get_service_hooks_client(self): - """get_service_hooks_client. - Gets the 5.1 version of the ServiceHooksClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.service_hooks.service_hooks_client.ServiceHooksClient') - - def get_settings_client(self): - """get_settings_client. - Gets the 5.1 version of the SettingsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.settings.settings_client.SettingsClient') - - def get_symbol_client(self): - """get_symbol_client. - Gets the 5.1 version of the SymbolClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.symbol.symbol_client.SymbolClient') - - def get_task_client(self): - """get_task_client. - Gets the 5.1 version of the TaskClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.task.task_client.TaskClient') - - def get_task_agent_client(self): - """get_task_agent_client. - Gets the 5.1 version of the TaskAgentClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.task_agent.task_agent_client.TaskAgentClient') - - def get_test_client(self): - """get_test_client. - Gets the 5.1 version of the TestClient - :rtype: :class:` ` - """ - 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:` ` - """ - return self._connection.get_client('azure.devops.v5_1.test_plan.test_plan_client.TestPlanClient') - - def get_test_results_client(self): - """get_test_results_client. - Gets the 5.1 version of the TestResultsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.test_results.test_results_client.TestResultsClient') - - def get_tfvc_client(self): - """get_tfvc_client. - Gets the 5.1 version of the TfvcClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.tfvc.tfvc_client.TfvcClient') - - def get_token_admin_client(self): - """get_token_admin_client. - Gets the 5.1 version of the TokenAdminClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.token_admin.token_admin_client.TokenAdminClient') - - def get_token_administration_client(self): - """get_token_administration_client. - Gets the 5.1 version of the TokenAdministrationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.token_administration.token_administration_client.TokenAdministrationClient') - - def get_upack_api_client(self): - """get_upack_api_client. - Gets the 5.1 version of the UPackApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.upack_api.upack_api_client.UPackApiClient') - - def get_upack_packaging_client(self): - """get_upack_packaging_client. - Gets the 5.1 version of the UPackPackagingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.upack_packaging.upack_packaging_client.UPackPackagingClient') - - def get_wiki_client(self): - """get_wiki_client. - Gets the 5.1 version of the WikiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.wiki.wiki_client.WikiClient') - - def get_work_client(self): - """get_work_client. - Gets the 5.1 version of the WorkClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.work.work_client.WorkClient') - - def get_work_item_tracking_client(self): - """get_work_item_tracking_client. - Gets the 5.1 version of the WorkItemTrackingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') - - def get_work_item_tracking_process_client(self): - """get_work_item_tracking_process_client. - Gets the 5.1 version of the WorkItemTrackingProcessClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.work_item_tracking_process.work_item_tracking_process_client.WorkItemTrackingProcessClient') - - def get_work_item_tracking_process_template_client(self): - """get_work_item_tracking_process_template_client. - Gets the 5.1 version of the WorkItemTrackingProcessTemplateClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v5_1.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') - diff --git a/azure-devops/azure/devops/v5_1/cloud_load_test/__init__.py b/azure-devops/azure/devops/v5_1/cloud_load_test/__init__.py deleted file mode 100644 index 70f8560e..00000000 --- a/azure-devops/azure/devops/v5_1/cloud_load_test/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .cloud_load_test_client import CloudLoadTestClient - -__all__ = [ - 'AgentGroup', - 'AgentGroupAccessData', - 'Application', - 'ApplicationCounters', - 'ApplicationType', - 'BrowserMix', - 'CltCustomerIntelligenceData', - 'CounterGroup', - 'CounterInstanceSamples', - 'CounterSample', - 'CounterSampleQueryDetails', - 'CounterSamplesResult', - 'Diagnostics', - 'DropAccessData', - 'ErrorDetails', - 'GraphSubjectBase', - 'IdentityRef', - 'LoadGenerationGeoLocation', - 'LoadTest', - 'LoadTestDefinition', - 'LoadTestErrors', - 'LoadTestRunDetails', - 'LoadTestRunSettings', - 'OverridableRunSettings', - 'PageSummary', - 'ReferenceLinks', - 'RequestSummary', - 'ScenarioSummary', - 'StaticAgentRunSetting', - 'SubType', - 'SummaryPercentileData', - 'TenantDetails', - 'TestDefinition', - 'TestDefinitionBasic', - 'TestDrop', - 'TestDropRef', - 'TestResults', - 'TestResultsSummary', - 'TestRun', - 'TestRunAbortMessage', - 'TestRunBasic', - 'TestRunCounterInstance', - 'TestRunMessage', - 'TestSettings', - 'TestSummary', - 'TransactionSummary', - 'WebApiLoadTestMachineInput', - 'WebApiSetupParamaters', - 'WebApiTestMachine', - 'WebApiUserLoadTestMachineInput', - 'WebInstanceSummaryData', - 'CloudLoadTestClient' -] diff --git a/azure-devops/azure/devops/v5_1/cloud_load_test/cloud_load_test_client.py b/azure-devops/azure/devops/v5_1/cloud_load_test/cloud_load_test_client.py deleted file mode 100644 index 8ffc3448..00000000 --- a/azure-devops/azure/devops/v5_1/cloud_load_test/cloud_load_test_client.py +++ /dev/null @@ -1,432 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CloudLoadTestClient(Client): - """CloudLoadTest - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(CloudLoadTestClient, 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 = '7ae6d0a6-cda5-44cf-a261-28c392bed25c' - - def create_agent_group(self, group): - """CreateAgentGroup. - :param :class:` ` group: Agent group to be created - :rtype: :class:` ` - """ - content = self._serialize.body(group, 'AgentGroup') - response = self._send(http_method='POST', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='5.1', - content=content) - return self._deserialize('AgentGroup', response) - - def get_agent_groups(self, agent_group_id=None, machine_setup_input=None, machine_access_data=None, outgoing_request_urls=None, agent_group_name=None): - """GetAgentGroups. - :param str agent_group_id: The agent group identifier - :param bool machine_setup_input: - :param bool machine_access_data: - :param bool outgoing_request_urls: - :param str agent_group_name: Name of the agent group - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if machine_setup_input is not None: - query_parameters['machineSetupInput'] = self._serialize.query('machine_setup_input', machine_setup_input, 'bool') - if machine_access_data is not None: - query_parameters['machineAccessData'] = self._serialize.query('machine_access_data', machine_access_data, 'bool') - if outgoing_request_urls is not None: - query_parameters['outgoingRequestUrls'] = self._serialize.query('outgoing_request_urls', outgoing_request_urls, 'bool') - if agent_group_name is not None: - query_parameters['agentGroupName'] = self._serialize.query('agent_group_name', agent_group_name, 'str') - response = self._send(http_method='GET', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def delete_static_agent(self, agent_group_id, agent_name): - """DeleteStaticAgent. - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: str - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='DELETE', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def get_static_agents(self, agent_group_id, agent_name=None): - """GetStaticAgents. - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='GET', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_application(self, application_id): - """GetApplication. - :param str application_id: Filter by APM application identifier. - :rtype: :class:` ` - """ - route_values = {} - if application_id is not None: - route_values['applicationId'] = self._serialize.url('application_id', application_id, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='5.1', - route_values=route_values) - return self._deserialize('Application', response) - - def get_applications(self, type=None): - """GetApplications. - :param str type: Filters the results based on the plugin type. - :rtype: [Application] - """ - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[Application]', self._unwrap_collection(response)) - - def get_counters(self, test_run_id, group_names, include_summary=None): - """GetCounters. - :param str test_run_id: The test run identifier - :param str group_names: Comma separated names of counter groups, such as 'Application', 'Performance' and 'Throughput' - :param bool include_summary: - :rtype: [TestRunCounterInstance] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if group_names is not None: - query_parameters['groupNames'] = self._serialize.query('group_names', group_names, 'str') - if include_summary is not None: - query_parameters['includeSummary'] = self._serialize.query('include_summary', include_summary, 'bool') - response = self._send(http_method='GET', - location_id='29265ea4-b5a5-4b2e-b054-47f5f6f00183', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestRunCounterInstance]', self._unwrap_collection(response)) - - def get_application_counters(self, application_id=None, plugintype=None): - """GetApplicationCounters. - :param str application_id: Filter by APM application identifier. - :param str plugintype: Currently ApplicationInsights is the only available plugin type. - :rtype: [ApplicationCounters] - """ - query_parameters = {} - if application_id is not None: - query_parameters['applicationId'] = self._serialize.query('application_id', application_id, 'str') - if plugintype is not None: - query_parameters['plugintype'] = self._serialize.query('plugintype', plugintype, 'str') - response = self._send(http_method='GET', - location_id='c1275ce9-6d26-4bc6-926b-b846502e812d', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[ApplicationCounters]', self._unwrap_collection(response)) - - def get_counter_samples(self, counter_sample_query_details, test_run_id): - """GetCounterSamples. - :param :class:` ` counter_sample_query_details: - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(counter_sample_query_details, 'VssJsonCollectionWrapper') - response = self._send(http_method='POST', - location_id='bad18480-7193-4518-992a-37289c5bb92d', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('CounterSamplesResult', response) - - def get_load_test_run_errors(self, test_run_id, type=None, sub_type=None, detailed=None): - """GetLoadTestRunErrors. - :param str test_run_id: The test run identifier - :param str type: Filter for the particular type of errors. - :param str sub_type: Filter for a particular subtype of errors. You should not provide error subtype without error type. - :param bool detailed: To include the details of test errors such as messagetext, request, stacktrace, testcasename, scenarioname, and lasterrordate. - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if sub_type is not None: - query_parameters['subType'] = self._serialize.query('sub_type', sub_type, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - response = self._send(http_method='GET', - location_id='b52025a7-3fb4-4283-8825-7079e75bd402', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('LoadTestErrors', response) - - def get_test_run_messages(self, test_run_id): - """GetTestRunMessages. - :param str test_run_id: Id of the test run - :rtype: [TestRunMessage] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='2e7ba122-f522-4205-845b-2d270e59850a', - version='5.1', - route_values=route_values) - return self._deserialize('[TestRunMessage]', self._unwrap_collection(response)) - - def get_plugin(self, type): - """GetPlugin. - :param str type: Currently ApplicationInsights is the only available plugin type. - :rtype: :class:` ` - """ - route_values = {} - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='5.1', - route_values=route_values) - return self._deserialize('ApplicationType', response) - - def get_plugins(self): - """GetPlugins. - :rtype: [ApplicationType] - """ - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='5.1') - return self._deserialize('[ApplicationType]', self._unwrap_collection(response)) - - def get_load_test_result(self, test_run_id): - """GetLoadTestResult. - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='5ed69bd8-4557-4cec-9b75-1ad67d0c257b', - version='5.1', - route_values=route_values) - return self._deserialize('TestResults', response) - - def create_test_definition(self, test_definition): - """CreateTestDefinition. - :param :class:` ` test_definition: Test definition to be created - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='POST', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - content=content) - return self._deserialize('TestDefinition', response) - - def get_test_definition(self, test_definition_id): - """GetTestDefinition. - :param str test_definition_id: The test definition identifier - :rtype: :class:` ` - """ - route_values = {} - if test_definition_id is not None: - route_values['testDefinitionId'] = self._serialize.url('test_definition_id', test_definition_id, 'str') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - route_values=route_values) - return self._deserialize('TestDefinition', response) - - def get_test_definitions(self, from_date=None, to_date=None, top=None): - """GetTestDefinitions. - :param str from_date: Date after which test definitions were created - :param str to_date: Date before which test definitions were crated - :param int top: - :rtype: [TestDefinitionBasic] - """ - query_parameters = {} - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('[TestDefinitionBasic]', self._unwrap_collection(response)) - - def update_test_definition(self, test_definition): - """UpdateTestDefinition. - :param :class:` ` test_definition: - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='PUT', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='5.1', - content=content) - return self._deserialize('TestDefinition', response) - - def create_test_drop(self, web_test_drop): - """CreateTestDrop. - :param :class:` ` web_test_drop: Test drop to be created - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_drop, 'TestDrop') - response = self._send(http_method='POST', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='5.1', - content=content) - return self._deserialize('TestDrop', response) - - def get_test_drop(self, test_drop_id): - """GetTestDrop. - :param str test_drop_id: The test drop identifier - :rtype: :class:` ` - """ - route_values = {} - if test_drop_id is not None: - route_values['testDropId'] = self._serialize.url('test_drop_id', test_drop_id, 'str') - response = self._send(http_method='GET', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='5.1', - route_values=route_values) - return self._deserialize('TestDrop', response) - - def create_test_run(self, web_test_run): - """CreateTestRun. - :param :class:` ` web_test_run: - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_run, 'TestRun') - response = self._send(http_method='POST', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - content=content) - return self._deserialize('TestRun', response) - - def get_test_run(self, test_run_id): - """GetTestRun. - :param str test_run_id: Unique ID of the test run - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - route_values=route_values) - return self._deserialize('TestRun', response) - - def get_test_runs(self, name=None, requested_by=None, status=None, run_type=None, from_date=None, to_date=None, detailed=None, top=None, runsourceidentifier=None, retention_state=None): - """GetTestRuns. - Returns test runs based on the filter specified. Returns all runs of the tenant if there is no filter. - :param str name: Name for the test run. Names are not unique. Test runs with same name are assigned sequential rolling numbers. - :param str requested_by: Filter by the user who requested the test run. Here requestedBy should be the display name of the user. - :param str status: Filter by the test run status. - :param str run_type: Valid values include: null, one of TestRunType, or "*" - :param str from_date: Filter by the test runs that have been modified after the fromDate timestamp. - :param str to_date: Filter by the test runs that have been modified before the toDate timestamp. - :param bool detailed: Include the detailed test run attributes. - :param int top: The maximum number of test runs to return. - :param str runsourceidentifier: - :param str retention_state: - :rtype: object - """ - query_parameters = {} - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if requested_by is not None: - query_parameters['requestedBy'] = self._serialize.query('requested_by', requested_by, 'str') - if status is not None: - query_parameters['status'] = self._serialize.query('status', status, 'str') - if run_type is not None: - query_parameters['runType'] = self._serialize.query('run_type', run_type, 'str') - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if runsourceidentifier is not None: - query_parameters['runsourceidentifier'] = self._serialize.query('runsourceidentifier', runsourceidentifier, 'str') - if retention_state is not None: - query_parameters['retentionState'] = self._serialize.query('retention_state', retention_state, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - query_parameters=query_parameters) - return self._deserialize('object', response) - - def update_test_run(self, web_test_run, test_run_id): - """UpdateTestRun. - :param :class:` ` web_test_run: - :param str test_run_id: - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(web_test_run, 'TestRun') - self._send(http_method='PATCH', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='5.1', - route_values=route_values, - content=content) - diff --git a/azure-devops/azure/devops/v5_1/cloud_load_test/models.py b/azure-devops/azure/devops/v5_1/cloud_load_test/models.py deleted file mode 100644 index df523517..00000000 --- a/azure-devops/azure/devops/v5_1/cloud_load_test/models.py +++ /dev/null @@ -1,1835 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class AgentGroup(Model): - """ - :param created_by: User that created the agent group - :type created_by: :class:`IdentityRef ` - :param creation_time: Time agent group was created - :type creation_time: datetime - :param group_id: Id of the agent group - :type group_id: str - :param group_name: The name of the agent group - :type group_name: str - :param machine_access_data: - :type machine_access_data: list of :class:`AgentGroupAccessData ` - :param machine_configuration: Machine configuration - :type machine_configuration: :class:`WebApiUserLoadTestMachineInput ` - :param tenant_id: Tenant Id - :type tenant_id: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'machine_access_data': {'key': 'machineAccessData', 'type': '[AgentGroupAccessData]'}, - 'machine_configuration': {'key': 'machineConfiguration', 'type': 'WebApiUserLoadTestMachineInput'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'} - } - - def __init__(self, created_by=None, creation_time=None, group_id=None, group_name=None, machine_access_data=None, machine_configuration=None, tenant_id=None): - super(AgentGroup, self).__init__() - self.created_by = created_by - self.creation_time = creation_time - self.group_id = group_id - self.group_name = group_name - self.machine_access_data = machine_access_data - self.machine_configuration = machine_configuration - self.tenant_id = tenant_id - - -class AgentGroupAccessData(Model): - """ - :param details: Type Specific details - :type details: str - :param storage_connection_string: Access string - :type storage_connection_string: str - :param storage_end_point: Endpoint for the service - :type storage_end_point: str - :param storage_name: Identifier for the storage (eg. table name) - :type storage_name: str - :param storage_type: Type of the store (table, queue, blob) - :type storage_type: str - """ - - _attribute_map = { - 'details': {'key': 'details', 'type': 'str'}, - 'storage_connection_string': {'key': 'storageConnectionString', 'type': 'str'}, - 'storage_end_point': {'key': 'storageEndPoint', 'type': 'str'}, - 'storage_name': {'key': 'storageName', 'type': 'str'}, - 'storage_type': {'key': 'storageType', 'type': 'str'} - } - - def __init__(self, details=None, storage_connection_string=None, storage_end_point=None, storage_name=None, storage_type=None): - super(AgentGroupAccessData, self).__init__() - self.details = details - self.storage_connection_string = storage_connection_string - self.storage_end_point = storage_end_point - self.storage_name = storage_name - self.storage_type = storage_type - - -class Application(Model): - """ - :param application_id: Unique Id of the Application Component - :type application_id: str - :param description: Description of the Application component - :type description: str - :param name: The Name of the Application component - :type name: str - :param path: Path identifier of the Application component - :type path: str - :param path_seperator: Character used to separate paths for counters - :type path_seperator: str - :param type: Type identifier of the Application component under test - :type type: str - :param version: Version of the Application Component - :type version: str - """ - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'path_seperator': {'key': 'pathSeperator', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, application_id=None, description=None, name=None, path=None, path_seperator=None, type=None, version=None): - super(Application, self).__init__() - self.application_id = application_id - self.description = description - self.name = name - self.path = path - self.path_seperator = path_seperator - self.type = type - self.version = version - - -class ApplicationCounters(Model): - """ - :param application_id: The unique Id of the Application that the counter belongs - :type application_id: str - :param description: Description of autCounter - :type description: str - :param id: The unique Id for the AutCounter - :type id: str - :param is_default: Whether the autCounter is a default counter or not - :type is_default: bool - :param name: Name of the AutCounter - :type name: str - :param path: The Path of the the autcounter wrt to hierarchy - :type path: str - """ - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, application_id=None, description=None, id=None, is_default=None, name=None, path=None): - super(ApplicationCounters, self).__init__() - self.application_id = application_id - self.description = description - self.id = id - self.is_default = is_default - self.name = name - self.path = path - - -class ApplicationType(Model): - """ - :param action_uri_link: Helper link url - :type action_uri_link: str - :param aut_portal_link: The link that points to aut results site - :type aut_portal_link: str - :param is_enabled: true if application results collection is enabled for this tenant - :type is_enabled: bool - :param max_components_allowed_for_collection: the max no. of application components allowed for collection per run - :type max_components_allowed_for_collection: int - :param max_counters_allowed: The max no. of counters that can be collected per aut - :type max_counters_allowed: int - :param type: Application Type - :type type: str - """ - - _attribute_map = { - 'action_uri_link': {'key': 'actionUriLink', 'type': 'str'}, - 'aut_portal_link': {'key': 'autPortalLink', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'max_components_allowed_for_collection': {'key': 'maxComponentsAllowedForCollection', 'type': 'int'}, - 'max_counters_allowed': {'key': 'maxCountersAllowed', 'type': 'int'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, action_uri_link=None, aut_portal_link=None, is_enabled=None, max_components_allowed_for_collection=None, max_counters_allowed=None, type=None): - super(ApplicationType, self).__init__() - self.action_uri_link = action_uri_link - self.aut_portal_link = aut_portal_link - self.is_enabled = is_enabled - self.max_components_allowed_for_collection = max_components_allowed_for_collection - self.max_counters_allowed = max_counters_allowed - self.type = type - - -class BrowserMix(Model): - """ - :param browser_name: - :type browser_name: str - :param browser_percentage: - :type browser_percentage: float - """ - - _attribute_map = { - 'browser_name': {'key': 'browserName', 'type': 'str'}, - 'browser_percentage': {'key': 'browserPercentage', 'type': 'float'} - } - - def __init__(self, browser_name=None, browser_percentage=None): - super(BrowserMix, self).__init__() - self.browser_name = browser_name - self.browser_percentage = browser_percentage - - -class CltCustomerIntelligenceData(Model): - """ - :param area: - :type area: str - :param feature: - :type feature: str - :param properties: - :type properties: dict - """ - - _attribute_map = { - 'area': {'key': 'area', 'type': 'str'}, - 'feature': {'key': 'feature', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'} - } - - def __init__(self, area=None, feature=None, properties=None): - super(CltCustomerIntelligenceData, self).__init__() - self.area = area - self.feature = feature - self.properties = properties - - -class CounterGroup(Model): - """ - :param group_name: - :type group_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, group_name=None, url=None): - super(CounterGroup, self).__init__() - self.group_name = group_name - self.url = url - - -class CounterInstanceSamples(Model): - """ - :param count: - :type count: int - :param counter_instance_id: - :type counter_instance_id: str - :param next_refresh_time: The time of next refresh - :type next_refresh_time: datetime - :param values: - :type values: list of :class:`CounterSample ` - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'next_refresh_time': {'key': 'nextRefreshTime', 'type': 'iso-8601'}, - 'values': {'key': 'values', 'type': '[CounterSample]'} - } - - def __init__(self, count=None, counter_instance_id=None, next_refresh_time=None, values=None): - super(CounterInstanceSamples, self).__init__() - self.count = count - self.counter_instance_id = counter_instance_id - self.next_refresh_time = next_refresh_time - self.values = values - - -class CounterSample(Model): - """ - :param base_value: - :type base_value: long - :param computed_value: - :type computed_value: float - :param counter_frequency: - :type counter_frequency: long - :param counter_instance_id: - :type counter_instance_id: str - :param counter_type: - :type counter_type: str - :param interval_end_date: - :type interval_end_date: datetime - :param interval_number: - :type interval_number: int - :param raw_value: - :type raw_value: long - :param system_frequency: - :type system_frequency: long - :param time_stamp: - :type time_stamp: long - """ - - _attribute_map = { - 'base_value': {'key': 'baseValue', 'type': 'long'}, - 'computed_value': {'key': 'computedValue', 'type': 'float'}, - 'counter_frequency': {'key': 'counterFrequency', 'type': 'long'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'counter_type': {'key': 'counterType', 'type': 'str'}, - 'interval_end_date': {'key': 'intervalEndDate', 'type': 'iso-8601'}, - 'interval_number': {'key': 'intervalNumber', 'type': 'int'}, - 'raw_value': {'key': 'rawValue', 'type': 'long'}, - 'system_frequency': {'key': 'systemFrequency', 'type': 'long'}, - 'time_stamp': {'key': 'timeStamp', 'type': 'long'} - } - - def __init__(self, base_value=None, computed_value=None, counter_frequency=None, counter_instance_id=None, counter_type=None, interval_end_date=None, interval_number=None, raw_value=None, system_frequency=None, time_stamp=None): - super(CounterSample, self).__init__() - self.base_value = base_value - self.computed_value = computed_value - self.counter_frequency = counter_frequency - self.counter_instance_id = counter_instance_id - self.counter_type = counter_type - self.interval_end_date = interval_end_date - self.interval_number = interval_number - self.raw_value = raw_value - self.system_frequency = system_frequency - self.time_stamp = time_stamp - - -class CounterSampleQueryDetails(Model): - """ - :param counter_instance_id: The instanceId for which samples are required - :type counter_instance_id: str - :param from_interval: - :type from_interval: int - :param to_interval: - :type to_interval: int - """ - - _attribute_map = { - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'from_interval': {'key': 'fromInterval', 'type': 'int'}, - 'to_interval': {'key': 'toInterval', 'type': 'int'} - } - - def __init__(self, counter_instance_id=None, from_interval=None, to_interval=None): - super(CounterSampleQueryDetails, self).__init__() - self.counter_instance_id = counter_instance_id - self.from_interval = from_interval - self.to_interval = to_interval - - -class CounterSamplesResult(Model): - """ - :param count: Count of the samples - :type count: int - :param max_batch_size: Maximum number of samples returned in this object - :type max_batch_size: int - :param total_samples_count: Count of the samples - :type total_samples_count: int - :param values: The result samples - :type values: list of :class:`CounterInstanceSamples ` - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'max_batch_size': {'key': 'maxBatchSize', 'type': 'int'}, - 'total_samples_count': {'key': 'totalSamplesCount', 'type': 'int'}, - 'values': {'key': 'values', 'type': '[CounterInstanceSamples]'} - } - - def __init__(self, count=None, max_batch_size=None, total_samples_count=None, values=None): - super(CounterSamplesResult, self).__init__() - self.count = count - self.max_batch_size = max_batch_size - self.total_samples_count = total_samples_count - self.values = values - - -class Diagnostics(Model): - """ - :param diagnostic_store_connection_string: - :type diagnostic_store_connection_string: str - :param last_modified_time: - :type last_modified_time: datetime - :param relative_path_to_diagnostic_files: - :type relative_path_to_diagnostic_files: str - """ - - _attribute_map = { - 'diagnostic_store_connection_string': {'key': 'diagnosticStoreConnectionString', 'type': 'str'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - 'relative_path_to_diagnostic_files': {'key': 'relativePathToDiagnosticFiles', 'type': 'str'} - } - - def __init__(self, diagnostic_store_connection_string=None, last_modified_time=None, relative_path_to_diagnostic_files=None): - super(Diagnostics, self).__init__() - self.diagnostic_store_connection_string = diagnostic_store_connection_string - self.last_modified_time = last_modified_time - self.relative_path_to_diagnostic_files = relative_path_to_diagnostic_files - - -class DropAccessData(Model): - """ - :param drop_container_url: - :type drop_container_url: str - :param sas_key: The SaSkey to use for the drop. - :type sas_key: str - """ - - _attribute_map = { - 'drop_container_url': {'key': 'dropContainerUrl', 'type': 'str'}, - 'sas_key': {'key': 'sasKey', 'type': 'str'} - } - - def __init__(self, drop_container_url=None, sas_key=None): - super(DropAccessData, self).__init__() - self.drop_container_url = drop_container_url - self.sas_key = sas_key - - -class ErrorDetails(Model): - """ - :param last_error_date: - :type last_error_date: datetime - :param message_text: - :type message_text: str - :param occurrences: - :type occurrences: int - :param request: - :type request: str - :param scenario_name: - :type scenario_name: str - :param stack_trace: - :type stack_trace: str - :param test_case_name: - :type test_case_name: str - """ - - _attribute_map = { - 'last_error_date': {'key': 'lastErrorDate', 'type': 'iso-8601'}, - 'message_text': {'key': 'messageText', 'type': 'str'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'request': {'key': 'request', 'type': 'str'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, - 'test_case_name': {'key': 'testCaseName', 'type': 'str'} - } - - def __init__(self, last_error_date=None, message_text=None, occurrences=None, request=None, scenario_name=None, stack_trace=None, test_case_name=None): - super(ErrorDetails, self).__init__() - self.last_error_date = last_error_date - self.message_text = message_text - self.occurrences = occurrences - self.request = request - self.scenario_name = scenario_name - self.stack_trace = stack_trace - self.test_case_name = test_case_name - - -class GraphSubjectBase(Model): - """ - :param _links: - :type _links: :class:`ReferenceLinks ` - :param descriptor: - :type descriptor: str - :param display_name: - :type display_name: str - :param url: - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityRef(GraphSubjectBase): - """ - :param _links: - :type _links: :class:`ReferenceLinks ` - :param descriptor: - :type descriptor: str - :param display_name: - :type display_name: str - :param url: - :type url: str - :param directory_alias: - :type directory_alias: str - :param id: - :type id: str - :param image_url: - :type image_url: str - :param inactive: - :type inactive: bool - :param is_aad_identity: - :type is_aad_identity: bool - :param is_container: - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class LoadGenerationGeoLocation(Model): - """ - :param location: - :type location: str - :param percentage: - :type percentage: int - """ - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'percentage': {'key': 'percentage', 'type': 'int'} - } - - def __init__(self, location=None, percentage=None): - super(LoadGenerationGeoLocation, self).__init__() - self.location = location - self.percentage = percentage - - -class LoadTest(Model): - """ - """ - - _attribute_map = { - } - - def __init__(self): - super(LoadTest, self).__init__() - - -class LoadTestDefinition(Model): - """ - :param agent_count: - :type agent_count: int - :param browser_mixs: - :type browser_mixs: list of :class:`BrowserMix ` - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_pattern_name: - :type load_pattern_name: str - :param load_test_name: - :type load_test_name: str - :param max_vusers: - :type max_vusers: int - :param run_duration: - :type run_duration: int - :param sampling_rate: - :type sampling_rate: int - :param think_time: - :type think_time: int - :param urls: - :type urls: list of str - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'browser_mixs': {'key': 'browserMixs', 'type': '[BrowserMix]'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_pattern_name': {'key': 'loadPatternName', 'type': 'str'}, - 'load_test_name': {'key': 'loadTestName', 'type': 'str'}, - 'max_vusers': {'key': 'maxVusers', 'type': 'int'}, - 'run_duration': {'key': 'runDuration', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'think_time': {'key': 'thinkTime', 'type': 'int'}, - 'urls': {'key': 'urls', 'type': '[str]'} - } - - def __init__(self, agent_count=None, browser_mixs=None, core_count=None, cores_per_agent=None, load_generation_geo_locations=None, load_pattern_name=None, load_test_name=None, max_vusers=None, run_duration=None, sampling_rate=None, think_time=None, urls=None): - super(LoadTestDefinition, self).__init__() - self.agent_count = agent_count - self.browser_mixs = browser_mixs - self.core_count = core_count - self.cores_per_agent = cores_per_agent - self.load_generation_geo_locations = load_generation_geo_locations - self.load_pattern_name = load_pattern_name - self.load_test_name = load_test_name - self.max_vusers = max_vusers - self.run_duration = run_duration - self.sampling_rate = sampling_rate - self.think_time = think_time - self.urls = urls - - -class LoadTestErrors(Model): - """ - :param count: - :type count: int - :param occurrences: - :type occurrences: int - :param types: - :type types: list of :class:`object ` - :param url: - :type url: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'types': {'key': 'types', 'type': '[object]'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, count=None, occurrences=None, types=None, url=None): - super(LoadTestErrors, self).__init__() - self.count = count - self.occurrences = occurrences - self.types = types - self.url = url - - -class LoadTestRunSettings(Model): - """ - :param agent_count: - :type agent_count: int - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param duration: - :type duration: int - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param sampling_interval: - :type sampling_interval: int - :param warm_up_duration: - :type warm_up_duration: int - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'duration': {'key': 'duration', 'type': 'int'}, - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'} - } - - def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None): - super(LoadTestRunSettings, self).__init__() - self.agent_count = agent_count - self.core_count = core_count - self.cores_per_agent = cores_per_agent - self.duration = duration - self.load_generator_machines_type = load_generator_machines_type - self.sampling_interval = sampling_interval - self.warm_up_duration = warm_up_duration - - -class OverridableRunSettings(Model): - """ - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param static_agent_run_settings: - :type static_agent_run_settings: :class:`StaticAgentRunSetting ` - """ - - _attribute_map = { - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'} - } - - def __init__(self, load_generator_machines_type=None, static_agent_run_settings=None): - super(OverridableRunSettings, self).__init__() - self.load_generator_machines_type = load_generator_machines_type - self.static_agent_run_settings = static_agent_run_settings - - -class PageSummary(Model): - """ - :param average_page_time: - :type average_page_time: float - :param page_url: - :type page_url: str - :param percentage_pages_meeting_goal: - :type percentage_pages_meeting_goal: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_pages: - :type total_pages: int - """ - - _attribute_map = { - 'average_page_time': {'key': 'averagePageTime', 'type': 'float'}, - 'page_url': {'key': 'pageUrl', 'type': 'str'}, - 'percentage_pages_meeting_goal': {'key': 'percentagePagesMeetingGoal', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_pages': {'key': 'totalPages', 'type': 'int'} - } - - def __init__(self, average_page_time=None, page_url=None, percentage_pages_meeting_goal=None, percentile_data=None, scenario_name=None, test_name=None, total_pages=None): - super(PageSummary, self).__init__() - self.average_page_time = average_page_time - self.page_url = page_url - self.percentage_pages_meeting_goal = percentage_pages_meeting_goal - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_pages = total_pages - - -class ReferenceLinks(Model): - """ - :param links: - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class RequestSummary(Model): - """ - :param average_response_time: - :type average_response_time: float - :param failed_requests: - :type failed_requests: int - :param passed_requests: - :type passed_requests: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param requests_per_sec: - :type requests_per_sec: float - :param request_url: - :type request_url: str - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_requests: - :type total_requests: int - """ - - _attribute_map = { - 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, - 'failed_requests': {'key': 'failedRequests', 'type': 'int'}, - 'passed_requests': {'key': 'passedRequests', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'requests_per_sec': {'key': 'requestsPerSec', 'type': 'float'}, - 'request_url': {'key': 'requestUrl', 'type': 'str'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_requests': {'key': 'totalRequests', 'type': 'int'} - } - - def __init__(self, average_response_time=None, failed_requests=None, passed_requests=None, percentile_data=None, requests_per_sec=None, request_url=None, scenario_name=None, test_name=None, total_requests=None): - super(RequestSummary, self).__init__() - self.average_response_time = average_response_time - self.failed_requests = failed_requests - self.passed_requests = passed_requests - self.percentile_data = percentile_data - self.requests_per_sec = requests_per_sec - self.request_url = request_url - self.scenario_name = scenario_name - self.test_name = test_name - self.total_requests = total_requests - - -class ScenarioSummary(Model): - """ - :param max_user_load: - :type max_user_load: int - :param min_user_load: - :type min_user_load: int - :param scenario_name: - :type scenario_name: str - """ - - _attribute_map = { - 'max_user_load': {'key': 'maxUserLoad', 'type': 'int'}, - 'min_user_load': {'key': 'minUserLoad', 'type': 'int'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'} - } - - def __init__(self, max_user_load=None, min_user_load=None, scenario_name=None): - super(ScenarioSummary, self).__init__() - self.max_user_load = max_user_load - self.min_user_load = min_user_load - self.scenario_name = scenario_name - - -class StaticAgentRunSetting(Model): - """ - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param static_agent_group_name: - :type static_agent_group_name: str - """ - - _attribute_map = { - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'static_agent_group_name': {'key': 'staticAgentGroupName', 'type': 'str'} - } - - def __init__(self, load_generator_machines_type=None, static_agent_group_name=None): - super(StaticAgentRunSetting, self).__init__() - self.load_generator_machines_type = load_generator_machines_type - self.static_agent_group_name = static_agent_group_name - - -class SubType(Model): - """ - :param count: - :type count: int - :param error_detail_list: - :type error_detail_list: list of :class:`ErrorDetails ` - :param occurrences: - :type occurrences: int - :param sub_type_name: - :type sub_type_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'error_detail_list': {'key': 'errorDetailList', 'type': '[ErrorDetails]'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'sub_type_name': {'key': 'subTypeName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, count=None, error_detail_list=None, occurrences=None, sub_type_name=None, url=None): - super(SubType, self).__init__() - self.count = count - self.error_detail_list = error_detail_list - self.occurrences = occurrences - self.sub_type_name = sub_type_name - self.url = url - - -class SummaryPercentileData(Model): - """ - :param percentile: - :type percentile: int - :param percentile_value: - :type percentile_value: float - """ - - _attribute_map = { - 'percentile': {'key': 'percentile', 'type': 'int'}, - 'percentile_value': {'key': 'percentileValue', 'type': 'float'} - } - - def __init__(self, percentile=None, percentile_value=None): - super(SummaryPercentileData, self).__init__() - self.percentile = percentile - self.percentile_value = percentile_value - - -class TenantDetails(Model): - """ - :param access_details: Access details - :type access_details: list of :class:`AgentGroupAccessData ` - :param id: Tenant Id - :type id: str - :param static_machines: Static machines configured for local runs - :type static_machines: list of :class:`WebApiTestMachine ` - :param user_load_agent_input: - :type user_load_agent_input: :class:`WebApiUserLoadTestMachineInput ` - :param user_load_agent_resources_uri: - :type user_load_agent_resources_uri: str - :param valid_geo_locations: The list of valid geo-lcations for tenant - :type valid_geo_locations: list of str - """ - - _attribute_map = { - 'access_details': {'key': 'accessDetails', 'type': '[AgentGroupAccessData]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'static_machines': {'key': 'staticMachines', 'type': '[WebApiTestMachine]'}, - 'user_load_agent_input': {'key': 'userLoadAgentInput', 'type': 'WebApiUserLoadTestMachineInput'}, - 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, - 'valid_geo_locations': {'key': 'validGeoLocations', 'type': '[str]'} - } - - def __init__(self, access_details=None, id=None, static_machines=None, user_load_agent_input=None, user_load_agent_resources_uri=None, valid_geo_locations=None): - super(TenantDetails, self).__init__() - self.access_details = access_details - self.id = id - self.static_machines = static_machines - self.user_load_agent_input = user_load_agent_input - self.user_load_agent_resources_uri = user_load_agent_resources_uri - self.valid_geo_locations = valid_geo_locations - - -class TestDefinitionBasic(Model): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_by: - :type created_by: :class:`IdentityRef ` - :param created_date: - :type created_date: datetime - :param id: - :type id: str - :param last_modified_by: - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_date: - :type last_modified_date: datetime - :param load_test_type: - :type load_test_type: object - :param name: - :type name: str - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, - 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None): - super(TestDefinitionBasic, self).__init__() - self.access_data = access_data - self.created_by = created_by - self.created_date = created_date - self.id = id - self.last_modified_by = last_modified_by - self.last_modified_date = last_modified_date - self.load_test_type = load_test_type - self.name = name - - -class TestDrop(Model): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_date: Time at which the drop is created - :type created_date: datetime - :param drop_type: Identifies the type of drop - :type drop_type: str - :param id: Drop Id - :type id: str - :param load_test_definition: LoadTest definition of the run for which testdrop is created - :type load_test_definition: :class:`LoadTestDefinition ` - :param test_run_id: Test Run Id - :type test_run_id: str - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'drop_type': {'key': 'dropType', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_test_definition': {'key': 'loadTestDefinition', 'type': 'LoadTestDefinition'}, - 'test_run_id': {'key': 'testRunId', 'type': 'str'} - } - - def __init__(self, access_data=None, created_date=None, drop_type=None, id=None, load_test_definition=None, test_run_id=None): - super(TestDrop, self).__init__() - self.access_data = access_data - self.created_date = created_date - self.drop_type = drop_type - self.id = id - self.load_test_definition = load_test_definition - self.test_run_id = test_run_id - - -class TestDropRef(Model): - """ - An abstracted reference to some other resource. This class is used to provide the load test data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. - - :param id: Id of the resource - :type id: str - :param url: Full http link to the resource - :type url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, id=None, url=None): - super(TestDropRef, self).__init__() - self.id = id - self.url = url - - -class TestResults(Model): - """ - :param cloud_load_test_solution_url: The uri to the test run results file. - :type cloud_load_test_solution_url: str - :param counter_groups: - :type counter_groups: list of :class:`CounterGroup ` - :param diagnostics: The object contains diagnostic details - :type diagnostics: :class:`Diagnostics ` - :param results_url: The uri to the test run results file. - :type results_url: str - """ - - _attribute_map = { - 'cloud_load_test_solution_url': {'key': 'cloudLoadTestSolutionUrl', 'type': 'str'}, - 'counter_groups': {'key': 'counterGroups', 'type': '[CounterGroup]'}, - 'diagnostics': {'key': 'diagnostics', 'type': 'Diagnostics'}, - 'results_url': {'key': 'resultsUrl', 'type': 'str'} - } - - def __init__(self, cloud_load_test_solution_url=None, counter_groups=None, diagnostics=None, results_url=None): - super(TestResults, self).__init__() - self.cloud_load_test_solution_url = cloud_load_test_solution_url - self.counter_groups = counter_groups - self.diagnostics = diagnostics - self.results_url = results_url - - -class TestResultsSummary(Model): - """ - :param overall_page_summary: - :type overall_page_summary: :class:`PageSummary ` - :param overall_request_summary: - :type overall_request_summary: :class:`RequestSummary ` - :param overall_scenario_summary: - :type overall_scenario_summary: :class:`ScenarioSummary ` - :param overall_test_summary: - :type overall_test_summary: :class:`TestSummary ` - :param overall_transaction_summary: - :type overall_transaction_summary: :class:`TransactionSummary ` - :param top_slow_pages: - :type top_slow_pages: list of :class:`PageSummary ` - :param top_slow_requests: - :type top_slow_requests: list of :class:`RequestSummary ` - :param top_slow_tests: - :type top_slow_tests: list of :class:`TestSummary ` - :param top_slow_transactions: - :type top_slow_transactions: list of :class:`TransactionSummary ` - """ - - _attribute_map = { - 'overall_page_summary': {'key': 'overallPageSummary', 'type': 'PageSummary'}, - 'overall_request_summary': {'key': 'overallRequestSummary', 'type': 'RequestSummary'}, - 'overall_scenario_summary': {'key': 'overallScenarioSummary', 'type': 'ScenarioSummary'}, - 'overall_test_summary': {'key': 'overallTestSummary', 'type': 'TestSummary'}, - 'overall_transaction_summary': {'key': 'overallTransactionSummary', 'type': 'TransactionSummary'}, - 'top_slow_pages': {'key': 'topSlowPages', 'type': '[PageSummary]'}, - 'top_slow_requests': {'key': 'topSlowRequests', 'type': '[RequestSummary]'}, - 'top_slow_tests': {'key': 'topSlowTests', 'type': '[TestSummary]'}, - 'top_slow_transactions': {'key': 'topSlowTransactions', 'type': '[TransactionSummary]'} - } - - def __init__(self, overall_page_summary=None, overall_request_summary=None, overall_scenario_summary=None, overall_test_summary=None, overall_transaction_summary=None, top_slow_pages=None, top_slow_requests=None, top_slow_tests=None, top_slow_transactions=None): - super(TestResultsSummary, self).__init__() - self.overall_page_summary = overall_page_summary - self.overall_request_summary = overall_request_summary - self.overall_scenario_summary = overall_scenario_summary - self.overall_test_summary = overall_test_summary - self.overall_transaction_summary = overall_transaction_summary - self.top_slow_pages = top_slow_pages - self.top_slow_requests = top_slow_requests - self.top_slow_tests = top_slow_tests - self.top_slow_transactions = top_slow_transactions - - -class TestRunAbortMessage(Model): - """ - :param action: - :type action: str - :param cause: - :type cause: str - :param details: - :type details: list of str - :param logged_date: - :type logged_date: datetime - :param source: - :type source: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'cause': {'key': 'cause', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[str]'}, - 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, - 'source': {'key': 'source', 'type': 'str'} - } - - def __init__(self, action=None, cause=None, details=None, logged_date=None, source=None): - super(TestRunAbortMessage, self).__init__() - self.action = action - self.cause = cause - self.details = details - self.logged_date = logged_date - self.source = source - - -class TestRunBasic(Model): - """ - :param created_by: Vss User identity who created the test run. - :type created_by: :class:`IdentityRef ` - :param created_date: Gets the creation time of the test run - :type created_date: datetime - :param deleted_by: Vss User identity who deleted the test run. - :type deleted_by: :class:`IdentityRef ` - :param deleted_date: Gets the deleted time of the test run - :type deleted_date: datetime - :param finished_date: Gets the finish time of the test run - :type finished_date: datetime - :param id: Gets the unique identifier for the test run definition. - :type id: str - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_file_name: Gets the load test file of the test run definition. - :type load_test_file_name: str - :param name: Gets the name of the test run definition. - :type name: str - :param run_number: Gets the number of the test run (unique within a tenant) - :type run_number: int - :param run_source: Test run source like Ibiza,VSO,BuildVNext, etc. - :type run_source: str - :param run_specific_details: Run specific details. - :type run_specific_details: :class:`LoadTestRunDetails ` - :param run_type: Run type like VisualStudioLoadTest or JMeterLoadTest - :type run_type: object - :param state: State of the test run. - :type state: object - :param url: - :type url: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, - 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, - 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'run_source': {'key': 'runSource', 'type': 'str'}, - 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, - 'run_type': {'key': 'runType', 'type': 'object'}, - 'state': {'key': 'state', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None): - super(TestRunBasic, self).__init__() - self.created_by = created_by - self.created_date = created_date - self.deleted_by = deleted_by - self.deleted_date = deleted_date - self.finished_date = finished_date - self.id = id - self.load_generation_geo_locations = load_generation_geo_locations - self.load_test_file_name = load_test_file_name - self.name = name - self.run_number = run_number - self.run_source = run_source - self.run_specific_details = run_specific_details - self.run_type = run_type - self.state = state - self.url = url - - -class TestRunCounterInstance(Model): - """ - :param category_name: CategoryName for this counter - :type category_name: str - :param counter_instance_id: Combination of source and SourceInstanceId - :type counter_instance_id: str - :param counter_name: Name of the counter Eg: Errors/Sec - :type counter_name: str - :param counter_units: Units for this counter. Empty string for mere numbers - :type counter_units: str - :param instance_name: Instance Name Eg: _Avg,_Total etc - :type instance_name: str - :param is_preselected_counter: true if this counter instance is a default counter - :type is_preselected_counter: bool - :param machine_name: Machine from where this counter was collected Used in case of machine specific counters like - Agent CPU and memory etc. - :type machine_name: str - :param part_of_counter_groups: Counter Groups to which this counter instance is part of - :type part_of_counter_groups: list of str - :param summary_data: Summary result for this counter instance - :type summary_data: :class:`WebInstanceSummaryData ` - :param unique_name: A unique name for this counter instance - :type unique_name: str - """ - - _attribute_map = { - 'category_name': {'key': 'categoryName', 'type': 'str'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'counter_name': {'key': 'counterName', 'type': 'str'}, - 'counter_units': {'key': 'counterUnits', 'type': 'str'}, - 'instance_name': {'key': 'instanceName', 'type': 'str'}, - 'is_preselected_counter': {'key': 'isPreselectedCounter', 'type': 'bool'}, - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'part_of_counter_groups': {'key': 'partOfCounterGroups', 'type': '[str]'}, - 'summary_data': {'key': 'summaryData', 'type': 'WebInstanceSummaryData'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, category_name=None, counter_instance_id=None, counter_name=None, counter_units=None, instance_name=None, is_preselected_counter=None, machine_name=None, part_of_counter_groups=None, summary_data=None, unique_name=None): - super(TestRunCounterInstance, self).__init__() - self.category_name = category_name - self.counter_instance_id = counter_instance_id - self.counter_name = counter_name - self.counter_units = counter_units - self.instance_name = instance_name - self.is_preselected_counter = is_preselected_counter - self.machine_name = machine_name - self.part_of_counter_groups = part_of_counter_groups - self.summary_data = summary_data - self.unique_name = unique_name - - -class TestRunMessage(Model): - """ - :param agent_id: Agent Id - :type agent_id: str - :param error_code: - :type error_code: str - :param logged_date: - :type logged_date: datetime - :param message: - :type message: str - :param message_id: Message Id - :type message_id: str - :param message_source: - :type message_source: object - :param message_type: - :type message_type: object - :param test_run_id: Id of the test run - :type test_run_id: str - :param url: - :type url: str - """ - - _attribute_map = { - 'agent_id': {'key': 'agentId', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'message_source': {'key': 'messageSource', 'type': 'object'}, - 'message_type': {'key': 'messageType', 'type': 'object'}, - 'test_run_id': {'key': 'testRunId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, agent_id=None, error_code=None, logged_date=None, message=None, message_id=None, message_source=None, message_type=None, test_run_id=None, url=None): - super(TestRunMessage, self).__init__() - self.agent_id = agent_id - self.error_code = error_code - self.logged_date = logged_date - self.message = message - self.message_id = message_id - self.message_source = message_source - self.message_type = message_type - self.test_run_id = test_run_id - self.url = url - - -class TestSettings(Model): - """ - :param cleanup_command: Cleanup command - :type cleanup_command: str - :param host_process_platform: Processor Architecture chosen - :type host_process_platform: object - :param setup_command: Setup command - :type setup_command: str - """ - - _attribute_map = { - 'cleanup_command': {'key': 'cleanupCommand', 'type': 'str'}, - 'host_process_platform': {'key': 'hostProcessPlatform', 'type': 'object'}, - 'setup_command': {'key': 'setupCommand', 'type': 'str'} - } - - def __init__(self, cleanup_command=None, host_process_platform=None, setup_command=None): - super(TestSettings, self).__init__() - self.cleanup_command = cleanup_command - self.host_process_platform = host_process_platform - self.setup_command = setup_command - - -class TestSummary(Model): - """ - :param average_test_time: - :type average_test_time: float - :param failed_tests: - :type failed_tests: int - :param passed_tests: - :type passed_tests: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_tests: - :type total_tests: int - """ - - _attribute_map = { - 'average_test_time': {'key': 'averageTestTime', 'type': 'float'}, - 'failed_tests': {'key': 'failedTests', 'type': 'int'}, - 'passed_tests': {'key': 'passedTests', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_tests': {'key': 'totalTests', 'type': 'int'} - } - - def __init__(self, average_test_time=None, failed_tests=None, passed_tests=None, percentile_data=None, scenario_name=None, test_name=None, total_tests=None): - super(TestSummary, self).__init__() - self.average_test_time = average_test_time - self.failed_tests = failed_tests - self.passed_tests = passed_tests - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_tests = total_tests - - -class TransactionSummary(Model): - """ - :param average_response_time: - :type average_response_time: float - :param average_transaction_time: - :type average_transaction_time: float - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_transactions: - :type total_transactions: int - :param transaction_name: - :type transaction_name: str - """ - - _attribute_map = { - 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, - 'average_transaction_time': {'key': 'averageTransactionTime', 'type': 'float'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_transactions': {'key': 'totalTransactions', 'type': 'int'}, - 'transaction_name': {'key': 'transactionName', 'type': 'str'} - } - - def __init__(self, average_response_time=None, average_transaction_time=None, percentile_data=None, scenario_name=None, test_name=None, total_transactions=None, transaction_name=None): - super(TransactionSummary, self).__init__() - self.average_response_time = average_response_time - self.average_transaction_time = average_transaction_time - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_transactions = total_transactions - self.transaction_name = transaction_name - - -class WebApiLoadTestMachineInput(Model): - """ - :param machine_group_id: - :type machine_group_id: str - :param machine_type: - :type machine_type: object - :param setup_configuration: - :type setup_configuration: :class:`WebApiSetupParamaters ` - :param supported_run_types: - :type supported_run_types: list of TestRunType - """ - - _attribute_map = { - 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, - 'machine_type': {'key': 'machineType', 'type': 'object'}, - 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, - 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[object]'} - } - - def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None): - super(WebApiLoadTestMachineInput, self).__init__() - self.machine_group_id = machine_group_id - self.machine_type = machine_type - self.setup_configuration = setup_configuration - self.supported_run_types = supported_run_types - - -class WebApiSetupParamaters(Model): - """ - :param configurations: - :type configurations: dict - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'} - } - - def __init__(self, configurations=None): - super(WebApiSetupParamaters, self).__init__() - self.configurations = configurations - - -class WebApiTestMachine(Model): - """ - :param last_heart_beat: - :type last_heart_beat: datetime - :param machine_name: - :type machine_name: str - :param status: - :type status: str - """ - - _attribute_map = { - 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'iso-8601'}, - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'} - } - - def __init__(self, last_heart_beat=None, machine_name=None, status=None): - super(WebApiTestMachine, self).__init__() - self.last_heart_beat = last_heart_beat - self.machine_name = machine_name - self.status = status - - -class WebApiUserLoadTestMachineInput(WebApiLoadTestMachineInput): - """ - This can eventually evolve as the ultimate JSON file that user can use to configure their machine(s) against CLT - - :param machine_group_id: - :type machine_group_id: str - :param machine_type: - :type machine_type: object - :param setup_configuration: - :type setup_configuration: :class:`WebApiSetupParamaters ` - :param supported_run_types: - :type supported_run_types: list of TestRunType - :param agent_group_name: - :type agent_group_name: str - :param tenant_id: - :type tenant_id: str - :param user_load_agent_resources_uri: - :type user_load_agent_resources_uri: str - :param vsts_account_uri: - :type vsts_account_uri: str - """ - - _attribute_map = { - 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, - 'machine_type': {'key': 'machineType', 'type': 'object'}, - 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, - 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[TestRunType]'}, - 'agent_group_name': {'key': 'agentGroupName', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, - 'vsts_account_uri': {'key': 'vstsAccountUri', 'type': 'str'} - } - - def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None, agent_group_name=None, tenant_id=None, user_load_agent_resources_uri=None, vsts_account_uri=None): - super(WebApiUserLoadTestMachineInput, self).__init__(machine_group_id=machine_group_id, machine_type=machine_type, setup_configuration=setup_configuration, supported_run_types=supported_run_types) - self.agent_group_name = agent_group_name - self.tenant_id = tenant_id - self.user_load_agent_resources_uri = user_load_agent_resources_uri - self.vsts_account_uri = vsts_account_uri - - -class WebInstanceSummaryData(Model): - """ - :param average: - :type average: float - :param max: - :type max: float - :param min: - :type min: float - """ - - _attribute_map = { - 'average': {'key': 'average', 'type': 'float'}, - 'max': {'key': 'max', 'type': 'float'}, - 'min': {'key': 'min', 'type': 'float'} - } - - def __init__(self, average=None, max=None, min=None): - super(WebInstanceSummaryData, self).__init__() - self.average = average - self.max = max - self.min = min - - -class LoadTestRunDetails(LoadTestRunSettings): - """ - :param agent_count: - :type agent_count: int - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param duration: - :type duration: int - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param sampling_interval: - :type sampling_interval: int - :param warm_up_duration: - :type warm_up_duration: int - :param virtual_user_count: - :type virtual_user_count: int - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'duration': {'key': 'duration', 'type': 'int'}, - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'}, - 'virtual_user_count': {'key': 'virtualUserCount', 'type': 'int'} - } - - def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None, virtual_user_count=None): - super(LoadTestRunDetails, self).__init__(agent_count=agent_count, core_count=core_count, cores_per_agent=cores_per_agent, duration=duration, load_generator_machines_type=load_generator_machines_type, sampling_interval=sampling_interval, warm_up_duration=warm_up_duration) - self.virtual_user_count = virtual_user_count - - -class TestDefinition(TestDefinitionBasic): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_by: - :type created_by: :class:`IdentityRef ` - :param created_date: - :type created_date: datetime - :param id: - :type id: str - :param last_modified_by: - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_date: - :type last_modified_date: datetime - :param load_test_type: - :type load_test_type: object - :param name: - :type name: str - :param description: - :type description: str - :param load_generation_geo_locations: Geo location from where load is generated - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_definition_source: - :type load_test_definition_source: str - :param run_settings: - :type run_settings: :class:`LoadTestRunSettings ` - :param static_agent_run_settings: - :type static_agent_run_settings: :class:`StaticAgentRunSetting ` - :param test_details: - :type test_details: :class:`LoadTest ` - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, - 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_definition_source': {'key': 'loadTestDefinitionSource', 'type': 'str'}, - 'run_settings': {'key': 'runSettings', 'type': 'LoadTestRunSettings'}, - 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'}, - 'test_details': {'key': 'testDetails', 'type': 'LoadTest'} - } - - def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None, description=None, load_generation_geo_locations=None, load_test_definition_source=None, run_settings=None, static_agent_run_settings=None, test_details=None): - super(TestDefinition, self).__init__(access_data=access_data, created_by=created_by, created_date=created_date, id=id, last_modified_by=last_modified_by, last_modified_date=last_modified_date, load_test_type=load_test_type, name=name) - self.description = description - self.load_generation_geo_locations = load_generation_geo_locations - self.load_test_definition_source = load_test_definition_source - self.run_settings = run_settings - self.static_agent_run_settings = static_agent_run_settings - self.test_details = test_details - - -class TestRun(TestRunBasic): - """ - :param created_by: Vss User identity who created the test run. - :type created_by: :class:`IdentityRef ` - :param created_date: Gets the creation time of the test run - :type created_date: datetime - :param deleted_by: Vss User identity who deleted the test run. - :type deleted_by: :class:`IdentityRef ` - :param deleted_date: Gets the deleted time of the test run - :type deleted_date: datetime - :param finished_date: Gets the finish time of the test run - :type finished_date: datetime - :param id: Gets the unique identifier for the test run definition. - :type id: str - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_file_name: Gets the load test file of the test run definition. - :type load_test_file_name: str - :param name: Gets the name of the test run definition. - :type name: str - :param run_number: Gets the number of the test run (unique within a tenant) - :type run_number: int - :param run_source: Test run source like Ibiza,VSO,BuildVNext, etc. - :type run_source: str - :param run_specific_details: Run specific details. - :type run_specific_details: :class:`LoadTestRunDetails ` - :param run_type: Run type like VisualStudioLoadTest or JMeterLoadTest - :type run_type: object - :param state: State of the test run. - :type state: object - :param url: - :type url: str - :param abort_message: Message associated to state change, contains details of infrastructure error. - :type abort_message: :class:`TestRunAbortMessage ` - :param aut_initialization_error: true if aut counter collection could not start due to some critical error for this run. - :type aut_initialization_error: bool - :param chargeable: Whether run is chargeable or not Its chargeable once we configured agent and sent start signal - :type chargeable: bool - :param charged_vUserminutes: Whether run is chargeable or not The Charged VUser Minutes for the RUN - :type charged_vUserminutes: int - :param description: Test run description. - :type description: str - :param execution_finished_date: Gets the time when the test run execution finished - :type execution_finished_date: datetime - :param execution_started_date: Gets the time when the test run warmup finished(if warmup was specified) and load test started - :type execution_started_date: datetime - :param queued_date: Gets the time when the test run was queued - :type queued_date: datetime - :param retention_state: Retention state of the run - :type retention_state: object - :param run_source_identifier: - :type run_source_identifier: str - :param run_source_url: The uri to the run source. - :type run_source_url: str - :param started_by: Vss User identity who created the test run. - :type started_by: :class:`IdentityRef ` - :param started_date: When the test run started execution. - :type started_date: datetime - :param stopped_by: Vss User identity who created the test run. - :type stopped_by: :class:`IdentityRef ` - :param sub_state: SubState is more granular description of the state - :type sub_state: object - :param supersede_run_settings: - :type supersede_run_settings: :class:`OverridableRunSettings ` - :param test_drop: Drop associated with this test run - :type test_drop: :class:`TestDropRef ` - :param test_settings: The Test settings for the test run - :type test_settings: :class:`TestSettings ` - :param warm_up_started_date: Gets the time when the test run warmup started - :type warm_up_started_date: datetime - :param web_result_url: The uri to the vso detailed result. - :type web_result_url: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, - 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, - 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'run_source': {'key': 'runSource', 'type': 'str'}, - 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, - 'run_type': {'key': 'runType', 'type': 'object'}, - 'state': {'key': 'state', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - 'abort_message': {'key': 'abortMessage', 'type': 'TestRunAbortMessage'}, - 'aut_initialization_error': {'key': 'autInitializationError', 'type': 'bool'}, - 'chargeable': {'key': 'chargeable', 'type': 'bool'}, - 'charged_vUserminutes': {'key': 'chargedVUserminutes', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'execution_finished_date': {'key': 'executionFinishedDate', 'type': 'iso-8601'}, - 'execution_started_date': {'key': 'executionStartedDate', 'type': 'iso-8601'}, - 'queued_date': {'key': 'queuedDate', 'type': 'iso-8601'}, - 'retention_state': {'key': 'retentionState', 'type': 'object'}, - 'run_source_identifier': {'key': 'runSourceIdentifier', 'type': 'str'}, - 'run_source_url': {'key': 'runSourceUrl', 'type': 'str'}, - 'started_by': {'key': 'startedBy', 'type': 'IdentityRef'}, - 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, - 'stopped_by': {'key': 'stoppedBy', 'type': 'IdentityRef'}, - 'sub_state': {'key': 'subState', 'type': 'object'}, - 'supersede_run_settings': {'key': 'supersedeRunSettings', 'type': 'OverridableRunSettings'}, - 'test_drop': {'key': 'testDrop', 'type': 'TestDropRef'}, - 'test_settings': {'key': 'testSettings', 'type': 'TestSettings'}, - 'warm_up_started_date': {'key': 'warmUpStartedDate', 'type': 'iso-8601'}, - 'web_result_url': {'key': 'webResultUrl', 'type': 'str'} - } - - def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None, abort_message=None, aut_initialization_error=None, chargeable=None, charged_vUserminutes=None, description=None, execution_finished_date=None, execution_started_date=None, queued_date=None, retention_state=None, run_source_identifier=None, run_source_url=None, started_by=None, started_date=None, stopped_by=None, sub_state=None, supersede_run_settings=None, test_drop=None, test_settings=None, warm_up_started_date=None, web_result_url=None): - super(TestRun, self).__init__(created_by=created_by, created_date=created_date, deleted_by=deleted_by, deleted_date=deleted_date, finished_date=finished_date, id=id, load_generation_geo_locations=load_generation_geo_locations, load_test_file_name=load_test_file_name, name=name, run_number=run_number, run_source=run_source, run_specific_details=run_specific_details, run_type=run_type, state=state, url=url) - self.abort_message = abort_message - self.aut_initialization_error = aut_initialization_error - self.chargeable = chargeable - self.charged_vUserminutes = charged_vUserminutes - self.description = description - self.execution_finished_date = execution_finished_date - self.execution_started_date = execution_started_date - self.queued_date = queued_date - self.retention_state = retention_state - self.run_source_identifier = run_source_identifier - self.run_source_url = run_source_url - self.started_by = started_by - self.started_date = started_date - self.stopped_by = stopped_by - self.sub_state = sub_state - self.supersede_run_settings = supersede_run_settings - self.test_drop = test_drop - self.test_settings = test_settings - self.warm_up_started_date = warm_up_started_date - self.web_result_url = web_result_url - - -__all__ = [ - 'AgentGroup', - 'AgentGroupAccessData', - 'Application', - 'ApplicationCounters', - 'ApplicationType', - 'BrowserMix', - 'CltCustomerIntelligenceData', - 'CounterGroup', - 'CounterInstanceSamples', - 'CounterSample', - 'CounterSampleQueryDetails', - 'CounterSamplesResult', - 'Diagnostics', - 'DropAccessData', - 'ErrorDetails', - 'GraphSubjectBase', - 'IdentityRef', - 'LoadGenerationGeoLocation', - 'LoadTest', - 'LoadTestDefinition', - 'LoadTestErrors', - 'LoadTestRunSettings', - 'OverridableRunSettings', - 'PageSummary', - 'ReferenceLinks', - 'RequestSummary', - 'ScenarioSummary', - 'StaticAgentRunSetting', - 'SubType', - 'SummaryPercentileData', - 'TenantDetails', - 'TestDefinitionBasic', - 'TestDrop', - 'TestDropRef', - 'TestResults', - 'TestResultsSummary', - 'TestRunAbortMessage', - 'TestRunBasic', - 'TestRunCounterInstance', - 'TestRunMessage', - 'TestSettings', - 'TestSummary', - 'TransactionSummary', - 'WebApiLoadTestMachineInput', - 'WebApiSetupParamaters', - 'WebApiTestMachine', - 'WebApiUserLoadTestMachineInput', - 'WebInstanceSummaryData', - 'LoadTestRunDetails', - 'TestDefinition', - 'TestRun', -] diff --git a/azure-devops/azure/devops/v5_1/feed_token/feed_token_client.py b/azure-devops/azure/devops/v5_1/feed_token/feed_token_client.py deleted file mode 100644 index 2dd3a52b..00000000 --- a/azure-devops/azure/devops/v5_1/feed_token/feed_token_client.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 FeedTokenClient(Client): - """FeedToken - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(FeedTokenClient, 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 = 'cdeb6c7d-6b25-4d6f-b664-c2e3ede202e8' - - def get_personal_access_token(self, feed_name=None): - """GetPersonalAccessToken. - [Preview API] Get a time-limited session token representing the current user, with permissions scoped to the read/write of Artifacts. - :param str feed_name: - :rtype: :class:` ` - """ - route_values = {} - if feed_name is not None: - route_values['feedName'] = self._serialize.url('feed_name', feed_name, 'str') - response = self._send(http_method='GET', - location_id='dfdb7ad7-3d8e-4907-911e-19b4a8330550', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('FeedSessionToken', response) - diff --git a/azure-devops/azure/devops/v5_1/feed_token/models.py b/azure-devops/azure/devops/v5_1/feed_token/models.py deleted file mode 100644 index 43b24b24..00000000 --- a/azure-devops/azure/devops/v5_1/feed_token/models.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class FeedSessionToken(Model): - """ - A cut-down version of SessionToken that just has what FeedSessionTokenController needs to serve the UI and which actually generates a TypeScript type for the UI to use - - :param token: - :type token: str - :param valid_to: - :type valid_to: datetime - """ - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} - } - - def __init__(self, token=None, valid_to=None): - super(FeedSessionToken, self).__init__() - self.token = token - self.valid_to = valid_to - - -__all__ = [ - 'FeedSessionToken', -] diff --git a/azure-devops/azure/devops/v5_1/git/git_client.py b/azure-devops/azure/devops/v5_1/git/git_client.py deleted file mode 100644 index c456406a..00000000 --- a/azure-devops/azure/devops/v5_1/git/git_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 - -from msrest.universal_http import ClientRequest -from .git_client_base import GitClientBase - - -class GitClient(GitClientBase): - """Git - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(GitClient, self).__init__(base_url, creds) - - def get_vsts_info(self, relative_remote_url): - url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') - request = ClientRequest(method='GET', url=url) - headers = {'Accept': 'application/json'} - if self._suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - if self._force_msa_pass_through: - headers['X-VSS-ForceMsaPassThrough'] = 'true' - response = self._send_request(request, headers) - return self._deserialize('VstsInfo', response) - - @staticmethod - def get_vsts_info_by_remote_url(remote_url, credentials, - suppress_fedauth_redirect=True, - force_msa_pass_through=True): - request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info') - headers = {'Accept': 'application/json'} - if suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - if force_msa_pass_through: - headers['X-VSS-ForceMsaPassThrough'] = 'true' - git_client = GitClient(base_url=remote_url, creds=credentials) - response = git_client._send_request(request, headers) - return git_client._deserialize('VstsInfo', response) diff --git a/azure-devops/azure/devops/v5_1/licensing/__init__.py b/azure-devops/azure/devops/v5_1/licensing/__init__.py deleted file mode 100644 index 4ecffe0c..00000000 --- a/azure-devops/azure/devops/v5_1/licensing/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .licensing_client import LicensingClient - -__all__ = [ - 'AccountEntitlement', - 'AccountEntitlementUpdateModel', - 'AccountLicenseExtensionUsage', - 'AccountLicenseUsage', - 'AccountRights', - 'AccountUserLicense', - 'ClientRightsContainer', - 'ExtensionAssignment', - 'ExtensionAssignmentDetails', - 'ExtensionLicenseData', - 'ExtensionOperationResult', - 'ExtensionRightsResult', - 'ExtensionSource', - 'GraphSubjectBase', - 'Identity', - 'IdentityBase', - 'IdentityMapping', - 'IdentityRef', - 'License', - 'MsdnEntitlement', - 'ReferenceLinks', - 'LicensingClient' -] diff --git a/azure-devops/azure/devops/v5_1/licensing/licensing_client.py b/azure-devops/azure/devops/v5_1/licensing/licensing_client.py deleted file mode 100644 index fdaf0cc2..00000000 --- a/azure-devops/azure/devops/v5_1/licensing/licensing_client.py +++ /dev/null @@ -1,411 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 LicensingClient(Client): - """Licensing - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(LicensingClient, 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 = 'c73a23a1-59bb-458c-8ce3-02c83215e015' - - def get_extension_license_usage(self): - """GetExtensionLicenseUsage. - [Preview API] Returns Licensing info about paid extensions assigned to user passed into GetExtensionsAssignedToAccount - :rtype: [AccountLicenseExtensionUsage] - """ - response = self._send(http_method='GET', - location_id='01bce8d3-c130-480f-a332-474ae3f6662e', - version='5.1-preview.1') - return self._deserialize('[AccountLicenseExtensionUsage]', self._unwrap_collection(response)) - - def get_certificate(self, **kwargs): - """GetCertificate. - [Preview API] - :rtype: object - """ - response = self._send(http_method='GET', - location_id='2e0dbce7-a327-4bc0-a291-056139393f6d', - version='5.1-preview.1', - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_client_rights(self, right_name=None, product_version=None, edition=None, rel_type=None, include_certificate=None, canary=None, machine_id=None): - """GetClientRights. - [Preview API] - :param str right_name: - :param str product_version: - :param str edition: - :param str rel_type: - :param bool include_certificate: - :param str canary: - :param str machine_id: - :rtype: :class:` ` - """ - route_values = {} - if right_name is not None: - route_values['rightName'] = self._serialize.url('right_name', right_name, 'str') - query_parameters = {} - if product_version is not None: - query_parameters['productVersion'] = self._serialize.query('product_version', product_version, 'str') - if edition is not None: - query_parameters['edition'] = self._serialize.query('edition', edition, 'str') - if rel_type is not None: - query_parameters['relType'] = self._serialize.query('rel_type', rel_type, 'str') - if include_certificate is not None: - query_parameters['includeCertificate'] = self._serialize.query('include_certificate', include_certificate, 'bool') - if canary is not None: - query_parameters['canary'] = self._serialize.query('canary', canary, 'str') - if machine_id is not None: - query_parameters['machineId'] = self._serialize.query('machine_id', machine_id, 'str') - response = self._send(http_method='GET', - location_id='643c72da-eaee-4163-9f07-d748ef5c2a0c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('ClientRightsContainer', response) - - def assign_available_account_entitlement(self, user_id, dont_notify_user=None, origin=None): - """AssignAvailableAccountEntitlement. - [Preview API] Assign an available entitilement to a user - :param str user_id: The user to which to assign the entitilement - :param bool dont_notify_user: - :param str origin: - :rtype: :class:` ` - """ - query_parameters = {} - if user_id is not None: - query_parameters['userId'] = self._serialize.query('user_id', user_id, 'str') - if dont_notify_user is not None: - query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') - if origin is not None: - query_parameters['origin'] = self._serialize.query('origin', origin, 'str') - response = self._send(http_method='POST', - location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', - version='5.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlement(self): - """GetAccountEntitlement. - [Preview API] Gets the account entitlement of the current user it is mapped to _apis/licensing/entitlements/me so specifically is looking for the user of the request - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', - version='5.1-preview.1') - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlements(self, top=None, skip=None): - """GetAccountEntitlements. - [Preview API] Gets top (top) entitlements for users in the account from offset (skip) order by DateCreated ASC - :param int top: number of accounts to return - :param int skip: records to skip, null is interpreted as 0 - :rtype: [AccountEntitlement] - """ - query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if skip is not None: - query_parameters['skip'] = self._serialize.query('skip', skip, 'int') - response = self._send(http_method='GET', - location_id='ea37be6f-8cd7-48dd-983d-2b72d6e3da0f', - version='5.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def assign_account_entitlement_for_user(self, body, user_id, dont_notify_user=None, origin=None): - """AssignAccountEntitlementForUser. - [Preview API] Assign an explicit account entitlement - :param :class:` ` body: The update model for the entitlement - :param str user_id: The id of the user - :param bool dont_notify_user: - :param str origin: - :rtype: :class:` ` - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - query_parameters = {} - if dont_notify_user is not None: - query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') - if origin is not None: - query_parameters['origin'] = self._serialize.query('origin', origin, 'str') - content = self._serialize.body(body, 'AccountEntitlementUpdateModel') - response = self._send(http_method='PUT', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('AccountEntitlement', response) - - def delete_user_entitlements(self, user_id): - """DeleteUserEntitlements. - [Preview API] - :param str user_id: - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - self._send(http_method='DELETE', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.1-preview.1', - route_values=route_values) - - def get_account_entitlement_for_user(self, user_id, determine_rights=None, create_if_not_exists=None): - """GetAccountEntitlementForUser. - [Preview API] Get the entitlements for a user - :param str user_id: The id of the user - :param bool determine_rights: - :param bool create_if_not_exists: - :rtype: :class:` ` - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - query_parameters = {} - if determine_rights is not None: - query_parameters['determineRights'] = self._serialize.query('determine_rights', determine_rights, 'bool') - if create_if_not_exists is not None: - query_parameters['createIfNotExists'] = self._serialize.query('create_if_not_exists', create_if_not_exists, 'bool') - response = self._send(http_method='GET', - location_id='6490e566-b299-49a7-a4e4-28749752581f', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('AccountEntitlement', response) - - def get_account_entitlements_batch(self, user_ids): - """GetAccountEntitlementsBatch. - [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account - :param [str] user_ids: List of user Ids. - :rtype: [AccountEntitlement] - """ - route_values = {} - route_values['action'] = 'GetUsersEntitlements' - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='POST', - location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def obtain_available_account_entitlements(self, user_ids): - """ObtainAvailableAccountEntitlements. - [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account - :param [str] user_ids: List of user Ids. - :rtype: [AccountEntitlement] - """ - route_values = {} - route_values['action'] = 'GetAvailableUsersEntitlements' - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='POST', - location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) - - def assign_extension_to_all_eligible_users(self, extension_id): - """AssignExtensionToAllEligibleUsers. - [Preview API] Assigns the access to the given extension for all eligible users in the account that do not already have access to the extension though bundle or account assignment - :param str extension_id: The extension id to assign the access to. - :rtype: [ExtensionOperationResult] - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='PUT', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) - - def get_eligible_users_for_extension(self, extension_id, options): - """GetEligibleUsersForExtension. - [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions - :param str extension_id: The extension to check the eligibility of the users for. - :param str options: The options to filter the list. - :rtype: [str] - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - query_parameters = {} - if options is not None: - query_parameters['options'] = self._serialize.query('options', options, 'str') - response = self._send(http_method='GET', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[str]', self._unwrap_collection(response)) - - def get_extension_status_for_users(self, extension_id): - """GetExtensionStatusForUsers. - [Preview API] Returns extension assignment status of all account users for the given extension - :param str extension_id: The extension to check the status of the users for. - :rtype: {ExtensionAssignmentDetails} - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='GET', - location_id='5434f182-7f32-4135-8326-9340d887c08a', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('{ExtensionAssignmentDetails}', self._unwrap_collection(response)) - - def assign_extension_to_users(self, body): - """AssignExtensionToUsers. - [Preview API] Assigns the access to the given extension for a given list of users - :param :class:` ` body: The extension assignment details. - :rtype: [ExtensionOperationResult] - """ - content = self._serialize.body(body, 'ExtensionAssignment') - response = self._send(http_method='PUT', - location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', - version='5.1-preview.1', - content=content) - return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) - - def get_extensions_assigned_to_user(self, user_id): - """GetExtensionsAssignedToUser. - [Preview API] Returns extensions that are currently assigned to the user in the account - :param str user_id: The user's identity id. - :rtype: {LicensingSource} - """ - route_values = {} - if user_id is not None: - route_values['userId'] = self._serialize.url('user_id', user_id, 'str') - response = self._send(http_method='GET', - location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('{LicensingSource}', self._unwrap_collection(response)) - - def bulk_get_extensions_assigned_to_users(self, user_ids): - """BulkGetExtensionsAssignedToUsers. - [Preview API] Returns extensions that are currrently assigned to the users that are in the account - :param [str] user_ids: - :rtype: {[ExtensionSource]} - """ - content = self._serialize.body(user_ids, '[str]') - response = self._send(http_method='PUT', - location_id='1d42ddc2-3e7d-4daa-a0eb-e12c1dbd7c72', - version='5.1-preview.2', - content=content) - return self._deserialize('{[ExtensionSource]}', self._unwrap_collection(response)) - - def get_extension_license_data(self, extension_id): - """GetExtensionLicenseData. - [Preview API] - :param str extension_id: - :rtype: :class:` ` - """ - route_values = {} - if extension_id is not None: - route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') - response = self._send(http_method='GET', - location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('ExtensionLicenseData', response) - - def register_extension_license(self, extension_license_data): - """RegisterExtensionLicense. - [Preview API] - :param :class:` ` extension_license_data: - :rtype: bool - """ - content = self._serialize.body(extension_license_data, 'ExtensionLicenseData') - response = self._send(http_method='POST', - location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', - version='5.1-preview.1', - content=content) - return self._deserialize('bool', response) - - def compute_extension_rights(self, ids): - """ComputeExtensionRights. - [Preview API] - :param [str] ids: - :rtype: {bool} - """ - content = self._serialize.body(ids, '[str]') - response = self._send(http_method='POST', - location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', - version='5.1-preview.1', - content=content) - return self._deserialize('{bool}', self._unwrap_collection(response)) - - def get_extension_rights(self): - """GetExtensionRights. - [Preview API] - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', - version='5.1-preview.1') - return self._deserialize('ExtensionRightsResult', response) - - def get_msdn_presence(self): - """GetMsdnPresence. - [Preview API] - """ - self._send(http_method='GET', - location_id='69522c3f-eecc-48d0-b333-f69ffb8fa6cc', - version='5.1-preview.1') - - def get_entitlements(self): - """GetEntitlements. - [Preview API] - :rtype: [MsdnEntitlement] - """ - response = self._send(http_method='GET', - location_id='1cc6137e-12d5-4d44-a4f2-765006c9e85d', - version='5.1-preview.1') - return self._deserialize('[MsdnEntitlement]', self._unwrap_collection(response)) - - def transfer_extensions_for_identities(self, identity_mapping): - """TransferExtensionsForIdentities. - [Preview API] This method transfers extensions for the given identities. - :param [IdentityMapping] identity_mapping: The identity mapping. - """ - content = self._serialize.body(identity_mapping, '[IdentityMapping]') - self._send(http_method='POST', - location_id='da46fe26-dbb6-41d9-9d6b-86bf47e4e444', - version='5.1-preview.1', - content=content) - - def get_account_licenses_usage(self): - """GetAccountLicensesUsage. - [Preview API] - :rtype: [AccountLicenseUsage] - """ - response = self._send(http_method='GET', - location_id='d3266b87-d395-4e91-97a5-0215b81a0b7d', - version='5.1-preview.1') - return self._deserialize('[AccountLicenseUsage]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v5_1/licensing/models.py b/azure-devops/azure/devops/v5_1/licensing/models.py deleted file mode 100644 index d4194f2e..00000000 --- a/azure-devops/azure/devops/v5_1/licensing/models.py +++ /dev/null @@ -1,747 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class AccountEntitlement(Model): - """AccountEntitlement. - - :param account_id: Gets or sets the id of the account to which the license belongs - :type account_id: str - :param assignment_date: Gets or sets the date the license was assigned - :type assignment_date: datetime - :param assignment_source: Assignment Source - :type assignment_source: object - :param date_created: Gets or sets the creation date of the user in this account - :type date_created: datetime - :param last_accessed_date: Gets or sets the date of the user last sign-in to this account - :type last_accessed_date: datetime - :param license: - :type license: :class:`License ` - :param origin: Licensing origin - :type origin: object - :param rights: The computed rights of this user in the account. - :type rights: :class:`AccountRights ` - :param status: The status of the user in the account - :type status: object - :param user: Identity information of the user to which the license belongs - :type user: :class:`IdentityRef ` - :param user_id: Gets the id of the user to which the license belongs - :type user_id: str - """ - - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'assignment_date': {'key': 'assignmentDate', 'type': 'iso-8601'}, - 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, - 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, - 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, - 'license': {'key': 'license', 'type': 'License'}, - 'origin': {'key': 'origin', 'type': 'object'}, - 'rights': {'key': 'rights', 'type': 'AccountRights'}, - 'status': {'key': 'status', 'type': 'object'}, - 'user': {'key': 'user', 'type': 'IdentityRef'}, - 'user_id': {'key': 'userId', 'type': 'str'} - } - - def __init__(self, account_id=None, assignment_date=None, assignment_source=None, date_created=None, last_accessed_date=None, license=None, origin=None, rights=None, status=None, user=None, user_id=None): - super(AccountEntitlement, self).__init__() - self.account_id = account_id - self.assignment_date = assignment_date - self.assignment_source = assignment_source - self.date_created = date_created - self.last_accessed_date = last_accessed_date - self.license = license - self.origin = origin - self.rights = rights - self.status = status - self.user = user - self.user_id = user_id - - -class AccountEntitlementUpdateModel(Model): - """AccountEntitlementUpdateModel. - - :param license: Gets or sets the license for the entitlement - :type license: :class:`License ` - """ - - _attribute_map = { - 'license': {'key': 'license', 'type': 'License'} - } - - def __init__(self, license=None): - super(AccountEntitlementUpdateModel, self).__init__() - self.license = license - - -class AccountLicenseExtensionUsage(Model): - """AccountLicenseExtensionUsage. - - :param extension_id: - :type extension_id: str - :param extension_name: - :type extension_name: str - :param included_quantity: - :type included_quantity: int - :param is_trial: - :type is_trial: bool - :param minimum_license_required: - :type minimum_license_required: object - :param msdn_used_count: - :type msdn_used_count: int - :param provisioned_count: - :type provisioned_count: int - :param remaining_trial_days: - :type remaining_trial_days: int - :param trial_expiry_date: - :type trial_expiry_date: datetime - :param used_count: - :type used_count: int - """ - - _attribute_map = { - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'extension_name': {'key': 'extensionName', 'type': 'str'}, - 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, - 'is_trial': {'key': 'isTrial', 'type': 'bool'}, - 'minimum_license_required': {'key': 'minimumLicenseRequired', 'type': 'object'}, - 'msdn_used_count': {'key': 'msdnUsedCount', 'type': 'int'}, - 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, - 'remaining_trial_days': {'key': 'remainingTrialDays', 'type': 'int'}, - 'trial_expiry_date': {'key': 'trialExpiryDate', 'type': 'iso-8601'}, - 'used_count': {'key': 'usedCount', 'type': 'int'} - } - - def __init__(self, extension_id=None, extension_name=None, included_quantity=None, is_trial=None, minimum_license_required=None, msdn_used_count=None, provisioned_count=None, remaining_trial_days=None, trial_expiry_date=None, used_count=None): - super(AccountLicenseExtensionUsage, self).__init__() - self.extension_id = extension_id - self.extension_name = extension_name - self.included_quantity = included_quantity - self.is_trial = is_trial - self.minimum_license_required = minimum_license_required - self.msdn_used_count = msdn_used_count - self.provisioned_count = provisioned_count - self.remaining_trial_days = remaining_trial_days - self.trial_expiry_date = trial_expiry_date - self.used_count = used_count - - -class AccountLicenseUsage(Model): - """AccountLicenseUsage. - - :param disabled_count: Amount that is disabled (Usually from licenses that were provisioned, but became invalid due to loss of subscription in a new billing cycle) - :type disabled_count: int - :param license: - :type license: :class:`AccountUserLicense ` - :param pending_provisioned_count: Amount that will be purchased in the next billing cycle - :type pending_provisioned_count: int - :param provisioned_count: Amount that has been purchased - :type provisioned_count: int - :param used_count: Amount currently being used. - :type used_count: int - """ - - _attribute_map = { - 'disabled_count': {'key': 'disabledCount', 'type': 'int'}, - 'license': {'key': 'license', 'type': 'AccountUserLicense'}, - 'pending_provisioned_count': {'key': 'pendingProvisionedCount', 'type': 'int'}, - 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, - 'used_count': {'key': 'usedCount', 'type': 'int'} - } - - def __init__(self, disabled_count=None, license=None, pending_provisioned_count=None, provisioned_count=None, used_count=None): - super(AccountLicenseUsage, self).__init__() - self.disabled_count = disabled_count - self.license = license - self.pending_provisioned_count = pending_provisioned_count - self.provisioned_count = provisioned_count - self.used_count = used_count - - -class AccountRights(Model): - """AccountRights. - - :param level: - :type level: object - :param reason: - :type reason: str - """ - - _attribute_map = { - 'level': {'key': 'level', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'str'} - } - - def __init__(self, level=None, reason=None): - super(AccountRights, self).__init__() - self.level = level - self.reason = reason - - -class AccountUserLicense(Model): - """AccountUserLicense. - - :param license: - :type license: int - :param source: - :type source: object - """ - - _attribute_map = { - 'license': {'key': 'license', 'type': 'int'}, - 'source': {'key': 'source', 'type': 'object'} - } - - def __init__(self, license=None, source=None): - super(AccountUserLicense, self).__init__() - self.license = license - self.source = source - - -class ClientRightsContainer(Model): - """ClientRightsContainer. - - :param certificate_bytes: - :type certificate_bytes: str - :param token: - :type token: str - """ - - _attribute_map = { - 'certificate_bytes': {'key': 'certificateBytes', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'} - } - - def __init__(self, certificate_bytes=None, token=None): - super(ClientRightsContainer, self).__init__() - self.certificate_bytes = certificate_bytes - self.token = token - - -class ExtensionAssignment(Model): - """ExtensionAssignment. - - :param extension_gallery_id: Gets or sets the extension ID to assign. - :type extension_gallery_id: str - :param is_auto_assignment: Set to true if this a auto assignment scenario. - :type is_auto_assignment: bool - :param licensing_source: Gets or sets the licensing source. - :type licensing_source: object - :param user_ids: Gets or sets the user IDs to assign the extension to. - :type user_ids: list of str - """ - - _attribute_map = { - 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, - 'is_auto_assignment': {'key': 'isAutoAssignment', 'type': 'bool'}, - 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, - 'user_ids': {'key': 'userIds', 'type': '[str]'} - } - - def __init__(self, extension_gallery_id=None, is_auto_assignment=None, licensing_source=None, user_ids=None): - super(ExtensionAssignment, self).__init__() - self.extension_gallery_id = extension_gallery_id - self.is_auto_assignment = is_auto_assignment - self.licensing_source = licensing_source - self.user_ids = user_ids - - -class ExtensionAssignmentDetails(Model): - """ExtensionAssignmentDetails. - - :param assignment_status: - :type assignment_status: object - :param source_collection_name: - :type source_collection_name: str - """ - - _attribute_map = { - 'assignment_status': {'key': 'assignmentStatus', 'type': 'object'}, - 'source_collection_name': {'key': 'sourceCollectionName', 'type': 'str'} - } - - def __init__(self, assignment_status=None, source_collection_name=None): - super(ExtensionAssignmentDetails, self).__init__() - self.assignment_status = assignment_status - self.source_collection_name = source_collection_name - - -class ExtensionLicenseData(Model): - """ExtensionLicenseData. - - :param created_date: - :type created_date: datetime - :param extension_id: - :type extension_id: str - :param is_free: - :type is_free: bool - :param minimum_required_access_level: - :type minimum_required_access_level: object - :param updated_date: - :type updated_date: datetime - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'is_free': {'key': 'isFree', 'type': 'bool'}, - 'minimum_required_access_level': {'key': 'minimumRequiredAccessLevel', 'type': 'object'}, - 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} - } - - def __init__(self, created_date=None, extension_id=None, is_free=None, minimum_required_access_level=None, updated_date=None): - super(ExtensionLicenseData, self).__init__() - self.created_date = created_date - self.extension_id = extension_id - self.is_free = is_free - self.minimum_required_access_level = minimum_required_access_level - self.updated_date = updated_date - - -class ExtensionOperationResult(Model): - """ExtensionOperationResult. - - :param account_id: - :type account_id: str - :param extension_id: - :type extension_id: str - :param message: - :type message: str - :param operation: - :type operation: object - :param result: - :type result: object - :param user_id: - :type user_id: str - """ - - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'extension_id': {'key': 'extensionId', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'object'}, - 'result': {'key': 'result', 'type': 'object'}, - 'user_id': {'key': 'userId', 'type': 'str'} - } - - def __init__(self, account_id=None, extension_id=None, message=None, operation=None, result=None, user_id=None): - super(ExtensionOperationResult, self).__init__() - self.account_id = account_id - self.extension_id = extension_id - self.message = message - self.operation = operation - self.result = result - self.user_id = user_id - - -class ExtensionRightsResult(Model): - """ExtensionRightsResult. - - :param entitled_extensions: - :type entitled_extensions: list of str - :param host_id: - :type host_id: str - :param reason: - :type reason: str - :param reason_code: - :type reason_code: object - :param result_code: - :type result_code: object - """ - - _attribute_map = { - 'entitled_extensions': {'key': 'entitledExtensions', 'type': '[str]'}, - 'host_id': {'key': 'hostId', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'reason_code': {'key': 'reasonCode', 'type': 'object'}, - 'result_code': {'key': 'resultCode', 'type': 'object'} - } - - def __init__(self, entitled_extensions=None, host_id=None, reason=None, reason_code=None, result_code=None): - super(ExtensionRightsResult, self).__init__() - self.entitled_extensions = entitled_extensions - self.host_id = host_id - self.reason = reason - self.reason_code = reason_code - self.result_code = result_code - - -class ExtensionSource(Model): - """ExtensionSource. - - :param assignment_source: Assignment Source - :type assignment_source: object - :param extension_gallery_id: extension Identifier - :type extension_gallery_id: str - :param licensing_source: The licensing source of the extension. Account, Msdn, ect. - :type licensing_source: object - """ - - _attribute_map = { - 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, - 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, - 'licensing_source': {'key': 'licensingSource', 'type': 'object'} - } - - def __init__(self, assignment_source=None, extension_gallery_id=None, licensing_source=None): - super(ExtensionSource, self).__init__() - self.assignment_source = assignment_source - self.extension_gallery_id = extension_gallery_id - self.licensing_source = licensing_source - - -class GraphSubjectBase(Model): - """GraphSubjectBase. - - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityBase(Model): - """IdentityBase. - - :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) - :type custom_display_name: str - :param descriptor: - :type descriptor: :class:`str ` - :param id: - :type id: str - :param is_active: - :type is_active: bool - :param is_container: - :type is_container: bool - :param master_id: - :type master_id: str - :param member_ids: - :type member_ids: list of str - :param member_of: - :type member_of: list of :class:`str ` - :param members: - :type members: list of :class:`str ` - :param meta_type_id: - :type meta_type_id: int - :param properties: - :type properties: :class:`object ` - :param provider_display_name: The display name for the identity as specified by the source identity provider. - :type provider_display_name: str - :param resource_version: - :type resource_version: int - :param subject_descriptor: - :type subject_descriptor: :class:`str ` - :param unique_user_id: - :type unique_user_id: int - """ - - _attribute_map = { - 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'master_id': {'key': 'masterId', 'type': 'str'}, - 'member_ids': {'key': 'memberIds', 'type': '[str]'}, - 'member_of': {'key': 'memberOf', 'type': '[str]'}, - 'members': {'key': 'members', 'type': '[str]'}, - 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, - 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, - 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'} - } - - def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): - super(IdentityBase, self).__init__() - self.custom_display_name = custom_display_name - self.descriptor = descriptor - self.id = id - self.is_active = is_active - self.is_container = is_container - self.master_id = master_id - self.member_ids = member_ids - self.member_of = member_of - self.members = members - self.meta_type_id = meta_type_id - self.properties = properties - self.provider_display_name = provider_display_name - self.resource_version = resource_version - self.subject_descriptor = subject_descriptor - self.unique_user_id = unique_user_id - - -class IdentityMapping(Model): - """IdentityMapping. - - :param source_identity: - :type source_identity: :class:`Identity ` - :param target_identity: - :type target_identity: :class:`Identity ` - """ - - _attribute_map = { - 'source_identity': {'key': 'sourceIdentity', 'type': 'Identity'}, - 'target_identity': {'key': 'targetIdentity', 'type': 'Identity'} - } - - def __init__(self, source_identity=None, target_identity=None): - super(IdentityMapping, self).__init__() - self.source_identity = source_identity - self.target_identity = target_identity - - -class IdentityRef(GraphSubjectBase): - """IdentityRef. - - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - :param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary - :type directory_alias: str - :param id: - :type id: str - :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary - :type image_url: str - :param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary - :type inactive: bool - :param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) - :type is_aad_identity: bool - :param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef - :type profile_url: str - :param unique_name: Deprecated - use Domain+PrincipalName instead - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class License(Model): - """License. - - :param source: Gets the source of the license - :type source: object - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'object'} - } - - def __init__(self, source=None): - super(License, self).__init__() - self.source = source - - -class MsdnEntitlement(Model): - """MsdnEntitlement. - - :param entitlement_code: Entilement id assigned to Entitlement in Benefits Database. - :type entitlement_code: str - :param entitlement_name: Entitlement Name e.g. Downloads, Chat. - :type entitlement_name: str - :param entitlement_type: Type of Entitlement e.g. Downloads, Chat. - :type entitlement_type: str - :param is_activated: Entitlement activation status - :type is_activated: bool - :param is_entitlement_available: Entitlement availability - :type is_entitlement_available: bool - :param subscription_channel: Write MSDN Channel into CRCT (Retail,MPN,VL,BizSpark,DreamSpark,MCT,FTE,Technet,WebsiteSpark,Other) - :type subscription_channel: str - :param subscription_expiration_date: Subscription Expiration Date. - :type subscription_expiration_date: datetime - :param subscription_id: Subscription id which identifies the subscription itself. This is the Benefit Detail Guid from BMS. - :type subscription_id: str - :param subscription_level_code: Identifier of the subscription or benefit level. - :type subscription_level_code: str - :param subscription_level_name: Name of subscription level. - :type subscription_level_name: str - :param subscription_status: Subscription Status Code (ACT, PND, INA ...). - :type subscription_status: str - """ - - _attribute_map = { - 'entitlement_code': {'key': 'entitlementCode', 'type': 'str'}, - 'entitlement_name': {'key': 'entitlementName', 'type': 'str'}, - 'entitlement_type': {'key': 'entitlementType', 'type': 'str'}, - 'is_activated': {'key': 'isActivated', 'type': 'bool'}, - 'is_entitlement_available': {'key': 'isEntitlementAvailable', 'type': 'bool'}, - 'subscription_channel': {'key': 'subscriptionChannel', 'type': 'str'}, - 'subscription_expiration_date': {'key': 'subscriptionExpirationDate', 'type': 'iso-8601'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'subscription_level_code': {'key': 'subscriptionLevelCode', 'type': 'str'}, - 'subscription_level_name': {'key': 'subscriptionLevelName', 'type': 'str'}, - 'subscription_status': {'key': 'subscriptionStatus', 'type': 'str'} - } - - def __init__(self, entitlement_code=None, entitlement_name=None, entitlement_type=None, is_activated=None, is_entitlement_available=None, subscription_channel=None, subscription_expiration_date=None, subscription_id=None, subscription_level_code=None, subscription_level_name=None, subscription_status=None): - super(MsdnEntitlement, self).__init__() - self.entitlement_code = entitlement_code - self.entitlement_name = entitlement_name - self.entitlement_type = entitlement_type - self.is_activated = is_activated - self.is_entitlement_available = is_entitlement_available - self.subscription_channel = subscription_channel - self.subscription_expiration_date = subscription_expiration_date - self.subscription_id = subscription_id - self.subscription_level_code = subscription_level_code - self.subscription_level_name = subscription_level_name - self.subscription_status = subscription_status - - -class ReferenceLinks(Model): - """ReferenceLinks. - - :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class Identity(IdentityBase): - """Identity. - - :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) - :type custom_display_name: str - :param descriptor: - :type descriptor: :class:`str ` - :param id: - :type id: str - :param is_active: - :type is_active: bool - :param is_container: - :type is_container: bool - :param master_id: - :type master_id: str - :param member_ids: - :type member_ids: list of str - :param member_of: - :type member_of: list of :class:`str ` - :param members: - :type members: list of :class:`str ` - :param meta_type_id: - :type meta_type_id: int - :param properties: - :type properties: :class:`object ` - :param provider_display_name: The display name for the identity as specified by the source identity provider. - :type provider_display_name: str - :param resource_version: - :type resource_version: int - :param subject_descriptor: - :type subject_descriptor: :class:`str ` - :param unique_user_id: - :type unique_user_id: int - """ - - _attribute_map = { - 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'master_id': {'key': 'masterId', 'type': 'str'}, - 'member_ids': {'key': 'memberIds', 'type': '[str]'}, - 'member_of': {'key': 'memberOf', 'type': '[str]'}, - 'members': {'key': 'members', 'type': '[str]'}, - 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, - 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, - 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'}, - } - - def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): - super(Identity, self).__init__(custom_display_name=custom_display_name, descriptor=descriptor, id=id, is_active=is_active, is_container=is_container, master_id=master_id, member_ids=member_ids, member_of=member_of, members=members, meta_type_id=meta_type_id, properties=properties, provider_display_name=provider_display_name, resource_version=resource_version, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) - - -__all__ = [ - 'AccountEntitlement', - 'AccountEntitlementUpdateModel', - 'AccountLicenseExtensionUsage', - 'AccountLicenseUsage', - 'AccountRights', - 'AccountUserLicense', - 'ClientRightsContainer', - 'ExtensionAssignment', - 'ExtensionAssignmentDetails', - 'ExtensionLicenseData', - 'ExtensionOperationResult', - 'ExtensionRightsResult', - 'ExtensionSource', - 'GraphSubjectBase', - 'IdentityBase', - 'IdentityMapping', - 'IdentityRef', - 'License', - 'MsdnEntitlement', - 'ReferenceLinks', - 'Identity', -] diff --git a/azure-devops/azure/devops/v5_1/release/__init__.py b/azure-devops/azure/devops/v5_1/release/__init__.py deleted file mode 100644 index f3e2ea9b..00000000 --- a/azure-devops/azure/devops/v5_1/release/__init__.py +++ /dev/null @@ -1,110 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .release_client import ReleaseClient - -__all__ = [ - 'AgentArtifactDefinition', - 'ApprovalOptions', - 'Artifact', - 'ArtifactMetadata', - 'ArtifactSourceReference', - 'ArtifactTriggerConfiguration', - 'ArtifactTypeDefinition', - 'ArtifactVersion', - 'ArtifactVersionQueryResult', - 'AuthorizationHeader', - 'AutoTriggerIssue', - 'BuildVersion', - 'Change', - 'ComplianceSettings', - 'Condition', - 'ConfigurationVariableValue', - 'DataSourceBindingBase', - 'DefinitionEnvironmentReference', - 'Deployment', - 'DeploymentAttempt', - 'DeploymentJob', - 'DeploymentQueryParameters', - 'EmailRecipients', - 'EnvironmentExecutionPolicy', - 'EnvironmentOptions', - 'EnvironmentRetentionPolicy', - 'EnvironmentTrigger', - 'FavoriteItem', - 'Folder', - 'GateUpdateMetadata', - 'GraphSubjectBase', - 'IdentityRef', - 'IgnoredGate', - 'InputDescriptor', - 'InputValidation', - 'InputValue', - 'InputValues', - 'InputValuesError', - 'InputValuesQuery', - 'Issue', - 'MailMessage', - 'ManualIntervention', - 'ManualInterventionUpdateMetadata', - 'Metric', - 'PipelineProcess', - 'ProcessParameters', - 'ProjectReference', - 'QueuedReleaseData', - 'ReferenceLinks', - 'Release', - 'ReleaseApproval', - 'ReleaseApprovalHistory', - 'ReleaseCondition', - 'ReleaseDefinition', - 'ReleaseDefinitionApprovals', - 'ReleaseDefinitionApprovalStep', - 'ReleaseDefinitionDeployStep', - 'ReleaseDefinitionEnvironment', - 'ReleaseDefinitionEnvironmentStep', - 'ReleaseDefinitionEnvironmentSummary', - 'ReleaseDefinitionEnvironmentTemplate', - 'ReleaseDefinitionGate', - 'ReleaseDefinitionGatesOptions', - 'ReleaseDefinitionGatesStep', - 'ReleaseDefinitionRevision', - 'ReleaseDefinitionShallowReference', - 'ReleaseDefinitionSummary', - 'ReleaseDefinitionUndeleteParameter', - 'ReleaseDeployPhase', - 'ReleaseEnvironment', - 'ReleaseEnvironmentShallowReference', - 'ReleaseEnvironmentUpdateMetadata', - 'ReleaseGates', - 'ReleaseReference', - 'ReleaseRevision', - 'ReleaseSchedule', - 'ReleaseSettings', - 'ReleaseShallowReference', - 'ReleaseStartEnvironmentMetadata', - 'ReleaseStartMetadata', - 'ReleaseTask', - 'ReleaseTaskAttachment', - 'ReleaseUpdateMetadata', - 'ReleaseWorkItemRef', - 'RetentionPolicy', - 'RetentionSettings', - 'SourcePullRequestVersion', - 'SummaryMailSection', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskSourceDefinitionBase', - 'VariableGroup', - 'VariableGroupProviderData', - 'VariableValue', - 'WorkflowTask', - 'WorkflowTaskReference', - 'ReleaseClient' -] diff --git a/azure-devops/azure/devops/v5_1/release/models.py b/azure-devops/azure/devops/v5_1/release/models.py deleted file mode 100644 index e462ec36..00000000 --- a/azure-devops/azure/devops/v5_1/release/models.py +++ /dev/null @@ -1,3710 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class AgentArtifactDefinition(Model): - """ - :param alias: Gets or sets the artifact definition alias. - :type alias: str - :param artifact_type: Gets or sets the artifact type. - :type artifact_type: object - :param details: Gets or sets the artifact definition details. - :type details: str - :param name: Gets or sets the name of artifact definition. - :type name: str - :param version: Gets or sets the version of artifact definition. - :type version: str - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'object'}, - 'details': {'key': 'details', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, alias=None, artifact_type=None, details=None, name=None, version=None): - super(AgentArtifactDefinition, self).__init__() - self.alias = alias - self.artifact_type = artifact_type - self.details = details - self.name = name - self.version = version - - -class ApprovalOptions(Model): - """ - :param auto_triggered_and_previous_environment_approved_can_be_skipped: Specify whether the approval can be skipped if the same approver approved the previous stage. - :type auto_triggered_and_previous_environment_approved_can_be_skipped: bool - :param enforce_identity_revalidation: Specify whether revalidate identity of approver before completing the approval. - :type enforce_identity_revalidation: bool - :param execution_order: Approvals execution order. - :type execution_order: object - :param release_creator_can_be_approver: Specify whether the user requesting a release or deployment should allow to approver. - :type release_creator_can_be_approver: bool - :param required_approver_count: The number of approvals required to move release forward. '0' means all approvals required. - :type required_approver_count: int - :param timeout_in_minutes: Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days. - :type timeout_in_minutes: int - """ - - _attribute_map = { - 'auto_triggered_and_previous_environment_approved_can_be_skipped': {'key': 'autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped', 'type': 'bool'}, - 'enforce_identity_revalidation': {'key': 'enforceIdentityRevalidation', 'type': 'bool'}, - 'execution_order': {'key': 'executionOrder', 'type': 'object'}, - 'release_creator_can_be_approver': {'key': 'releaseCreatorCanBeApprover', 'type': 'bool'}, - 'required_approver_count': {'key': 'requiredApproverCount', 'type': 'int'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} - } - - def __init__(self, auto_triggered_and_previous_environment_approved_can_be_skipped=None, enforce_identity_revalidation=None, execution_order=None, release_creator_can_be_approver=None, required_approver_count=None, timeout_in_minutes=None): - super(ApprovalOptions, self).__init__() - self.auto_triggered_and_previous_environment_approved_can_be_skipped = auto_triggered_and_previous_environment_approved_can_be_skipped - self.enforce_identity_revalidation = enforce_identity_revalidation - self.execution_order = execution_order - self.release_creator_can_be_approver = release_creator_can_be_approver - self.required_approver_count = required_approver_count - self.timeout_in_minutes = timeout_in_minutes - - -class Artifact(Model): - """ - :param alias: Gets or sets alias. - :type alias: str - :param definition_reference: Gets or sets definition reference. e.g. {"project":{"id":"fed755ea-49c5-4399-acea-fd5b5aa90a6c","name":"myProject"},"definition":{"id":"1","name":"mybuildDefinition"},"connection":{"id":"1","name":"myConnection"}}. - :type definition_reference: dict - :param is_primary: Indicates whether artifact is primary or not. - :type is_primary: bool - :param is_retained: Indicates whether artifact is retained by release or not. - :type is_retained: bool - :param source_id: - :type source_id: str - :param type: Gets or sets type. It can have value as 'Build', 'Jenkins', 'GitHub', 'Nuget', 'Team Build (external)', 'ExternalTFSBuild', 'Git', 'TFVC', 'ExternalTfsXamlBuild'. - :type type: str - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'definition_reference': {'key': 'definitionReference', 'type': '{ArtifactSourceReference}'}, - 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, - 'is_retained': {'key': 'isRetained', 'type': 'bool'}, - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, alias=None, definition_reference=None, is_primary=None, is_retained=None, source_id=None, type=None): - super(Artifact, self).__init__() - self.alias = alias - self.definition_reference = definition_reference - self.is_primary = is_primary - self.is_retained = is_retained - self.source_id = source_id - self.type = type - - -class ArtifactMetadata(Model): - """ - :param alias: Sets alias of artifact. - :type alias: str - :param instance_reference: Sets instance reference of artifact. e.g. for build artifact it is build number. - :type instance_reference: :class:`BuildVersion ` - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'instance_reference': {'key': 'instanceReference', 'type': 'BuildVersion'} - } - - def __init__(self, alias=None, instance_reference=None): - super(ArtifactMetadata, self).__init__() - self.alias = alias - self.instance_reference = instance_reference - - -class ArtifactSourceReference(Model): - """ - :param id: ID of the artifact source. - :type id: str - :param name: Name of the artifact source. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, name=None): - super(ArtifactSourceReference, self).__init__() - self.id = id - self.name = name - - -class ArtifactTriggerConfiguration(Model): - """ - :param is_trigger_supported: Gets or sets the whether trigger is supported or not. - :type is_trigger_supported: bool - :param is_trigger_supported_only_in_hosted: Gets or sets the whether trigger is supported only on hosted environment. - :type is_trigger_supported_only_in_hosted: bool - :param is_webhook_supported_at_server_level: Gets or sets the whether webhook is supported at server level. - :type is_webhook_supported_at_server_level: bool - :param payload_hash_header_name: Gets or sets the payload hash header name for the artifact trigger configuration. - :type payload_hash_header_name: str - :param resources: Gets or sets the resources for artifact trigger configuration. - :type resources: dict - :param webhook_payload_mapping: Gets or sets the webhook payload mapping for artifact trigger configuration. - :type webhook_payload_mapping: dict - """ - - _attribute_map = { - 'is_trigger_supported': {'key': 'isTriggerSupported', 'type': 'bool'}, - 'is_trigger_supported_only_in_hosted': {'key': 'isTriggerSupportedOnlyInHosted', 'type': 'bool'}, - 'is_webhook_supported_at_server_level': {'key': 'isWebhookSupportedAtServerLevel', 'type': 'bool'}, - 'payload_hash_header_name': {'key': 'payloadHashHeaderName', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': '{str}'}, - 'webhook_payload_mapping': {'key': 'webhookPayloadMapping', 'type': '{str}'} - } - - def __init__(self, is_trigger_supported=None, is_trigger_supported_only_in_hosted=None, is_webhook_supported_at_server_level=None, payload_hash_header_name=None, resources=None, webhook_payload_mapping=None): - super(ArtifactTriggerConfiguration, self).__init__() - self.is_trigger_supported = is_trigger_supported - self.is_trigger_supported_only_in_hosted = is_trigger_supported_only_in_hosted - self.is_webhook_supported_at_server_level = is_webhook_supported_at_server_level - self.payload_hash_header_name = payload_hash_header_name - self.resources = resources - self.webhook_payload_mapping = webhook_payload_mapping - - -class ArtifactTypeDefinition(Model): - """ - :param artifact_trigger_configuration: Gets or sets the artifact trigger configuration of artifact type definition. - :type artifact_trigger_configuration: :class:`ArtifactTriggerConfiguration ` - :param artifact_type: Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'. - :type artifact_type: str - :param display_name: Gets or sets the display name of artifact type definition. - :type display_name: str - :param endpoint_type_id: Gets or sets the endpoint type id of artifact type definition. - :type endpoint_type_id: str - :param input_descriptors: Gets or sets the input descriptors of artifact type definition. - :type input_descriptors: list of :class:`InputDescriptor ` - :param name: Gets or sets the name of artifact type definition. - :type name: str - :param unique_source_identifier: Gets or sets the unique source identifier of artifact type definition. - :type unique_source_identifier: str - """ - - _attribute_map = { - 'artifact_trigger_configuration': {'key': 'artifactTriggerConfiguration', 'type': 'ArtifactTriggerConfiguration'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_type_id': {'key': 'endpointTypeId', 'type': 'str'}, - 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'unique_source_identifier': {'key': 'uniqueSourceIdentifier', 'type': 'str'} - } - - def __init__(self, artifact_trigger_configuration=None, artifact_type=None, display_name=None, endpoint_type_id=None, input_descriptors=None, name=None, unique_source_identifier=None): - super(ArtifactTypeDefinition, self).__init__() - self.artifact_trigger_configuration = artifact_trigger_configuration - self.artifact_type = artifact_type - self.display_name = display_name - self.endpoint_type_id = endpoint_type_id - self.input_descriptors = input_descriptors - self.name = name - self.unique_source_identifier = unique_source_identifier - - -class ArtifactVersion(Model): - """ - :param alias: Gets or sets the alias of artifact. - :type alias: str - :param default_version: Gets or sets the default version of artifact. - :type default_version: :class:`BuildVersion ` - :param error_message: Gets or sets the error message encountered during querying of versions for artifact. - :type error_message: str - :param source_id: - :type source_id: str - :param versions: Gets or sets the list of build versions of artifact. - :type versions: list of :class:`BuildVersion ` - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'default_version': {'key': 'defaultVersion', 'type': 'BuildVersion'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[BuildVersion]'} - } - - def __init__(self, alias=None, default_version=None, error_message=None, source_id=None, versions=None): - super(ArtifactVersion, self).__init__() - self.alias = alias - self.default_version = default_version - self.error_message = error_message - self.source_id = source_id - self.versions = versions - - -class ArtifactVersionQueryResult(Model): - """ - :param artifact_versions: Gets or sets the list for artifact versions of artifact version query result. - :type artifact_versions: list of :class:`ArtifactVersion ` - """ - - _attribute_map = { - 'artifact_versions': {'key': 'artifactVersions', 'type': '[ArtifactVersion]'} - } - - def __init__(self, artifact_versions=None): - super(ArtifactVersionQueryResult, self).__init__() - self.artifact_versions = artifact_versions - - -class AuthorizationHeader(Model): - """ - :param name: - :type name: str - :param value: - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, name=None, value=None): - super(AuthorizationHeader, self).__init__() - self.name = name - self.value = value - - -class AutoTriggerIssue(Model): - """ - :param issue: - :type issue: :class:`Issue ` - :param issue_source: - :type issue_source: object - :param project: - :type project: :class:`ProjectReference ` - :param release_definition_reference: - :type release_definition_reference: :class:`ReleaseDefinitionShallowReference ` - :param release_trigger_type: - :type release_trigger_type: object - """ - - _attribute_map = { - 'issue': {'key': 'issue', 'type': 'Issue'}, - 'issue_source': {'key': 'issueSource', 'type': 'object'}, - 'project': {'key': 'project', 'type': 'ProjectReference'}, - 'release_definition_reference': {'key': 'releaseDefinitionReference', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_trigger_type': {'key': 'releaseTriggerType', 'type': 'object'} - } - - def __init__(self, issue=None, issue_source=None, project=None, release_definition_reference=None, release_trigger_type=None): - super(AutoTriggerIssue, self).__init__() - self.issue = issue - self.issue_source = issue_source - self.project = project - self.release_definition_reference = release_definition_reference - self.release_trigger_type = release_trigger_type - - -class BuildVersion(Model): - """ - :param commit_message: Gets or sets the commit message for the artifact. - :type commit_message: str - :param definition_id: Gets or sets the definition id. - :type definition_id: str - :param definition_name: Gets or sets the definition name. - :type definition_name: str - :param id: Gets or sets the build id. - :type id: str - :param is_multi_definition_type: Gets or sets if the artifact supports multiple definitions. - :type is_multi_definition_type: bool - :param name: Gets or sets the build number. - :type name: str - :param source_branch: Gets or sets the source branch for the artifact. - :type source_branch: str - :param source_pull_request_version: Gets or sets the source pull request version for the artifact. - :type source_pull_request_version: :class:`SourcePullRequestVersion ` - :param source_repository_id: Gets or sets the repository id for the artifact. - :type source_repository_id: str - :param source_repository_type: Gets or sets the repository type for the artifact. - :type source_repository_type: str - :param source_version: Gets or sets the source version for the artifact. - :type source_version: str - """ - - _attribute_map = { - 'commit_message': {'key': 'commitMessage', 'type': 'str'}, - 'definition_id': {'key': 'definitionId', 'type': 'str'}, - 'definition_name': {'key': 'definitionName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_multi_definition_type': {'key': 'isMultiDefinitionType', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, - 'source_pull_request_version': {'key': 'sourcePullRequestVersion', 'type': 'SourcePullRequestVersion'}, - 'source_repository_id': {'key': 'sourceRepositoryId', 'type': 'str'}, - 'source_repository_type': {'key': 'sourceRepositoryType', 'type': 'str'}, - 'source_version': {'key': 'sourceVersion', 'type': 'str'} - } - - def __init__(self, commit_message=None, definition_id=None, definition_name=None, id=None, is_multi_definition_type=None, name=None, source_branch=None, source_pull_request_version=None, source_repository_id=None, source_repository_type=None, source_version=None): - super(BuildVersion, self).__init__() - self.commit_message = commit_message - self.definition_id = definition_id - self.definition_name = definition_name - self.id = id - self.is_multi_definition_type = is_multi_definition_type - self.name = name - self.source_branch = source_branch - self.source_pull_request_version = source_pull_request_version - self.source_repository_id = source_repository_id - self.source_repository_type = source_repository_type - self.source_version = source_version - - -class Change(Model): - """ - Represents a change associated with a build. - - :param author: The author of the change. - :type author: :class:`IdentityRef ` - :param change_type: The type of source. "TfsVersionControl", "TfsGit", etc. - :type change_type: str - :param display_uri: The location of a user-friendly representation of the resource. - :type display_uri: str - :param id: Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. - :type id: str - :param location: The location of the full representation of the resource. - :type location: str - :param message: A description of the change. This might be a commit message or changeset description. - :type message: str - :param pushed_by: The person or process that pushed the change. - :type pushed_by: :class:`IdentityRef ` - :param pusher: The person or process that pushed the change. - :type pusher: str - :param timestamp: A timestamp for the change. - :type timestamp: datetime - """ - - _attribute_map = { - 'author': {'key': 'author', 'type': 'IdentityRef'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'display_uri': {'key': 'displayUri', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'pushed_by': {'key': 'pushedBy', 'type': 'IdentityRef'}, - 'pusher': {'key': 'pusher', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'} - } - - def __init__(self, author=None, change_type=None, display_uri=None, id=None, location=None, message=None, pushed_by=None, pusher=None, timestamp=None): - super(Change, self).__init__() - self.author = author - self.change_type = change_type - self.display_uri = display_uri - self.id = id - self.location = location - self.message = message - self.pushed_by = pushed_by - self.pusher = pusher - self.timestamp = timestamp - - -class ComplianceSettings(Model): - """ - :param check_for_credentials_and_other_secrets: Scan the release definition for secrets - :type check_for_credentials_and_other_secrets: bool - """ - - _attribute_map = { - 'check_for_credentials_and_other_secrets': {'key': 'checkForCredentialsAndOtherSecrets', 'type': 'bool'} - } - - def __init__(self, check_for_credentials_and_other_secrets=None): - super(ComplianceSettings, self).__init__() - self.check_for_credentials_and_other_secrets = check_for_credentials_and_other_secrets - - -class Condition(Model): - """ - :param condition_type: Gets or sets the condition type. - :type condition_type: object - :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. - :type name: str - :param value: Gets or set value of the condition. - :type value: str - """ - - _attribute_map = { - 'condition_type': {'key': 'conditionType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, condition_type=None, name=None, value=None): - super(Condition, self).__init__() - self.condition_type = condition_type - self.name = name - self.value = value - - -class ConfigurationVariableValue(Model): - """ - :param allow_override: Gets and sets if a variable can be overridden at deployment time or not. - :type allow_override: bool - :param is_secret: Gets or sets as variable is secret or not. - :type is_secret: bool - :param value: Gets and sets value of the configuration variable. - :type value: str - """ - - _attribute_map = { - 'allow_override': {'key': 'allowOverride', 'type': 'bool'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, allow_override=None, is_secret=None, value=None): - super(ConfigurationVariableValue, self).__init__() - self.allow_override = allow_override - self.is_secret = is_secret - self.value = value - - -class DataSourceBindingBase(Model): - """ - Represents binding of data source for the service endpoint request. - - :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). - :type callback_context_template: str - :param callback_required_template: Subsequent calls needed? - :type callback_required_template: str - :param data_source_name: Gets or sets the name of the data source. - :type data_source_name: str - :param endpoint_id: Gets or sets the endpoint Id. - :type endpoint_id: str - :param endpoint_url: Gets or sets the url of the service endpoint. - :type endpoint_url: str - :param headers: Gets or sets the authorization headers. - :type headers: list of :class:`AuthorizationHeader ` - :param initial_context_template: Defines the initial value of the query params - :type initial_context_template: str - :param parameters: Gets or sets the parameters for the data source. - :type parameters: dict - :param request_content: Gets or sets http request body - :type request_content: str - :param request_verb: Gets or sets http request verb - :type request_verb: str - :param result_selector: Gets or sets the result selector. - :type result_selector: str - :param result_template: Gets or sets the result template. - :type result_template: str - :param target: Gets or sets the target of the data source. - :type target: str - """ - - _attribute_map = { - 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, - 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, - 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{str}'}, - 'request_content': {'key': 'requestContent', 'type': 'str'}, - 'request_verb': {'key': 'requestVerb', 'type': 'str'}, - 'result_selector': {'key': 'resultSelector', 'type': 'str'}, - 'result_template': {'key': 'resultTemplate', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'} - } - - def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, request_content=None, request_verb=None, result_selector=None, result_template=None, target=None): - super(DataSourceBindingBase, self).__init__() - self.callback_context_template = callback_context_template - self.callback_required_template = callback_required_template - self.data_source_name = data_source_name - self.endpoint_id = endpoint_id - self.endpoint_url = endpoint_url - self.headers = headers - self.initial_context_template = initial_context_template - self.parameters = parameters - self.request_content = request_content - self.request_verb = request_verb - self.result_selector = result_selector - self.result_template = result_template - self.target = target - - -class DefinitionEnvironmentReference(Model): - """ - :param definition_environment_id: Definition environment ID. - :type definition_environment_id: int - :param definition_environment_name: Definition environment name. - :type definition_environment_name: str - :param release_definition_id: ReleaseDefinition ID. - :type release_definition_id: int - :param release_definition_name: ReleaseDefinition name. - :type release_definition_name: str - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'definition_environment_name': {'key': 'definitionEnvironmentName', 'type': 'str'}, - 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, - 'release_definition_name': {'key': 'releaseDefinitionName', 'type': 'str'} - } - - def __init__(self, definition_environment_id=None, definition_environment_name=None, release_definition_id=None, release_definition_name=None): - super(DefinitionEnvironmentReference, self).__init__() - self.definition_environment_id = definition_environment_id - self.definition_environment_name = definition_environment_name - self.release_definition_id = release_definition_id - self.release_definition_name = release_definition_name - - -class Deployment(Model): - """ - :param _links: Gets links to access the deployment. - :type _links: :class:`ReferenceLinks ` - :param attempt: Gets attempt number. - :type attempt: int - :param completed_on: Gets the date on which deployment is complete. - :type completed_on: datetime - :param conditions: Gets the list of condition associated with deployment. - :type conditions: list of :class:`Condition ` - :param definition_environment_id: Gets release definition environment id. - :type definition_environment_id: int - :param deployment_status: Gets status of the deployment. - :type deployment_status: object - :param id: Gets the unique identifier for deployment. - :type id: int - :param last_modified_by: Gets the identity who last modified the deployment. - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_on: Gets the date on which deployment is last modified. - :type last_modified_on: datetime - :param operation_status: Gets operation status of deployment. - :type operation_status: object - :param post_deploy_approvals: Gets list of PostDeployApprovals. - :type post_deploy_approvals: list of :class:`ReleaseApproval ` - :param pre_deploy_approvals: Gets list of PreDeployApprovals. - :type pre_deploy_approvals: list of :class:`ReleaseApproval ` - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param queued_on: Gets the date on which deployment is queued. - :type queued_on: datetime - :param reason: Gets reason of deployment. - :type reason: object - :param release: Gets the reference of release. - :type release: :class:`ReleaseReference ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which the deployment is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which the deployment is associated. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param requested_by: Gets the identity who requested. - :type requested_by: :class:`IdentityRef ` - :param requested_for: Gets the identity for whom deployment is requested. - :type requested_for: :class:`IdentityRef ` - :param scheduled_deployment_time: Gets the date on which deployment is scheduled. - :type scheduled_deployment_time: datetime - :param started_on: Gets the date on which deployment is started. - :type started_on: datetime - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'completed_on': {'key': 'completedOn', 'type': 'iso-8601'}, - 'conditions': {'key': 'conditions', 'type': '[Condition]'}, - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, - 'id': {'key': 'id', 'type': 'int'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release': {'key': 'release', 'type': 'ReleaseReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, - 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'} - } - - def __init__(self, _links=None, attempt=None, completed_on=None, conditions=None, definition_environment_id=None, deployment_status=None, id=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deploy_approvals=None, pre_deploy_approvals=None, project_reference=None, queued_on=None, reason=None, release=None, release_definition=None, release_environment=None, requested_by=None, requested_for=None, scheduled_deployment_time=None, started_on=None): - super(Deployment, self).__init__() - self._links = _links - self.attempt = attempt - self.completed_on = completed_on - self.conditions = conditions - self.definition_environment_id = definition_environment_id - self.deployment_status = deployment_status - self.id = id - self.last_modified_by = last_modified_by - self.last_modified_on = last_modified_on - self.operation_status = operation_status - self.post_deploy_approvals = post_deploy_approvals - self.pre_deploy_approvals = pre_deploy_approvals - self.project_reference = project_reference - self.queued_on = queued_on - self.reason = reason - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.requested_by = requested_by - self.requested_for = requested_for - self.scheduled_deployment_time = scheduled_deployment_time - self.started_on = started_on - - -class DeploymentAttempt(Model): - """ - :param attempt: Deployment attempt. - :type attempt: int - :param deployment_id: ID of the deployment. - :type deployment_id: int - :param error_log: Error log to show any unexpected error that occurred during executing deploy step - :type error_log: str - :param has_started: Specifies whether deployment has started or not. - :type has_started: bool - :param id: ID of deployment. - :type id: int - :param issues: All the issues related to the deployment. - :type issues: list of :class:`Issue ` - :param job: - :type job: :class:`ReleaseTask ` - :param last_modified_by: Identity who last modified this deployment. - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_on: Time when this deployment last modified. - :type last_modified_on: datetime - :param operation_status: Deployment operation status. - :type operation_status: object - :param post_deployment_gates: Post deployment gates that executed in this deployment. - :type post_deployment_gates: :class:`ReleaseGates ` - :param pre_deployment_gates: Pre deployment gates that executed in this deployment. - :type pre_deployment_gates: :class:`ReleaseGates ` - :param queued_on: When this deployment queued on. - :type queued_on: datetime - :param reason: Reason for the deployment. - :type reason: object - :param release_deploy_phases: List of release deployphases executed in this deployment. - :type release_deploy_phases: list of :class:`ReleaseDeployPhase ` - :param requested_by: Identity who requested this deployment. - :type requested_by: :class:`IdentityRef ` - :param requested_for: Identity for this deployment requested. - :type requested_for: :class:`IdentityRef ` - :param run_plan_id: - :type run_plan_id: str - :param status: status of the deployment. - :type status: object - :param tasks: - :type tasks: list of :class:`ReleaseTask ` - """ - - _attribute_map = { - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'deployment_id': {'key': 'deploymentId', 'type': 'int'}, - 'error_log': {'key': 'errorLog', 'type': 'str'}, - 'has_started': {'key': 'hasStarted', 'type': 'bool'}, - 'id': {'key': 'id', 'type': 'int'}, - 'issues': {'key': 'issues', 'type': '[Issue]'}, - 'job': {'key': 'job', 'type': 'ReleaseTask'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseGates'}, - 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseGates'}, - 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_deploy_phases': {'key': 'releaseDeployPhases', 'type': '[ReleaseDeployPhase]'}, - 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, - 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} - } - - def __init__(self, attempt=None, deployment_id=None, error_log=None, has_started=None, id=None, issues=None, job=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deployment_gates=None, pre_deployment_gates=None, queued_on=None, reason=None, release_deploy_phases=None, requested_by=None, requested_for=None, run_plan_id=None, status=None, tasks=None): - super(DeploymentAttempt, self).__init__() - self.attempt = attempt - self.deployment_id = deployment_id - self.error_log = error_log - self.has_started = has_started - self.id = id - self.issues = issues - self.job = job - self.last_modified_by = last_modified_by - self.last_modified_on = last_modified_on - self.operation_status = operation_status - self.post_deployment_gates = post_deployment_gates - self.pre_deployment_gates = pre_deployment_gates - self.queued_on = queued_on - self.reason = reason - self.release_deploy_phases = release_deploy_phases - self.requested_by = requested_by - self.requested_for = requested_for - self.run_plan_id = run_plan_id - self.status = status - self.tasks = tasks - - -class DeploymentJob(Model): - """ - :param job: Parent task of all executed tasks. - :type job: :class:`ReleaseTask ` - :param tasks: List of executed tasks with in job. - :type tasks: list of :class:`ReleaseTask ` - """ - - _attribute_map = { - 'job': {'key': 'job', 'type': 'ReleaseTask'}, - 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} - } - - def __init__(self, job=None, tasks=None): - super(DeploymentJob, self).__init__() - self.job = job - self.tasks = tasks - - -class DeploymentQueryParameters(Model): - """ - :param artifact_source_id: Query deployments based specified artifact source id. - :type artifact_source_id: str - :param artifact_type_id: Query deployments based specified artifact type id. - :type artifact_type_id: str - :param artifact_versions: Query deployments based specified artifact versions. - :type artifact_versions: list of str - :param deployments_per_environment: Query deployments number of deployments per environment. - :type deployments_per_environment: int - :param deployment_status: Query deployment based on deployment status. - :type deployment_status: object - :param environments: Query deployments of specified environments. - :type environments: list of :class:`DefinitionEnvironmentReference ` - :param expands: Query deployments based specified expands. - :type expands: object - :param is_deleted: Specify deleted deployments should return or not. - :type is_deleted: bool - :param latest_deployments_only: - :type latest_deployments_only: bool - :param max_deployments_per_environment: - :type max_deployments_per_environment: int - :param max_modified_time: - :type max_modified_time: datetime - :param min_modified_time: - :type min_modified_time: datetime - :param operation_status: Query deployment based on deployment operation status. - :type operation_status: object - :param query_order: - :type query_order: object - :param query_type: Query deployments based query type. - :type query_type: object - :param source_branch: Query deployments based specified source branch. - :type source_branch: str - """ - - _attribute_map = { - 'artifact_source_id': {'key': 'artifactSourceId', 'type': 'str'}, - 'artifact_type_id': {'key': 'artifactTypeId', 'type': 'str'}, - 'artifact_versions': {'key': 'artifactVersions', 'type': '[str]'}, - 'deployments_per_environment': {'key': 'deploymentsPerEnvironment', 'type': 'int'}, - 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, - 'environments': {'key': 'environments', 'type': '[DefinitionEnvironmentReference]'}, - 'expands': {'key': 'expands', 'type': 'object'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'latest_deployments_only': {'key': 'latestDeploymentsOnly', 'type': 'bool'}, - 'max_deployments_per_environment': {'key': 'maxDeploymentsPerEnvironment', 'type': 'int'}, - 'max_modified_time': {'key': 'maxModifiedTime', 'type': 'iso-8601'}, - 'min_modified_time': {'key': 'minModifiedTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'query_order': {'key': 'queryOrder', 'type': 'object'}, - 'query_type': {'key': 'queryType', 'type': 'object'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'} - } - - def __init__(self, artifact_source_id=None, artifact_type_id=None, artifact_versions=None, deployments_per_environment=None, deployment_status=None, environments=None, expands=None, is_deleted=None, latest_deployments_only=None, max_deployments_per_environment=None, max_modified_time=None, min_modified_time=None, operation_status=None, query_order=None, query_type=None, source_branch=None): - super(DeploymentQueryParameters, self).__init__() - self.artifact_source_id = artifact_source_id - self.artifact_type_id = artifact_type_id - self.artifact_versions = artifact_versions - self.deployments_per_environment = deployments_per_environment - self.deployment_status = deployment_status - self.environments = environments - self.expands = expands - self.is_deleted = is_deleted - self.latest_deployments_only = latest_deployments_only - self.max_deployments_per_environment = max_deployments_per_environment - self.max_modified_time = max_modified_time - self.min_modified_time = min_modified_time - self.operation_status = operation_status - self.query_order = query_order - self.query_type = query_type - self.source_branch = source_branch - - -class EmailRecipients(Model): - """ - :param email_addresses: List of email addresses. - :type email_addresses: list of str - :param tfs_ids: List of TFS IDs guids. - :type tfs_ids: list of str - """ - - _attribute_map = { - 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, - 'tfs_ids': {'key': 'tfsIds', 'type': '[str]'} - } - - def __init__(self, email_addresses=None, tfs_ids=None): - super(EmailRecipients, self).__init__() - self.email_addresses = email_addresses - self.tfs_ids = tfs_ids - - -class EnvironmentExecutionPolicy(Model): - """ - Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied. - - :param concurrency_count: This policy decides, how many environments would be with Environment Runner. - :type concurrency_count: int - :param queue_depth_count: Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running. - :type queue_depth_count: int - """ - - _attribute_map = { - 'concurrency_count': {'key': 'concurrencyCount', 'type': 'int'}, - 'queue_depth_count': {'key': 'queueDepthCount', 'type': 'int'} - } - - def __init__(self, concurrency_count=None, queue_depth_count=None): - super(EnvironmentExecutionPolicy, self).__init__() - self.concurrency_count = concurrency_count - self.queue_depth_count = queue_depth_count - - -class EnvironmentOptions(Model): - """ - :param auto_link_work_items: Gets and sets as the auto link workitems or not. - :type auto_link_work_items: bool - :param badge_enabled: Gets and sets as the badge enabled or not. - :type badge_enabled: bool - :param email_notification_type: - :type email_notification_type: str - :param email_recipients: - :type email_recipients: str - :param enable_access_token: - :type enable_access_token: bool - :param publish_deployment_status: Gets and sets as the publish deployment status or not. - :type publish_deployment_status: bool - :param pull_request_deployment_enabled: Gets and sets as the.pull request deployment enabled or not. - :type pull_request_deployment_enabled: bool - :param skip_artifacts_download: - :type skip_artifacts_download: bool - :param timeout_in_minutes: - :type timeout_in_minutes: int - """ - - _attribute_map = { - 'auto_link_work_items': {'key': 'autoLinkWorkItems', 'type': 'bool'}, - 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, - 'email_notification_type': {'key': 'emailNotificationType', 'type': 'str'}, - 'email_recipients': {'key': 'emailRecipients', 'type': 'str'}, - 'enable_access_token': {'key': 'enableAccessToken', 'type': 'bool'}, - 'publish_deployment_status': {'key': 'publishDeploymentStatus', 'type': 'bool'}, - 'pull_request_deployment_enabled': {'key': 'pullRequestDeploymentEnabled', 'type': 'bool'}, - 'skip_artifacts_download': {'key': 'skipArtifactsDownload', 'type': 'bool'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} - } - - def __init__(self, auto_link_work_items=None, badge_enabled=None, email_notification_type=None, email_recipients=None, enable_access_token=None, publish_deployment_status=None, pull_request_deployment_enabled=None, skip_artifacts_download=None, timeout_in_minutes=None): - super(EnvironmentOptions, self).__init__() - self.auto_link_work_items = auto_link_work_items - self.badge_enabled = badge_enabled - self.email_notification_type = email_notification_type - self.email_recipients = email_recipients - self.enable_access_token = enable_access_token - self.publish_deployment_status = publish_deployment_status - self.pull_request_deployment_enabled = pull_request_deployment_enabled - self.skip_artifacts_download = skip_artifacts_download - self.timeout_in_minutes = timeout_in_minutes - - -class EnvironmentRetentionPolicy(Model): - """ - :param days_to_keep: Gets and sets the number of days to keep environment. - :type days_to_keep: int - :param releases_to_keep: Gets and sets the number of releases to keep. - :type releases_to_keep: int - :param retain_build: Gets and sets as the build to be retained or not. - :type retain_build: bool - """ - - _attribute_map = { - 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'}, - 'releases_to_keep': {'key': 'releasesToKeep', 'type': 'int'}, - 'retain_build': {'key': 'retainBuild', 'type': 'bool'} - } - - def __init__(self, days_to_keep=None, releases_to_keep=None, retain_build=None): - super(EnvironmentRetentionPolicy, self).__init__() - self.days_to_keep = days_to_keep - self.releases_to_keep = releases_to_keep - self.retain_build = retain_build - - -class EnvironmentTrigger(Model): - """ - :param definition_environment_id: Definition environment ID on which this trigger applicable. - :type definition_environment_id: int - :param release_definition_id: ReleaseDefinition ID on which this trigger applicable. - :type release_definition_id: int - :param trigger_content: Gets or sets the trigger content. - :type trigger_content: str - :param trigger_type: Gets or sets the trigger type. - :type trigger_type: object - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, - 'trigger_content': {'key': 'triggerContent', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'object'} - } - - def __init__(self, definition_environment_id=None, release_definition_id=None, trigger_content=None, trigger_type=None): - super(EnvironmentTrigger, self).__init__() - self.definition_environment_id = definition_environment_id - self.release_definition_id = release_definition_id - self.trigger_content = trigger_content - self.trigger_type = trigger_type - - -class FavoriteItem(Model): - """ - Class to represent favorite entry. - - :param data: Application specific data for the entry. - :type data: str - :param id: Unique Id of the the entry. - :type id: str - :param name: Display text for favorite entry. - :type name: str - :param type: Application specific favorite entry type. Empty or Null represents that Favorite item is a Folder. - :type type: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, data=None, id=None, name=None, type=None): - super(FavoriteItem, self).__init__() - self.data = data - self.id = id - self.name = name - self.type = type - - -class Folder(Model): - """ - :param created_by: Identity who created this folder. - :type created_by: :class:`IdentityRef ` - :param created_on: Time when this folder created. - :type created_on: datetime - :param description: Description of the folder. - :type description: str - :param last_changed_by: Identity who last changed this folder. - :type last_changed_by: :class:`IdentityRef ` - :param last_changed_date: Time when this folder last changed. - :type last_changed_date: datetime - :param path: path of the folder. - :type path: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, - 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, created_by=None, created_on=None, description=None, last_changed_by=None, last_changed_date=None, path=None): - super(Folder, self).__init__() - self.created_by = created_by - self.created_on = created_on - self.description = description - self.last_changed_by = last_changed_by - self.last_changed_date = last_changed_date - self.path = path - - -class GateUpdateMetadata(Model): - """ - :param comment: Comment. - :type comment: str - :param gates_to_ignore: Name of gate to be ignored. - :type gates_to_ignore: list of str - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'gates_to_ignore': {'key': 'gatesToIgnore', 'type': '[str]'} - } - - def __init__(self, comment=None, gates_to_ignore=None): - super(GateUpdateMetadata, self).__init__() - self.comment = comment - self.gates_to_ignore = gates_to_ignore - - -class GraphSubjectBase(Model): - """ - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityRef(GraphSubjectBase): - """ - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - :param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary - :type directory_alias: str - :param id: - :type id: str - :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary - :type image_url: str - :param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary - :type inactive: bool - :param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) - :type is_aad_identity: bool - :param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef - :type profile_url: str - :param unique_name: Deprecated - use Domain+PrincipalName instead - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class IgnoredGate(Model): - """ - :param last_modified_on: Gets the date on which gate is last ignored. - :type last_modified_on: datetime - :param name: Name of gate ignored. - :type name: str - """ - - _attribute_map = { - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, last_modified_on=None, name=None): - super(IgnoredGate, self).__init__() - self.last_modified_on = last_modified_on - self.name = name - - -class InputDescriptor(Model): - """ - Describes an input for subscriptions. - - :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. - :type dependency_input_ids: list of str - :param description: Description of what this input is used for - :type description: str - :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. - :type group_name: str - :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. - :type has_dynamic_value_information: bool - :param id: Identifier for the subscription input - :type id: str - :param input_mode: Mode in which the value of this input should be entered - :type input_mode: object - :param is_confidential: Gets whether this input is confidential, such as for a password or application key - :type is_confidential: bool - :param name: Localized name which can be shown as a label for the subscription input - :type name: str - :param properties: Custom properties for the input which can be used by the service provider - :type properties: dict - :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. - :type type: str - :param use_in_default_description: Gets whether this input is included in the default generated action description. - :type use_in_default_description: bool - :param validation: Information to use to validate this input's value - :type validation: :class:`InputValidation ` - :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. - :type value_hint: str - :param values: Information about possible values for this input - :type values: :class:`InputValues ` - """ - - _attribute_map = { - 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, - 'id': {'key': 'id', 'type': 'str'}, - 'input_mode': {'key': 'inputMode', 'type': 'object'}, - 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, - 'validation': {'key': 'validation', 'type': 'InputValidation'}, - 'value_hint': {'key': 'valueHint', 'type': 'str'}, - 'values': {'key': 'values', 'type': 'InputValues'} - } - - def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): - super(InputDescriptor, self).__init__() - self.dependency_input_ids = dependency_input_ids - self.description = description - self.group_name = group_name - self.has_dynamic_value_information = has_dynamic_value_information - self.id = id - self.input_mode = input_mode - self.is_confidential = is_confidential - self.name = name - self.properties = properties - self.type = type - self.use_in_default_description = use_in_default_description - self.validation = validation - self.value_hint = value_hint - self.values = values - - -class InputValidation(Model): - """ - Describes what values are valid for a subscription input - - :param data_type: Gets or sets the data data type to validate. - :type data_type: object - :param is_required: Gets or sets if this is a required field. - :type is_required: bool - :param max_length: Gets or sets the maximum length of this descriptor. - :type max_length: int - :param max_value: Gets or sets the minimum value for this descriptor. - :type max_value: decimal - :param min_length: Gets or sets the minimum length of this descriptor. - :type min_length: int - :param min_value: Gets or sets the minimum value for this descriptor. - :type min_value: decimal - :param pattern: Gets or sets the pattern to validate. - :type pattern: str - :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. - :type pattern_mismatch_error_message: str - """ - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'object'}, - 'is_required': {'key': 'isRequired', 'type': 'bool'}, - 'max_length': {'key': 'maxLength', 'type': 'int'}, - 'max_value': {'key': 'maxValue', 'type': 'decimal'}, - 'min_length': {'key': 'minLength', 'type': 'int'}, - 'min_value': {'key': 'minValue', 'type': 'decimal'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} - } - - def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): - super(InputValidation, self).__init__() - self.data_type = data_type - self.is_required = is_required - self.max_length = max_length - self.max_value = max_value - self.min_length = min_length - self.min_value = min_value - self.pattern = pattern - self.pattern_mismatch_error_message = pattern_mismatch_error_message - - -class InputValue(Model): - """ - Information about a single value for an input - - :param data: Any other data about this input - :type data: dict - :param display_value: The text to show for the display of this value - :type display_value: str - :param value: The value to store for this input - :type value: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{object}'}, - 'display_value': {'key': 'displayValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, data=None, display_value=None, value=None): - super(InputValue, self).__init__() - self.data = data - self.display_value = display_value - self.value = value - - -class InputValues(Model): - """ - Information about the possible/allowed values for a given subscription input - - :param default_value: The default value to use for this input - :type default_value: str - :param error: Errors encountered while computing dynamic values. - :type error: :class:`InputValuesError ` - :param input_id: The id of the input - :type input_id: str - :param is_disabled: Should this input be disabled - :type is_disabled: bool - :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) - :type is_limited_to_possible_values: bool - :param is_read_only: Should this input be made read-only - :type is_read_only: bool - :param possible_values: Possible values that this input can take - :type possible_values: list of :class:`InputValue ` - """ - - _attribute_map = { - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'InputValuesError'}, - 'input_id': {'key': 'inputId', 'type': 'str'}, - 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, - 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, - 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, - 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} - } - - def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): - super(InputValues, self).__init__() - self.default_value = default_value - self.error = error - self.input_id = input_id - self.is_disabled = is_disabled - self.is_limited_to_possible_values = is_limited_to_possible_values - self.is_read_only = is_read_only - self.possible_values = possible_values - - -class InputValuesError(Model): - """ - Error information related to a subscription input value. - - :param message: The error message. - :type message: str - """ - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, message=None): - super(InputValuesError, self).__init__() - self.message = message - - -class InputValuesQuery(Model): - """ - :param current_values: - :type current_values: dict - :param input_values: The input values to return on input, and the result from the consumer on output. - :type input_values: list of :class:`InputValues ` - :param resource: Subscription containing information about the publisher/consumer and the current input values - :type resource: object - """ - - _attribute_map = { - 'current_values': {'key': 'currentValues', 'type': '{str}'}, - 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, - 'resource': {'key': 'resource', 'type': 'object'} - } - - def __init__(self, current_values=None, input_values=None, resource=None): - super(InputValuesQuery, self).__init__() - self.current_values = current_values - self.input_values = input_values - self.resource = resource - - -class Issue(Model): - """ - :param data: Issue data. - :type data: dict - :param issue_type: Issue type, for example error, warning or info. - :type issue_type: str - :param message: Issue message. - :type message: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - 'issue_type': {'key': 'issueType', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, data=None, issue_type=None, message=None): - super(Issue, self).__init__() - self.data = data - self.issue_type = issue_type - self.message = message - - -class MailMessage(Model): - """ - :param body: Body of mail. - :type body: str - :param cc: Mail CC recipients. - :type cc: :class:`EmailRecipients ` - :param in_reply_to: Reply to. - :type in_reply_to: str - :param message_id: Message ID of the mail. - :type message_id: str - :param reply_by: Data when should be replied to mail. - :type reply_by: datetime - :param reply_to: Reply to Email recipients. - :type reply_to: :class:`EmailRecipients ` - :param sections: List of mail section types. - :type sections: list of MailSectionType - :param sender_type: Mail sender type. - :type sender_type: object - :param subject: Subject of the mail. - :type subject: str - :param to: Mail To recipients. - :type to: :class:`EmailRecipients ` - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'str'}, - 'cc': {'key': 'cc', 'type': 'EmailRecipients'}, - 'in_reply_to': {'key': 'inReplyTo', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'reply_by': {'key': 'replyBy', 'type': 'iso-8601'}, - 'reply_to': {'key': 'replyTo', 'type': 'EmailRecipients'}, - 'sections': {'key': 'sections', 'type': '[object]'}, - 'sender_type': {'key': 'senderType', 'type': 'object'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'EmailRecipients'} - } - - def __init__(self, body=None, cc=None, in_reply_to=None, message_id=None, reply_by=None, reply_to=None, sections=None, sender_type=None, subject=None, to=None): - super(MailMessage, self).__init__() - self.body = body - self.cc = cc - self.in_reply_to = in_reply_to - self.message_id = message_id - self.reply_by = reply_by - self.reply_to = reply_to - self.sections = sections - self.sender_type = sender_type - self.subject = subject - self.to = to - - -class ManualIntervention(Model): - """ - :param approver: Gets or sets the identity who should approve. - :type approver: :class:`IdentityRef ` - :param comments: Gets or sets comments for approval. - :type comments: str - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param id: Gets the unique identifier for manual intervention. - :type id: int - :param instructions: Gets or sets instructions for approval. - :type instructions: str - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets or sets the name. - :type name: str - :param release: Gets releaseReference for manual intervention. - :type release: :class:`ReleaseShallowReference ` - :param release_definition: Gets releaseDefinitionReference for manual intervention. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference for manual intervention. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param status: Gets or sets the status of the manual intervention. - :type status: object - :param task_instance_id: Get task instance identifier. - :type task_instance_id: str - :param url: Gets url to access the manual intervention. - :type url: str - """ - - _attribute_map = { - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'int'}, - 'instructions': {'key': 'instructions', 'type': 'str'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'status': {'key': 'status', 'type': 'object'}, - 'task_instance_id': {'key': 'taskInstanceId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, approver=None, comments=None, created_on=None, id=None, instructions=None, modified_on=None, name=None, release=None, release_definition=None, release_environment=None, status=None, task_instance_id=None, url=None): - super(ManualIntervention, self).__init__() - self.approver = approver - self.comments = comments - self.created_on = created_on - self.id = id - self.instructions = instructions - self.modified_on = modified_on - self.name = name - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.status = status - self.task_instance_id = task_instance_id - self.url = url - - -class ManualInterventionUpdateMetadata(Model): - """ - :param comment: Sets the comment for manual intervention update. - :type comment: str - :param status: Sets the status of the manual intervention. - :type status: object - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, comment=None, status=None): - super(ManualInterventionUpdateMetadata, self).__init__() - self.comment = comment - self.status = status - - -class Metric(Model): - """ - :param name: Name of the Metric. - :type name: str - :param value: Value of the Metric. - :type value: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'} - } - - def __init__(self, name=None, value=None): - super(Metric, self).__init__() - self.name = name - self.value = value - - -class PipelineProcess(Model): - """ - :param type: Pipeline process type. - :type type: object - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'object'} - } - - def __init__(self, type=None): - super(PipelineProcess, self).__init__() - self.type = type - - -class ProcessParameters(Model): - """ - :param data_source_bindings: - :type data_source_bindings: list of :class:`DataSourceBindingBase ` - :param inputs: - :type inputs: list of :class:`TaskInputDefinitionBase ` - :param source_definitions: - :type source_definitions: list of :class:`TaskSourceDefinitionBase ` - """ - - _attribute_map = { - 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBindingBase]'}, - 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinitionBase]'}, - 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinitionBase]'} - } - - def __init__(self, data_source_bindings=None, inputs=None, source_definitions=None): - super(ProcessParameters, self).__init__() - self.data_source_bindings = data_source_bindings - self.inputs = inputs - self.source_definitions = source_definitions - - -class ProjectReference(Model): - """ - :param id: Gets the unique identifier of this field. - :type id: str - :param name: Gets name of project. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, name=None): - super(ProjectReference, self).__init__() - self.id = id - self.name = name - - -class QueuedReleaseData(Model): - """ - :param project_id: Project ID of the release. - :type project_id: str - :param queue_position: Release queue position. - :type queue_position: int - :param release_id: Queued release ID. - :type release_id: int - """ - - _attribute_map = { - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'queue_position': {'key': 'queuePosition', 'type': 'int'}, - 'release_id': {'key': 'releaseId', 'type': 'int'} - } - - def __init__(self, project_id=None, queue_position=None, release_id=None): - super(QueuedReleaseData, self).__init__() - self.project_id = project_id - self.queue_position = queue_position - self.release_id = release_id - - -class ReferenceLinks(Model): - """ - The class to represent a collection of REST reference links. - - :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class Release(Model): - """ - :param _links: Gets links to access the release. - :type _links: :class:`ReferenceLinks ` - :param artifacts: Gets or sets the list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param comment: Gets or sets comment. - :type comment: str - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param definition_snapshot_revision: Gets revision number of definition snapshot. - :type definition_snapshot_revision: int - :param description: Gets or sets description of release. - :type description: str - :param environments: Gets list of environments. - :type environments: list of :class:`ReleaseEnvironment ` - :param id: Gets the unique identifier of this field. - :type id: int - :param keep_forever: Whether to exclude the release from retention policies. - :type keep_forever: bool - :param logs_container_url: Gets logs container url. - :type logs_container_url: str - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets name. - :type name: str - :param pool_name: Gets pool name. - :type pool_name: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param properties: - :type properties: :class:`object ` - :param reason: Gets reason of release. - :type reason: object - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_definition_revision: Gets or sets the release definition revision. - :type release_definition_revision: int - :param release_name_format: Gets release name format. - :type release_name_format: str - :param status: Gets status. - :type status: object - :param tags: Gets or sets list of tags. - :type tags: list of str - :param triggering_artifact_alias: - :type triggering_artifact_alias: str - :param url: - :type url: str - :param variable_groups: Gets the list of variable groups. - :type variable_groups: list of :class:`VariableGroup ` - :param variables: Gets or sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments': {'key': 'environments', 'type': '[ReleaseEnvironment]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, - 'logs_container_url': {'key': 'logsContainerUrl', 'type': 'str'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_definition_revision': {'key': 'releaseDefinitionRevision', 'type': 'int'}, - 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'triggering_artifact_alias': {'key': 'triggeringArtifactAlias', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, created_on=None, definition_snapshot_revision=None, description=None, environments=None, id=None, keep_forever=None, logs_container_url=None, modified_by=None, modified_on=None, name=None, pool_name=None, project_reference=None, properties=None, reason=None, release_definition=None, release_definition_revision=None, release_name_format=None, status=None, tags=None, triggering_artifact_alias=None, url=None, variable_groups=None, variables=None): - super(Release, self).__init__() - self._links = _links - self.artifacts = artifacts - self.comment = comment - self.created_by = created_by - self.created_on = created_on - self.definition_snapshot_revision = definition_snapshot_revision - self.description = description - self.environments = environments - self.id = id - self.keep_forever = keep_forever - self.logs_container_url = logs_container_url - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.pool_name = pool_name - self.project_reference = project_reference - self.properties = properties - self.reason = reason - self.release_definition = release_definition - self.release_definition_revision = release_definition_revision - self.release_name_format = release_name_format - self.status = status - self.tags = tags - self.triggering_artifact_alias = triggering_artifact_alias - self.url = url - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseApproval(Model): - """ - :param approval_type: Gets or sets the type of approval. - :type approval_type: object - :param approved_by: Gets the identity who approved. - :type approved_by: :class:`IdentityRef ` - :param approver: Gets or sets the identity who should approve. - :type approver: :class:`IdentityRef ` - :param attempt: Gets or sets attempt which specifies as which deployment attempt it belongs. - :type attempt: int - :param comments: Gets or sets comments for approval. - :type comments: str - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param history: Gets history which specifies all approvals associated with this approval. - :type history: list of :class:`ReleaseApprovalHistory ` - :param id: Gets the unique identifier of this field. - :type id: int - :param is_automated: Gets or sets as approval is automated or not. - :type is_automated: bool - :param is_notification_on: - :type is_notification_on: bool - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param rank: Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval. - :type rank: int - :param release: Gets releaseReference which specifies the reference of the release to which this approval is associated. - :type release: :class:`ReleaseShallowReference ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param revision: Gets the revision number. - :type revision: int - :param status: Gets or sets the status of the approval. - :type status: object - :param trial_number: - :type trial_number: int - :param url: Gets url to access the approval. - :type url: str - """ - - _attribute_map = { - 'approval_type': {'key': 'approvalType', 'type': 'object'}, - 'approved_by': {'key': 'approvedBy', 'type': 'IdentityRef'}, - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'history': {'key': 'history', 'type': '[ReleaseApprovalHistory]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, - 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'object'}, - 'trial_number': {'key': 'trialNumber', 'type': 'int'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, approval_type=None, approved_by=None, approver=None, attempt=None, comments=None, created_on=None, history=None, id=None, is_automated=None, is_notification_on=None, modified_on=None, rank=None, release=None, release_definition=None, release_environment=None, revision=None, status=None, trial_number=None, url=None): - super(ReleaseApproval, self).__init__() - self.approval_type = approval_type - self.approved_by = approved_by - self.approver = approver - self.attempt = attempt - self.comments = comments - self.created_on = created_on - self.history = history - self.id = id - self.is_automated = is_automated - self.is_notification_on = is_notification_on - self.modified_on = modified_on - self.rank = rank - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.revision = revision - self.status = status - self.trial_number = trial_number - self.url = url - - -class ReleaseApprovalHistory(Model): - """ - :param approver: Identity of the approver. - :type approver: :class:`IdentityRef ` - :param changed_by: Identity of the object who changed approval. - :type changed_by: :class:`IdentityRef ` - :param comments: Approval history comments. - :type comments: str - :param created_on: Time when this approval created. - :type created_on: datetime - :param modified_on: Time when this approval modified. - :type modified_on: datetime - :param revision: Approval history revision. - :type revision: int - """ - - _attribute_map = { - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'revision': {'key': 'revision', 'type': 'int'} - } - - def __init__(self, approver=None, changed_by=None, comments=None, created_on=None, modified_on=None, revision=None): - super(ReleaseApprovalHistory, self).__init__() - self.approver = approver - self.changed_by = changed_by - self.comments = comments - self.created_on = created_on - self.modified_on = modified_on - self.revision = revision - - -class ReleaseCondition(Condition): - """ - :param condition_type: Gets or sets the condition type. - :type condition_type: object - :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. - :type name: str - :param value: Gets or set value of the condition. - :type value: str - :param result: The release condition result. - :type result: bool - """ - - _attribute_map = { - 'condition_type': {'key': 'conditionType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'result': {'key': 'result', 'type': 'bool'} - } - - def __init__(self, condition_type=None, name=None, value=None, result=None): - super(ReleaseCondition, self).__init__(condition_type=condition_type, name=name, value=value) - self.result = result - - -class ReleaseDefinitionApprovals(Model): - """ - :param approval_options: Gets or sets the approval options. - :type approval_options: :class:`ApprovalOptions ` - :param approvals: Gets or sets the approvals. - :type approvals: list of :class:`ReleaseDefinitionApprovalStep ` - """ - - _attribute_map = { - 'approval_options': {'key': 'approvalOptions', 'type': 'ApprovalOptions'}, - 'approvals': {'key': 'approvals', 'type': '[ReleaseDefinitionApprovalStep]'} - } - - def __init__(self, approval_options=None, approvals=None): - super(ReleaseDefinitionApprovals, self).__init__() - self.approval_options = approval_options - self.approvals = approvals - - -class ReleaseDefinitionEnvironment(Model): - """ - :param badge_url: Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment. - :type badge_url: str - :param conditions: Gets or sets the environment conditions. - :type conditions: list of :class:`Condition ` - :param current_release: Gets or sets the current release reference. - :type current_release: :class:`ReleaseShallowReference ` - :param demands: Gets or sets the demands. - :type demands: list of :class:`object ` - :param deploy_phases: Gets or sets the deploy phases of environment. - :type deploy_phases: list of :class:`object ` - :param deploy_step: Gets or sets the deploystep. - :type deploy_step: :class:`ReleaseDefinitionDeployStep ` - :param environment_options: Gets or sets the environment options. - :type environment_options: :class:`EnvironmentOptions ` - :param environment_triggers: Gets or sets the triggers on environment. - :type environment_triggers: list of :class:`EnvironmentTrigger ` - :param execution_policy: Gets or sets the environment execution policy. - :type execution_policy: :class:`EnvironmentExecutionPolicy ` - :param id: Gets and sets the ID of the ReleaseDefinitionEnvironment. - :type id: int - :param name: Gets and sets the name of the ReleaseDefinitionEnvironment. - :type name: str - :param owner: Gets and sets the Owner of the ReleaseDefinitionEnvironment. - :type owner: :class:`IdentityRef ` - :param post_deploy_approvals: Gets or sets the post deployment approvals. - :type post_deploy_approvals: :class:`ReleaseDefinitionApprovals ` - :param post_deployment_gates: Gets or sets the post deployment gates. - :type post_deployment_gates: :class:`ReleaseDefinitionGatesStep ` - :param pre_deploy_approvals: Gets or sets the pre deployment approvals. - :type pre_deploy_approvals: :class:`ReleaseDefinitionApprovals ` - :param pre_deployment_gates: Gets or sets the pre deployment gates. - :type pre_deployment_gates: :class:`ReleaseDefinitionGatesStep ` - :param process_parameters: Gets or sets the environment process parameters. - :type process_parameters: :class:`ProcessParameters ` - :param properties: Gets or sets the properties on environment. - :type properties: :class:`object ` - :param queue_id: Gets or sets the queue ID. - :type queue_id: int - :param rank: Gets and sets the rank of the ReleaseDefinitionEnvironment. - :type rank: int - :param retention_policy: Gets or sets the environment retention policy. - :type retention_policy: :class:`EnvironmentRetentionPolicy ` - :param run_options: - :type run_options: dict - :param schedules: Gets or sets the schedules - :type schedules: list of :class:`ReleaseSchedule ` - :param variable_groups: Gets or sets the variable groups. - :type variable_groups: list of int - :param variables: Gets and sets the variables. - :type variables: dict - """ - - _attribute_map = { - 'badge_url': {'key': 'badgeUrl', 'type': 'str'}, - 'conditions': {'key': 'conditions', 'type': '[Condition]'}, - 'current_release': {'key': 'currentRelease', 'type': 'ReleaseShallowReference'}, - 'demands': {'key': 'demands', 'type': '[object]'}, - 'deploy_phases': {'key': 'deployPhases', 'type': '[object]'}, - 'deploy_step': {'key': 'deployStep', 'type': 'ReleaseDefinitionDeployStep'}, - 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, - 'environment_triggers': {'key': 'environmentTriggers', 'type': '[EnvironmentTrigger]'}, - 'execution_policy': {'key': 'executionPolicy', 'type': 'EnvironmentExecutionPolicy'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'owner': {'key': 'owner', 'type': 'IdentityRef'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, - 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, - 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, - 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'queue_id': {'key': 'queueId', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, - 'run_options': {'key': 'runOptions', 'type': '{str}'}, - 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, badge_url=None, conditions=None, current_release=None, demands=None, deploy_phases=None, deploy_step=None, environment_options=None, environment_triggers=None, execution_policy=None, id=None, name=None, owner=None, post_deploy_approvals=None, post_deployment_gates=None, pre_deploy_approvals=None, pre_deployment_gates=None, process_parameters=None, properties=None, queue_id=None, rank=None, retention_policy=None, run_options=None, schedules=None, variable_groups=None, variables=None): - super(ReleaseDefinitionEnvironment, self).__init__() - self.badge_url = badge_url - self.conditions = conditions - self.current_release = current_release - self.demands = demands - self.deploy_phases = deploy_phases - self.deploy_step = deploy_step - self.environment_options = environment_options - self.environment_triggers = environment_triggers - self.execution_policy = execution_policy - self.id = id - self.name = name - self.owner = owner - self.post_deploy_approvals = post_deploy_approvals - self.post_deployment_gates = post_deployment_gates - self.pre_deploy_approvals = pre_deploy_approvals - self.pre_deployment_gates = pre_deployment_gates - self.process_parameters = process_parameters - self.properties = properties - self.queue_id = queue_id - self.rank = rank - self.retention_policy = retention_policy - self.run_options = run_options - self.schedules = schedules - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseDefinitionEnvironmentStep(Model): - """ - :param id: ID of the approval or deploy step. - :type id: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, id=None): - super(ReleaseDefinitionEnvironmentStep, self).__init__() - self.id = id - - -class ReleaseDefinitionEnvironmentSummary(Model): - """ - :param id: ID of ReleaseDefinition environment summary. - :type id: int - :param last_releases: List of release shallow reference deployed using this ReleaseDefinition. - :type last_releases: list of :class:`ReleaseShallowReference ` - :param name: Name of ReleaseDefinition environment summary. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'last_releases': {'key': 'lastReleases', 'type': '[ReleaseShallowReference]'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, last_releases=None, name=None): - super(ReleaseDefinitionEnvironmentSummary, self).__init__() - self.id = id - self.last_releases = last_releases - self.name = name - - -class ReleaseDefinitionEnvironmentTemplate(Model): - """ - :param can_delete: Indicates whether template can be deleted or not. - :type can_delete: bool - :param category: Category of the ReleaseDefinition environment template. - :type category: str - :param description: Description of the ReleaseDefinition environment template. - :type description: str - :param environment: ReleaseDefinition environment data which used to create this template. - :type environment: :class:`ReleaseDefinitionEnvironment ` - :param icon_task_id: ID of the task which used to display icon used for this template. - :type icon_task_id: str - :param icon_uri: Icon uri of the template. - :type icon_uri: str - :param id: ID of the ReleaseDefinition environment template. - :type id: str - :param is_deleted: Indicates whether template deleted or not. - :type is_deleted: bool - :param name: Name of the ReleaseDefinition environment template. - :type name: str - """ - - _attribute_map = { - 'can_delete': {'key': 'canDelete', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ReleaseDefinitionEnvironment'}, - 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, - 'icon_uri': {'key': 'iconUri', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, can_delete=None, category=None, description=None, environment=None, icon_task_id=None, icon_uri=None, id=None, is_deleted=None, name=None): - super(ReleaseDefinitionEnvironmentTemplate, self).__init__() - self.can_delete = can_delete - self.category = category - self.description = description - self.environment = environment - self.icon_task_id = icon_task_id - self.icon_uri = icon_uri - self.id = id - self.is_deleted = is_deleted - self.name = name - - -class ReleaseDefinitionGate(Model): - """ - :param tasks: Gets or sets the gates workflow. - :type tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, tasks=None): - super(ReleaseDefinitionGate, self).__init__() - self.tasks = tasks - - -class ReleaseDefinitionGatesOptions(Model): - """ - :param is_enabled: Gets or sets as the gates enabled or not. - :type is_enabled: bool - :param minimum_success_duration: Gets or sets the minimum duration for steady results after a successful gates evaluation. - :type minimum_success_duration: int - :param sampling_interval: Gets or sets the time between re-evaluation of gates. - :type sampling_interval: int - :param stabilization_time: Gets or sets the delay before evaluation. - :type stabilization_time: int - :param timeout: Gets or sets the timeout after which gates fail. - :type timeout: int - """ - - _attribute_map = { - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'minimum_success_duration': {'key': 'minimumSuccessDuration', 'type': 'int'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'stabilization_time': {'key': 'stabilizationTime', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'int'} - } - - def __init__(self, is_enabled=None, minimum_success_duration=None, sampling_interval=None, stabilization_time=None, timeout=None): - super(ReleaseDefinitionGatesOptions, self).__init__() - self.is_enabled = is_enabled - self.minimum_success_duration = minimum_success_duration - self.sampling_interval = sampling_interval - self.stabilization_time = stabilization_time - self.timeout = timeout - - -class ReleaseDefinitionGatesStep(Model): - """ - :param gates: Gets or sets the gates. - :type gates: list of :class:`ReleaseDefinitionGate ` - :param gates_options: Gets or sets the gate options. - :type gates_options: :class:`ReleaseDefinitionGatesOptions ` - :param id: ID of the ReleaseDefinitionGateStep. - :type id: int - """ - - _attribute_map = { - 'gates': {'key': 'gates', 'type': '[ReleaseDefinitionGate]'}, - 'gates_options': {'key': 'gatesOptions', 'type': 'ReleaseDefinitionGatesOptions'}, - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, gates=None, gates_options=None, id=None): - super(ReleaseDefinitionGatesStep, self).__init__() - self.gates = gates - self.gates_options = gates_options - self.id = id - - -class ReleaseDefinitionRevision(Model): - """ - :param api_version: Gets api-version for revision object. - :type api_version: str - :param changed_by: Gets the identity who did change. - :type changed_by: :class:`IdentityRef ` - :param changed_date: Gets date on which ReleaseDefinition changed. - :type changed_date: datetime - :param change_type: Gets type of change. - :type change_type: object - :param comment: Gets comments for revision. - :type comment: str - :param definition_id: Get id of the definition. - :type definition_id: int - :param definition_url: Gets definition URL. - :type definition_url: str - :param revision: Get revision number of the definition. - :type revision: int - """ - - _attribute_map = { - 'api_version': {'key': 'apiVersion', 'type': 'str'}, - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'change_type': {'key': 'changeType', 'type': 'object'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'definition_id': {'key': 'definitionId', 'type': 'int'}, - 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'} - } - - def __init__(self, api_version=None, changed_by=None, changed_date=None, change_type=None, comment=None, definition_id=None, definition_url=None, revision=None): - super(ReleaseDefinitionRevision, self).__init__() - self.api_version = api_version - self.changed_by = changed_by - self.changed_date = changed_date - self.change_type = change_type - self.comment = comment - self.definition_id = definition_id - self.definition_url = definition_url - self.revision = revision - - -class ReleaseDefinitionShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release definition. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release definition. - :type id: int - :param name: Gets or sets the name of the release definition. - :type name: str - :param path: Gets or sets the path of the release definition. - :type path: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param url: Gets the REST API url to access the release definition. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None): - super(ReleaseDefinitionShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.path = path - self.project_reference = project_reference - self.url = url - - -class ReleaseDefinitionSummary(Model): - """ - :param environments: List of Release Definition environment summary. - :type environments: list of :class:`ReleaseDefinitionEnvironmentSummary ` - :param release_definition: Release Definition reference. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param releases: List of releases deployed using this Release Definition. - :type releases: list of :class:`Release ` - """ - - _attribute_map = { - 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironmentSummary]'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'releases': {'key': 'releases', 'type': '[Release]'} - } - - def __init__(self, environments=None, release_definition=None, releases=None): - super(ReleaseDefinitionSummary, self).__init__() - self.environments = environments - self.release_definition = release_definition - self.releases = releases - - -class ReleaseDefinitionUndeleteParameter(Model): - """ - :param comment: Gets or sets comment. - :type comment: str - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'} - } - - def __init__(self, comment=None): - super(ReleaseDefinitionUndeleteParameter, self).__init__() - self.comment = comment - - -class ReleaseDeployPhase(Model): - """ - :param deployment_jobs: Deployment jobs of the phase. - :type deployment_jobs: list of :class:`DeploymentJob ` - :param error_log: Phase execution error logs. - :type error_log: str - :param id: ID of the phase. - :type id: int - :param manual_interventions: List of manual intervention tasks execution information in phase. - :type manual_interventions: list of :class:`ManualIntervention ` - :param name: Name of the phase. - :type name: str - :param phase_id: ID of the phase. - :type phase_id: str - :param phase_type: Type of the phase. - :type phase_type: object - :param rank: Rank of the phase. - :type rank: int - :param run_plan_id: Run Plan ID of the phase. - :type run_plan_id: str - :param started_on: Phase start time. - :type started_on: datetime - :param status: Status of the phase. - :type status: object - """ - - _attribute_map = { - 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, - 'error_log': {'key': 'errorLog', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'manual_interventions': {'key': 'manualInterventions', 'type': '[ManualIntervention]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'phase_id': {'key': 'phaseId', 'type': 'str'}, - 'phase_type': {'key': 'phaseType', 'type': 'object'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, deployment_jobs=None, error_log=None, id=None, manual_interventions=None, name=None, phase_id=None, phase_type=None, rank=None, run_plan_id=None, started_on=None, status=None): - super(ReleaseDeployPhase, self).__init__() - self.deployment_jobs = deployment_jobs - self.error_log = error_log - self.id = id - self.manual_interventions = manual_interventions - self.name = name - self.phase_id = phase_id - self.phase_type = phase_type - self.rank = rank - self.run_plan_id = run_plan_id - self.started_on = started_on - self.status = status - - -class ReleaseEnvironment(Model): - """ - :param conditions: Gets list of conditions. - :type conditions: list of :class:`ReleaseCondition ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param definition_environment_id: Gets definition environment id. - :type definition_environment_id: int - :param demands: Gets demands. - :type demands: list of :class:`object ` - :param deploy_phases_snapshot: Gets list of deploy phases snapshot. - :type deploy_phases_snapshot: list of :class:`object ` - :param deploy_steps: Gets deploy steps. - :type deploy_steps: list of :class:`DeploymentAttempt ` - :param environment_options: Gets environment options. - :type environment_options: :class:`EnvironmentOptions ` - :param id: Gets the unique identifier of this field. - :type id: int - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets name. - :type name: str - :param next_scheduled_utc_time: Gets next scheduled UTC time. - :type next_scheduled_utc_time: datetime - :param owner: Gets the identity who is owner for release environment. - :type owner: :class:`IdentityRef ` - :param post_approvals_snapshot: Gets list of post deploy approvals snapshot. - :type post_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` - :param post_deploy_approvals: Gets list of post deploy approvals. - :type post_deploy_approvals: list of :class:`ReleaseApproval ` - :param post_deployment_gates_snapshot: Post deployment gates snapshot data. - :type post_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` - :param pre_approvals_snapshot: Gets list of pre deploy approvals snapshot. - :type pre_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` - :param pre_deploy_approvals: Gets list of pre deploy approvals. - :type pre_deploy_approvals: list of :class:`ReleaseApproval ` - :param pre_deployment_gates_snapshot: Pre deployment gates snapshot data. - :type pre_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` - :param process_parameters: Gets process parameters. - :type process_parameters: :class:`ProcessParameters ` - :param queue_id: Gets queue id. - :type queue_id: int - :param rank: Gets rank. - :type rank: int - :param release: Gets release reference which specifies the reference of the release to which this release environment is associated. - :type release: :class:`ReleaseShallowReference ` - :param release_created_by: Gets the identity who created release. - :type release_created_by: :class:`IdentityRef ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release environment is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_description: Gets release description. - :type release_description: str - :param release_id: Gets release id. - :type release_id: int - :param scheduled_deployment_time: Gets schedule deployment time of release environment. - :type scheduled_deployment_time: datetime - :param schedules: Gets list of schedules. - :type schedules: list of :class:`ReleaseSchedule ` - :param status: Gets environment status. - :type status: object - :param time_to_deploy: Gets time to deploy. - :type time_to_deploy: float - :param trigger_reason: Gets trigger reason. - :type trigger_reason: str - :param variable_groups: Gets the list of variable groups. - :type variable_groups: list of :class:`VariableGroup ` - :param variables: Gets the dictionary of variables. - :type variables: dict - :param workflow_tasks: Gets list of workflow tasks. - :type workflow_tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'conditions': {'key': 'conditions', 'type': '[ReleaseCondition]'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'demands': {'key': 'demands', 'type': '[object]'}, - 'deploy_phases_snapshot': {'key': 'deployPhasesSnapshot', 'type': '[object]'}, - 'deploy_steps': {'key': 'deploySteps', 'type': '[DeploymentAttempt]'}, - 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, - 'id': {'key': 'id', 'type': 'int'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'next_scheduled_utc_time': {'key': 'nextScheduledUtcTime', 'type': 'iso-8601'}, - 'owner': {'key': 'owner', 'type': 'IdentityRef'}, - 'post_approvals_snapshot': {'key': 'postApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, - 'post_deployment_gates_snapshot': {'key': 'postDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, - 'pre_approvals_snapshot': {'key': 'preApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, - 'pre_deployment_gates_snapshot': {'key': 'preDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, - 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, - 'queue_id': {'key': 'queueId', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_created_by': {'key': 'releaseCreatedBy', 'type': 'IdentityRef'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_description': {'key': 'releaseDescription', 'type': 'str'}, - 'release_id': {'key': 'releaseId', 'type': 'int'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, - 'status': {'key': 'status', 'type': 'object'}, - 'time_to_deploy': {'key': 'timeToDeploy', 'type': 'float'}, - 'trigger_reason': {'key': 'triggerReason', 'type': 'str'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'}, - 'workflow_tasks': {'key': 'workflowTasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, conditions=None, created_on=None, definition_environment_id=None, demands=None, deploy_phases_snapshot=None, deploy_steps=None, environment_options=None, id=None, modified_on=None, name=None, next_scheduled_utc_time=None, owner=None, post_approvals_snapshot=None, post_deploy_approvals=None, post_deployment_gates_snapshot=None, pre_approvals_snapshot=None, pre_deploy_approvals=None, pre_deployment_gates_snapshot=None, process_parameters=None, queue_id=None, rank=None, release=None, release_created_by=None, release_definition=None, release_description=None, release_id=None, scheduled_deployment_time=None, schedules=None, status=None, time_to_deploy=None, trigger_reason=None, variable_groups=None, variables=None, workflow_tasks=None): - super(ReleaseEnvironment, self).__init__() - self.conditions = conditions - self.created_on = created_on - self.definition_environment_id = definition_environment_id - self.demands = demands - self.deploy_phases_snapshot = deploy_phases_snapshot - self.deploy_steps = deploy_steps - self.environment_options = environment_options - self.id = id - self.modified_on = modified_on - self.name = name - self.next_scheduled_utc_time = next_scheduled_utc_time - self.owner = owner - self.post_approvals_snapshot = post_approvals_snapshot - self.post_deploy_approvals = post_deploy_approvals - self.post_deployment_gates_snapshot = post_deployment_gates_snapshot - self.pre_approvals_snapshot = pre_approvals_snapshot - self.pre_deploy_approvals = pre_deploy_approvals - self.pre_deployment_gates_snapshot = pre_deployment_gates_snapshot - self.process_parameters = process_parameters - self.queue_id = queue_id - self.rank = rank - self.release = release - self.release_created_by = release_created_by - self.release_definition = release_definition - self.release_description = release_description - self.release_id = release_id - self.scheduled_deployment_time = scheduled_deployment_time - self.schedules = schedules - self.status = status - self.time_to_deploy = time_to_deploy - self.trigger_reason = trigger_reason - self.variable_groups = variable_groups - self.variables = variables - self.workflow_tasks = workflow_tasks - - -class ReleaseEnvironmentShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release environment. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release environment. - :type id: int - :param name: Gets or sets the name of the release environment. - :type name: str - :param url: Gets the REST API url to access the release environment. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, url=None): - super(ReleaseEnvironmentShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.url = url - - -class ReleaseEnvironmentUpdateMetadata(Model): - """ - :param comment: Gets or sets comment. - :type comment: str - :param scheduled_deployment_time: Gets or sets scheduled deployment time. - :type scheduled_deployment_time: datetime - :param status: Gets or sets status of environment. - :type status: object - :param variables: Sets list of environment variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, comment=None, scheduled_deployment_time=None, status=None, variables=None): - super(ReleaseEnvironmentUpdateMetadata, self).__init__() - self.comment = comment - self.scheduled_deployment_time = scheduled_deployment_time - self.status = status - self.variables = variables - - -class ReleaseGates(Model): - """ - :param deployment_jobs: Contains the gates job details of each evaluation. - :type deployment_jobs: list of :class:`DeploymentJob ` - :param id: ID of release gates. - :type id: int - :param ignored_gates: List of ignored gates. - :type ignored_gates: list of :class:`IgnoredGate ` - :param last_modified_on: Gates last modified time. - :type last_modified_on: datetime - :param run_plan_id: Run plan ID of the gates. - :type run_plan_id: str - :param stabilization_completed_on: Gates stabilization completed date and time. - :type stabilization_completed_on: datetime - :param started_on: Gates evaluation started time. - :type started_on: datetime - :param status: Status of release gates. - :type status: object - :param succeeding_since: Date and time at which all gates executed successfully. - :type succeeding_since: datetime - """ - - _attribute_map = { - 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'ignored_gates': {'key': 'ignoredGates', 'type': '[IgnoredGate]'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'stabilization_completed_on': {'key': 'stabilizationCompletedOn', 'type': 'iso-8601'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'succeeding_since': {'key': 'succeedingSince', 'type': 'iso-8601'} - } - - def __init__(self, deployment_jobs=None, id=None, ignored_gates=None, last_modified_on=None, run_plan_id=None, stabilization_completed_on=None, started_on=None, status=None, succeeding_since=None): - super(ReleaseGates, self).__init__() - self.deployment_jobs = deployment_jobs - self.id = id - self.ignored_gates = ignored_gates - self.last_modified_on = last_modified_on - self.run_plan_id = run_plan_id - self.stabilization_completed_on = stabilization_completed_on - self.started_on = started_on - self.status = status - self.succeeding_since = succeeding_since - - -class ReleaseReference(Model): - """ - :param _links: Gets links to access the release. - :type _links: :class:`ReferenceLinks ` - :param artifacts: Gets list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param created_by: Gets the identity who created release. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on when this release created. - :type created_on: datetime - :param description: Gets description. - :type description: str - :param id: ID of the Release. - :type id: int - :param modified_by: Gets the identity who modified release. - :type modified_by: :class:`IdentityRef ` - :param name: Gets name of release. - :type name: str - :param reason: Gets reason for release. - :type reason: object - :param release_definition: Gets release definition shallow reference. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param url: - :type url: str - :param web_access_uri: - :type web_access_uri: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'name': {'key': 'name', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'url': {'key': 'url', 'type': 'str'}, - 'web_access_uri': {'key': 'webAccessUri', 'type': 'str'} - } - - def __init__(self, _links=None, artifacts=None, created_by=None, created_on=None, description=None, id=None, modified_by=None, name=None, reason=None, release_definition=None, url=None, web_access_uri=None): - super(ReleaseReference, self).__init__() - self._links = _links - self.artifacts = artifacts - self.created_by = created_by - self.created_on = created_on - self.description = description - self.id = id - self.modified_by = modified_by - self.name = name - self.reason = reason - self.release_definition = release_definition - self.url = url - self.web_access_uri = web_access_uri - - -class ReleaseRevision(Model): - """ - :param changed_by: Gets or sets the identity who changed. - :type changed_by: :class:`IdentityRef ` - :param changed_date: Change date of the revision. - :type changed_date: datetime - :param change_details: Change details of the revision. - :type change_details: str - :param change_type: Change details of the revision. Typically ChangeDetails values are Add and Update. - :type change_type: str - :param comment: Comment of the revision. - :type comment: str - :param definition_snapshot_revision: Release ID of which this revision belongs. - :type definition_snapshot_revision: int - :param release_id: Gets or sets the release ID of which this revision belongs. - :type release_id: int - """ - - _attribute_map = { - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'change_details': {'key': 'changeDetails', 'type': 'str'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, - 'release_id': {'key': 'releaseId', 'type': 'int'} - } - - def __init__(self, changed_by=None, changed_date=None, change_details=None, change_type=None, comment=None, definition_snapshot_revision=None, release_id=None): - super(ReleaseRevision, self).__init__() - self.changed_by = changed_by - self.changed_date = changed_date - self.change_details = change_details - self.change_type = change_type - self.comment = comment - self.definition_snapshot_revision = definition_snapshot_revision - self.release_id = release_id - - -class ReleaseSchedule(Model): - """ - :param days_to_release: Days of the week to release. - :type days_to_release: object - :param job_id: Team Foundation Job Definition Job Id. - :type job_id: str - :param schedule_only_with_changes: Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed. - :type schedule_only_with_changes: bool - :param start_hours: Local time zone hour to start. - :type start_hours: int - :param start_minutes: Local time zone minute to start. - :type start_minutes: int - :param time_zone_id: Time zone Id of release schedule, such as 'UTC'. - :type time_zone_id: str - """ - - _attribute_map = { - 'days_to_release': {'key': 'daysToRelease', 'type': 'object'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'schedule_only_with_changes': {'key': 'scheduleOnlyWithChanges', 'type': 'bool'}, - 'start_hours': {'key': 'startHours', 'type': 'int'}, - 'start_minutes': {'key': 'startMinutes', 'type': 'int'}, - 'time_zone_id': {'key': 'timeZoneId', 'type': 'str'} - } - - def __init__(self, days_to_release=None, job_id=None, schedule_only_with_changes=None, start_hours=None, start_minutes=None, time_zone_id=None): - super(ReleaseSchedule, self).__init__() - self.days_to_release = days_to_release - self.job_id = job_id - self.schedule_only_with_changes = schedule_only_with_changes - self.start_hours = start_hours - self.start_minutes = start_minutes - self.time_zone_id = time_zone_id - - -class ReleaseSettings(Model): - """ - :param compliance_settings: Release Compliance settings. - :type compliance_settings: :class:`ComplianceSettings ` - :param retention_settings: Release retention settings. - :type retention_settings: :class:`RetentionSettings ` - """ - - _attribute_map = { - 'compliance_settings': {'key': 'complianceSettings', 'type': 'ComplianceSettings'}, - 'retention_settings': {'key': 'retentionSettings', 'type': 'RetentionSettings'} - } - - def __init__(self, compliance_settings=None, retention_settings=None): - super(ReleaseSettings, self).__init__() - self.compliance_settings = compliance_settings - self.retention_settings = retention_settings - - -class ReleaseShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release. - :type id: int - :param name: Gets or sets the name of the release. - :type name: str - :param url: Gets the REST API url to access the release. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, url=None): - super(ReleaseShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.url = url - - -class ReleaseStartEnvironmentMetadata(Model): - """ - :param definition_environment_id: Sets release definition environment id. - :type definition_environment_id: int - :param variables: Sets list of environments variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, definition_environment_id=None, variables=None): - super(ReleaseStartEnvironmentMetadata, self).__init__() - self.definition_environment_id = definition_environment_id - self.variables = variables - - -class ReleaseStartMetadata(Model): - """ - :param artifacts: Sets list of artifact to create a release. - :type artifacts: list of :class:`ArtifactMetadata ` - :param definition_id: Sets definition Id to create a release. - :type definition_id: int - :param description: Sets description to create a release. - :type description: str - :param environments_metadata: Sets list of environments meta data. - :type environments_metadata: list of :class:`ReleaseStartEnvironmentMetadata ` - :param is_draft: Sets 'true' to create release in draft mode, 'false' otherwise. - :type is_draft: bool - :param manual_environments: Sets list of environments to manual as condition. - :type manual_environments: list of str - :param properties: - :type properties: :class:`object ` - :param reason: Sets reason to create a release. - :type reason: object - :param variables: Sets list of release variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'artifacts': {'key': 'artifacts', 'type': '[ArtifactMetadata]'}, - 'definition_id': {'key': 'definitionId', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments_metadata': {'key': 'environmentsMetadata', 'type': '[ReleaseStartEnvironmentMetadata]'}, - 'is_draft': {'key': 'isDraft', 'type': 'bool'}, - 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, artifacts=None, definition_id=None, description=None, environments_metadata=None, is_draft=None, manual_environments=None, properties=None, reason=None, variables=None): - super(ReleaseStartMetadata, self).__init__() - self.artifacts = artifacts - self.definition_id = definition_id - self.description = description - self.environments_metadata = environments_metadata - self.is_draft = is_draft - self.manual_environments = manual_environments - self.properties = properties - self.reason = reason - self.variables = variables - - -class ReleaseTask(Model): - """ - :param agent_name: Agent name on which task executed. - :type agent_name: str - :param date_ended: - :type date_ended: datetime - :param date_started: - :type date_started: datetime - :param finish_time: Finish time of the release task. - :type finish_time: datetime - :param id: ID of the release task. - :type id: int - :param issues: List of issues occurred while execution of task. - :type issues: list of :class:`Issue ` - :param line_count: Number of lines log release task has. - :type line_count: long - :param log_url: Log URL of the task. - :type log_url: str - :param name: Name of the task. - :type name: str - :param percent_complete: Task execution complete precent. - :type percent_complete: int - :param rank: Rank of the release task. - :type rank: int - :param result_code: Result code of the task. - :type result_code: str - :param start_time: ID of the release task. - :type start_time: datetime - :param status: Status of release task. - :type status: object - :param task: Workflow task reference. - :type task: :class:`WorkflowTaskReference ` - :param timeline_record_id: Timeline record ID of the release task. - :type timeline_record_id: str - """ - - _attribute_map = { - 'agent_name': {'key': 'agentName', 'type': 'str'}, - 'date_ended': {'key': 'dateEnded', 'type': 'iso-8601'}, - 'date_started': {'key': 'dateStarted', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'int'}, - 'issues': {'key': 'issues', 'type': '[Issue]'}, - 'line_count': {'key': 'lineCount', 'type': 'long'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'task': {'key': 'task', 'type': 'WorkflowTaskReference'}, - 'timeline_record_id': {'key': 'timelineRecordId', 'type': 'str'} - } - - def __init__(self, agent_name=None, date_ended=None, date_started=None, finish_time=None, id=None, issues=None, line_count=None, log_url=None, name=None, percent_complete=None, rank=None, result_code=None, start_time=None, status=None, task=None, timeline_record_id=None): - super(ReleaseTask, self).__init__() - self.agent_name = agent_name - self.date_ended = date_ended - self.date_started = date_started - self.finish_time = finish_time - self.id = id - self.issues = issues - self.line_count = line_count - self.log_url = log_url - self.name = name - self.percent_complete = percent_complete - self.rank = rank - self.result_code = result_code - self.start_time = start_time - self.status = status - self.task = task - self.timeline_record_id = timeline_record_id - - -class ReleaseTaskAttachment(Model): - """ - :param _links: Reference links of task. - :type _links: :class:`ReferenceLinks ` - :param created_on: Data and time when it created. - :type created_on: datetime - :param modified_by: Identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Data and time when modified. - :type modified_on: datetime - :param name: Name of the task attachment. - :type name: str - :param record_id: Record ID of the task. - :type record_id: str - :param timeline_id: Timeline ID of the task. - :type timeline_id: str - :param type: Type of task attachment. - :type type: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'record_id': {'key': 'recordId', 'type': 'str'}, - 'timeline_id': {'key': 'timelineId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, _links=None, created_on=None, modified_by=None, modified_on=None, name=None, record_id=None, timeline_id=None, type=None): - super(ReleaseTaskAttachment, self).__init__() - self._links = _links - self.created_on = created_on - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.record_id = record_id - self.timeline_id = timeline_id - self.type = type - - -class ReleaseUpdateMetadata(Model): - """ - :param comment: Sets comment for release. - :type comment: str - :param keep_forever: Set 'true' to exclude the release from retention policies. - :type keep_forever: bool - :param manual_environments: Sets list of manual environments. - :type manual_environments: list of str - :param name: Sets name of the release. - :type name: str - :param status: Sets status of the release. - :type status: object - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, - 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, comment=None, keep_forever=None, manual_environments=None, name=None, status=None): - super(ReleaseUpdateMetadata, self).__init__() - self.comment = comment - self.keep_forever = keep_forever - self.manual_environments = manual_environments - self.name = name - self.status = status - - -class ReleaseWorkItemRef(Model): - """ - :param assignee: - :type assignee: str - :param id: Gets or sets the ID. - :type id: str - :param state: Gets or sets the state. - :type state: str - :param title: Gets or sets the title. - :type title: str - :param type: Gets or sets the type. - :type type: str - :param url: Gets or sets the workitem url. - :type url: str - """ - - _attribute_map = { - 'assignee': {'key': 'assignee', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, assignee=None, id=None, state=None, title=None, type=None, url=None): - super(ReleaseWorkItemRef, self).__init__() - self.assignee = assignee - self.id = id - self.state = state - self.title = title - self.type = type - self.url = url - - -class RetentionPolicy(Model): - """ - :param days_to_keep: Indicates the number of days to keep deployment. - :type days_to_keep: int - """ - - _attribute_map = { - 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'} - } - - def __init__(self, days_to_keep=None): - super(RetentionPolicy, self).__init__() - self.days_to_keep = days_to_keep - - -class RetentionSettings(Model): - """ - :param days_to_keep_deleted_releases: Number of days to keep deleted releases. - :type days_to_keep_deleted_releases: int - :param default_environment_retention_policy: Specifies the default environment retention policy. - :type default_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` - :param maximum_environment_retention_policy: Specifies the maximum environment retention policy. - :type maximum_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` - """ - - _attribute_map = { - 'days_to_keep_deleted_releases': {'key': 'daysToKeepDeletedReleases', 'type': 'int'}, - 'default_environment_retention_policy': {'key': 'defaultEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, - 'maximum_environment_retention_policy': {'key': 'maximumEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'} - } - - def __init__(self, days_to_keep_deleted_releases=None, default_environment_retention_policy=None, maximum_environment_retention_policy=None): - super(RetentionSettings, self).__init__() - self.days_to_keep_deleted_releases = days_to_keep_deleted_releases - self.default_environment_retention_policy = default_environment_retention_policy - self.maximum_environment_retention_policy = maximum_environment_retention_policy - - -class SourcePullRequestVersion(Model): - """ - :param iteration_id: Pull Request Iteration Id for which the release will publish status. - :type iteration_id: str - :param pull_request_id: Pull Request Id for which the release will publish status. - :type pull_request_id: str - :param pull_request_merged_at: Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request. - :type pull_request_merged_at: datetime - :param source_branch: Source branch of the Pull Request. - :type source_branch: str - :param source_branch_commit_id: Source branch commit Id of the Pull Request for which the release will publish status. - :type source_branch_commit_id: str - :param target_branch: Target branch of the Pull Request. - :type target_branch: str - """ - - _attribute_map = { - 'iteration_id': {'key': 'iterationId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', 'type': 'str'}, - 'pull_request_merged_at': {'key': 'pullRequestMergedAt', 'type': 'iso-8601'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, - 'source_branch_commit_id': {'key': 'sourceBranchCommitId', 'type': 'str'}, - 'target_branch': {'key': 'targetBranch', 'type': 'str'} - } - - def __init__(self, iteration_id=None, pull_request_id=None, pull_request_merged_at=None, source_branch=None, source_branch_commit_id=None, target_branch=None): - super(SourcePullRequestVersion, self).__init__() - self.iteration_id = iteration_id - self.pull_request_id = pull_request_id - self.pull_request_merged_at = pull_request_merged_at - self.source_branch = source_branch - self.source_branch_commit_id = source_branch_commit_id - self.target_branch = target_branch - - -class SummaryMailSection(Model): - """ - :param html_content: Html content of summary mail. - :type html_content: str - :param rank: Rank of the summary mail. - :type rank: int - :param section_type: Summary mail section type. MailSectionType has section types. - :type section_type: object - :param title: Title of the summary mail. - :type title: str - """ - - _attribute_map = { - 'html_content': {'key': 'htmlContent', 'type': 'str'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'section_type': {'key': 'sectionType', 'type': 'object'}, - 'title': {'key': 'title', 'type': 'str'} - } - - def __init__(self, html_content=None, rank=None, section_type=None, title=None): - super(SummaryMailSection, self).__init__() - self.html_content = html_content - self.rank = rank - self.section_type = section_type - self.title = title - - -class TaskInputDefinitionBase(Model): - """ - :param aliases: - :type aliases: list of str - :param default_value: - :type default_value: str - :param group_name: - :type group_name: str - :param help_mark_down: - :type help_mark_down: str - :param label: - :type label: str - :param name: - :type name: str - :param options: - :type options: dict - :param properties: - :type properties: dict - :param required: - :type required: bool - :param type: - :type type: str - :param validation: - :type validation: :class:`TaskInputValidation ` - :param visible_rule: - :type visible_rule: str - """ - - _attribute_map = { - 'aliases': {'key': 'aliases', 'type': '[str]'}, - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'options': {'key': 'options', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'required': {'key': 'required', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, - 'visible_rule': {'key': 'visibleRule', 'type': 'str'} - } - - def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): - super(TaskInputDefinitionBase, self).__init__() - self.aliases = aliases - self.default_value = default_value - self.group_name = group_name - self.help_mark_down = help_mark_down - self.label = label - self.name = name - self.options = options - self.properties = properties - self.required = required - self.type = type - self.validation = validation - self.visible_rule = visible_rule - - -class TaskInputValidation(Model): - """ - :param expression: Conditional expression - :type expression: str - :param message: Message explaining how user can correct if validation fails - :type message: str - """ - - _attribute_map = { - 'expression': {'key': 'expression', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, expression=None, message=None): - super(TaskInputValidation, self).__init__() - self.expression = expression - self.message = message - - -class TaskSourceDefinitionBase(Model): - """ - :param auth_key: - :type auth_key: str - :param endpoint: - :type endpoint: str - :param key_selector: - :type key_selector: str - :param selector: - :type selector: str - :param target: - :type target: str - """ - - _attribute_map = { - 'auth_key': {'key': 'authKey', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'key_selector': {'key': 'keySelector', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'} - } - - def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): - super(TaskSourceDefinitionBase, self).__init__() - self.auth_key = auth_key - self.endpoint = endpoint - self.key_selector = key_selector - self.selector = selector - self.target = target - - -class VariableGroup(Model): - """ - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param description: Gets or sets description. - :type description: str - :param id: Gets the unique identifier of this field. - :type id: int - :param is_shared: Denotes if a variable group is shared with other project or not. - :type is_shared: bool - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets or sets name. - :type name: str - :param provider_data: Gets or sets provider data. - :type provider_data: :class:`VariableGroupProviderData ` - :param type: Gets or sets type. - :type type: str - :param variables: Gets and sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'is_shared': {'key': 'isShared', 'type': 'bool'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provider_data': {'key': 'providerData', 'type': 'VariableGroupProviderData'}, - 'type': {'key': 'type', 'type': 'str'}, - 'variables': {'key': 'variables', 'type': '{VariableValue}'} - } - - def __init__(self, created_by=None, created_on=None, description=None, id=None, is_shared=None, modified_by=None, modified_on=None, name=None, provider_data=None, type=None, variables=None): - super(VariableGroup, self).__init__() - self.created_by = created_by - self.created_on = created_on - self.description = description - self.id = id - self.is_shared = is_shared - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.provider_data = provider_data - self.type = type - self.variables = variables - - -class VariableGroupProviderData(Model): - """ - """ - - _attribute_map = { - } - - def __init__(self): - super(VariableGroupProviderData, self).__init__() - - -class VariableValue(Model): - """ - :param is_secret: Gets or sets as the variable is secret or not. - :type is_secret: bool - :param value: Gets or sets the value. - :type value: str - """ - - _attribute_map = { - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, is_secret=None, value=None): - super(VariableValue, self).__init__() - self.is_secret = is_secret - self.value = value - - -class WorkflowTask(Model): - """ - :param always_run: Gets or sets as the task always run or not. - :type always_run: bool - :param condition: Gets or sets the task condition. - :type condition: str - :param continue_on_error: Gets or sets as the task continue run on error or not. - :type continue_on_error: bool - :param definition_type: Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'. - :type definition_type: str - :param enabled: Gets or sets as the task enabled or not. - :type enabled: bool - :param environment: Gets or sets the task environment variables. - :type environment: dict - :param inputs: Gets or sets the task inputs. - :type inputs: dict - :param name: Gets or sets the name of the task. - :type name: str - :param override_inputs: Gets or sets the task override inputs. - :type override_inputs: dict - :param ref_name: Gets or sets the reference name of the task. - :type ref_name: str - :param task_id: Gets or sets the ID of the task. - :type task_id: str - :param timeout_in_minutes: Gets or sets the task timeout. - :type timeout_in_minutes: int - :param version: Gets or sets the version of the task. - :type version: str - """ - - _attribute_map = { - 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, - 'condition': {'key': 'condition', 'type': 'str'}, - 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, - 'definition_type': {'key': 'definitionType', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'environment': {'key': 'environment', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{str}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'override_inputs': {'key': 'overrideInputs', 'type': '{str}'}, - 'ref_name': {'key': 'refName', 'type': 'str'}, - 'task_id': {'key': 'taskId', 'type': 'str'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, always_run=None, condition=None, continue_on_error=None, definition_type=None, enabled=None, environment=None, inputs=None, name=None, override_inputs=None, ref_name=None, task_id=None, timeout_in_minutes=None, version=None): - super(WorkflowTask, self).__init__() - self.always_run = always_run - self.condition = condition - self.continue_on_error = continue_on_error - self.definition_type = definition_type - self.enabled = enabled - self.environment = environment - self.inputs = inputs - self.name = name - self.override_inputs = override_inputs - self.ref_name = ref_name - self.task_id = task_id - self.timeout_in_minutes = timeout_in_minutes - self.version = version - - -class WorkflowTaskReference(Model): - """ - :param id: Task identifier. - :type id: str - :param name: Name of the task. - :type name: str - :param version: Version of the task. - :type version: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, id=None, name=None, version=None): - super(WorkflowTaskReference, self).__init__() - self.id = id - self.name = name - self.version = version - - -class ReleaseDefinition(ReleaseDefinitionShallowReference): - """ - :param _links: Gets the links to related resources, APIs, and views for the release definition. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release definition. - :type id: int - :param name: Gets or sets the name of the release definition. - :type name: str - :param path: Gets or sets the path of the release definition. - :type path: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param url: Gets the REST API url to access the release definition. - :type url: str - :param artifacts: Gets or sets the list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param comment: Gets or sets comment. - :type comment: str - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param description: Gets or sets the description. - :type description: str - :param environments: Gets or sets the list of environments. - :type environments: list of :class:`ReleaseDefinitionEnvironment ` - :param is_deleted: Whether release definition is deleted. - :type is_deleted: bool - :param last_release: Gets the reference of last release. - :type last_release: :class:`ReleaseReference ` - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param pipeline_process: Gets or sets pipeline process. - :type pipeline_process: :class:`PipelineProcess ` - :param properties: Gets or sets properties. - :type properties: :class:`object ` - :param release_name_format: Gets or sets the release name format. - :type release_name_format: str - :param retention_policy: - :type retention_policy: :class:`RetentionPolicy ` - :param revision: Gets the revision number. - :type revision: int - :param source: Gets or sets source of release definition. - :type source: object - :param tags: Gets or sets list of tags. - :type tags: list of str - :param triggers: Gets or sets the list of triggers. - :type triggers: list of :class:`object ` - :param variable_groups: Gets or sets the list of variable groups. - :type variable_groups: list of int - :param variables: Gets or sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'url': {'key': 'url', 'type': 'str'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironment]'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_release': {'key': 'lastRelease', 'type': 'ReleaseReference'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'pipeline_process': {'key': 'pipelineProcess', 'type': 'PipelineProcess'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'source': {'key': 'source', 'type': 'object'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'triggers': {'key': 'triggers', 'type': '[object]'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None, artifacts=None, comment=None, created_by=None, created_on=None, description=None, environments=None, is_deleted=None, last_release=None, modified_by=None, modified_on=None, pipeline_process=None, properties=None, release_name_format=None, retention_policy=None, revision=None, source=None, tags=None, triggers=None, variable_groups=None, variables=None): - super(ReleaseDefinition, self).__init__(_links=_links, id=id, name=name, path=path, project_reference=project_reference, url=url) - self.artifacts = artifacts - self.comment = comment - self.created_by = created_by - self.created_on = created_on - self.description = description - self.environments = environments - self.is_deleted = is_deleted - self.last_release = last_release - self.modified_by = modified_by - self.modified_on = modified_on - self.pipeline_process = pipeline_process - self.properties = properties - self.release_name_format = release_name_format - self.retention_policy = retention_policy - self.revision = revision - self.source = source - self.tags = tags - self.triggers = triggers - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseDefinitionApprovalStep(ReleaseDefinitionEnvironmentStep): - """ - :param id: ID of the approval or deploy step. - :type id: int - :param approver: Gets and sets the approver. - :type approver: :class:`IdentityRef ` - :param is_automated: Indicates whether the approval automated. - :type is_automated: bool - :param is_notification_on: Indicates whether the approval notification set. - :type is_notification_on: bool - :param rank: Gets or sets the rank of approval step. - :type rank: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, - 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, - 'rank': {'key': 'rank', 'type': 'int'} - } - - def __init__(self, id=None, approver=None, is_automated=None, is_notification_on=None, rank=None): - super(ReleaseDefinitionApprovalStep, self).__init__(id=id) - self.approver = approver - self.is_automated = is_automated - self.is_notification_on = is_notification_on - self.rank = rank - - -class ReleaseDefinitionDeployStep(ReleaseDefinitionEnvironmentStep): - """ - :param id: ID of the approval or deploy step. - :type id: int - :param tasks: The list of steps for this definition. - :type tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, id=None, tasks=None): - super(ReleaseDefinitionDeployStep, self).__init__(id=id) - self.tasks = tasks - - -__all__ = [ - 'AgentArtifactDefinition', - 'ApprovalOptions', - 'Artifact', - 'ArtifactMetadata', - 'ArtifactSourceReference', - 'ArtifactTriggerConfiguration', - 'ArtifactTypeDefinition', - 'ArtifactVersion', - 'ArtifactVersionQueryResult', - 'AuthorizationHeader', - 'AutoTriggerIssue', - 'BuildVersion', - 'Change', - 'ComplianceSettings', - 'Condition', - 'ConfigurationVariableValue', - 'DataSourceBindingBase', - 'DefinitionEnvironmentReference', - 'Deployment', - 'DeploymentAttempt', - 'DeploymentJob', - 'DeploymentQueryParameters', - 'EmailRecipients', - 'EnvironmentExecutionPolicy', - 'EnvironmentOptions', - 'EnvironmentRetentionPolicy', - 'EnvironmentTrigger', - 'FavoriteItem', - 'Folder', - 'GateUpdateMetadata', - 'GraphSubjectBase', - 'IdentityRef', - 'IgnoredGate', - 'InputDescriptor', - 'InputValidation', - 'InputValue', - 'InputValues', - 'InputValuesError', - 'InputValuesQuery', - 'Issue', - 'MailMessage', - 'ManualIntervention', - 'ManualInterventionUpdateMetadata', - 'Metric', - 'PipelineProcess', - 'ProcessParameters', - 'ProjectReference', - 'QueuedReleaseData', - 'ReferenceLinks', - 'Release', - 'ReleaseApproval', - 'ReleaseApprovalHistory', - 'ReleaseCondition', - 'ReleaseDefinitionApprovals', - 'ReleaseDefinitionEnvironment', - 'ReleaseDefinitionEnvironmentStep', - 'ReleaseDefinitionEnvironmentSummary', - 'ReleaseDefinitionEnvironmentTemplate', - 'ReleaseDefinitionGate', - 'ReleaseDefinitionGatesOptions', - 'ReleaseDefinitionGatesStep', - 'ReleaseDefinitionRevision', - 'ReleaseDefinitionShallowReference', - 'ReleaseDefinitionSummary', - 'ReleaseDefinitionUndeleteParameter', - 'ReleaseDeployPhase', - 'ReleaseEnvironment', - 'ReleaseEnvironmentShallowReference', - 'ReleaseEnvironmentUpdateMetadata', - 'ReleaseGates', - 'ReleaseReference', - 'ReleaseRevision', - 'ReleaseSchedule', - 'ReleaseSettings', - 'ReleaseShallowReference', - 'ReleaseStartEnvironmentMetadata', - 'ReleaseStartMetadata', - 'ReleaseTask', - 'ReleaseTaskAttachment', - 'ReleaseUpdateMetadata', - 'ReleaseWorkItemRef', - 'RetentionPolicy', - 'RetentionSettings', - 'SourcePullRequestVersion', - 'SummaryMailSection', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskSourceDefinitionBase', - 'VariableGroup', - 'VariableGroupProviderData', - 'VariableValue', - 'WorkflowTask', - 'WorkflowTaskReference', - 'ReleaseDefinition', - 'ReleaseDefinitionApprovalStep', - 'ReleaseDefinitionDeployStep', -] diff --git a/azure-devops/azure/devops/v5_1/release/release_client.py b/azure-devops/azure/devops/v5_1/release/release_client.py deleted file mode 100644 index 206e5c7b..00000000 --- a/azure-devops/azure/devops/v5_1/release/release_client.py +++ /dev/null @@ -1,931 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ReleaseClient(Client): - """Release - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(ReleaseClient, 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 = 'efc2f575-36ef-48e9-b672-0c6fb4a48ac5' - - def get_approvals(self, project, assigned_to_filter=None, status_filter=None, release_ids_filter=None, type_filter=None, top=None, continuation_token=None, query_order=None, include_my_group_approvals=None): - """GetApprovals. - Get a list of approvals - :param str project: Project ID or project name - :param str assigned_to_filter: Approvals assigned to this user. - :param str status_filter: Approvals with this status. Default is 'pending'. - :param [int] release_ids_filter: Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. - :param str type_filter: Approval with this type. - :param int top: Number of approvals to get. Default is 50. - :param int continuation_token: Gets the approvals after the continuation token provided. - :param str query_order: Gets the results in the defined order of created approvals. Default is 'descending'. - :param bool include_my_group_approvals: 'true' to include my group approvals. Default is 'false'. - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if assigned_to_filter is not None: - query_parameters['assignedToFilter'] = self._serialize.query('assigned_to_filter', assigned_to_filter, 'str') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') - if release_ids_filter is not None: - release_ids_filter = ",".join(map(str, release_ids_filter)) - query_parameters['releaseIdsFilter'] = self._serialize.query('release_ids_filter', release_ids_filter, 'str') - if type_filter is not None: - query_parameters['typeFilter'] = self._serialize.query('type_filter', type_filter, 'str') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if include_my_group_approvals is not None: - query_parameters['includeMyGroupApprovals'] = self._serialize.query('include_my_group_approvals', include_my_group_approvals, 'bool') - response = self._send(http_method='GET', - location_id='b47c6458-e73b-47cb-a770-4df1e8813a91', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetApprovalsResponseValue(response_value, continuation_token) - - class GetApprovalsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_approvals method - - :param value: - :type value: :class:`<[ReleaseApproval]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def update_release_approval(self, approval, project, approval_id): - """UpdateReleaseApproval. - Update status of an approval - :param :class:` ` approval: ReleaseApproval object having status, approver and comments. - :param str project: Project ID or project name - :param int approval_id: Id of the approval. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if approval_id is not None: - route_values['approvalId'] = self._serialize.url('approval_id', approval_id, 'int') - content = self._serialize.body(approval, 'ReleaseApproval') - response = self._send(http_method='PATCH', - location_id='9328e074-59fb-465a-89d9-b09c82ee5109', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('ReleaseApproval', response) - - def get_release_task_attachment_content(self, project, release_id, environment_id, attempt_id, plan_id, timeline_id, record_id, type, name, **kwargs): - """GetReleaseTaskAttachmentContent. - [Preview API] Get a release task attachment. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :param int attempt_id: Attempt number of deployment. - :param str plan_id: Plan Id of the deploy phase. - :param str timeline_id: Timeline Id of the task. - :param str record_id: Record Id of attachment. - :param str type: Type of the attachment. - :param str name: Name of the attachment. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if attempt_id is not None: - route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') - if plan_id is not None: - route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') - if timeline_id is not None: - route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') - if record_id is not None: - route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - if name is not None: - route_values['name'] = self._serialize.url('name', name, 'str') - response = self._send(http_method='GET', - location_id='60b86efb-7b8c-4853-8f9f-aa142b77b479', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_release_task_attachments(self, project, release_id, environment_id, attempt_id, plan_id, type): - """GetReleaseTaskAttachments. - [Preview API] Get the release task attachments. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :param int attempt_id: Attempt number of deployment. - :param str plan_id: Plan Id of the deploy phase. - :param str type: Type of the attachment. - :rtype: [ReleaseTaskAttachment] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if attempt_id is not None: - route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') - if plan_id is not None: - route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - response = self._send(http_method='GET', - location_id='a4d06688-0dfa-4895-82a5-f43ec9452306', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[ReleaseTaskAttachment]', self._unwrap_collection(response)) - - def create_release_definition(self, release_definition, project): - """CreateReleaseDefinition. - Create a release definition - :param :class:` ` release_definition: release definition object to create. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_definition, 'ReleaseDefinition') - response = self._send(http_method='POST', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('ReleaseDefinition', response) - - def delete_release_definition(self, project, definition_id, comment=None, force_delete=None): - """DeleteReleaseDefinition. - Delete a release definition. - :param str project: Project ID or project name - :param int definition_id: Id of the release definition. - :param str comment: Comment for deleting a release definition. - :param bool force_delete: 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - query_parameters = {} - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query('force_delete', force_delete, 'bool') - self._send(http_method='DELETE', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - - def get_release_definition(self, project, definition_id, property_filters=None): - """GetReleaseDefinition. - Get a release definition. - :param str project: Project ID or project name - :param int definition_id: Id of the release definition. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - query_parameters = {} - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - response = self._send(http_method='GET', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('ReleaseDefinition', response) - - def get_release_definitions(self, project, search_text=None, expand=None, artifact_type=None, artifact_source_id=None, top=None, continuation_token=None, query_order=None, path=None, is_exact_name_match=None, tag_filter=None, property_filters=None, definition_id_filter=None, is_deleted=None, search_text_contains_folder_name=None): - """GetReleaseDefinitions. - Get a list of release definitions. - :param str project: Project ID or project name - :param str search_text: Get release definitions with names containing searchText. - :param str expand: The properties that should be expanded in the list of Release definitions. - :param str artifact_type: Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - :param str artifact_source_id: Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - :param int top: Number of release definitions to get. - :param str continuation_token: Gets the release definitions after the continuation token provided. - :param str query_order: Gets the results in the defined order. Default is 'IdAscending'. - :param str path: Gets the release definitions under the specified path. - :param bool is_exact_name_match: 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. - :param [str] tag_filter: A comma-delimited list of tags. Only release definitions with these tags will be returned. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. - :param [str] definition_id_filter: A comma-delimited list of release definitions to retrieve. - :param bool is_deleted: 'true' to get release definitions that has been deleted. Default is 'false' - :param bool search_text_contains_folder_name: 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if search_text is not None: - query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if artifact_type is not None: - query_parameters['artifactType'] = self._serialize.query('artifact_type', artifact_type, 'str') - if artifact_source_id is not None: - query_parameters['artifactSourceId'] = self._serialize.query('artifact_source_id', artifact_source_id, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if is_exact_name_match is not None: - query_parameters['isExactNameMatch'] = self._serialize.query('is_exact_name_match', is_exact_name_match, 'bool') - if tag_filter is not None: - tag_filter = ",".join(tag_filter) - query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if definition_id_filter is not None: - definition_id_filter = ",".join(definition_id_filter) - query_parameters['definitionIdFilter'] = self._serialize.query('definition_id_filter', definition_id_filter, 'str') - if is_deleted is not None: - query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') - if search_text_contains_folder_name is not None: - query_parameters['searchTextContainsFolderName'] = self._serialize.query('search_text_contains_folder_name', search_text_contains_folder_name, 'bool') - response = self._send(http_method='GET', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetReleaseDefinitionsResponseValue(response_value, continuation_token) - - class GetReleaseDefinitionsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_release_definitions method - - :param value: - :type value: :class:`<[ReleaseDefinition]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def update_release_definition(self, release_definition, project): - """UpdateReleaseDefinition. - Update a release definition. - :param :class:` ` release_definition: Release definition object to update. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_definition, 'ReleaseDefinition') - response = self._send(http_method='PUT', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('ReleaseDefinition', response) - - def get_deployments(self, project, definition_id=None, definition_environment_id=None, created_by=None, min_modified_time=None, max_modified_time=None, deployment_status=None, operation_status=None, latest_attempts_only=None, query_order=None, top=None, continuation_token=None, created_for=None, min_started_time=None, max_started_time=None, source_branch=None): - """GetDeployments. - :param str project: Project ID or project name - :param int definition_id: - :param int definition_environment_id: - :param str created_by: - :param datetime min_modified_time: - :param datetime max_modified_time: - :param str deployment_status: - :param str operation_status: - :param bool latest_attempts_only: - :param str query_order: - :param int top: - :param int continuation_token: - :param str created_for: - :param datetime min_started_time: - :param datetime max_started_time: - :param str source_branch: - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if definition_id is not None: - query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') - if definition_environment_id is not None: - query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') - if created_by is not None: - query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') - if min_modified_time is not None: - query_parameters['minModifiedTime'] = self._serialize.query('min_modified_time', min_modified_time, 'iso-8601') - if max_modified_time is not None: - query_parameters['maxModifiedTime'] = self._serialize.query('max_modified_time', max_modified_time, 'iso-8601') - if deployment_status is not None: - query_parameters['deploymentStatus'] = self._serialize.query('deployment_status', deployment_status, 'str') - if operation_status is not None: - query_parameters['operationStatus'] = self._serialize.query('operation_status', operation_status, 'str') - if latest_attempts_only is not None: - query_parameters['latestAttemptsOnly'] = self._serialize.query('latest_attempts_only', latest_attempts_only, 'bool') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if created_for is not None: - query_parameters['createdFor'] = self._serialize.query('created_for', created_for, 'str') - if min_started_time is not None: - query_parameters['minStartedTime'] = self._serialize.query('min_started_time', min_started_time, 'iso-8601') - if max_started_time is not None: - query_parameters['maxStartedTime'] = self._serialize.query('max_started_time', max_started_time, 'iso-8601') - if source_branch is not None: - query_parameters['sourceBranch'] = self._serialize.query('source_branch', source_branch, 'str') - response = self._send(http_method='GET', - location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[Deployment]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetDeploymentsResponseValue(response_value, continuation_token) - - class GetDeploymentsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_deployments method - - :param value: - :type value: :class:`<[Deployment]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_release_environment(self, project, release_id, environment_id): - """GetReleaseEnvironment. - [Preview API] Get a release environment. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - response = self._send(http_method='GET', - location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', - version='5.1-preview.6', - route_values=route_values) - return self._deserialize('ReleaseEnvironment', response) - - def update_release_environment(self, environment_update_data, project, release_id, environment_id): - """UpdateReleaseEnvironment. - [Preview API] Update the status of a release environment - :param :class:` ` environment_update_data: Environment update meta data. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of release environment. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - content = self._serialize.body(environment_update_data, 'ReleaseEnvironmentUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', - version='5.1-preview.6', - route_values=route_values, - content=content) - return self._deserialize('ReleaseEnvironment', response) - - def delete_folder(self, project, path): - """DeleteFolder. - [Preview API] Deletes a definition folder for given folder name and path and all it's existing definitions. - :param str project: Project ID or project name - :param str path: Path of the folder to delete. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - self._send(http_method='DELETE', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='5.1-preview.2', - route_values=route_values) - - def get_folders(self, project, path=None, query_order=None): - """GetFolders. - [Preview API] Gets folders. - :param str project: Project ID or project name - :param str path: Path of the folder. - :param str query_order: Gets the results in the defined order. Default is 'None'. - :rtype: [Folder] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - query_parameters = {} - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - response = self._send(http_method='GET', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='5.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[Folder]', self._unwrap_collection(response)) - - def update_folder(self, folder, project, path): - """UpdateFolder. - [Preview API] Updates an existing folder at given existing path. - :param :class:` ` folder: folder. - :param str project: Project ID or project name - :param str path: Path of the folder to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - content = self._serialize.body(folder, 'Folder') - response = self._send(http_method='PATCH', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='5.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('Folder', response) - - def update_gates(self, gate_update_metadata, project, gate_step_id): - """UpdateGates. - [Preview API] Updates the gate for a deployment. - :param :class:` ` gate_update_metadata: Metadata to patch the Release Gates. - :param str project: Project ID or project name - :param int gate_step_id: Gate step Id. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if gate_step_id is not None: - route_values['gateStepId'] = self._serialize.url('gate_step_id', gate_step_id, 'int') - content = self._serialize.body(gate_update_metadata, 'GateUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='2666a539-2001-4f80-bcc7-0379956749d4', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('ReleaseGates', response) - - def get_logs(self, project, release_id, **kwargs): - """GetLogs. - [Preview API] Get logs for a release Id. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - response = self._send(http_method='GET', - location_id='c37fbab5-214b-48e4-a55b-cb6b4f6e4038', - version='5.1-preview.2', - route_values=route_values, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): - """GetTaskLog. - [Preview API] Gets the task log of a release as a plain text file. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of release environment. - :param int release_deploy_phase_id: Release deploy phase Id. - :param int task_id: ReleaseTask Id for the log. - :param long start_line: Starting line number for logs - :param long end_line: Ending line number for logs - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if release_deploy_phase_id is not None: - route_values['releaseDeployPhaseId'] = self._serialize.url('release_deploy_phase_id', release_deploy_phase_id, 'int') - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'int') - query_parameters = {} - if start_line is not None: - query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') - if end_line is not None: - query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') - response = self._send(http_method='GET', - location_id='17c91af7-09fd-4256-bff1-c24ee4f73bc0', - version='5.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_manual_intervention(self, project, release_id, manual_intervention_id): - """GetManualIntervention. - Get manual intervention for a given release and manual intervention id. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if manual_intervention_id is not None: - route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') - response = self._send(http_method='GET', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', - route_values=route_values) - return self._deserialize('ManualIntervention', response) - - def get_manual_interventions(self, project, release_id): - """GetManualInterventions. - List all manual interventions for a given release. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :rtype: [ManualIntervention] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - response = self._send(http_method='GET', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', - route_values=route_values) - return self._deserialize('[ManualIntervention]', self._unwrap_collection(response)) - - def update_manual_intervention(self, manual_intervention_update_metadata, project, release_id, manual_intervention_id): - """UpdateManualIntervention. - Update manual intervention. - :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if manual_intervention_id is not None: - route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') - content = self._serialize.body(manual_intervention_update_metadata, 'ManualInterventionUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('ManualIntervention', response) - - def get_releases(self, project=None, definition_id=None, definition_environment_id=None, search_text=None, created_by=None, status_filter=None, environment_status_filter=None, min_created_time=None, max_created_time=None, query_order=None, top=None, continuation_token=None, expand=None, artifact_type_id=None, source_id=None, artifact_version_id=None, source_branch_filter=None, is_deleted=None, tag_filter=None, property_filters=None, release_id_filter=None, path=None): - """GetReleases. - Get a list of releases - :param str project: Project ID or project name - :param int definition_id: Releases from this release definition Id. - :param int definition_environment_id: - :param str search_text: Releases with names containing searchText. - :param str created_by: Releases created by this user. - :param str status_filter: Releases that have this status. - :param int environment_status_filter: - :param datetime min_created_time: Releases that were created after this time. - :param datetime max_created_time: Releases that were created before this time. - :param str query_order: Gets the results in the defined order of created date for releases. Default is descending. - :param int top: Number of releases to get. Default is 50. - :param int continuation_token: Gets the releases after the continuation token provided. - :param str expand: The property that should be expanded in the list of releases. - :param str artifact_type_id: Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - :param str source_id: Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - :param str artifact_version_id: Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. - :param str source_branch_filter: Releases with given sourceBranchFilter will be returned. - :param bool is_deleted: Gets the soft deleted releases, if true. - :param [str] tag_filter: A comma-delimited list of tags. Only releases with these tags will be returned. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. - :param [int] release_id_filter: A comma-delimited list of releases Ids. Only releases with these Ids will be returned. - :param str path: Releases under this folder path will be returned - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if definition_id is not None: - query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') - if definition_environment_id is not None: - query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') - if search_text is not None: - query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') - if created_by is not None: - query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') - if environment_status_filter is not None: - query_parameters['environmentStatusFilter'] = self._serialize.query('environment_status_filter', environment_status_filter, 'int') - if min_created_time is not None: - query_parameters['minCreatedTime'] = self._serialize.query('min_created_time', min_created_time, 'iso-8601') - if max_created_time is not None: - query_parameters['maxCreatedTime'] = self._serialize.query('max_created_time', max_created_time, 'iso-8601') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if artifact_type_id is not None: - query_parameters['artifactTypeId'] = self._serialize.query('artifact_type_id', artifact_type_id, 'str') - if source_id is not None: - query_parameters['sourceId'] = self._serialize.query('source_id', source_id, 'str') - if artifact_version_id is not None: - query_parameters['artifactVersionId'] = self._serialize.query('artifact_version_id', artifact_version_id, 'str') - if source_branch_filter is not None: - query_parameters['sourceBranchFilter'] = self._serialize.query('source_branch_filter', source_branch_filter, 'str') - if is_deleted is not None: - query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') - if tag_filter is not None: - tag_filter = ",".join(tag_filter) - query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if release_id_filter is not None: - release_id_filter = ",".join(map(str, release_id_filter)) - query_parameters['releaseIdFilter'] = self._serialize.query('release_id_filter', release_id_filter, 'str') - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[Release]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetReleasesResponseValue(response_value, continuation_token) - - class GetReleasesResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_releases method - - :param value: - :type value: :class:`<[Release]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def create_release(self, release_start_metadata, project): - """CreateRelease. - Create a release. - :param :class:` ` release_start_metadata: Metadata to create a release. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_start_metadata, 'ReleaseStartMetadata') - response = self._send(http_method='POST', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def get_release(self, project, release_id, approval_filters=None, property_filters=None, expand=None, top_gate_records=None): - """GetRelease. - Get a Release - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param str approval_filters: A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - :param str expand: A property that should be expanded in the release. - :param int top_gate_records: Number of release gate records to get. Default is 5. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - query_parameters = {} - if approval_filters is not None: - query_parameters['approvalFilters'] = self._serialize.query('approval_filters', approval_filters, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if top_gate_records is not None: - query_parameters['$topGateRecords'] = self._serialize.query('top_gate_records', top_gate_records, 'int') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Release', response) - - def get_release_revision(self, project, release_id, definition_snapshot_revision, **kwargs): - """GetReleaseRevision. - Get release for a given revision number. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int definition_snapshot_revision: Definition snapshot revision number. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - query_parameters = {} - if definition_snapshot_revision is not None: - query_parameters['definitionSnapshotRevision'] = self._serialize.query('definition_snapshot_revision', definition_snapshot_revision, 'int') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def update_release(self, release, project, release_id): - """UpdateRelease. - Update a complete release object. - :param :class:` ` release: Release object for update. - :param str project: Project ID or project name - :param int release_id: Id of the release to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - content = self._serialize.body(release, 'Release') - response = self._send(http_method='PUT', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def update_release_resource(self, release_update_metadata, project, release_id): - """UpdateReleaseResource. - Update few properties of a release. - :param :class:` ` release_update_metadata: Properties of release to update. - :param str project: Project ID or project name - :param int release_id: Id of the release to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - content = self._serialize.body(release_update_metadata, 'ReleaseUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='5.1', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def get_definition_revision(self, project, definition_id, revision, **kwargs): - """GetDefinitionRevision. - [Preview API] Get release definition for a given definitionId and revision - :param str project: Project ID or project name - :param int definition_id: Id of the definition. - :param int revision: Id of the revision. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - if revision is not None: - route_values['revision'] = self._serialize.url('revision', revision, 'int') - response = self._send(http_method='GET', - location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_release_definition_history(self, project, definition_id): - """GetReleaseDefinitionHistory. - [Preview API] Get revision history for a release definition - :param str project: Project ID or project name - :param int definition_id: Id of the definition. - :rtype: [ReleaseDefinitionRevision] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - response = self._send(http_method='GET', - location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v5_1/test_results/test_results_client.py b/azure-devops/azure/devops/v5_1/test_results/test_results_client.py deleted file mode 100644 index 7abd837e..00000000 --- a/azure-devops/azure/devops/v5_1/test_results/test_results_client.py +++ /dev/null @@ -1,1808 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TestResultsClient(Client): - """TestResults - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(TestResultsClient, 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 create_test_iteration_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id, iteration_id, action_path=None): - """CreateTestIterationResultAttachment. - [Preview API] - :param :class:` ` attachment_request_model: - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int iteration_id: - :param str action_path: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query('iteration_id', iteration_id, 'int') - if action_path is not None: - query_parameters['actionPath'] = self._serialize.query('action_path', action_path, 'str') - content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') - response = self._send(http_method='POST', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('TestAttachmentReference', response) - - def create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id): - """CreateTestResultAttachment. - [Preview API] - :param :class:` ` attachment_request_model: - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') - response = self._send(http_method='POST', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestAttachmentReference', response) - - def create_test_sub_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id, test_sub_result_id): - """CreateTestSubResultAttachment. - [Preview API] - :param :class:` ` attachment_request_model: - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int test_sub_result_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - query_parameters = {} - if test_sub_result_id is not None: - query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') - content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') - response = self._send(http_method='POST', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('TestAttachmentReference', response) - - def delete_test_result_attachment(self, project, run_id, test_case_result_id, attachment_id): - """DeleteTestResultAttachment. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int attachment_id: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - self._send(http_method='DELETE', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values) - - def get_test_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, **kwargs): - """GetTestResultAttachmentContent. - [Preview API] Returns a test result attachment - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int attachment_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_test_result_attachments(self, project, run_id, test_case_result_id): - """GetTestResultAttachments. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :rtype: [TestAttachment] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) - - def get_test_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, **kwargs): - """GetTestResultAttachmentZip. - [Preview API] Returns a test result attachment - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int attachment_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): - """GetTestSubResultAttachmentContent. - [Preview API] Returns a test sub result attachment - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int attachment_id: - :param int test_sub_result_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - query_parameters = {} - if test_sub_result_id is not None: - query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id): - """GetTestSubResultAttachments. - [Preview API] Returns attachment references for test sub result. - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int test_sub_result_id: - :rtype: [TestAttachment] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - query_parameters = {} - if test_sub_result_id is not None: - query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) - - def get_test_sub_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): - """GetTestSubResultAttachmentZip. - [Preview API] Returns a test sub result attachment - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :param int attachment_id: - :param int test_sub_result_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - query_parameters = {} - if test_sub_result_id is not None: - query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') - response = self._send(http_method='GET', - location_id='2a632e97-e014-4275-978f-8e5c4906d4b3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def create_test_run_attachment(self, attachment_request_model, project, run_id): - """CreateTestRunAttachment. - [Preview API] - :param :class:` ` attachment_request_model: - :param str project: Project ID or project name - :param int run_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') - response = self._send(http_method='POST', - location_id='b5731898-8206-477a-a51d-3fdf116fc6bf', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestAttachmentReference', response) - - def delete_test_run_attachment(self, project, run_id, attachment_id): - """DeleteTestRunAttachment. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int attachment_id: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - self._send(http_method='DELETE', - location_id='b5731898-8206-477a-a51d-3fdf116fc6bf', - version='5.1-preview.1', - route_values=route_values) - - def get_test_run_attachment_content(self, project, run_id, attachment_id, **kwargs): - """GetTestRunAttachmentContent. - [Preview API] Returns a test run attachment - :param str project: Project ID or project name - :param int run_id: - :param int attachment_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - response = self._send(http_method='GET', - location_id='b5731898-8206-477a-a51d-3fdf116fc6bf', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_test_run_attachments(self, project, run_id): - """GetTestRunAttachments. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :rtype: [TestAttachment] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - response = self._send(http_method='GET', - location_id='b5731898-8206-477a-a51d-3fdf116fc6bf', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) - - def get_test_run_attachment_zip(self, project, run_id, attachment_id, **kwargs): - """GetTestRunAttachmentZip. - [Preview API] Returns a test run attachment - :param str project: Project ID or project name - :param int run_id: - :param int attachment_id: - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if attachment_id is not None: - route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') - response = self._send(http_method='GET', - location_id='b5731898-8206-477a-a51d-3fdf116fc6bf', - version='5.1-preview.1', - route_values=route_values, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_bugs_linked_to_test_result(self, project, run_id, test_case_result_id): - """GetBugsLinkedToTestResult. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int test_case_result_id: - :rtype: [WorkItemReference] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_case_result_id is not None: - route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') - response = self._send(http_method='GET', - location_id='d8dbf98f-eb34-4f8d-8365-47972af34f29', - version='5.1-preview.1', - route_values=route_values) - return self._deserialize('[WorkItemReference]', self._unwrap_collection(response)) - - def get_build_code_coverage(self, project, build_id, flags): - """GetBuildCodeCoverage. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param int flags: - :rtype: [BuildCoverage] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if flags is not None: - query_parameters['flags'] = self._serialize.query('flags', flags, 'int') - response = self._send(http_method='GET', - location_id='9b3e1ece-c6ab-4fbb-8167-8a32a0c92216', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[BuildCoverage]', self._unwrap_collection(response)) - - def get_code_coverage_summary(self, project, build_id, delta_build_id=None): - """GetCodeCoverageSummary. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param int delta_build_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if delta_build_id is not None: - query_parameters['deltaBuildId'] = self._serialize.query('delta_build_id', delta_build_id, 'int') - response = self._send(http_method='GET', - location_id='9b3e1ece-c6ab-4fbb-8167-8a32a0c92216', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('CodeCoverageSummary', response) - - def update_code_coverage_summary(self, project, build_id, coverage_data=None): - """UpdateCodeCoverageSummary. - [Preview API] http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary - :param str project: Project ID or project name - :param int build_id: - :param :class:` ` coverage_data: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - content = self._serialize.body(coverage_data, 'CodeCoverageData') - self._send(http_method='POST', - location_id='9b3e1ece-c6ab-4fbb-8167-8a32a0c92216', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - - def get_test_run_code_coverage(self, project, run_id, flags): - """GetTestRunCodeCoverage. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int flags: - :rtype: [TestRunCoverage] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if flags is not None: - query_parameters['flags'] = self._serialize.query('flags', flags, 'int') - response = self._send(http_method='GET', - location_id='5641efbc-6f9b-401a-baeb-d3da22489e5e', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestRunCoverage]', self._unwrap_collection(response)) - - def query_test_result_history(self, filter, project): - """QueryTestResultHistory. - [Preview API] - :param :class:` ` filter: - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(filter, 'ResultsFilter') - response = self._send(http_method='POST', - location_id='bdf7a97b-0395-4da8-9d5d-f957619327d1', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestResultHistory', response) - - def get_test_result_details_for_build(self, project, build_id, publish_context=None, group_by=None, filter=None, orderby=None, should_include_results=None, query_run_summary_for_in_progress=None): - """GetTestResultDetailsForBuild. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param str publish_context: - :param str group_by: - :param str filter: - :param str orderby: - :param bool should_include_results: - :param bool query_run_summary_for_in_progress: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if publish_context is not None: - query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') - if group_by is not None: - query_parameters['groupBy'] = self._serialize.query('group_by', group_by, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') - if should_include_results is not None: - query_parameters['shouldIncludeResults'] = self._serialize.query('should_include_results', should_include_results, 'bool') - if query_run_summary_for_in_progress is not None: - query_parameters['queryRunSummaryForInProgress'] = self._serialize.query('query_run_summary_for_in_progress', query_run_summary_for_in_progress, 'bool') - response = self._send(http_method='GET', - location_id='a518c749-4524-45b2-a7ef-1ac009b312cd', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestResultsDetails', response) - - def get_test_result_details_for_release(self, project, release_id, release_env_id, publish_context=None, group_by=None, filter=None, orderby=None, should_include_results=None, query_run_summary_for_in_progress=None): - """GetTestResultDetailsForRelease. - [Preview API] - :param str project: Project ID or project name - :param int release_id: - :param int release_env_id: - :param str publish_context: - :param str group_by: - :param str filter: - :param str orderby: - :param bool should_include_results: - :param bool query_run_summary_for_in_progress: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if release_id is not None: - query_parameters['releaseId'] = self._serialize.query('release_id', release_id, 'int') - if release_env_id is not None: - query_parameters['releaseEnvId'] = self._serialize.query('release_env_id', release_env_id, 'int') - if publish_context is not None: - query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') - if group_by is not None: - query_parameters['groupBy'] = self._serialize.query('group_by', group_by, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') - if should_include_results is not None: - query_parameters['shouldIncludeResults'] = self._serialize.query('should_include_results', should_include_results, 'bool') - if query_run_summary_for_in_progress is not None: - query_parameters['queryRunSummaryForInProgress'] = self._serialize.query('query_run_summary_for_in_progress', query_run_summary_for_in_progress, 'bool') - response = self._send(http_method='GET', - location_id='19a8183a-69fb-47d7-bfbf-1b6b0d921294', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestResultsDetails', response) - - def get_test_results_by_query(self, query, project): - """GetTestResultsByQuery. - [Preview API] - :param :class:` ` query: - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(query, 'TestResultsQuery') - response = self._send(http_method='POST', - location_id='14033a2c-af25-4af1-9e39-8ef6900482e3', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestResultsQuery', response) - - def get_test_results_by_query_wiql(self, query_model, project, include_result_details=None, include_iteration_details=None, skip=None, top=None): - """GetTestResultsByQueryWiql. - [Preview API] - :param :class:` ` query_model: - :param str project: Project ID or project name - :param bool include_result_details: - :param bool include_iteration_details: - :param int skip: - :param int top: - :rtype: [TestCaseResult] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if include_result_details is not None: - query_parameters['includeResultDetails'] = self._serialize.query('include_result_details', include_result_details, 'bool') - if include_iteration_details is not None: - query_parameters['includeIterationDetails'] = self._serialize.query('include_iteration_details', include_iteration_details, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - content = self._serialize.body(query_model, 'QueryModel') - response = self._send(http_method='POST', - location_id='5ea78be3-2f5a-4110-8034-c27f24c62db1', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) - - def add_test_results_to_test_run(self, results, project, run_id): - """AddTestResultsToTestRun. - [Preview API] - :param [TestCaseResult] results: - :param str project: Project ID or project name - :param int run_id: - :rtype: [TestCaseResult] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - content = self._serialize.body(results, '[TestCaseResult]') - response = self._send(http_method='POST', - location_id='02afa165-e79a-4d70-8f0c-2af0f35b4e07', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) - - def get_test_result_by_id(self, project, run_id, test_result_id, details_to_include=None): - """GetTestResultById. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int test_result_id: - :param str details_to_include: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if test_result_id is not None: - route_values['testResultId'] = self._serialize.url('test_result_id', test_result_id, 'int') - query_parameters = {} - if details_to_include is not None: - query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') - response = self._send(http_method='GET', - location_id='02afa165-e79a-4d70-8f0c-2af0f35b4e07', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestCaseResult', response) - - def get_test_results(self, project, run_id, details_to_include=None, skip=None, top=None, outcomes=None): - """GetTestResults. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param str details_to_include: - :param int skip: - :param int top: - :param [TestOutcome] outcomes: - :rtype: [TestCaseResult] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if details_to_include is not None: - query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') - if skip is not None: - query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if outcomes is not None: - outcomes = ",".join(map(str, outcomes)) - query_parameters['outcomes'] = self._serialize.query('outcomes', outcomes, 'str') - response = self._send(http_method='GET', - location_id='02afa165-e79a-4d70-8f0c-2af0f35b4e07', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) - - def update_test_results(self, results, project, run_id): - """UpdateTestResults. - [Preview API] - :param [TestCaseResult] results: - :param str project: Project ID or project name - :param int run_id: - :rtype: [TestCaseResult] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - content = self._serialize.body(results, '[TestCaseResult]') - response = self._send(http_method='PATCH', - location_id='02afa165-e79a-4d70-8f0c-2af0f35b4e07', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) - - def query_test_results_report_for_build(self, project, build_id, publish_context=None, include_failure_details=None, build_to_compare=None): - """QueryTestResultsReportForBuild. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param str publish_context: - :param bool include_failure_details: - :param :class:` ` build_to_compare: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if publish_context is not None: - query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') - if include_failure_details is not None: - query_parameters['includeFailureDetails'] = self._serialize.query('include_failure_details', include_failure_details, 'bool') - if build_to_compare is not None: - if build_to_compare.id is not None: - query_parameters['buildToCompare.id'] = build_to_compare.id - if build_to_compare.definition_id is not None: - query_parameters['buildToCompare.definitionId'] = build_to_compare.definition_id - if build_to_compare.number is not None: - query_parameters['buildToCompare.number'] = build_to_compare.number - if build_to_compare.uri is not None: - query_parameters['buildToCompare.uri'] = build_to_compare.uri - if build_to_compare.build_system is not None: - query_parameters['buildToCompare.buildSystem'] = build_to_compare.build_system - if build_to_compare.branch_name is not None: - query_parameters['buildToCompare.branchName'] = build_to_compare.branch_name - if build_to_compare.repository_id is not None: - query_parameters['buildToCompare.repositoryId'] = build_to_compare.repository_id - response = self._send(http_method='GET', - location_id='e009fa95-95a5-4ad4-9681-590043ce2423', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestResultSummary', response) - - def query_test_results_report_for_release(self, project, release_id, release_env_id, publish_context=None, include_failure_details=None, release_to_compare=None): - """QueryTestResultsReportForRelease. - [Preview API] - :param str project: Project ID or project name - :param int release_id: - :param int release_env_id: - :param str publish_context: - :param bool include_failure_details: - :param :class:` ` release_to_compare: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if release_id is not None: - query_parameters['releaseId'] = self._serialize.query('release_id', release_id, 'int') - if release_env_id is not None: - query_parameters['releaseEnvId'] = self._serialize.query('release_env_id', release_env_id, 'int') - if publish_context is not None: - query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') - if include_failure_details is not None: - query_parameters['includeFailureDetails'] = self._serialize.query('include_failure_details', include_failure_details, 'bool') - if release_to_compare is not None: - if release_to_compare.id is not None: - query_parameters['releaseToCompare.id'] = release_to_compare.id - if release_to_compare.name is not None: - query_parameters['releaseToCompare.name'] = release_to_compare.name - if release_to_compare.environment_id is not None: - query_parameters['releaseToCompare.environmentId'] = release_to_compare.environment_id - if release_to_compare.environment_name is not None: - query_parameters['releaseToCompare.environmentName'] = release_to_compare.environment_name - if release_to_compare.definition_id is not None: - query_parameters['releaseToCompare.definitionId'] = release_to_compare.definition_id - if release_to_compare.environment_definition_id is not None: - query_parameters['releaseToCompare.environmentDefinitionId'] = release_to_compare.environment_definition_id - if release_to_compare.environment_definition_name is not None: - query_parameters['releaseToCompare.environmentDefinitionName'] = release_to_compare.environment_definition_name - if release_to_compare.creation_date is not None: - query_parameters['releaseToCompare.creationDate'] = release_to_compare.creation_date - if release_to_compare.environment_creation_date is not None: - query_parameters['releaseToCompare.environmentCreationDate'] = release_to_compare.environment_creation_date - if release_to_compare.attempt is not None: - query_parameters['releaseToCompare.attempt'] = release_to_compare.attempt - response = self._send(http_method='GET', - location_id='f10f9577-2c04-45ab-8c99-b26567a7cd55', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestResultSummary', response) - - def query_test_results_summary_for_releases(self, releases, project): - """QueryTestResultsSummaryForReleases. - [Preview API] - :param [ReleaseReference] releases: - :param str project: Project ID or project name - :rtype: [TestResultSummary] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(releases, '[ReleaseReference]') - response = self._send(http_method='POST', - location_id='f10f9577-2c04-45ab-8c99-b26567a7cd55', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[TestResultSummary]', self._unwrap_collection(response)) - - def query_test_summary_by_requirement(self, results_context, project, work_item_ids=None): - """QueryTestSummaryByRequirement. - [Preview API] - :param :class:` ` results_context: - :param str project: Project ID or project name - :param [int] work_item_ids: - :rtype: [TestSummaryForWorkItem] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if work_item_ids is not None: - work_item_ids = ",".join(map(str, work_item_ids)) - query_parameters['workItemIds'] = self._serialize.query('work_item_ids', work_item_ids, 'str') - content = self._serialize.body(results_context, 'TestResultsContext') - response = self._send(http_method='POST', - location_id='3b7fd26f-c335-4e55-afc1-a588f5e2af3c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('[TestSummaryForWorkItem]', self._unwrap_collection(response)) - - def query_result_trend_for_build(self, filter, project): - """QueryResultTrendForBuild. - [Preview API] - :param :class:` ` filter: - :param str project: Project ID or project name - :rtype: [AggregatedDataForResultTrend] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(filter, 'TestResultTrendFilter') - response = self._send(http_method='POST', - location_id='0886a7ae-315a-4dba-9122-bcce93301f3a', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AggregatedDataForResultTrend]', self._unwrap_collection(response)) - - def query_result_trend_for_release(self, filter, project): - """QueryResultTrendForRelease. - [Preview API] - :param :class:` ` filter: - :param str project: Project ID or project name - :rtype: [AggregatedDataForResultTrend] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(filter, 'TestResultTrendFilter') - response = self._send(http_method='POST', - location_id='107f23c3-359a-460a-a70c-63ee739f9f9a', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('[AggregatedDataForResultTrend]', self._unwrap_collection(response)) - - def create_test_run(self, test_run, project): - """CreateTestRun. - [Preview API] - :param :class:` ` test_run: - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(test_run, 'RunCreateModel') - response = self._send(http_method='POST', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestRun', response) - - def delete_test_run(self, project, run_id): - """DeleteTestRun. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - self._send(http_method='DELETE', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values) - - def get_test_run_by_id(self, project, run_id, include_details=None, include_tags=None): - """GetTestRunById. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param bool include_details: - :param bool include_tags: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if include_details is not None: - query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') - if include_tags is not None: - query_parameters['includeTags'] = self._serialize.query('include_tags', include_tags, 'bool') - response = self._send(http_method='GET', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestRun', response) - - def get_test_runs(self, project, build_uri=None, owner=None, tmi_run_id=None, plan_id=None, include_run_details=None, automated=None, skip=None, top=None): - """GetTestRuns. - [Preview API] - :param str project: Project ID or project name - :param str build_uri: - :param str owner: - :param str tmi_run_id: - :param int plan_id: - :param bool include_run_details: - :param bool automated: - :param int skip: - :param int top: - :rtype: [TestRun] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_uri is not None: - query_parameters['buildUri'] = self._serialize.query('build_uri', build_uri, 'str') - if owner is not None: - query_parameters['owner'] = self._serialize.query('owner', owner, 'str') - if tmi_run_id is not None: - query_parameters['tmiRunId'] = self._serialize.query('tmi_run_id', tmi_run_id, 'str') - if plan_id is not None: - query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'int') - if include_run_details is not None: - query_parameters['includeRunDetails'] = self._serialize.query('include_run_details', include_run_details, 'bool') - if automated is not None: - query_parameters['automated'] = self._serialize.query('automated', automated, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestRun]', self._unwrap_collection(response)) - - def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, state=None, plan_ids=None, is_automated=None, publish_context=None, build_ids=None, build_def_ids=None, branch_name=None, release_ids=None, release_def_ids=None, release_env_ids=None, release_env_def_ids=None, run_title=None, top=None, continuation_token=None): - """QueryTestRuns. - [Preview API] Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. - :param str project: Project ID or project name - :param datetime min_last_updated_date: Minimum Last Modified Date of run to be queried (Mandatory). - :param datetime max_last_updated_date: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). - :param str state: Current state of the Runs to be queried. - :param [int] plan_ids: Plan Ids of the Runs to be queried, comma separated list of valid ids. - :param bool is_automated: Automation type of the Runs to be queried. - :param str publish_context: PublishContext of the Runs to be queried. - :param [int] build_ids: Build Ids of the Runs to be queried, comma separated list of valid ids. - :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma separated list of valid ids. - :param str branch_name: Source Branch name of the Runs to be queried. - :param [int] release_ids: Release Ids of the Runs to be queried, comma separated list of valid ids. - :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma separated list of valid ids. - :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma separated list of valid ids. - :param [int] release_env_def_ids: Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids. - :param str run_title: Run Title of the Runs to be queried. - :param int top: Number of runs to be queried. Limit is 100 - :param str continuation_token: continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if min_last_updated_date is not None: - query_parameters['minLastUpdatedDate'] = self._serialize.query('min_last_updated_date', min_last_updated_date, 'iso-8601') - if max_last_updated_date is not None: - query_parameters['maxLastUpdatedDate'] = self._serialize.query('max_last_updated_date', max_last_updated_date, 'iso-8601') - if state is not None: - query_parameters['state'] = self._serialize.query('state', state, 'str') - if plan_ids is not None: - plan_ids = ",".join(map(str, plan_ids)) - query_parameters['planIds'] = self._serialize.query('plan_ids', plan_ids, 'str') - if is_automated is not None: - query_parameters['isAutomated'] = self._serialize.query('is_automated', is_automated, 'bool') - if publish_context is not None: - query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') - if build_ids is not None: - build_ids = ",".join(map(str, build_ids)) - query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') - if build_def_ids is not None: - build_def_ids = ",".join(map(str, build_def_ids)) - query_parameters['buildDefIds'] = self._serialize.query('build_def_ids', build_def_ids, 'str') - if branch_name is not None: - query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') - if release_ids is not None: - release_ids = ",".join(map(str, release_ids)) - query_parameters['releaseIds'] = self._serialize.query('release_ids', release_ids, 'str') - if release_def_ids is not None: - release_def_ids = ",".join(map(str, release_def_ids)) - query_parameters['releaseDefIds'] = self._serialize.query('release_def_ids', release_def_ids, 'str') - if release_env_ids is not None: - release_env_ids = ",".join(map(str, release_env_ids)) - query_parameters['releaseEnvIds'] = self._serialize.query('release_env_ids', release_env_ids, 'str') - if release_env_def_ids is not None: - release_env_def_ids = ",".join(map(str, release_env_def_ids)) - query_parameters['releaseEnvDefIds'] = self._serialize.query('release_env_def_ids', release_env_def_ids, 'str') - if run_title is not None: - query_parameters['runTitle'] = self._serialize.query('run_title', run_title, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - response = self._send(http_method='GET', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[TestRun]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.QueryTestRunsResponseValue(response_value, continuation_token) - - class QueryTestRunsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the query_test_runs method - - :param value: - :type value: :class:`<[TestRun]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def update_test_run(self, run_update_model, project, run_id): - """UpdateTestRun. - [Preview API] - :param :class:` ` run_update_model: - :param str project: Project ID or project name - :param int run_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - content = self._serialize.body(run_update_model, 'RunUpdateModel') - response = self._send(http_method='PATCH', - location_id='364538f9-8062-4ce0-b024-75a0fb463f0d', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TestRun', response) - - def get_test_run_statistics(self, project, run_id): - """GetTestRunStatistics. - Get test run statistics , used when we want to get summary of a run by outcome. - :param str project: Project ID or project name - :param int run_id: ID of the run to get. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - response = self._send(http_method='GET', - location_id='82b986e8-ca9e-4a89-b39e-f65c69bc104a', - version='5.1', - route_values=route_values) - return self._deserialize('TestRunStatistic', response) - - def get_test_results_settings(self, project, settings_type=None): - """GetTestResultsSettings. - [Preview API] Get TestResultsSettings data - :param str project: Project ID or project name - :param str settings_type: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if settings_type is not None: - query_parameters['settingsType'] = self._serialize.query('settings_type', settings_type, 'str') - response = self._send(http_method='GET', - location_id='7319952e-e5a9-4e19-a006-84f3be8b7c68', - version='5.1-preview.3', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestResultsSettings', response) - - def update_pipelines_test_settings(self, test_results_update_settings, project): - """UpdatePipelinesTestSettings. - [Preview API] Update project settings of test results - :param :class:` ` test_results_update_settings: - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(test_results_update_settings, 'TestResultsUpdateSettings') - response = self._send(http_method='PATCH', - location_id='7319952e-e5a9-4e19-a006-84f3be8b7c68', - version='5.1-preview.3', - route_values=route_values, - content=content) - return self._deserialize('TestResultsSettings', response) - - def query_test_history(self, filter, project): - """QueryTestHistory. - [Preview API] Get history of a test method using TestHistoryQuery - :param :class:` ` filter: TestHistoryQuery to get history - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(filter, 'TestHistoryQuery') - response = self._send(http_method='POST', - location_id='2a41bd6a-8118-4403-b74e-5ba7492aed9d', - version='5.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('TestHistoryQuery', response) - - def get_test_logs_for_build(self, project, build_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): - """GetTestLogsForBuild. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param str type: - :param str directory_path: - :param str file_name_prefix: - :param bool fetch_meta_data: - :param int top: - :param String continuation_token: Header to pass the continuationToken - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if directory_path is not None: - query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') - if file_name_prefix is not None: - query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') - if fetch_meta_data is not None: - query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - additional_headers = {} - if continuation_token is not None: - additional_headers['x-ms-continuationtoken'] = continuation_token - response = self._send(http_method='GET', - location_id='dff8ce3a-e539-4817-a405-d968491a88f1', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - additional_headers=additional_headers) - response_value = self._deserialize('[TestLog]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetTestLogsForBuildResponseValue(response_value, continuation_token) - - class GetTestLogsForBuildResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_test_logs_for_build method - - :param value: - :type value: :class:`<[TestLog]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_test_result_logs(self, project, run_id, result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): - """GetTestResultLogs. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int result_id: - :param str type: - :param str directory_path: - :param str file_name_prefix: - :param bool fetch_meta_data: - :param int top: - :param String continuation_token: Header to pass the continuationToken - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if result_id is not None: - route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if directory_path is not None: - query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') - if file_name_prefix is not None: - query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') - if fetch_meta_data is not None: - query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - additional_headers = {} - if continuation_token is not None: - additional_headers['x-ms-continuationtoken'] = continuation_token - response = self._send(http_method='GET', - location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - additional_headers=additional_headers) - response_value = self._deserialize('[TestLog]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetTestResultLogsResponseValue(response_value, continuation_token) - - class GetTestResultLogsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_test_result_logs method - - :param value: - :type value: :class:`<[TestLog]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_test_sub_result_logs(self, project, run_id, result_id, sub_result_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): - """GetTestSubResultLogs. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int result_id: - :param int sub_result_id: - :param str type: - :param str directory_path: - :param str file_name_prefix: - :param bool fetch_meta_data: - :param int top: - :param String continuation_token: Header to pass the continuationToken - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if result_id is not None: - route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') - query_parameters = {} - if sub_result_id is not None: - query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if directory_path is not None: - query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') - if file_name_prefix is not None: - query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') - if fetch_meta_data is not None: - query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - additional_headers = {} - if continuation_token is not None: - additional_headers['x-ms-continuationtoken'] = continuation_token - response = self._send(http_method='GET', - location_id='714caaac-ae1e-4869-8323-9bc0f5120dbf', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - additional_headers=additional_headers) - response_value = self._deserialize('[TestLog]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetTestSubResultLogsResponseValue(response_value, continuation_token) - - class GetTestSubResultLogsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_test_sub_result_logs method - - :param value: - :type value: :class:`<[TestLog]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_test_run_logs(self, project, run_id, type, directory_path=None, file_name_prefix=None, fetch_meta_data=None, top=None, continuation_token=None): - """GetTestRunLogs. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param str type: - :param str directory_path: - :param str file_name_prefix: - :param bool fetch_meta_data: - :param int top: - :param String continuation_token: Header to pass the continuationToken - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if directory_path is not None: - query_parameters['directoryPath'] = self._serialize.query('directory_path', directory_path, 'str') - if file_name_prefix is not None: - query_parameters['fileNamePrefix'] = self._serialize.query('file_name_prefix', file_name_prefix, 'str') - if fetch_meta_data is not None: - query_parameters['fetchMetaData'] = self._serialize.query('fetch_meta_data', fetch_meta_data, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - additional_headers = {} - if continuation_token is not None: - additional_headers['x-ms-continuationtoken'] = continuation_token - response = self._send(http_method='GET', - location_id='5b47b946-e875-4c9a-acdc-2a20996caebe', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - additional_headers=additional_headers) - response_value = self._deserialize('[TestLog]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetTestRunLogsResponseValue(response_value, continuation_token) - - class GetTestRunLogsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_test_run_logs method - - :param value: - :type value: :class:`<[TestLog]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_test_log_store_endpoint_details_for_build_log(self, project, build, type, file_path): - """GetTestLogStoreEndpointDetailsForBuildLog. - [Preview API] - :param str project: Project ID or project name - :param int build: - :param str type: - :param str file_path: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build is not None: - query_parameters['build'] = self._serialize.query('build', build, 'int') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - response = self._send(http_method='GET', - location_id='39b09be7-f0c9-4a83-a513-9ae31b45c56f', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def test_log_store_endpoint_details_for_build(self, project, build_id, test_log_store_operation_type): - """TestLogStoreEndpointDetailsForBuild. - [Preview API] - :param str project: Project ID or project name - :param int build_id: - :param str test_log_store_operation_type: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if build_id is not None: - query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') - if test_log_store_operation_type is not None: - query_parameters['testLogStoreOperationType'] = self._serialize.query('test_log_store_operation_type', test_log_store_operation_type, 'str') - response = self._send(http_method='POST', - location_id='39b09be7-f0c9-4a83-a513-9ae31b45c56f', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def get_test_log_store_endpoint_details_for_result_log(self, project, run_id, result_id, type, file_path): - """GetTestLogStoreEndpointDetailsForResultLog. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int result_id: - :param str type: - :param str file_path: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if result_id is not None: - route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - response = self._send(http_method='GET', - location_id='da630b37-1236-45b5-945e-1d7bdb673850', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def get_test_log_store_endpoint_details_for_sub_result_log(self, project, run_id, result_id, sub_result_id, type, file_path): - """GetTestLogStoreEndpointDetailsForSubResultLog. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int result_id: - :param int sub_result_id: - :param str type: - :param str file_path: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if result_id is not None: - route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') - query_parameters = {} - if sub_result_id is not None: - query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - response = self._send(http_method='GET', - location_id='da630b37-1236-45b5-945e-1d7bdb673850', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def test_log_store_endpoint_details_for_result(self, project, run_id, result_id, sub_result_id, file_path, type): - """TestLogStoreEndpointDetailsForResult. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param int result_id: - :param int sub_result_id: - :param str file_path: - :param str type: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - if result_id is not None: - route_values['resultId'] = self._serialize.url('result_id', result_id, 'int') - query_parameters = {} - if sub_result_id is not None: - query_parameters['subResultId'] = self._serialize.query('sub_result_id', sub_result_id, 'int') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - response = self._send(http_method='POST', - location_id='da630b37-1236-45b5-945e-1d7bdb673850', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def get_test_log_store_endpoint_details_for_run_log(self, project, run_id, type, file_path): - """GetTestLogStoreEndpointDetailsForRunLog. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param str type: - :param str file_path: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - response = self._send(http_method='GET', - location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def test_log_store_endpoint_details_for_run(self, project, run_id, test_log_store_operation_type, file_path=None, type=None): - """TestLogStoreEndpointDetailsForRun. - [Preview API] - :param str project: Project ID or project name - :param int run_id: - :param str test_log_store_operation_type: - :param str file_path: - :param str type: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if run_id is not None: - route_values['runId'] = self._serialize.url('run_id', run_id, 'int') - query_parameters = {} - if test_log_store_operation_type is not None: - query_parameters['testLogStoreOperationType'] = self._serialize.query('test_log_store_operation_type', test_log_store_operation_type, 'str') - if file_path is not None: - query_parameters['filePath'] = self._serialize.query('file_path', file_path, 'str') - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - response = self._send(http_method='POST', - location_id='67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestLogStoreEndpointDetails', response) - - def create_test_settings(self, test_settings, project): - """CreateTestSettings. - [Preview API] - :param :class:` ` test_settings: - :param str project: Project ID or project name - :rtype: int - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(test_settings, 'TestSettings') - response = self._send(http_method='POST', - location_id='930bad47-f826-4099-9597-f44d0a9c735c', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('int', response) - - def delete_test_settings(self, project, test_settings_id): - """DeleteTestSettings. - [Preview API] - :param str project: Project ID or project name - :param int test_settings_id: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if test_settings_id is not None: - query_parameters['testSettingsId'] = self._serialize.query('test_settings_id', test_settings_id, 'int') - self._send(http_method='DELETE', - location_id='930bad47-f826-4099-9597-f44d0a9c735c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - - def get_test_settings_by_id(self, project, test_settings_id): - """GetTestSettingsById. - [Preview API] - :param str project: Project ID or project name - :param int test_settings_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if test_settings_id is not None: - query_parameters['testSettingsId'] = self._serialize.query('test_settings_id', test_settings_id, 'int') - response = self._send(http_method='GET', - location_id='930bad47-f826-4099-9597-f44d0a9c735c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestSettings', response) - - def add_work_item_to_test_links(self, work_item_to_test_links, project): - """AddWorkItemToTestLinks. - [Preview API] - :param :class:` ` work_item_to_test_links: - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(work_item_to_test_links, 'WorkItemToTestLinks') - response = self._send(http_method='POST', - location_id='4e3abe63-ca46-4fe0-98b2-363f7ec7aa5f', - version='5.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('WorkItemToTestLinks', response) - - def delete_test_method_to_work_item_link(self, project, test_name, work_item_id): - """DeleteTestMethodToWorkItemLink. - [Preview API] - :param str project: Project ID or project name - :param str test_name: - :param int work_item_id: - :rtype: bool - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if test_name is not None: - query_parameters['testName'] = self._serialize.query('test_name', test_name, 'str') - if work_item_id is not None: - query_parameters['workItemId'] = self._serialize.query('work_item_id', work_item_id, 'int') - response = self._send(http_method='DELETE', - location_id='cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('bool', response) - - def query_test_method_linked_work_items(self, project, test_name): - """QueryTestMethodLinkedWorkItems. - [Preview API] - :param str project: Project ID or project name - :param str test_name: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if test_name is not None: - query_parameters['testName'] = self._serialize.query('test_name', test_name, 'str') - response = self._send(http_method='POST', - location_id='cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TestToWorkItemLinks', response) - - def query_test_result_work_items(self, project, work_item_category, automated_test_name=None, test_case_id=None, max_complete_date=None, days=None, work_item_count=None): - """QueryTestResultWorkItems. - [Preview API] - :param str project: Project ID or project name - :param str work_item_category: - :param str automated_test_name: - :param int test_case_id: - :param datetime max_complete_date: - :param int days: - :param int work_item_count: - :rtype: [WorkItemReference] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if work_item_category is not None: - query_parameters['workItemCategory'] = self._serialize.query('work_item_category', work_item_category, 'str') - if automated_test_name is not None: - query_parameters['automatedTestName'] = self._serialize.query('automated_test_name', automated_test_name, 'str') - if test_case_id is not None: - query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'int') - if max_complete_date is not None: - query_parameters['maxCompleteDate'] = self._serialize.query('max_complete_date', max_complete_date, 'iso-8601') - if days is not None: - query_parameters['days'] = self._serialize.query('days', days, 'int') - if work_item_count is not None: - query_parameters['$workItemCount'] = self._serialize.query('work_item_count', work_item_count, 'int') - response = self._send(http_method='GET', - location_id='f7401a26-331b-44fe-a470-f7ed35138e4a', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[WorkItemReference]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v5_1/token_administration/models.py b/azure-devops/azure/devops/v5_1/token_administration/models.py deleted file mode 100644 index 69001aa3..00000000 --- a/azure-devops/azure/devops/v5_1/token_administration/models.py +++ /dev/null @@ -1,153 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class SessionToken(Model): - """ - :param access_id: - :type access_id: str - :param alternate_token: This is populated when user requests a compact token. The alternate token value is self describing token. - :type alternate_token: str - :param authorization_id: - :type authorization_id: str - :param claims: - :type claims: dict - :param client_id: - :type client_id: str - :param display_name: - :type display_name: str - :param host_authorization_id: - :type host_authorization_id: str - :param is_public: - :type is_public: bool - :param is_valid: - :type is_valid: bool - :param public_data: - :type public_data: str - :param scope: - :type scope: str - :param source: - :type source: str - :param target_accounts: - :type target_accounts: list of str - :param token: This is computed and not returned in Get queries - :type token: str - :param user_id: - :type user_id: str - :param valid_from: - :type valid_from: datetime - :param valid_to: - :type valid_to: datetime - """ - - _attribute_map = { - 'access_id': {'key': 'accessId', 'type': 'str'}, - 'alternate_token': {'key': 'alternateToken', 'type': 'str'}, - 'authorization_id': {'key': 'authorizationId', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': '{str}'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'host_authorization_id': {'key': 'hostAuthorizationId', 'type': 'str'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, - 'is_valid': {'key': 'isValid', 'type': 'bool'}, - 'public_data': {'key': 'publicData', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target_accounts': {'key': 'targetAccounts', 'type': '[str]'}, - 'token': {'key': 'token', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} - } - - def __init__(self, access_id=None, alternate_token=None, authorization_id=None, claims=None, client_id=None, display_name=None, host_authorization_id=None, is_public=None, is_valid=None, public_data=None, scope=None, source=None, target_accounts=None, token=None, user_id=None, valid_from=None, valid_to=None): - super(SessionToken, self).__init__() - self.access_id = access_id - self.alternate_token = alternate_token - self.authorization_id = authorization_id - self.claims = claims - self.client_id = client_id - self.display_name = display_name - self.host_authorization_id = host_authorization_id - self.is_public = is_public - self.is_valid = is_valid - self.public_data = public_data - self.scope = scope - self.source = source - self.target_accounts = target_accounts - self.token = token - self.user_id = user_id - self.valid_from = valid_from - self.valid_to = valid_to - - -class TokenAdministrationRevocation(Model): - """ - :param audience: A list of audience (target accounts) to limit the revocations to - :type audience: list of str - :param authorization_ids: A list of authorization ID of the OAuth authorization to revoke. - :type authorization_ids: list of str - """ - - _attribute_map = { - 'audience': {'key': 'audience', 'type': '[str]'}, - 'authorization_ids': {'key': 'authorizationIds', 'type': '[str]'} - } - - def __init__(self, audience=None, authorization_ids=None): - super(TokenAdministrationRevocation, self).__init__() - self.audience = audience - self.authorization_ids = authorization_ids - - -class TokenAdminPagedSessionTokens(Model): - """ - A paginated list of session tokens. Session tokens correspond to OAuth credentials such as personal access tokens (PATs) and other OAuth authorizations. - - :param continuation_token: The continuation token that can be used to retrieve the next page of session tokens, or null if there is no next page. - :type continuation_token: str - :param value: The list of all session tokens in the current page. - :type value: list of :class:`SessionToken ` - """ - - _attribute_map = { - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SessionToken]'} - } - - def __init__(self, continuation_token=None, value=None): - super(TokenAdminPagedSessionTokens, self).__init__() - self.continuation_token = continuation_token - self.value = value - - -class TokenAdminRevocation(Model): - """ - A request to revoke a particular delegated authorization. - - :param authorization_id: The authorization ID of the OAuth authorization to revoke. - :type authorization_id: str - """ - - _attribute_map = { - 'authorization_id': {'key': 'authorizationId', 'type': 'str'} - } - - def __init__(self, authorization_id=None): - super(TokenAdminRevocation, self).__init__() - self.authorization_id = authorization_id - - -__all__ = [ - 'SessionToken', - 'TokenAdministrationRevocation', - 'TokenAdminPagedSessionTokens', - 'TokenAdminRevocation', -] diff --git a/azure-devops/azure/devops/v5_1/token_administration/token_administration_client.py b/azure-devops/azure/devops/v5_1/token_administration/token_administration_client.py deleted file mode 100644 index 5d3032c1..00000000 --- a/azure-devops/azure/devops/v5_1/token_administration/token_administration_client.py +++ /dev/null @@ -1,95 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TokenAdministrationClient(Client): - """TokenAdministration - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(TokenAdministrationClient, 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 = '95935461-9e54-44bd-b9fb-04f4dd05d640' - - def list_identities_with_global_access_tokens(self, revocations, is_public=None): - """ListIdentitiesWithGlobalAccessTokens. - [Preview API] Revokes the listed OAuth authorizations. - :param [TokenAdminRevocation] revocations: The list of identities containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be checked for global access tokens. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: [str] - """ - query_parameters = {} - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(revocations, '[TokenAdminRevocation]') - response = self._send(http_method='POST', - location_id='30d3a12b-66c3-4669-b016-ecb0706c8d0f', - version='5.1-preview.1', - query_parameters=query_parameters, - content=content) - return self._deserialize('[str]', self._unwrap_collection(response)) - - def list_personal_access_tokens(self, audience, subject_descriptor, page_size=None, continuation_token=None, is_public=None): - """ListPersonalAccessTokens. - [Preview API] Lists of all the session token details of the personal access tokens (PATs) for a particular user. - :param [str] audience: - :param :class:` ` subject_descriptor: The descriptor of the target user. - :param int page_size: The maximum number of results to return on each page. - :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: :class:` ` - """ - route_values = {} - if subject_descriptor is not None: - route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') - query_parameters = {} - if page_size is not None: - query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(audience, '[str]') - response = self._send(http_method='POST', - location_id='1bb7db14-87c5-4762-bf77-a70ad34a9ab3', - version='5.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('TokenAdminPagedSessionTokens', response) - - def revoke_authorizations(self, revocations, host_id, is_public=None): - """RevokeAuthorizations. - [Preview API] Revokes the listed OAuth authorizations. - :param :class:` ` revocations: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked. - :param str host_id: Host Id to display on the notification page to manage tokens. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: [SessionToken] - """ - query_parameters = {} - if host_id is not None: - query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(revocations, 'TokenAdministrationRevocation') - response = self._send(http_method='POST', - location_id='a2e4520b-1cc8-4526-871e-f3a8f865f221', - version='5.1-preview.1', - query_parameters=query_parameters, - content=content) - return self._deserialize('[SessionToken]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v6_0/client_factory.py b/azure-devops/azure/devops/v6_0/client_factory.py deleted file mode 100644 index de617a06..00000000 --- a/azure-devops/azure/devops/v6_0/client_factory.py +++ /dev/null @@ -1,409 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------------------------- - - -class ClientFactoryV6_0(object): - """ClientFactoryV6_0. - A factory class to get the 6.0 preview clients. - """ - - def __init__(self, connection): - self._connection = connection - - def get_accounts_client(self): - """get_accounts_client. - Gets the 6.0 version of the AccountsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.accounts.accounts_client.AccountsClient') - - def get_audit_client(self): - """get_audit_client. - Gets the 6.0 version of the AuditClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.audit.audit_client.AuditClient') - - def get_build_client(self): - """get_build_client. - Gets the 6.0 version of the BuildClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.build.build_client.BuildClient') - - def get_cix_client(self): - """get_cix_client. - Gets the 6.0 version of the CixClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.cix.cix_client.CixClient') - - def get_client_trace_client(self): - """get_client_trace_client. - Gets the 6.0 version of the ClientTraceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.client_trace.client_trace_client.ClientTraceClient') - - def get_cloud_load_test_client(self): - """get_cloud_load_test_client. - Gets the 6.0 version of the CloudLoadTestClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') - - def get_contributions_client(self): - """get_contributions_client. - Gets the 6.0 version of the ContributionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.contributions.contributions_client.ContributionsClient') - - def get_core_client(self): - """get_core_client. - Gets the 6.0 version of the CoreClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.core.core_client.CoreClient') - - def get_customer_intelligence_client(self): - """get_customer_intelligence_client. - Gets the 6.0 version of the CustomerIntelligenceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') - - def get_dashboard_client(self): - """get_dashboard_client. - Gets the 6.0 version of the DashboardClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.dashboard.dashboard_client.DashboardClient') - - def get_extension_management_client(self): - """get_extension_management_client. - Gets the 6.0 version of the ExtensionManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.extension_management.extension_management_client.ExtensionManagementClient') - - def get_feature_availability_client(self): - """get_feature_availability_client. - Gets the 6.0 version of the FeatureAvailabilityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') - - def get_feature_management_client(self): - """get_feature_management_client. - Gets the 6.0 version of the FeatureManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.feature_management.feature_management_client.FeatureManagementClient') - - def get_feed_client(self): - """get_feed_client. - Gets the 6.0 version of the FeedClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.feed.feed_client.FeedClient') - - def get_file_container_client(self): - """get_file_container_client. - Gets the 6.0 version of the FileContainerClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.file_container.file_container_client.FileContainerClient') - - def get_gallery_client(self): - """get_gallery_client. - Gets the 6.0 version of the GalleryClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.gallery.gallery_client.GalleryClient') - - def get_git_client(self): - """get_git_client. - Gets the 6.0 version of the GitClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.git.git_client.GitClient') - - def get_graph_client(self): - """get_graph_client. - Gets the 6.0 version of the GraphClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.graph.graph_client.GraphClient') - - def get_identity_client(self): - """get_identity_client. - Gets the 6.0 version of the IdentityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.identity.identity_client.IdentityClient') - - def get_location_client(self): - """get_location_client. - Gets the 6.0 version of the LocationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.location.location_client.LocationClient') - - def get_maven_client(self): - """get_maven_client. - Gets the 6.0 version of the MavenClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.maven.maven_client.MavenClient') - - def get_member_entitlement_management_client(self): - """get_member_entitlement_management_client. - Gets the 6.0 version of the MemberEntitlementManagementClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') - - def get_notification_client(self): - """get_notification_client. - Gets the 6.0 version of the NotificationClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.notification.notification_client.NotificationClient') - - def get_npm_client(self): - """get_npm_client. - Gets the 6.0 version of the NpmClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.npm.npm_client.NpmClient') - - def get_nuget_client(self): - """get_nuget_client. - Gets the 6.0 version of the NuGetClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.nuget.nuget_client.NuGetClient') - - def get_operations_client(self): - """get_operations_client. - Gets the 6.0 version of the OperationsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.operations.operations_client.OperationsClient') - - def get_pipeline_permissions_client(self): - """get_pipeline_permissions_client. - Gets the 6.0 version of the PipelinePermissionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient') - - def get_pipelines_client(self): - """get_pipelines_client. - Gets the 6.0 version of the PipelinesClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.pipelines.pipelines_client.PipelinesClient') - - def get_pipelines_checks_client(self): - """get_pipelines_checks_client. - Gets the 6.0 version of the PipelinesChecksClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.pipelines_checks.pipelines_checks_client.PipelinesChecksClient') - - def get_policy_client(self): - """get_policy_client. - Gets the 6.0 version of the PolicyClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.policy.policy_client.PolicyClient') - - def get_profile_client(self): - """get_profile_client. - Gets the 6.0 version of the ProfileClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.profile.profile_client.ProfileClient') - - def get_profile_regions_client(self): - """get_profile_regions_client. - Gets the 6.0 version of the ProfileRegionsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.profile_regions.profile_regions_client.ProfileRegionsClient') - - def get_project_analysis_client(self): - """get_project_analysis_client. - Gets the 6.0 version of the ProjectAnalysisClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.project_analysis.project_analysis_client.ProjectAnalysisClient') - - def get_provenance_client(self): - """get_provenance_client. - Gets the 6.0 version of the ProvenanceClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.provenance.provenance_client.ProvenanceClient') - - def get_py_pi_api_client(self): - """get_py_pi_api_client. - Gets the 6.0 version of the PyPiApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.py_pi_api.py_pi_api_client.PyPiApiClient') - - def get_release_client(self): - """get_release_client. - Gets the 6.0 version of the ReleaseClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.release.release_client.ReleaseClient') - - def get_search_client(self): - """get_search_client. - Gets the 6.0 version of the SearchClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.search.search_client.SearchClient') - - def get_security_client(self): - """get_security_client. - Gets the 6.0 version of the SecurityClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.security.security_client.SecurityClient') - - def get_service_endpoint_client(self): - """get_service_endpoint_client. - Gets the 6.0 version of the ServiceEndpointClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') - - def get_service_hooks_client(self): - """get_service_hooks_client. - Gets the 6.0 version of the ServiceHooksClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.service_hooks.service_hooks_client.ServiceHooksClient') - - def get_settings_client(self): - """get_settings_client. - Gets the 6.0 version of the SettingsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.settings.settings_client.SettingsClient') - - def get_symbol_client(self): - """get_symbol_client. - Gets the 6.0 version of the SymbolClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.symbol.symbol_client.SymbolClient') - - def get_task_client(self): - """get_task_client. - Gets the 6.0 version of the TaskClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.task.task_client.TaskClient') - - def get_task_agent_client(self): - """get_task_agent_client. - Gets the 6.0 version of the TaskAgentClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.task_agent.task_agent_client.TaskAgentClient') - - def get_test_client(self): - """get_test_client. - Gets the 6.0 version of the TestClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.test.test_client.TestClient') - - def get_test_plan_client(self): - """get_test_plan_client. - Gets the 6.0 version of the TestPlanClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.test_plan.test_plan_client.TestPlanClient') - - def get_test_results_client(self): - """get_test_results_client. - Gets the 6.0 version of the TestResultsClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.test_results.test_results_client.TestResultsClient') - - def get_tfvc_client(self): - """get_tfvc_client. - Gets the 6.0 version of the TfvcClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.tfvc.tfvc_client.TfvcClient') - - def get_token_admin_client(self): - """get_token_admin_client. - Gets the 6.0 version of the TokenAdminClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.token_admin.token_admin_client.TokenAdminClient') - - def get_upack_api_client(self): - """get_upack_api_client. - Gets the 6.0 version of the UPackApiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.upack_api.upack_api_client.UPackApiClient') - - def get_upack_packaging_client(self): - """get_upack_packaging_client. - Gets the 6.0 version of the UPackPackagingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.upack_packaging.upack_packaging_client.UPackPackagingClient') - - def get_wiki_client(self): - """get_wiki_client. - Gets the 6.0 version of the WikiClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.wiki.wiki_client.WikiClient') - - def get_work_client(self): - """get_work_client. - Gets the 6.0 version of the WorkClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.work.work_client.WorkClient') - - def get_work_item_tracking_client(self): - """get_work_item_tracking_client. - Gets the 6.0 version of the WorkItemTrackingClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') - - def get_work_item_tracking_process_client(self): - """get_work_item_tracking_process_client. - Gets the 6.0 version of the WorkItemTrackingProcessClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.work_item_tracking_process.work_item_tracking_process_client.WorkItemTrackingProcessClient') - - def get_work_item_tracking_process_template_client(self): - """get_work_item_tracking_process_template_client. - Gets the 6.0 version of the WorkItemTrackingProcessTemplateClient - :rtype: :class:` ` - """ - return self._connection.get_client('azure.devops.v6_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') - diff --git a/azure-devops/azure/devops/v6_0/cloud_load_test/__init__.py b/azure-devops/azure/devops/v6_0/cloud_load_test/__init__.py deleted file mode 100644 index 70f8560e..00000000 --- a/azure-devops/azure/devops/v6_0/cloud_load_test/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .cloud_load_test_client import CloudLoadTestClient - -__all__ = [ - 'AgentGroup', - 'AgentGroupAccessData', - 'Application', - 'ApplicationCounters', - 'ApplicationType', - 'BrowserMix', - 'CltCustomerIntelligenceData', - 'CounterGroup', - 'CounterInstanceSamples', - 'CounterSample', - 'CounterSampleQueryDetails', - 'CounterSamplesResult', - 'Diagnostics', - 'DropAccessData', - 'ErrorDetails', - 'GraphSubjectBase', - 'IdentityRef', - 'LoadGenerationGeoLocation', - 'LoadTest', - 'LoadTestDefinition', - 'LoadTestErrors', - 'LoadTestRunDetails', - 'LoadTestRunSettings', - 'OverridableRunSettings', - 'PageSummary', - 'ReferenceLinks', - 'RequestSummary', - 'ScenarioSummary', - 'StaticAgentRunSetting', - 'SubType', - 'SummaryPercentileData', - 'TenantDetails', - 'TestDefinition', - 'TestDefinitionBasic', - 'TestDrop', - 'TestDropRef', - 'TestResults', - 'TestResultsSummary', - 'TestRun', - 'TestRunAbortMessage', - 'TestRunBasic', - 'TestRunCounterInstance', - 'TestRunMessage', - 'TestSettings', - 'TestSummary', - 'TransactionSummary', - 'WebApiLoadTestMachineInput', - 'WebApiSetupParamaters', - 'WebApiTestMachine', - 'WebApiUserLoadTestMachineInput', - 'WebInstanceSummaryData', - 'CloudLoadTestClient' -] diff --git a/azure-devops/azure/devops/v6_0/cloud_load_test/cloud_load_test_client.py b/azure-devops/azure/devops/v6_0/cloud_load_test/cloud_load_test_client.py deleted file mode 100644 index 822a6f53..00000000 --- a/azure-devops/azure/devops/v6_0/cloud_load_test/cloud_load_test_client.py +++ /dev/null @@ -1,455 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 CloudLoadTestClient(Client): - """CloudLoadTest - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(CloudLoadTestClient, 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 = '7ae6d0a6-cda5-44cf-a261-28c392bed25c' - - def create_agent_group(self, group): - """CreateAgentGroup. - [Preview API] - :param :class:` ` group: Agent group to be created - :rtype: :class:` ` - """ - content = self._serialize.body(group, 'AgentGroup') - response = self._send(http_method='POST', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='6.0-preview.1', - content=content) - return self._deserialize('AgentGroup', response) - - def get_agent_groups(self, agent_group_id=None, machine_setup_input=None, machine_access_data=None, outgoing_request_urls=None, agent_group_name=None): - """GetAgentGroups. - [Preview API] - :param str agent_group_id: The agent group identifier - :param bool machine_setup_input: - :param bool machine_access_data: - :param bool outgoing_request_urls: - :param str agent_group_name: Name of the agent group - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if machine_setup_input is not None: - query_parameters['machineSetupInput'] = self._serialize.query('machine_setup_input', machine_setup_input, 'bool') - if machine_access_data is not None: - query_parameters['machineAccessData'] = self._serialize.query('machine_access_data', machine_access_data, 'bool') - if outgoing_request_urls is not None: - query_parameters['outgoingRequestUrls'] = self._serialize.query('outgoing_request_urls', outgoing_request_urls, 'bool') - if agent_group_name is not None: - query_parameters['agentGroupName'] = self._serialize.query('agent_group_name', agent_group_name, 'str') - response = self._send(http_method='GET', - location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', - version='6.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def delete_static_agent(self, agent_group_id, agent_name): - """DeleteStaticAgent. - [Preview API] - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: str - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='DELETE', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='6.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('str', response) - - def get_static_agents(self, agent_group_id, agent_name=None): - """GetStaticAgents. - [Preview API] - :param str agent_group_id: The agent group identifier - :param str agent_name: Name of the static agent - :rtype: object - """ - route_values = {} - if agent_group_id is not None: - route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - response = self._send(http_method='GET', - location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', - version='6.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_application(self, application_id): - """GetApplication. - [Preview API] - :param str application_id: Filter by APM application identifier. - :rtype: :class:` ` - """ - route_values = {} - if application_id is not None: - route_values['applicationId'] = self._serialize.url('application_id', application_id, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('Application', response) - - def get_applications(self, type=None): - """GetApplications. - [Preview API] - :param str type: Filters the results based on the plugin type. - :rtype: [Application] - """ - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - response = self._send(http_method='GET', - location_id='2c986dce-8e8d-4142-b541-d016d5aff764', - version='6.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('[Application]', self._unwrap_collection(response)) - - def get_counters(self, test_run_id, group_names, include_summary=None): - """GetCounters. - [Preview API] - :param str test_run_id: The test run identifier - :param str group_names: Comma separated names of counter groups, such as 'Application', 'Performance' and 'Throughput' - :param bool include_summary: - :rtype: [TestRunCounterInstance] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if group_names is not None: - query_parameters['groupNames'] = self._serialize.query('group_names', group_names, 'str') - if include_summary is not None: - query_parameters['includeSummary'] = self._serialize.query('include_summary', include_summary, 'bool') - response = self._send(http_method='GET', - location_id='29265ea4-b5a5-4b2e-b054-47f5f6f00183', - version='6.0-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[TestRunCounterInstance]', self._unwrap_collection(response)) - - def get_application_counters(self, application_id=None, plugintype=None): - """GetApplicationCounters. - [Preview API] - :param str application_id: Filter by APM application identifier. - :param str plugintype: Currently ApplicationInsights is the only available plugin type. - :rtype: [ApplicationCounters] - """ - query_parameters = {} - if application_id is not None: - query_parameters['applicationId'] = self._serialize.query('application_id', application_id, 'str') - if plugintype is not None: - query_parameters['plugintype'] = self._serialize.query('plugintype', plugintype, 'str') - response = self._send(http_method='GET', - location_id='c1275ce9-6d26-4bc6-926b-b846502e812d', - version='6.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('[ApplicationCounters]', self._unwrap_collection(response)) - - def get_counter_samples(self, counter_sample_query_details, test_run_id): - """GetCounterSamples. - [Preview API] - :param :class:` ` counter_sample_query_details: - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(counter_sample_query_details, 'VssJsonCollectionWrapper') - response = self._send(http_method='POST', - location_id='bad18480-7193-4518-992a-37289c5bb92d', - version='6.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('CounterSamplesResult', response) - - def get_load_test_run_errors(self, test_run_id, type=None, sub_type=None, detailed=None): - """GetLoadTestRunErrors. - [Preview API] - :param str test_run_id: The test run identifier - :param str type: Filter for the particular type of errors. - :param str sub_type: Filter for a particular subtype of errors. You should not provide error subtype without error type. - :param bool detailed: To include the details of test errors such as messagetext, request, stacktrace, testcasename, scenarioname, and lasterrordate. - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - query_parameters = {} - if type is not None: - query_parameters['type'] = self._serialize.query('type', type, 'str') - if sub_type is not None: - query_parameters['subType'] = self._serialize.query('sub_type', sub_type, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - response = self._send(http_method='GET', - location_id='b52025a7-3fb4-4283-8825-7079e75bd402', - version='6.0-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('LoadTestErrors', response) - - def get_test_run_messages(self, test_run_id): - """GetTestRunMessages. - [Preview API] - :param str test_run_id: Id of the test run - :rtype: [TestRunMessage] - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='2e7ba122-f522-4205-845b-2d270e59850a', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('[TestRunMessage]', self._unwrap_collection(response)) - - def get_plugin(self, type): - """GetPlugin. - [Preview API] - :param str type: Currently ApplicationInsights is the only available plugin type. - :rtype: :class:` ` - """ - route_values = {} - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('ApplicationType', response) - - def get_plugins(self): - """GetPlugins. - [Preview API] - :rtype: [ApplicationType] - """ - response = self._send(http_method='GET', - location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', - version='6.0-preview.1') - return self._deserialize('[ApplicationType]', self._unwrap_collection(response)) - - def get_load_test_result(self, test_run_id): - """GetLoadTestResult. - [Preview API] - :param str test_run_id: The test run identifier - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='5ed69bd8-4557-4cec-9b75-1ad67d0c257b', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('TestResults', response) - - def create_test_definition(self, test_definition): - """CreateTestDefinition. - [Preview API] - :param :class:` ` test_definition: Test definition to be created - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='POST', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='6.0-preview.1', - content=content) - return self._deserialize('TestDefinition', response) - - def get_test_definition(self, test_definition_id): - """GetTestDefinition. - [Preview API] - :param str test_definition_id: The test definition identifier - :rtype: :class:` ` - """ - route_values = {} - if test_definition_id is not None: - route_values['testDefinitionId'] = self._serialize.url('test_definition_id', test_definition_id, 'str') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('TestDefinition', response) - - def get_test_definitions(self, from_date=None, to_date=None, top=None): - """GetTestDefinitions. - [Preview API] - :param str from_date: Date after which test definitions were created - :param str to_date: Date before which test definitions were crated - :param int top: - :rtype: [TestDefinitionBasic] - """ - query_parameters = {} - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='6.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('[TestDefinitionBasic]', self._unwrap_collection(response)) - - def update_test_definition(self, test_definition): - """UpdateTestDefinition. - [Preview API] - :param :class:` ` test_definition: - :rtype: :class:` ` - """ - content = self._serialize.body(test_definition, 'TestDefinition') - response = self._send(http_method='PUT', - location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', - version='6.0-preview.1', - content=content) - return self._deserialize('TestDefinition', response) - - def create_test_drop(self, web_test_drop): - """CreateTestDrop. - [Preview API] - :param :class:` ` web_test_drop: Test drop to be created - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_drop, 'TestDrop') - response = self._send(http_method='POST', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='6.0-preview.1', - content=content) - return self._deserialize('TestDrop', response) - - def get_test_drop(self, test_drop_id): - """GetTestDrop. - [Preview API] - :param str test_drop_id: The test drop identifier - :rtype: :class:` ` - """ - route_values = {} - if test_drop_id is not None: - route_values['testDropId'] = self._serialize.url('test_drop_id', test_drop_id, 'str') - response = self._send(http_method='GET', - location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('TestDrop', response) - - def create_test_run(self, web_test_run): - """CreateTestRun. - [Preview API] - :param :class:` ` web_test_run: - :rtype: :class:` ` - """ - content = self._serialize.body(web_test_run, 'TestRun') - response = self._send(http_method='POST', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='6.0-preview.1', - content=content) - return self._deserialize('TestRun', response) - - def get_test_run(self, test_run_id): - """GetTestRun. - [Preview API] - :param str test_run_id: Unique ID of the test run - :rtype: :class:` ` - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('TestRun', response) - - def get_test_runs(self, name=None, requested_by=None, status=None, run_type=None, from_date=None, to_date=None, detailed=None, top=None, runsourceidentifier=None, retention_state=None): - """GetTestRuns. - [Preview API] Returns test runs based on the filter specified. Returns all runs of the tenant if there is no filter. - :param str name: Name for the test run. Names are not unique. Test runs with same name are assigned sequential rolling numbers. - :param str requested_by: Filter by the user who requested the test run. Here requestedBy should be the display name of the user. - :param str status: Filter by the test run status. - :param str run_type: Valid values include: null, one of TestRunType, or "*" - :param str from_date: Filter by the test runs that have been modified after the fromDate timestamp. - :param str to_date: Filter by the test runs that have been modified before the toDate timestamp. - :param bool detailed: Include the detailed test run attributes. - :param int top: The maximum number of test runs to return. - :param str runsourceidentifier: - :param str retention_state: - :rtype: object - """ - query_parameters = {} - if name is not None: - query_parameters['name'] = self._serialize.query('name', name, 'str') - if requested_by is not None: - query_parameters['requestedBy'] = self._serialize.query('requested_by', requested_by, 'str') - if status is not None: - query_parameters['status'] = self._serialize.query('status', status, 'str') - if run_type is not None: - query_parameters['runType'] = self._serialize.query('run_type', run_type, 'str') - if from_date is not None: - query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') - if to_date is not None: - query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') - if detailed is not None: - query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if runsourceidentifier is not None: - query_parameters['runsourceidentifier'] = self._serialize.query('runsourceidentifier', runsourceidentifier, 'str') - if retention_state is not None: - query_parameters['retentionState'] = self._serialize.query('retention_state', retention_state, 'str') - response = self._send(http_method='GET', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='6.0-preview.1', - query_parameters=query_parameters) - return self._deserialize('object', response) - - def update_test_run(self, web_test_run, test_run_id): - """UpdateTestRun. - [Preview API] - :param :class:` ` web_test_run: - :param str test_run_id: - """ - route_values = {} - if test_run_id is not None: - route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') - content = self._serialize.body(web_test_run, 'TestRun') - self._send(http_method='PATCH', - location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', - version='6.0-preview.1', - route_values=route_values, - content=content) - diff --git a/azure-devops/azure/devops/v6_0/cloud_load_test/models.py b/azure-devops/azure/devops/v6_0/cloud_load_test/models.py deleted file mode 100644 index 582115b0..00000000 --- a/azure-devops/azure/devops/v6_0/cloud_load_test/models.py +++ /dev/null @@ -1,1835 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class AgentGroup(Model): - """ - :param created_by: User that created the agent group - :type created_by: :class:`IdentityRef ` - :param creation_time: Time agent group was created - :type creation_time: datetime - :param group_id: Id of the agent group - :type group_id: str - :param group_name: The name of the agent group - :type group_name: str - :param machine_access_data: - :type machine_access_data: list of :class:`AgentGroupAccessData ` - :param machine_configuration: Machine configuration - :type machine_configuration: :class:`WebApiUserLoadTestMachineInput ` - :param tenant_id: Tenant Id - :type tenant_id: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'machine_access_data': {'key': 'machineAccessData', 'type': '[AgentGroupAccessData]'}, - 'machine_configuration': {'key': 'machineConfiguration', 'type': 'WebApiUserLoadTestMachineInput'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'} - } - - def __init__(self, created_by=None, creation_time=None, group_id=None, group_name=None, machine_access_data=None, machine_configuration=None, tenant_id=None): - super(AgentGroup, self).__init__() - self.created_by = created_by - self.creation_time = creation_time - self.group_id = group_id - self.group_name = group_name - self.machine_access_data = machine_access_data - self.machine_configuration = machine_configuration - self.tenant_id = tenant_id - - -class AgentGroupAccessData(Model): - """ - :param details: Type Specific details - :type details: str - :param storage_connection_string: Access string - :type storage_connection_string: str - :param storage_end_point: Endpoint for the service - :type storage_end_point: str - :param storage_name: Identifier for the storage (eg. table name) - :type storage_name: str - :param storage_type: Type of the store (table, queue, blob) - :type storage_type: str - """ - - _attribute_map = { - 'details': {'key': 'details', 'type': 'str'}, - 'storage_connection_string': {'key': 'storageConnectionString', 'type': 'str'}, - 'storage_end_point': {'key': 'storageEndPoint', 'type': 'str'}, - 'storage_name': {'key': 'storageName', 'type': 'str'}, - 'storage_type': {'key': 'storageType', 'type': 'str'} - } - - def __init__(self, details=None, storage_connection_string=None, storage_end_point=None, storage_name=None, storage_type=None): - super(AgentGroupAccessData, self).__init__() - self.details = details - self.storage_connection_string = storage_connection_string - self.storage_end_point = storage_end_point - self.storage_name = storage_name - self.storage_type = storage_type - - -class Application(Model): - """ - :param application_id: Unique Id of the Application Component - :type application_id: str - :param description: Description of the Application component - :type description: str - :param name: The Name of the Application component - :type name: str - :param path: Path identifier of the Application component - :type path: str - :param path_seperator: Character used to separate paths for counters - :type path_seperator: str - :param type: Type identifier of the Application component under test - :type type: str - :param version: Version of the Application Component - :type version: str - """ - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'path_seperator': {'key': 'pathSeperator', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, application_id=None, description=None, name=None, path=None, path_seperator=None, type=None, version=None): - super(Application, self).__init__() - self.application_id = application_id - self.description = description - self.name = name - self.path = path - self.path_seperator = path_seperator - self.type = type - self.version = version - - -class ApplicationCounters(Model): - """ - :param application_id: The unique Id of the Application that the counter belongs - :type application_id: str - :param description: Description of autCounter - :type description: str - :param id: The unique Id for the AutCounter - :type id: str - :param is_default: Whether the autCounter is a default counter or not - :type is_default: bool - :param name: Name of the AutCounter - :type name: str - :param path: The Path of the the autcounter wrt to hierarchy - :type path: str - """ - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, application_id=None, description=None, id=None, is_default=None, name=None, path=None): - super(ApplicationCounters, self).__init__() - self.application_id = application_id - self.description = description - self.id = id - self.is_default = is_default - self.name = name - self.path = path - - -class ApplicationType(Model): - """ - :param action_uri_link: Helper link url - :type action_uri_link: str - :param aut_portal_link: The link that points to aut results site - :type aut_portal_link: str - :param is_enabled: true if application results collection is enabled for this tenant - :type is_enabled: bool - :param max_components_allowed_for_collection: the max no. of application components allowed for collection per run - :type max_components_allowed_for_collection: int - :param max_counters_allowed: The max no. of counters that can be collected per aut - :type max_counters_allowed: int - :param type: Application Type - :type type: str - """ - - _attribute_map = { - 'action_uri_link': {'key': 'actionUriLink', 'type': 'str'}, - 'aut_portal_link': {'key': 'autPortalLink', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'max_components_allowed_for_collection': {'key': 'maxComponentsAllowedForCollection', 'type': 'int'}, - 'max_counters_allowed': {'key': 'maxCountersAllowed', 'type': 'int'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, action_uri_link=None, aut_portal_link=None, is_enabled=None, max_components_allowed_for_collection=None, max_counters_allowed=None, type=None): - super(ApplicationType, self).__init__() - self.action_uri_link = action_uri_link - self.aut_portal_link = aut_portal_link - self.is_enabled = is_enabled - self.max_components_allowed_for_collection = max_components_allowed_for_collection - self.max_counters_allowed = max_counters_allowed - self.type = type - - -class BrowserMix(Model): - """ - :param browser_name: - :type browser_name: str - :param browser_percentage: - :type browser_percentage: float - """ - - _attribute_map = { - 'browser_name': {'key': 'browserName', 'type': 'str'}, - 'browser_percentage': {'key': 'browserPercentage', 'type': 'float'} - } - - def __init__(self, browser_name=None, browser_percentage=None): - super(BrowserMix, self).__init__() - self.browser_name = browser_name - self.browser_percentage = browser_percentage - - -class CltCustomerIntelligenceData(Model): - """ - :param area: - :type area: str - :param feature: - :type feature: str - :param properties: - :type properties: dict - """ - - _attribute_map = { - 'area': {'key': 'area', 'type': 'str'}, - 'feature': {'key': 'feature', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'} - } - - def __init__(self, area=None, feature=None, properties=None): - super(CltCustomerIntelligenceData, self).__init__() - self.area = area - self.feature = feature - self.properties = properties - - -class CounterGroup(Model): - """ - :param group_name: - :type group_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, group_name=None, url=None): - super(CounterGroup, self).__init__() - self.group_name = group_name - self.url = url - - -class CounterInstanceSamples(Model): - """ - :param count: - :type count: int - :param counter_instance_id: - :type counter_instance_id: str - :param next_refresh_time: The time of next refresh - :type next_refresh_time: datetime - :param values: - :type values: list of :class:`CounterSample ` - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'next_refresh_time': {'key': 'nextRefreshTime', 'type': 'iso-8601'}, - 'values': {'key': 'values', 'type': '[CounterSample]'} - } - - def __init__(self, count=None, counter_instance_id=None, next_refresh_time=None, values=None): - super(CounterInstanceSamples, self).__init__() - self.count = count - self.counter_instance_id = counter_instance_id - self.next_refresh_time = next_refresh_time - self.values = values - - -class CounterSample(Model): - """ - :param base_value: - :type base_value: long - :param computed_value: - :type computed_value: float - :param counter_frequency: - :type counter_frequency: long - :param counter_instance_id: - :type counter_instance_id: str - :param counter_type: - :type counter_type: str - :param interval_end_date: - :type interval_end_date: datetime - :param interval_number: - :type interval_number: int - :param raw_value: - :type raw_value: long - :param system_frequency: - :type system_frequency: long - :param time_stamp: - :type time_stamp: long - """ - - _attribute_map = { - 'base_value': {'key': 'baseValue', 'type': 'long'}, - 'computed_value': {'key': 'computedValue', 'type': 'float'}, - 'counter_frequency': {'key': 'counterFrequency', 'type': 'long'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'counter_type': {'key': 'counterType', 'type': 'str'}, - 'interval_end_date': {'key': 'intervalEndDate', 'type': 'iso-8601'}, - 'interval_number': {'key': 'intervalNumber', 'type': 'int'}, - 'raw_value': {'key': 'rawValue', 'type': 'long'}, - 'system_frequency': {'key': 'systemFrequency', 'type': 'long'}, - 'time_stamp': {'key': 'timeStamp', 'type': 'long'} - } - - def __init__(self, base_value=None, computed_value=None, counter_frequency=None, counter_instance_id=None, counter_type=None, interval_end_date=None, interval_number=None, raw_value=None, system_frequency=None, time_stamp=None): - super(CounterSample, self).__init__() - self.base_value = base_value - self.computed_value = computed_value - self.counter_frequency = counter_frequency - self.counter_instance_id = counter_instance_id - self.counter_type = counter_type - self.interval_end_date = interval_end_date - self.interval_number = interval_number - self.raw_value = raw_value - self.system_frequency = system_frequency - self.time_stamp = time_stamp - - -class CounterSampleQueryDetails(Model): - """ - :param counter_instance_id: The instanceId for which samples are required - :type counter_instance_id: str - :param from_interval: - :type from_interval: int - :param to_interval: - :type to_interval: int - """ - - _attribute_map = { - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'from_interval': {'key': 'fromInterval', 'type': 'int'}, - 'to_interval': {'key': 'toInterval', 'type': 'int'} - } - - def __init__(self, counter_instance_id=None, from_interval=None, to_interval=None): - super(CounterSampleQueryDetails, self).__init__() - self.counter_instance_id = counter_instance_id - self.from_interval = from_interval - self.to_interval = to_interval - - -class CounterSamplesResult(Model): - """ - :param count: Count of the samples - :type count: int - :param max_batch_size: Maximum number of samples returned in this object - :type max_batch_size: int - :param total_samples_count: Count of the samples - :type total_samples_count: int - :param values: The result samples - :type values: list of :class:`CounterInstanceSamples ` - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'max_batch_size': {'key': 'maxBatchSize', 'type': 'int'}, - 'total_samples_count': {'key': 'totalSamplesCount', 'type': 'int'}, - 'values': {'key': 'values', 'type': '[CounterInstanceSamples]'} - } - - def __init__(self, count=None, max_batch_size=None, total_samples_count=None, values=None): - super(CounterSamplesResult, self).__init__() - self.count = count - self.max_batch_size = max_batch_size - self.total_samples_count = total_samples_count - self.values = values - - -class Diagnostics(Model): - """ - :param diagnostic_store_connection_string: - :type diagnostic_store_connection_string: str - :param last_modified_time: - :type last_modified_time: datetime - :param relative_path_to_diagnostic_files: - :type relative_path_to_diagnostic_files: str - """ - - _attribute_map = { - 'diagnostic_store_connection_string': {'key': 'diagnosticStoreConnectionString', 'type': 'str'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - 'relative_path_to_diagnostic_files': {'key': 'relativePathToDiagnosticFiles', 'type': 'str'} - } - - def __init__(self, diagnostic_store_connection_string=None, last_modified_time=None, relative_path_to_diagnostic_files=None): - super(Diagnostics, self).__init__() - self.diagnostic_store_connection_string = diagnostic_store_connection_string - self.last_modified_time = last_modified_time - self.relative_path_to_diagnostic_files = relative_path_to_diagnostic_files - - -class DropAccessData(Model): - """ - :param drop_container_url: - :type drop_container_url: str - :param sas_key: The SaSkey to use for the drop. - :type sas_key: str - """ - - _attribute_map = { - 'drop_container_url': {'key': 'dropContainerUrl', 'type': 'str'}, - 'sas_key': {'key': 'sasKey', 'type': 'str'} - } - - def __init__(self, drop_container_url=None, sas_key=None): - super(DropAccessData, self).__init__() - self.drop_container_url = drop_container_url - self.sas_key = sas_key - - -class ErrorDetails(Model): - """ - :param last_error_date: - :type last_error_date: datetime - :param message_text: - :type message_text: str - :param occurrences: - :type occurrences: int - :param request: - :type request: str - :param scenario_name: - :type scenario_name: str - :param stack_trace: - :type stack_trace: str - :param test_case_name: - :type test_case_name: str - """ - - _attribute_map = { - 'last_error_date': {'key': 'lastErrorDate', 'type': 'iso-8601'}, - 'message_text': {'key': 'messageText', 'type': 'str'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'request': {'key': 'request', 'type': 'str'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, - 'test_case_name': {'key': 'testCaseName', 'type': 'str'} - } - - def __init__(self, last_error_date=None, message_text=None, occurrences=None, request=None, scenario_name=None, stack_trace=None, test_case_name=None): - super(ErrorDetails, self).__init__() - self.last_error_date = last_error_date - self.message_text = message_text - self.occurrences = occurrences - self.request = request - self.scenario_name = scenario_name - self.stack_trace = stack_trace - self.test_case_name = test_case_name - - -class GraphSubjectBase(Model): - """ - :param _links: - :type _links: :class:`ReferenceLinks ` - :param descriptor: - :type descriptor: str - :param display_name: - :type display_name: str - :param url: - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityRef(GraphSubjectBase): - """ - :param _links: - :type _links: :class:`ReferenceLinks ` - :param descriptor: - :type descriptor: str - :param display_name: - :type display_name: str - :param url: - :type url: str - :param directory_alias: - :type directory_alias: str - :param id: - :type id: str - :param image_url: - :type image_url: str - :param inactive: - :type inactive: bool - :param is_aad_identity: - :type is_aad_identity: bool - :param is_container: - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: - :type profile_url: str - :param unique_name: - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class LoadGenerationGeoLocation(Model): - """ - :param location: - :type location: str - :param percentage: - :type percentage: int - """ - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'percentage': {'key': 'percentage', 'type': 'int'} - } - - def __init__(self, location=None, percentage=None): - super(LoadGenerationGeoLocation, self).__init__() - self.location = location - self.percentage = percentage - - -class LoadTest(Model): - """ - """ - - _attribute_map = { - } - - def __init__(self): - super(LoadTest, self).__init__() - - -class LoadTestDefinition(Model): - """ - :param agent_count: - :type agent_count: int - :param browser_mixs: - :type browser_mixs: list of :class:`BrowserMix ` - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_pattern_name: - :type load_pattern_name: str - :param load_test_name: - :type load_test_name: str - :param max_vusers: - :type max_vusers: int - :param run_duration: - :type run_duration: int - :param sampling_rate: - :type sampling_rate: int - :param think_time: - :type think_time: int - :param urls: - :type urls: list of str - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'browser_mixs': {'key': 'browserMixs', 'type': '[BrowserMix]'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_pattern_name': {'key': 'loadPatternName', 'type': 'str'}, - 'load_test_name': {'key': 'loadTestName', 'type': 'str'}, - 'max_vusers': {'key': 'maxVusers', 'type': 'int'}, - 'run_duration': {'key': 'runDuration', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'think_time': {'key': 'thinkTime', 'type': 'int'}, - 'urls': {'key': 'urls', 'type': '[str]'} - } - - def __init__(self, agent_count=None, browser_mixs=None, core_count=None, cores_per_agent=None, load_generation_geo_locations=None, load_pattern_name=None, load_test_name=None, max_vusers=None, run_duration=None, sampling_rate=None, think_time=None, urls=None): - super(LoadTestDefinition, self).__init__() - self.agent_count = agent_count - self.browser_mixs = browser_mixs - self.core_count = core_count - self.cores_per_agent = cores_per_agent - self.load_generation_geo_locations = load_generation_geo_locations - self.load_pattern_name = load_pattern_name - self.load_test_name = load_test_name - self.max_vusers = max_vusers - self.run_duration = run_duration - self.sampling_rate = sampling_rate - self.think_time = think_time - self.urls = urls - - -class LoadTestErrors(Model): - """ - :param count: - :type count: int - :param occurrences: - :type occurrences: int - :param types: - :type types: list of :class:`object ` - :param url: - :type url: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'types': {'key': 'types', 'type': '[object]'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, count=None, occurrences=None, types=None, url=None): - super(LoadTestErrors, self).__init__() - self.count = count - self.occurrences = occurrences - self.types = types - self.url = url - - -class LoadTestRunSettings(Model): - """ - :param agent_count: - :type agent_count: int - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param duration: - :type duration: int - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param sampling_interval: - :type sampling_interval: int - :param warm_up_duration: - :type warm_up_duration: int - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'duration': {'key': 'duration', 'type': 'int'}, - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'} - } - - def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None): - super(LoadTestRunSettings, self).__init__() - self.agent_count = agent_count - self.core_count = core_count - self.cores_per_agent = cores_per_agent - self.duration = duration - self.load_generator_machines_type = load_generator_machines_type - self.sampling_interval = sampling_interval - self.warm_up_duration = warm_up_duration - - -class OverridableRunSettings(Model): - """ - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param static_agent_run_settings: - :type static_agent_run_settings: :class:`StaticAgentRunSetting ` - """ - - _attribute_map = { - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'} - } - - def __init__(self, load_generator_machines_type=None, static_agent_run_settings=None): - super(OverridableRunSettings, self).__init__() - self.load_generator_machines_type = load_generator_machines_type - self.static_agent_run_settings = static_agent_run_settings - - -class PageSummary(Model): - """ - :param average_page_time: - :type average_page_time: float - :param page_url: - :type page_url: str - :param percentage_pages_meeting_goal: - :type percentage_pages_meeting_goal: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_pages: - :type total_pages: int - """ - - _attribute_map = { - 'average_page_time': {'key': 'averagePageTime', 'type': 'float'}, - 'page_url': {'key': 'pageUrl', 'type': 'str'}, - 'percentage_pages_meeting_goal': {'key': 'percentagePagesMeetingGoal', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_pages': {'key': 'totalPages', 'type': 'int'} - } - - def __init__(self, average_page_time=None, page_url=None, percentage_pages_meeting_goal=None, percentile_data=None, scenario_name=None, test_name=None, total_pages=None): - super(PageSummary, self).__init__() - self.average_page_time = average_page_time - self.page_url = page_url - self.percentage_pages_meeting_goal = percentage_pages_meeting_goal - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_pages = total_pages - - -class ReferenceLinks(Model): - """ - :param links: - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class RequestSummary(Model): - """ - :param average_response_time: - :type average_response_time: float - :param failed_requests: - :type failed_requests: int - :param passed_requests: - :type passed_requests: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param requests_per_sec: - :type requests_per_sec: float - :param request_url: - :type request_url: str - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_requests: - :type total_requests: int - """ - - _attribute_map = { - 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, - 'failed_requests': {'key': 'failedRequests', 'type': 'int'}, - 'passed_requests': {'key': 'passedRequests', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'requests_per_sec': {'key': 'requestsPerSec', 'type': 'float'}, - 'request_url': {'key': 'requestUrl', 'type': 'str'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_requests': {'key': 'totalRequests', 'type': 'int'} - } - - def __init__(self, average_response_time=None, failed_requests=None, passed_requests=None, percentile_data=None, requests_per_sec=None, request_url=None, scenario_name=None, test_name=None, total_requests=None): - super(RequestSummary, self).__init__() - self.average_response_time = average_response_time - self.failed_requests = failed_requests - self.passed_requests = passed_requests - self.percentile_data = percentile_data - self.requests_per_sec = requests_per_sec - self.request_url = request_url - self.scenario_name = scenario_name - self.test_name = test_name - self.total_requests = total_requests - - -class ScenarioSummary(Model): - """ - :param max_user_load: - :type max_user_load: int - :param min_user_load: - :type min_user_load: int - :param scenario_name: - :type scenario_name: str - """ - - _attribute_map = { - 'max_user_load': {'key': 'maxUserLoad', 'type': 'int'}, - 'min_user_load': {'key': 'minUserLoad', 'type': 'int'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'} - } - - def __init__(self, max_user_load=None, min_user_load=None, scenario_name=None): - super(ScenarioSummary, self).__init__() - self.max_user_load = max_user_load - self.min_user_load = min_user_load - self.scenario_name = scenario_name - - -class StaticAgentRunSetting(Model): - """ - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param static_agent_group_name: - :type static_agent_group_name: str - """ - - _attribute_map = { - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'static_agent_group_name': {'key': 'staticAgentGroupName', 'type': 'str'} - } - - def __init__(self, load_generator_machines_type=None, static_agent_group_name=None): - super(StaticAgentRunSetting, self).__init__() - self.load_generator_machines_type = load_generator_machines_type - self.static_agent_group_name = static_agent_group_name - - -class SubType(Model): - """ - :param count: - :type count: int - :param error_detail_list: - :type error_detail_list: list of :class:`ErrorDetails ` - :param occurrences: - :type occurrences: int - :param sub_type_name: - :type sub_type_name: str - :param url: - :type url: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'error_detail_list': {'key': 'errorDetailList', 'type': '[ErrorDetails]'}, - 'occurrences': {'key': 'occurrences', 'type': 'int'}, - 'sub_type_name': {'key': 'subTypeName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, count=None, error_detail_list=None, occurrences=None, sub_type_name=None, url=None): - super(SubType, self).__init__() - self.count = count - self.error_detail_list = error_detail_list - self.occurrences = occurrences - self.sub_type_name = sub_type_name - self.url = url - - -class SummaryPercentileData(Model): - """ - :param percentile: - :type percentile: int - :param percentile_value: - :type percentile_value: float - """ - - _attribute_map = { - 'percentile': {'key': 'percentile', 'type': 'int'}, - 'percentile_value': {'key': 'percentileValue', 'type': 'float'} - } - - def __init__(self, percentile=None, percentile_value=None): - super(SummaryPercentileData, self).__init__() - self.percentile = percentile - self.percentile_value = percentile_value - - -class TenantDetails(Model): - """ - :param access_details: Access details - :type access_details: list of :class:`AgentGroupAccessData ` - :param id: Tenant Id - :type id: str - :param static_machines: Static machines configured for local runs - :type static_machines: list of :class:`WebApiTestMachine ` - :param user_load_agent_input: - :type user_load_agent_input: :class:`WebApiUserLoadTestMachineInput ` - :param user_load_agent_resources_uri: - :type user_load_agent_resources_uri: str - :param valid_geo_locations: The list of valid geo-lcations for tenant - :type valid_geo_locations: list of str - """ - - _attribute_map = { - 'access_details': {'key': 'accessDetails', 'type': '[AgentGroupAccessData]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'static_machines': {'key': 'staticMachines', 'type': '[WebApiTestMachine]'}, - 'user_load_agent_input': {'key': 'userLoadAgentInput', 'type': 'WebApiUserLoadTestMachineInput'}, - 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, - 'valid_geo_locations': {'key': 'validGeoLocations', 'type': '[str]'} - } - - def __init__(self, access_details=None, id=None, static_machines=None, user_load_agent_input=None, user_load_agent_resources_uri=None, valid_geo_locations=None): - super(TenantDetails, self).__init__() - self.access_details = access_details - self.id = id - self.static_machines = static_machines - self.user_load_agent_input = user_load_agent_input - self.user_load_agent_resources_uri = user_load_agent_resources_uri - self.valid_geo_locations = valid_geo_locations - - -class TestDefinitionBasic(Model): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_by: - :type created_by: :class:`IdentityRef ` - :param created_date: - :type created_date: datetime - :param id: - :type id: str - :param last_modified_by: - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_date: - :type last_modified_date: datetime - :param load_test_type: - :type load_test_type: object - :param name: - :type name: str - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, - 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None): - super(TestDefinitionBasic, self).__init__() - self.access_data = access_data - self.created_by = created_by - self.created_date = created_date - self.id = id - self.last_modified_by = last_modified_by - self.last_modified_date = last_modified_date - self.load_test_type = load_test_type - self.name = name - - -class TestDrop(Model): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_date: Time at which the drop is created - :type created_date: datetime - :param drop_type: Identifies the type of drop - :type drop_type: str - :param id: Drop Id - :type id: str - :param load_test_definition: LoadTest definition of the run for which testdrop is created - :type load_test_definition: :class:`LoadTestDefinition ` - :param test_run_id: Test Run Id - :type test_run_id: str - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'drop_type': {'key': 'dropType', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_test_definition': {'key': 'loadTestDefinition', 'type': 'LoadTestDefinition'}, - 'test_run_id': {'key': 'testRunId', 'type': 'str'} - } - - def __init__(self, access_data=None, created_date=None, drop_type=None, id=None, load_test_definition=None, test_run_id=None): - super(TestDrop, self).__init__() - self.access_data = access_data - self.created_date = created_date - self.drop_type = drop_type - self.id = id - self.load_test_definition = load_test_definition - self.test_run_id = test_run_id - - -class TestDropRef(Model): - """ - An abstracted reference to some other resource. This class is used to provide the load test data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. - - :param id: Id of the resource - :type id: str - :param url: Full http link to the resource - :type url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, id=None, url=None): - super(TestDropRef, self).__init__() - self.id = id - self.url = url - - -class TestResults(Model): - """ - :param cloud_load_test_solution_url: The uri to the test run results file. - :type cloud_load_test_solution_url: str - :param counter_groups: - :type counter_groups: list of :class:`CounterGroup ` - :param diagnostics: The object contains diagnostic details - :type diagnostics: :class:`Diagnostics ` - :param results_url: The uri to the test run results file. - :type results_url: str - """ - - _attribute_map = { - 'cloud_load_test_solution_url': {'key': 'cloudLoadTestSolutionUrl', 'type': 'str'}, - 'counter_groups': {'key': 'counterGroups', 'type': '[CounterGroup]'}, - 'diagnostics': {'key': 'diagnostics', 'type': 'Diagnostics'}, - 'results_url': {'key': 'resultsUrl', 'type': 'str'} - } - - def __init__(self, cloud_load_test_solution_url=None, counter_groups=None, diagnostics=None, results_url=None): - super(TestResults, self).__init__() - self.cloud_load_test_solution_url = cloud_load_test_solution_url - self.counter_groups = counter_groups - self.diagnostics = diagnostics - self.results_url = results_url - - -class TestResultsSummary(Model): - """ - :param overall_page_summary: - :type overall_page_summary: :class:`PageSummary ` - :param overall_request_summary: - :type overall_request_summary: :class:`RequestSummary ` - :param overall_scenario_summary: - :type overall_scenario_summary: :class:`ScenarioSummary ` - :param overall_test_summary: - :type overall_test_summary: :class:`TestSummary ` - :param overall_transaction_summary: - :type overall_transaction_summary: :class:`TransactionSummary ` - :param top_slow_pages: - :type top_slow_pages: list of :class:`PageSummary ` - :param top_slow_requests: - :type top_slow_requests: list of :class:`RequestSummary ` - :param top_slow_tests: - :type top_slow_tests: list of :class:`TestSummary ` - :param top_slow_transactions: - :type top_slow_transactions: list of :class:`TransactionSummary ` - """ - - _attribute_map = { - 'overall_page_summary': {'key': 'overallPageSummary', 'type': 'PageSummary'}, - 'overall_request_summary': {'key': 'overallRequestSummary', 'type': 'RequestSummary'}, - 'overall_scenario_summary': {'key': 'overallScenarioSummary', 'type': 'ScenarioSummary'}, - 'overall_test_summary': {'key': 'overallTestSummary', 'type': 'TestSummary'}, - 'overall_transaction_summary': {'key': 'overallTransactionSummary', 'type': 'TransactionSummary'}, - 'top_slow_pages': {'key': 'topSlowPages', 'type': '[PageSummary]'}, - 'top_slow_requests': {'key': 'topSlowRequests', 'type': '[RequestSummary]'}, - 'top_slow_tests': {'key': 'topSlowTests', 'type': '[TestSummary]'}, - 'top_slow_transactions': {'key': 'topSlowTransactions', 'type': '[TransactionSummary]'} - } - - def __init__(self, overall_page_summary=None, overall_request_summary=None, overall_scenario_summary=None, overall_test_summary=None, overall_transaction_summary=None, top_slow_pages=None, top_slow_requests=None, top_slow_tests=None, top_slow_transactions=None): - super(TestResultsSummary, self).__init__() - self.overall_page_summary = overall_page_summary - self.overall_request_summary = overall_request_summary - self.overall_scenario_summary = overall_scenario_summary - self.overall_test_summary = overall_test_summary - self.overall_transaction_summary = overall_transaction_summary - self.top_slow_pages = top_slow_pages - self.top_slow_requests = top_slow_requests - self.top_slow_tests = top_slow_tests - self.top_slow_transactions = top_slow_transactions - - -class TestRunAbortMessage(Model): - """ - :param action: - :type action: str - :param cause: - :type cause: str - :param details: - :type details: list of str - :param logged_date: - :type logged_date: datetime - :param source: - :type source: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'cause': {'key': 'cause', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[str]'}, - 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, - 'source': {'key': 'source', 'type': 'str'} - } - - def __init__(self, action=None, cause=None, details=None, logged_date=None, source=None): - super(TestRunAbortMessage, self).__init__() - self.action = action - self.cause = cause - self.details = details - self.logged_date = logged_date - self.source = source - - -class TestRunBasic(Model): - """ - :param created_by: Vss User identity who created the test run. - :type created_by: :class:`IdentityRef ` - :param created_date: Gets the creation time of the test run - :type created_date: datetime - :param deleted_by: Vss User identity who deleted the test run. - :type deleted_by: :class:`IdentityRef ` - :param deleted_date: Gets the deleted time of the test run - :type deleted_date: datetime - :param finished_date: Gets the finish time of the test run - :type finished_date: datetime - :param id: Gets the unique identifier for the test run definition. - :type id: str - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_file_name: Gets the load test file of the test run definition. - :type load_test_file_name: str - :param name: Gets the name of the test run definition. - :type name: str - :param run_number: Gets the number of the test run (unique within a tenant) - :type run_number: int - :param run_source: Test run source like Ibiza,VSO,BuildVNext, etc. - :type run_source: str - :param run_specific_details: Run specific details. - :type run_specific_details: :class:`LoadTestRunDetails ` - :param run_type: Run type like VisualStudioLoadTest or JMeterLoadTest - :type run_type: object - :param state: State of the test run. - :type state: object - :param url: - :type url: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, - 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, - 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'run_source': {'key': 'runSource', 'type': 'str'}, - 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, - 'run_type': {'key': 'runType', 'type': 'object'}, - 'state': {'key': 'state', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None): - super(TestRunBasic, self).__init__() - self.created_by = created_by - self.created_date = created_date - self.deleted_by = deleted_by - self.deleted_date = deleted_date - self.finished_date = finished_date - self.id = id - self.load_generation_geo_locations = load_generation_geo_locations - self.load_test_file_name = load_test_file_name - self.name = name - self.run_number = run_number - self.run_source = run_source - self.run_specific_details = run_specific_details - self.run_type = run_type - self.state = state - self.url = url - - -class TestRunCounterInstance(Model): - """ - :param category_name: CategoryName for this counter - :type category_name: str - :param counter_instance_id: Combination of source and SourceInstanceId - :type counter_instance_id: str - :param counter_name: Name of the counter Eg: Errors/Sec - :type counter_name: str - :param counter_units: Units for this counter. Empty string for mere numbers - :type counter_units: str - :param instance_name: Instance Name Eg: _Avg,_Total etc - :type instance_name: str - :param is_preselected_counter: true if this counter instance is a default counter - :type is_preselected_counter: bool - :param machine_name: Machine from where this counter was collected Used in case of machine specific counters like - Agent CPU and memory etc. - :type machine_name: str - :param part_of_counter_groups: Counter Groups to which this counter instance is part of - :type part_of_counter_groups: list of str - :param summary_data: Summary result for this counter instance - :type summary_data: :class:`WebInstanceSummaryData ` - :param unique_name: A unique name for this counter instance - :type unique_name: str - """ - - _attribute_map = { - 'category_name': {'key': 'categoryName', 'type': 'str'}, - 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, - 'counter_name': {'key': 'counterName', 'type': 'str'}, - 'counter_units': {'key': 'counterUnits', 'type': 'str'}, - 'instance_name': {'key': 'instanceName', 'type': 'str'}, - 'is_preselected_counter': {'key': 'isPreselectedCounter', 'type': 'bool'}, - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'part_of_counter_groups': {'key': 'partOfCounterGroups', 'type': '[str]'}, - 'summary_data': {'key': 'summaryData', 'type': 'WebInstanceSummaryData'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, category_name=None, counter_instance_id=None, counter_name=None, counter_units=None, instance_name=None, is_preselected_counter=None, machine_name=None, part_of_counter_groups=None, summary_data=None, unique_name=None): - super(TestRunCounterInstance, self).__init__() - self.category_name = category_name - self.counter_instance_id = counter_instance_id - self.counter_name = counter_name - self.counter_units = counter_units - self.instance_name = instance_name - self.is_preselected_counter = is_preselected_counter - self.machine_name = machine_name - self.part_of_counter_groups = part_of_counter_groups - self.summary_data = summary_data - self.unique_name = unique_name - - -class TestRunMessage(Model): - """ - :param agent_id: Agent Id - :type agent_id: str - :param error_code: - :type error_code: str - :param logged_date: - :type logged_date: datetime - :param message: - :type message: str - :param message_id: Message Id - :type message_id: str - :param message_source: - :type message_source: object - :param message_type: - :type message_type: object - :param test_run_id: Id of the test run - :type test_run_id: str - :param url: - :type url: str - """ - - _attribute_map = { - 'agent_id': {'key': 'agentId', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'message_source': {'key': 'messageSource', 'type': 'object'}, - 'message_type': {'key': 'messageType', 'type': 'object'}, - 'test_run_id': {'key': 'testRunId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, agent_id=None, error_code=None, logged_date=None, message=None, message_id=None, message_source=None, message_type=None, test_run_id=None, url=None): - super(TestRunMessage, self).__init__() - self.agent_id = agent_id - self.error_code = error_code - self.logged_date = logged_date - self.message = message - self.message_id = message_id - self.message_source = message_source - self.message_type = message_type - self.test_run_id = test_run_id - self.url = url - - -class TestSettings(Model): - """ - :param cleanup_command: Cleanup command - :type cleanup_command: str - :param host_process_platform: Processor Architecture chosen - :type host_process_platform: object - :param setup_command: Setup command - :type setup_command: str - """ - - _attribute_map = { - 'cleanup_command': {'key': 'cleanupCommand', 'type': 'str'}, - 'host_process_platform': {'key': 'hostProcessPlatform', 'type': 'object'}, - 'setup_command': {'key': 'setupCommand', 'type': 'str'} - } - - def __init__(self, cleanup_command=None, host_process_platform=None, setup_command=None): - super(TestSettings, self).__init__() - self.cleanup_command = cleanup_command - self.host_process_platform = host_process_platform - self.setup_command = setup_command - - -class TestSummary(Model): - """ - :param average_test_time: - :type average_test_time: float - :param failed_tests: - :type failed_tests: int - :param passed_tests: - :type passed_tests: int - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_tests: - :type total_tests: int - """ - - _attribute_map = { - 'average_test_time': {'key': 'averageTestTime', 'type': 'float'}, - 'failed_tests': {'key': 'failedTests', 'type': 'int'}, - 'passed_tests': {'key': 'passedTests', 'type': 'int'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_tests': {'key': 'totalTests', 'type': 'int'} - } - - def __init__(self, average_test_time=None, failed_tests=None, passed_tests=None, percentile_data=None, scenario_name=None, test_name=None, total_tests=None): - super(TestSummary, self).__init__() - self.average_test_time = average_test_time - self.failed_tests = failed_tests - self.passed_tests = passed_tests - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_tests = total_tests - - -class TransactionSummary(Model): - """ - :param average_response_time: - :type average_response_time: float - :param average_transaction_time: - :type average_transaction_time: float - :param percentile_data: - :type percentile_data: list of :class:`SummaryPercentileData ` - :param scenario_name: - :type scenario_name: str - :param test_name: - :type test_name: str - :param total_transactions: - :type total_transactions: int - :param transaction_name: - :type transaction_name: str - """ - - _attribute_map = { - 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, - 'average_transaction_time': {'key': 'averageTransactionTime', 'type': 'float'}, - 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'test_name': {'key': 'testName', 'type': 'str'}, - 'total_transactions': {'key': 'totalTransactions', 'type': 'int'}, - 'transaction_name': {'key': 'transactionName', 'type': 'str'} - } - - def __init__(self, average_response_time=None, average_transaction_time=None, percentile_data=None, scenario_name=None, test_name=None, total_transactions=None, transaction_name=None): - super(TransactionSummary, self).__init__() - self.average_response_time = average_response_time - self.average_transaction_time = average_transaction_time - self.percentile_data = percentile_data - self.scenario_name = scenario_name - self.test_name = test_name - self.total_transactions = total_transactions - self.transaction_name = transaction_name - - -class WebApiLoadTestMachineInput(Model): - """ - :param machine_group_id: - :type machine_group_id: str - :param machine_type: - :type machine_type: object - :param setup_configuration: - :type setup_configuration: :class:`WebApiSetupParamaters ` - :param supported_run_types: - :type supported_run_types: list of TestRunType - """ - - _attribute_map = { - 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, - 'machine_type': {'key': 'machineType', 'type': 'object'}, - 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, - 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[object]'} - } - - def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None): - super(WebApiLoadTestMachineInput, self).__init__() - self.machine_group_id = machine_group_id - self.machine_type = machine_type - self.setup_configuration = setup_configuration - self.supported_run_types = supported_run_types - - -class WebApiSetupParamaters(Model): - """ - :param configurations: - :type configurations: dict - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'} - } - - def __init__(self, configurations=None): - super(WebApiSetupParamaters, self).__init__() - self.configurations = configurations - - -class WebApiTestMachine(Model): - """ - :param last_heart_beat: - :type last_heart_beat: datetime - :param machine_name: - :type machine_name: str - :param status: - :type status: str - """ - - _attribute_map = { - 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'iso-8601'}, - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'} - } - - def __init__(self, last_heart_beat=None, machine_name=None, status=None): - super(WebApiTestMachine, self).__init__() - self.last_heart_beat = last_heart_beat - self.machine_name = machine_name - self.status = status - - -class WebApiUserLoadTestMachineInput(WebApiLoadTestMachineInput): - """ - This can eventually evolve as the ultimate JSON file that user can use to configure their machine(s) against CLT - - :param machine_group_id: - :type machine_group_id: str - :param machine_type: - :type machine_type: object - :param setup_configuration: - :type setup_configuration: :class:`WebApiSetupParamaters ` - :param supported_run_types: - :type supported_run_types: list of TestRunType - :param agent_group_name: - :type agent_group_name: str - :param tenant_id: - :type tenant_id: str - :param user_load_agent_resources_uri: - :type user_load_agent_resources_uri: str - :param vsts_account_uri: - :type vsts_account_uri: str - """ - - _attribute_map = { - 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, - 'machine_type': {'key': 'machineType', 'type': 'object'}, - 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, - 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[TestRunType]'}, - 'agent_group_name': {'key': 'agentGroupName', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, - 'vsts_account_uri': {'key': 'vstsAccountUri', 'type': 'str'} - } - - def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None, agent_group_name=None, tenant_id=None, user_load_agent_resources_uri=None, vsts_account_uri=None): - super(WebApiUserLoadTestMachineInput, self).__init__(machine_group_id=machine_group_id, machine_type=machine_type, setup_configuration=setup_configuration, supported_run_types=supported_run_types) - self.agent_group_name = agent_group_name - self.tenant_id = tenant_id - self.user_load_agent_resources_uri = user_load_agent_resources_uri - self.vsts_account_uri = vsts_account_uri - - -class WebInstanceSummaryData(Model): - """ - :param average: - :type average: float - :param max: - :type max: float - :param min: - :type min: float - """ - - _attribute_map = { - 'average': {'key': 'average', 'type': 'float'}, - 'max': {'key': 'max', 'type': 'float'}, - 'min': {'key': 'min', 'type': 'float'} - } - - def __init__(self, average=None, max=None, min=None): - super(WebInstanceSummaryData, self).__init__() - self.average = average - self.max = max - self.min = min - - -class LoadTestRunDetails(LoadTestRunSettings): - """ - :param agent_count: - :type agent_count: int - :param core_count: - :type core_count: int - :param cores_per_agent: - :type cores_per_agent: int - :param duration: - :type duration: int - :param load_generator_machines_type: - :type load_generator_machines_type: object - :param sampling_interval: - :type sampling_interval: int - :param warm_up_duration: - :type warm_up_duration: int - :param virtual_user_count: - :type virtual_user_count: int - """ - - _attribute_map = { - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'core_count': {'key': 'coreCount', 'type': 'int'}, - 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, - 'duration': {'key': 'duration', 'type': 'int'}, - 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'}, - 'virtual_user_count': {'key': 'virtualUserCount', 'type': 'int'} - } - - def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None, virtual_user_count=None): - super(LoadTestRunDetails, self).__init__(agent_count=agent_count, core_count=core_count, cores_per_agent=cores_per_agent, duration=duration, load_generator_machines_type=load_generator_machines_type, sampling_interval=sampling_interval, warm_up_duration=warm_up_duration) - self.virtual_user_count = virtual_user_count - - -class TestDefinition(TestDefinitionBasic): - """ - :param access_data: Data for accessing the drop and not persisted in storage - :type access_data: :class:`DropAccessData ` - :param created_by: - :type created_by: :class:`IdentityRef ` - :param created_date: - :type created_date: datetime - :param id: - :type id: str - :param last_modified_by: - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_date: - :type last_modified_date: datetime - :param load_test_type: - :type load_test_type: object - :param name: - :type name: str - :param description: - :type description: str - :param load_generation_geo_locations: Geo location from where load is generated - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_definition_source: - :type load_test_definition_source: str - :param run_settings: - :type run_settings: :class:`LoadTestRunSettings ` - :param static_agent_run_settings: - :type static_agent_run_settings: :class:`StaticAgentRunSetting ` - :param test_details: - :type test_details: :class:`LoadTest ` - """ - - _attribute_map = { - 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, - 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_definition_source': {'key': 'loadTestDefinitionSource', 'type': 'str'}, - 'run_settings': {'key': 'runSettings', 'type': 'LoadTestRunSettings'}, - 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'}, - 'test_details': {'key': 'testDetails', 'type': 'LoadTest'} - } - - def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None, description=None, load_generation_geo_locations=None, load_test_definition_source=None, run_settings=None, static_agent_run_settings=None, test_details=None): - super(TestDefinition, self).__init__(access_data=access_data, created_by=created_by, created_date=created_date, id=id, last_modified_by=last_modified_by, last_modified_date=last_modified_date, load_test_type=load_test_type, name=name) - self.description = description - self.load_generation_geo_locations = load_generation_geo_locations - self.load_test_definition_source = load_test_definition_source - self.run_settings = run_settings - self.static_agent_run_settings = static_agent_run_settings - self.test_details = test_details - - -class TestRun(TestRunBasic): - """ - :param created_by: Vss User identity who created the test run. - :type created_by: :class:`IdentityRef ` - :param created_date: Gets the creation time of the test run - :type created_date: datetime - :param deleted_by: Vss User identity who deleted the test run. - :type deleted_by: :class:`IdentityRef ` - :param deleted_date: Gets the deleted time of the test run - :type deleted_date: datetime - :param finished_date: Gets the finish time of the test run - :type finished_date: datetime - :param id: Gets the unique identifier for the test run definition. - :type id: str - :param load_generation_geo_locations: - :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` - :param load_test_file_name: Gets the load test file of the test run definition. - :type load_test_file_name: str - :param name: Gets the name of the test run definition. - :type name: str - :param run_number: Gets the number of the test run (unique within a tenant) - :type run_number: int - :param run_source: Test run source like Ibiza,VSO,BuildVNext, etc. - :type run_source: str - :param run_specific_details: Run specific details. - :type run_specific_details: :class:`LoadTestRunDetails ` - :param run_type: Run type like VisualStudioLoadTest or JMeterLoadTest - :type run_type: object - :param state: State of the test run. - :type state: object - :param url: - :type url: str - :param abort_message: Message associated to state change, contains details of infrastructure error. - :type abort_message: :class:`TestRunAbortMessage ` - :param aut_initialization_error: true if aut counter collection could not start due to some critical error for this run. - :type aut_initialization_error: bool - :param chargeable: Whether run is chargeable or not Its chargeable once we configured agent and sent start signal - :type chargeable: bool - :param charged_vUserminutes: Whether run is chargeable or not The Charged VUser Minutes for the RUN - :type charged_vUserminutes: int - :param description: Test run description. - :type description: str - :param execution_finished_date: Gets the time when the test run execution finished - :type execution_finished_date: datetime - :param execution_started_date: Gets the time when the test run warmup finished(if warmup was specified) and load test started - :type execution_started_date: datetime - :param queued_date: Gets the time when the test run was queued - :type queued_date: datetime - :param retention_state: Retention state of the run - :type retention_state: object - :param run_source_identifier: - :type run_source_identifier: str - :param run_source_url: The uri to the run source. - :type run_source_url: str - :param started_by: Vss User identity who created the test run. - :type started_by: :class:`IdentityRef ` - :param started_date: When the test run started execution. - :type started_date: datetime - :param stopped_by: Vss User identity who created the test run. - :type stopped_by: :class:`IdentityRef ` - :param sub_state: SubState is more granular description of the state - :type sub_state: object - :param supersede_run_settings: - :type supersede_run_settings: :class:`OverridableRunSettings ` - :param test_drop: Drop associated with this test run - :type test_drop: :class:`TestDropRef ` - :param test_settings: The Test settings for the test run - :type test_settings: :class:`TestSettings ` - :param warm_up_started_date: Gets the time when the test run warmup started - :type warm_up_started_date: datetime - :param web_result_url: The uri to the vso detailed result. - :type web_result_url: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, - 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, - 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, - 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'run_source': {'key': 'runSource', 'type': 'str'}, - 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, - 'run_type': {'key': 'runType', 'type': 'object'}, - 'state': {'key': 'state', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - 'abort_message': {'key': 'abortMessage', 'type': 'TestRunAbortMessage'}, - 'aut_initialization_error': {'key': 'autInitializationError', 'type': 'bool'}, - 'chargeable': {'key': 'chargeable', 'type': 'bool'}, - 'charged_vUserminutes': {'key': 'chargedVUserminutes', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'execution_finished_date': {'key': 'executionFinishedDate', 'type': 'iso-8601'}, - 'execution_started_date': {'key': 'executionStartedDate', 'type': 'iso-8601'}, - 'queued_date': {'key': 'queuedDate', 'type': 'iso-8601'}, - 'retention_state': {'key': 'retentionState', 'type': 'object'}, - 'run_source_identifier': {'key': 'runSourceIdentifier', 'type': 'str'}, - 'run_source_url': {'key': 'runSourceUrl', 'type': 'str'}, - 'started_by': {'key': 'startedBy', 'type': 'IdentityRef'}, - 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, - 'stopped_by': {'key': 'stoppedBy', 'type': 'IdentityRef'}, - 'sub_state': {'key': 'subState', 'type': 'object'}, - 'supersede_run_settings': {'key': 'supersedeRunSettings', 'type': 'OverridableRunSettings'}, - 'test_drop': {'key': 'testDrop', 'type': 'TestDropRef'}, - 'test_settings': {'key': 'testSettings', 'type': 'TestSettings'}, - 'warm_up_started_date': {'key': 'warmUpStartedDate', 'type': 'iso-8601'}, - 'web_result_url': {'key': 'webResultUrl', 'type': 'str'} - } - - def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None, abort_message=None, aut_initialization_error=None, chargeable=None, charged_vUserminutes=None, description=None, execution_finished_date=None, execution_started_date=None, queued_date=None, retention_state=None, run_source_identifier=None, run_source_url=None, started_by=None, started_date=None, stopped_by=None, sub_state=None, supersede_run_settings=None, test_drop=None, test_settings=None, warm_up_started_date=None, web_result_url=None): - super(TestRun, self).__init__(created_by=created_by, created_date=created_date, deleted_by=deleted_by, deleted_date=deleted_date, finished_date=finished_date, id=id, load_generation_geo_locations=load_generation_geo_locations, load_test_file_name=load_test_file_name, name=name, run_number=run_number, run_source=run_source, run_specific_details=run_specific_details, run_type=run_type, state=state, url=url) - self.abort_message = abort_message - self.aut_initialization_error = aut_initialization_error - self.chargeable = chargeable - self.charged_vUserminutes = charged_vUserminutes - self.description = description - self.execution_finished_date = execution_finished_date - self.execution_started_date = execution_started_date - self.queued_date = queued_date - self.retention_state = retention_state - self.run_source_identifier = run_source_identifier - self.run_source_url = run_source_url - self.started_by = started_by - self.started_date = started_date - self.stopped_by = stopped_by - self.sub_state = sub_state - self.supersede_run_settings = supersede_run_settings - self.test_drop = test_drop - self.test_settings = test_settings - self.warm_up_started_date = warm_up_started_date - self.web_result_url = web_result_url - - -__all__ = [ - 'AgentGroup', - 'AgentGroupAccessData', - 'Application', - 'ApplicationCounters', - 'ApplicationType', - 'BrowserMix', - 'CltCustomerIntelligenceData', - 'CounterGroup', - 'CounterInstanceSamples', - 'CounterSample', - 'CounterSampleQueryDetails', - 'CounterSamplesResult', - 'Diagnostics', - 'DropAccessData', - 'ErrorDetails', - 'GraphSubjectBase', - 'IdentityRef', - 'LoadGenerationGeoLocation', - 'LoadTest', - 'LoadTestDefinition', - 'LoadTestErrors', - 'LoadTestRunSettings', - 'OverridableRunSettings', - 'PageSummary', - 'ReferenceLinks', - 'RequestSummary', - 'ScenarioSummary', - 'StaticAgentRunSetting', - 'SubType', - 'SummaryPercentileData', - 'TenantDetails', - 'TestDefinitionBasic', - 'TestDrop', - 'TestDropRef', - 'TestResults', - 'TestResultsSummary', - 'TestRunAbortMessage', - 'TestRunBasic', - 'TestRunCounterInstance', - 'TestRunMessage', - 'TestSettings', - 'TestSummary', - 'TransactionSummary', - 'WebApiLoadTestMachineInput', - 'WebApiSetupParamaters', - 'WebApiTestMachine', - 'WebApiUserLoadTestMachineInput', - 'WebInstanceSummaryData', - 'LoadTestRunDetails', - 'TestDefinition', - 'TestRun', -] diff --git a/azure-devops/azure/devops/v6_0/feed_token/__init__.py b/azure-devops/azure/devops/v6_0/feed_token/__init__.py deleted file mode 100644 index 9bb0eb8c..00000000 --- a/azure-devops/azure/devops/v6_0/feed_token/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .feed_token_client import FeedTokenClient - -__all__ = [ - 'FeedSessionToken', - 'FeedTokenClient' -] diff --git a/azure-devops/azure/devops/v6_0/feed_token/feed_token_client.py b/azure-devops/azure/devops/v6_0/feed_token/feed_token_client.py deleted file mode 100644 index ff82d5a5..00000000 --- a/azure-devops/azure/devops/v6_0/feed_token/feed_token_client.py +++ /dev/null @@ -1,42 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 FeedTokenClient(Client): - """FeedToken - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(FeedTokenClient, 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 = 'cdeb6c7d-6b25-4d6f-b664-c2e3ede202e8' - - def get_personal_access_token(self, feed_name=None): - """GetPersonalAccessToken. - [Preview API] Get a time-limited session token representing the current user, with permissions scoped to the read/write of Artifacts. - :param str feed_name: - :rtype: :class:` ` - """ - route_values = {} - if feed_name is not None: - route_values['feedName'] = self._serialize.url('feed_name', feed_name, 'str') - response = self._send(http_method='GET', - location_id='dfdb7ad7-3d8e-4907-911e-19b4a8330550', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('FeedSessionToken', response) - diff --git a/azure-devops/azure/devops/v6_0/feed_token/models.py b/azure-devops/azure/devops/v6_0/feed_token/models.py deleted file mode 100644 index 43b24b24..00000000 --- a/azure-devops/azure/devops/v6_0/feed_token/models.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class FeedSessionToken(Model): - """ - A cut-down version of SessionToken that just has what FeedSessionTokenController needs to serve the UI and which actually generates a TypeScript type for the UI to use - - :param token: - :type token: str - :param valid_to: - :type valid_to: datetime - """ - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} - } - - def __init__(self, token=None, valid_to=None): - super(FeedSessionToken, self).__init__() - self.token = token - self.valid_to = valid_to - - -__all__ = [ - 'FeedSessionToken', -] diff --git a/azure-devops/azure/devops/v6_0/git/git_client.py b/azure-devops/azure/devops/v6_0/git/git_client.py deleted file mode 100644 index c456406a..00000000 --- a/azure-devops/azure/devops/v6_0/git/git_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 - -from msrest.universal_http import ClientRequest -from .git_client_base import GitClientBase - - -class GitClient(GitClientBase): - """Git - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(GitClient, self).__init__(base_url, creds) - - def get_vsts_info(self, relative_remote_url): - url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') - request = ClientRequest(method='GET', url=url) - headers = {'Accept': 'application/json'} - if self._suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - if self._force_msa_pass_through: - headers['X-VSS-ForceMsaPassThrough'] = 'true' - response = self._send_request(request, headers) - return self._deserialize('VstsInfo', response) - - @staticmethod - def get_vsts_info_by_remote_url(remote_url, credentials, - suppress_fedauth_redirect=True, - force_msa_pass_through=True): - request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info') - headers = {'Accept': 'application/json'} - if suppress_fedauth_redirect: - headers['X-TFS-FedAuthRedirect'] = 'Suppress' - if force_msa_pass_through: - headers['X-VSS-ForceMsaPassThrough'] = 'true' - git_client = GitClient(base_url=remote_url, creds=credentials) - response = git_client._send_request(request, headers) - return git_client._deserialize('VstsInfo', response) diff --git a/azure-devops/azure/devops/v6_0/release/__init__.py b/azure-devops/azure/devops/v6_0/release/__init__.py deleted file mode 100644 index d22fe74a..00000000 --- a/azure-devops/azure/devops/v6_0/release/__init__.py +++ /dev/null @@ -1,115 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 .release_client import ReleaseClient - -__all__ = [ - 'AgentArtifactDefinition', - 'ApprovalOptions', - 'Artifact', - 'ArtifactMetadata', - 'ArtifactSourceReference', - 'ArtifactTriggerConfiguration', - 'ArtifactTypeDefinition', - 'ArtifactVersion', - 'ArtifactVersionQueryResult', - 'AuthorizationHeader', - 'AutoTriggerIssue', - 'BuildVersion', - 'Change', - 'ComplianceSettings', - 'Condition', - 'ConfigurationVariableValue', - 'DataSourceBindingBase', - 'DefinitionEnvironmentReference', - 'Deployment', - 'DeploymentAttempt', - 'DeploymentJob', - 'DeploymentQueryParameters', - 'EmailRecipients', - 'EnvironmentExecutionPolicy', - 'EnvironmentOptions', - 'EnvironmentRetentionPolicy', - 'EnvironmentTrigger', - 'FavoriteItem', - 'Folder', - 'GateUpdateMetadata', - 'GraphSubjectBase', - 'IdentityRef', - 'IgnoredGate', - 'InputDescriptor', - 'InputValidation', - 'InputValue', - 'InputValues', - 'InputValuesError', - 'InputValuesQuery', - 'Issue', - 'MailMessage', - 'ManualIntervention', - 'ManualInterventionUpdateMetadata', - 'Metric', - 'OrgPipelineReleaseSettings', - 'OrgPipelineReleaseSettingsUpdateParameters', - 'PipelineProcess', - 'ProcessParameters', - 'ProjectPipelineReleaseSettings', - 'ProjectPipelineReleaseSettingsUpdateParameters', - 'ProjectReference', - 'QueuedReleaseData', - 'ReferenceLinks', - 'Release', - 'ReleaseApproval', - 'ReleaseApprovalHistory', - 'ReleaseCondition', - 'ReleaseDefinition', - 'ReleaseDefinitionApprovals', - 'ReleaseDefinitionApprovalStep', - 'ReleaseDefinitionDeployStep', - 'ReleaseDefinitionEnvironment', - 'ReleaseDefinitionEnvironmentStep', - 'ReleaseDefinitionEnvironmentSummary', - 'ReleaseDefinitionEnvironmentTemplate', - 'ReleaseDefinitionGate', - 'ReleaseDefinitionGatesOptions', - 'ReleaseDefinitionGatesStep', - 'ReleaseDefinitionRevision', - 'ReleaseDefinitionShallowReference', - 'ReleaseDefinitionSummary', - 'ReleaseDefinitionUndeleteParameter', - 'ReleaseDeployPhase', - 'ReleaseEnvironment', - 'ReleaseEnvironmentShallowReference', - 'ReleaseEnvironmentUpdateMetadata', - 'ReleaseGates', - 'ReleaseReference', - 'ReleaseRevision', - 'ReleaseSchedule', - 'ReleaseSettings', - 'ReleaseShallowReference', - 'ReleaseStartEnvironmentMetadata', - 'ReleaseStartMetadata', - 'ReleaseTask', - 'ReleaseTaskAttachment', - 'ReleaseUpdateMetadata', - 'ReleaseWorkItemRef', - 'RetentionPolicy', - 'RetentionSettings', - 'SourcePullRequestVersion', - 'SummaryMailSection', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskSourceDefinitionBase', - 'VariableGroup', - 'VariableGroupProjectReference', - 'VariableGroupProviderData', - 'VariableValue', - 'WorkflowTask', - 'WorkflowTaskReference', - 'ReleaseClient' -] diff --git a/azure-devops/azure/devops/v6_0/release/models.py b/azure-devops/azure/devops/v6_0/release/models.py deleted file mode 100644 index 827c2be8..00000000 --- a/azure-devops/azure/devops/v6_0/release/models.py +++ /dev/null @@ -1,3844 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class AgentArtifactDefinition(Model): - """ - :param alias: Gets or sets the artifact definition alias. - :type alias: str - :param artifact_type: Gets or sets the artifact type. - :type artifact_type: object - :param details: Gets or sets the artifact definition details. - :type details: str - :param name: Gets or sets the name of artifact definition. - :type name: str - :param version: Gets or sets the version of artifact definition. - :type version: str - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'object'}, - 'details': {'key': 'details', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, alias=None, artifact_type=None, details=None, name=None, version=None): - super(AgentArtifactDefinition, self).__init__() - self.alias = alias - self.artifact_type = artifact_type - self.details = details - self.name = name - self.version = version - - -class ApprovalOptions(Model): - """ - :param auto_triggered_and_previous_environment_approved_can_be_skipped: Specify whether the approval can be skipped if the same approver approved the previous stage. - :type auto_triggered_and_previous_environment_approved_can_be_skipped: bool - :param enforce_identity_revalidation: Specify whether revalidate identity of approver before completing the approval. - :type enforce_identity_revalidation: bool - :param execution_order: Approvals execution order. - :type execution_order: object - :param release_creator_can_be_approver: Specify whether the user requesting a release or deployment should allow to approver. - :type release_creator_can_be_approver: bool - :param required_approver_count: The number of approvals required to move release forward. '0' means all approvals required. - :type required_approver_count: int - :param timeout_in_minutes: Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days. - :type timeout_in_minutes: int - """ - - _attribute_map = { - 'auto_triggered_and_previous_environment_approved_can_be_skipped': {'key': 'autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped', 'type': 'bool'}, - 'enforce_identity_revalidation': {'key': 'enforceIdentityRevalidation', 'type': 'bool'}, - 'execution_order': {'key': 'executionOrder', 'type': 'object'}, - 'release_creator_can_be_approver': {'key': 'releaseCreatorCanBeApprover', 'type': 'bool'}, - 'required_approver_count': {'key': 'requiredApproverCount', 'type': 'int'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} - } - - def __init__(self, auto_triggered_and_previous_environment_approved_can_be_skipped=None, enforce_identity_revalidation=None, execution_order=None, release_creator_can_be_approver=None, required_approver_count=None, timeout_in_minutes=None): - super(ApprovalOptions, self).__init__() - self.auto_triggered_and_previous_environment_approved_can_be_skipped = auto_triggered_and_previous_environment_approved_can_be_skipped - self.enforce_identity_revalidation = enforce_identity_revalidation - self.execution_order = execution_order - self.release_creator_can_be_approver = release_creator_can_be_approver - self.required_approver_count = required_approver_count - self.timeout_in_minutes = timeout_in_minutes - - -class Artifact(Model): - """ - :param alias: Gets or sets alias. - :type alias: str - :param definition_reference: Gets or sets definition reference. e.g. {"project":{"id":"fed755ea-49c5-4399-acea-fd5b5aa90a6c","name":"myProject"},"definition":{"id":"1","name":"mybuildDefinition"},"connection":{"id":"1","name":"myConnection"}}. - :type definition_reference: dict - :param is_primary: Indicates whether artifact is primary or not. - :type is_primary: bool - :param is_retained: Indicates whether artifact is retained by release or not. - :type is_retained: bool - :param source_id: - :type source_id: str - :param type: Gets or sets type. It can have value as 'Build', 'Jenkins', 'GitHub', 'Nuget', 'Team Build (external)', 'ExternalTFSBuild', 'Git', 'TFVC', 'ExternalTfsXamlBuild'. - :type type: str - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'definition_reference': {'key': 'definitionReference', 'type': '{ArtifactSourceReference}'}, - 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, - 'is_retained': {'key': 'isRetained', 'type': 'bool'}, - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, alias=None, definition_reference=None, is_primary=None, is_retained=None, source_id=None, type=None): - super(Artifact, self).__init__() - self.alias = alias - self.definition_reference = definition_reference - self.is_primary = is_primary - self.is_retained = is_retained - self.source_id = source_id - self.type = type - - -class ArtifactMetadata(Model): - """ - :param alias: Sets alias of artifact. - :type alias: str - :param instance_reference: Sets instance reference of artifact. e.g. for build artifact it is build number. - :type instance_reference: :class:`BuildVersion ` - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'instance_reference': {'key': 'instanceReference', 'type': 'BuildVersion'} - } - - def __init__(self, alias=None, instance_reference=None): - super(ArtifactMetadata, self).__init__() - self.alias = alias - self.instance_reference = instance_reference - - -class ArtifactSourceReference(Model): - """ - :param id: ID of the artifact source. - :type id: str - :param name: Name of the artifact source. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, name=None): - super(ArtifactSourceReference, self).__init__() - self.id = id - self.name = name - - -class ArtifactTriggerConfiguration(Model): - """ - :param is_trigger_supported: Gets or sets the whether trigger is supported or not. - :type is_trigger_supported: bool - :param is_trigger_supported_only_in_hosted: Gets or sets the whether trigger is supported only on hosted environment. - :type is_trigger_supported_only_in_hosted: bool - :param is_webhook_supported_at_server_level: Gets or sets the whether webhook is supported at server level. - :type is_webhook_supported_at_server_level: bool - :param payload_hash_header_name: Gets or sets the payload hash header name for the artifact trigger configuration. - :type payload_hash_header_name: str - :param resources: Gets or sets the resources for artifact trigger configuration. - :type resources: dict - :param webhook_payload_mapping: Gets or sets the webhook payload mapping for artifact trigger configuration. - :type webhook_payload_mapping: dict - """ - - _attribute_map = { - 'is_trigger_supported': {'key': 'isTriggerSupported', 'type': 'bool'}, - 'is_trigger_supported_only_in_hosted': {'key': 'isTriggerSupportedOnlyInHosted', 'type': 'bool'}, - 'is_webhook_supported_at_server_level': {'key': 'isWebhookSupportedAtServerLevel', 'type': 'bool'}, - 'payload_hash_header_name': {'key': 'payloadHashHeaderName', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': '{str}'}, - 'webhook_payload_mapping': {'key': 'webhookPayloadMapping', 'type': '{str}'} - } - - def __init__(self, is_trigger_supported=None, is_trigger_supported_only_in_hosted=None, is_webhook_supported_at_server_level=None, payload_hash_header_name=None, resources=None, webhook_payload_mapping=None): - super(ArtifactTriggerConfiguration, self).__init__() - self.is_trigger_supported = is_trigger_supported - self.is_trigger_supported_only_in_hosted = is_trigger_supported_only_in_hosted - self.is_webhook_supported_at_server_level = is_webhook_supported_at_server_level - self.payload_hash_header_name = payload_hash_header_name - self.resources = resources - self.webhook_payload_mapping = webhook_payload_mapping - - -class ArtifactTypeDefinition(Model): - """ - :param artifact_trigger_configuration: Gets or sets the artifact trigger configuration of artifact type definition. - :type artifact_trigger_configuration: :class:`ArtifactTriggerConfiguration ` - :param artifact_type: Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'. - :type artifact_type: str - :param display_name: Gets or sets the display name of artifact type definition. - :type display_name: str - :param endpoint_type_id: Gets or sets the endpoint type id of artifact type definition. - :type endpoint_type_id: str - :param input_descriptors: Gets or sets the input descriptors of artifact type definition. - :type input_descriptors: list of :class:`InputDescriptor ` - :param is_commits_traceability_supported: Gets or sets the is commits tracebility supported value of artifact type defintion. - :type is_commits_traceability_supported: bool - :param is_workitems_traceability_supported: Gets or sets the is workitems tracebility supported value of artifact type defintion. - :type is_workitems_traceability_supported: bool - :param name: Gets or sets the name of artifact type definition. - :type name: str - :param unique_source_identifier: Gets or sets the unique source identifier of artifact type definition. - :type unique_source_identifier: str - """ - - _attribute_map = { - 'artifact_trigger_configuration': {'key': 'artifactTriggerConfiguration', 'type': 'ArtifactTriggerConfiguration'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_type_id': {'key': 'endpointTypeId', 'type': 'str'}, - 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, - 'is_commits_traceability_supported': {'key': 'isCommitsTraceabilitySupported', 'type': 'bool'}, - 'is_workitems_traceability_supported': {'key': 'isWorkitemsTraceabilitySupported', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'unique_source_identifier': {'key': 'uniqueSourceIdentifier', 'type': 'str'} - } - - def __init__(self, artifact_trigger_configuration=None, artifact_type=None, display_name=None, endpoint_type_id=None, input_descriptors=None, is_commits_traceability_supported=None, is_workitems_traceability_supported=None, name=None, unique_source_identifier=None): - super(ArtifactTypeDefinition, self).__init__() - self.artifact_trigger_configuration = artifact_trigger_configuration - self.artifact_type = artifact_type - self.display_name = display_name - self.endpoint_type_id = endpoint_type_id - self.input_descriptors = input_descriptors - self.is_commits_traceability_supported = is_commits_traceability_supported - self.is_workitems_traceability_supported = is_workitems_traceability_supported - self.name = name - self.unique_source_identifier = unique_source_identifier - - -class ArtifactVersion(Model): - """ - :param alias: Gets or sets the alias of artifact. - :type alias: str - :param default_version: Gets or sets the default version of artifact. - :type default_version: :class:`BuildVersion ` - :param error_message: Gets or sets the error message encountered during querying of versions for artifact. - :type error_message: str - :param source_id: - :type source_id: str - :param versions: Gets or sets the list of build versions of artifact. - :type versions: list of :class:`BuildVersion ` - """ - - _attribute_map = { - 'alias': {'key': 'alias', 'type': 'str'}, - 'default_version': {'key': 'defaultVersion', 'type': 'BuildVersion'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[BuildVersion]'} - } - - def __init__(self, alias=None, default_version=None, error_message=None, source_id=None, versions=None): - super(ArtifactVersion, self).__init__() - self.alias = alias - self.default_version = default_version - self.error_message = error_message - self.source_id = source_id - self.versions = versions - - -class ArtifactVersionQueryResult(Model): - """ - :param artifact_versions: Gets or sets the list for artifact versions of artifact version query result. - :type artifact_versions: list of :class:`ArtifactVersion ` - """ - - _attribute_map = { - 'artifact_versions': {'key': 'artifactVersions', 'type': '[ArtifactVersion]'} - } - - def __init__(self, artifact_versions=None): - super(ArtifactVersionQueryResult, self).__init__() - self.artifact_versions = artifact_versions - - -class AuthorizationHeader(Model): - """ - :param name: - :type name: str - :param value: - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, name=None, value=None): - super(AuthorizationHeader, self).__init__() - self.name = name - self.value = value - - -class AutoTriggerIssue(Model): - """ - :param issue: - :type issue: :class:`Issue ` - :param issue_source: - :type issue_source: object - :param project: - :type project: :class:`ProjectReference ` - :param release_definition_reference: - :type release_definition_reference: :class:`ReleaseDefinitionShallowReference ` - :param release_trigger_type: - :type release_trigger_type: object - """ - - _attribute_map = { - 'issue': {'key': 'issue', 'type': 'Issue'}, - 'issue_source': {'key': 'issueSource', 'type': 'object'}, - 'project': {'key': 'project', 'type': 'ProjectReference'}, - 'release_definition_reference': {'key': 'releaseDefinitionReference', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_trigger_type': {'key': 'releaseTriggerType', 'type': 'object'} - } - - def __init__(self, issue=None, issue_source=None, project=None, release_definition_reference=None, release_trigger_type=None): - super(AutoTriggerIssue, self).__init__() - self.issue = issue - self.issue_source = issue_source - self.project = project - self.release_definition_reference = release_definition_reference - self.release_trigger_type = release_trigger_type - - -class BuildVersion(Model): - """ - :param commit_message: Gets or sets the commit message for the artifact. - :type commit_message: str - :param definition_id: Gets or sets the definition id. - :type definition_id: str - :param definition_name: Gets or sets the definition name. - :type definition_name: str - :param id: Gets or sets the build id. - :type id: str - :param is_multi_definition_type: Gets or sets if the artifact supports multiple definitions. - :type is_multi_definition_type: bool - :param name: Gets or sets the build number. - :type name: str - :param source_branch: Gets or sets the source branch for the artifact. - :type source_branch: str - :param source_pull_request_version: Gets or sets the source pull request version for the artifact. - :type source_pull_request_version: :class:`SourcePullRequestVersion ` - :param source_repository_id: Gets or sets the repository id for the artifact. - :type source_repository_id: str - :param source_repository_type: Gets or sets the repository type for the artifact. - :type source_repository_type: str - :param source_version: Gets or sets the source version for the artifact. - :type source_version: str - """ - - _attribute_map = { - 'commit_message': {'key': 'commitMessage', 'type': 'str'}, - 'definition_id': {'key': 'definitionId', 'type': 'str'}, - 'definition_name': {'key': 'definitionName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_multi_definition_type': {'key': 'isMultiDefinitionType', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, - 'source_pull_request_version': {'key': 'sourcePullRequestVersion', 'type': 'SourcePullRequestVersion'}, - 'source_repository_id': {'key': 'sourceRepositoryId', 'type': 'str'}, - 'source_repository_type': {'key': 'sourceRepositoryType', 'type': 'str'}, - 'source_version': {'key': 'sourceVersion', 'type': 'str'} - } - - def __init__(self, commit_message=None, definition_id=None, definition_name=None, id=None, is_multi_definition_type=None, name=None, source_branch=None, source_pull_request_version=None, source_repository_id=None, source_repository_type=None, source_version=None): - super(BuildVersion, self).__init__() - self.commit_message = commit_message - self.definition_id = definition_id - self.definition_name = definition_name - self.id = id - self.is_multi_definition_type = is_multi_definition_type - self.name = name - self.source_branch = source_branch - self.source_pull_request_version = source_pull_request_version - self.source_repository_id = source_repository_id - self.source_repository_type = source_repository_type - self.source_version = source_version - - -class Change(Model): - """ - Represents a change associated with a build. - - :param author: The author of the change. - :type author: :class:`IdentityRef ` - :param change_type: The type of source. "TfsVersionControl", "TfsGit", etc. - :type change_type: str - :param display_uri: The location of a user-friendly representation of the resource. - :type display_uri: str - :param id: Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. - :type id: str - :param location: The location of the full representation of the resource. - :type location: str - :param message: A description of the change. This might be a commit message or changeset description. - :type message: str - :param pushed_by: The person or process that pushed the change. - :type pushed_by: :class:`IdentityRef ` - :param pusher: The person or process that pushed the change. - :type pusher: str - :param timestamp: A timestamp for the change. - :type timestamp: datetime - """ - - _attribute_map = { - 'author': {'key': 'author', 'type': 'IdentityRef'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'display_uri': {'key': 'displayUri', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'pushed_by': {'key': 'pushedBy', 'type': 'IdentityRef'}, - 'pusher': {'key': 'pusher', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'} - } - - def __init__(self, author=None, change_type=None, display_uri=None, id=None, location=None, message=None, pushed_by=None, pusher=None, timestamp=None): - super(Change, self).__init__() - self.author = author - self.change_type = change_type - self.display_uri = display_uri - self.id = id - self.location = location - self.message = message - self.pushed_by = pushed_by - self.pusher = pusher - self.timestamp = timestamp - - -class ComplianceSettings(Model): - """ - :param check_for_credentials_and_other_secrets: Scan the release definition for secrets - :type check_for_credentials_and_other_secrets: bool - """ - - _attribute_map = { - 'check_for_credentials_and_other_secrets': {'key': 'checkForCredentialsAndOtherSecrets', 'type': 'bool'} - } - - def __init__(self, check_for_credentials_and_other_secrets=None): - super(ComplianceSettings, self).__init__() - self.check_for_credentials_and_other_secrets = check_for_credentials_and_other_secrets - - -class Condition(Model): - """ - :param condition_type: Gets or sets the condition type. - :type condition_type: object - :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. - :type name: str - :param value: Gets or set value of the condition. - :type value: str - """ - - _attribute_map = { - 'condition_type': {'key': 'conditionType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, condition_type=None, name=None, value=None): - super(Condition, self).__init__() - self.condition_type = condition_type - self.name = name - self.value = value - - -class ConfigurationVariableValue(Model): - """ - :param allow_override: Gets and sets if a variable can be overridden at deployment time or not. - :type allow_override: bool - :param is_secret: Gets or sets as variable is secret or not. - :type is_secret: bool - :param value: Gets and sets value of the configuration variable. - :type value: str - """ - - _attribute_map = { - 'allow_override': {'key': 'allowOverride', 'type': 'bool'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, allow_override=None, is_secret=None, value=None): - super(ConfigurationVariableValue, self).__init__() - self.allow_override = allow_override - self.is_secret = is_secret - self.value = value - - -class DataSourceBindingBase(Model): - """ - Represents binding of data source for the service endpoint request. - - :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). - :type callback_context_template: str - :param callback_required_template: Subsequent calls needed? - :type callback_required_template: str - :param data_source_name: Gets or sets the name of the data source. - :type data_source_name: str - :param endpoint_id: Gets or sets the endpoint Id. - :type endpoint_id: str - :param endpoint_url: Gets or sets the url of the service endpoint. - :type endpoint_url: str - :param headers: Gets or sets the authorization headers. - :type headers: list of :class:`AuthorizationHeader ` - :param initial_context_template: Defines the initial value of the query params - :type initial_context_template: str - :param parameters: Gets or sets the parameters for the data source. - :type parameters: dict - :param request_content: Gets or sets http request body - :type request_content: str - :param request_verb: Gets or sets http request verb - :type request_verb: str - :param result_selector: Gets or sets the result selector. - :type result_selector: str - :param result_template: Gets or sets the result template. - :type result_template: str - :param target: Gets or sets the target of the data source. - :type target: str - """ - - _attribute_map = { - 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, - 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, - 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{str}'}, - 'request_content': {'key': 'requestContent', 'type': 'str'}, - 'request_verb': {'key': 'requestVerb', 'type': 'str'}, - 'result_selector': {'key': 'resultSelector', 'type': 'str'}, - 'result_template': {'key': 'resultTemplate', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'} - } - - def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, request_content=None, request_verb=None, result_selector=None, result_template=None, target=None): - super(DataSourceBindingBase, self).__init__() - self.callback_context_template = callback_context_template - self.callback_required_template = callback_required_template - self.data_source_name = data_source_name - self.endpoint_id = endpoint_id - self.endpoint_url = endpoint_url - self.headers = headers - self.initial_context_template = initial_context_template - self.parameters = parameters - self.request_content = request_content - self.request_verb = request_verb - self.result_selector = result_selector - self.result_template = result_template - self.target = target - - -class DefinitionEnvironmentReference(Model): - """ - :param definition_environment_id: Definition environment ID. - :type definition_environment_id: int - :param definition_environment_name: Definition environment name. - :type definition_environment_name: str - :param release_definition_id: ReleaseDefinition ID. - :type release_definition_id: int - :param release_definition_name: ReleaseDefinition name. - :type release_definition_name: str - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'definition_environment_name': {'key': 'definitionEnvironmentName', 'type': 'str'}, - 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, - 'release_definition_name': {'key': 'releaseDefinitionName', 'type': 'str'} - } - - def __init__(self, definition_environment_id=None, definition_environment_name=None, release_definition_id=None, release_definition_name=None): - super(DefinitionEnvironmentReference, self).__init__() - self.definition_environment_id = definition_environment_id - self.definition_environment_name = definition_environment_name - self.release_definition_id = release_definition_id - self.release_definition_name = release_definition_name - - -class Deployment(Model): - """ - :param _links: Gets links to access the deployment. - :type _links: :class:`ReferenceLinks ` - :param attempt: Gets attempt number. - :type attempt: int - :param completed_on: Gets the date on which deployment is complete. - :type completed_on: datetime - :param conditions: Gets the list of condition associated with deployment. - :type conditions: list of :class:`Condition ` - :param definition_environment_id: Gets release definition environment id. - :type definition_environment_id: int - :param deployment_status: Gets status of the deployment. - :type deployment_status: object - :param id: Gets the unique identifier for deployment. - :type id: int - :param last_modified_by: Gets the identity who last modified the deployment. - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_on: Gets the date on which deployment is last modified. - :type last_modified_on: datetime - :param operation_status: Gets operation status of deployment. - :type operation_status: object - :param post_deploy_approvals: Gets list of PostDeployApprovals. - :type post_deploy_approvals: list of :class:`ReleaseApproval ` - :param pre_deploy_approvals: Gets list of PreDeployApprovals. - :type pre_deploy_approvals: list of :class:`ReleaseApproval ` - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param queued_on: Gets the date on which deployment is queued. - :type queued_on: datetime - :param reason: Gets reason of deployment. - :type reason: object - :param release: Gets the reference of release. - :type release: :class:`ReleaseReference ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which the deployment is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which the deployment is associated. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param requested_by: Gets the identity who requested. - :type requested_by: :class:`IdentityRef ` - :param requested_for: Gets the identity for whom deployment is requested. - :type requested_for: :class:`IdentityRef ` - :param scheduled_deployment_time: Gets the date on which deployment is scheduled. - :type scheduled_deployment_time: datetime - :param started_on: Gets the date on which deployment is started. - :type started_on: datetime - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'completed_on': {'key': 'completedOn', 'type': 'iso-8601'}, - 'conditions': {'key': 'conditions', 'type': '[Condition]'}, - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, - 'id': {'key': 'id', 'type': 'int'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release': {'key': 'release', 'type': 'ReleaseReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, - 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'} - } - - def __init__(self, _links=None, attempt=None, completed_on=None, conditions=None, definition_environment_id=None, deployment_status=None, id=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deploy_approvals=None, pre_deploy_approvals=None, project_reference=None, queued_on=None, reason=None, release=None, release_definition=None, release_environment=None, requested_by=None, requested_for=None, scheduled_deployment_time=None, started_on=None): - super(Deployment, self).__init__() - self._links = _links - self.attempt = attempt - self.completed_on = completed_on - self.conditions = conditions - self.definition_environment_id = definition_environment_id - self.deployment_status = deployment_status - self.id = id - self.last_modified_by = last_modified_by - self.last_modified_on = last_modified_on - self.operation_status = operation_status - self.post_deploy_approvals = post_deploy_approvals - self.pre_deploy_approvals = pre_deploy_approvals - self.project_reference = project_reference - self.queued_on = queued_on - self.reason = reason - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.requested_by = requested_by - self.requested_for = requested_for - self.scheduled_deployment_time = scheduled_deployment_time - self.started_on = started_on - - -class DeploymentAttempt(Model): - """ - :param attempt: Deployment attempt. - :type attempt: int - :param deployment_id: ID of the deployment. - :type deployment_id: int - :param error_log: Error log to show any unexpected error that occurred during executing deploy step - :type error_log: str - :param has_started: Specifies whether deployment has started or not. - :type has_started: bool - :param id: ID of deployment. - :type id: int - :param issues: All the issues related to the deployment. - :type issues: list of :class:`Issue ` - :param job: - :type job: :class:`ReleaseTask ` - :param last_modified_by: Identity who last modified this deployment. - :type last_modified_by: :class:`IdentityRef ` - :param last_modified_on: Time when this deployment last modified. - :type last_modified_on: datetime - :param operation_status: Deployment operation status. - :type operation_status: object - :param post_deployment_gates: Post deployment gates that executed in this deployment. - :type post_deployment_gates: :class:`ReleaseGates ` - :param pre_deployment_gates: Pre deployment gates that executed in this deployment. - :type pre_deployment_gates: :class:`ReleaseGates ` - :param queued_on: When this deployment queued on. - :type queued_on: datetime - :param reason: Reason for the deployment. - :type reason: object - :param release_deploy_phases: List of release deployphases executed in this deployment. - :type release_deploy_phases: list of :class:`ReleaseDeployPhase ` - :param requested_by: Identity who requested this deployment. - :type requested_by: :class:`IdentityRef ` - :param requested_for: Identity for this deployment requested. - :type requested_for: :class:`IdentityRef ` - :param run_plan_id: - :type run_plan_id: str - :param status: status of the deployment. - :type status: object - :param tasks: - :type tasks: list of :class:`ReleaseTask ` - """ - - _attribute_map = { - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'deployment_id': {'key': 'deploymentId', 'type': 'int'}, - 'error_log': {'key': 'errorLog', 'type': 'str'}, - 'has_started': {'key': 'hasStarted', 'type': 'bool'}, - 'id': {'key': 'id', 'type': 'int'}, - 'issues': {'key': 'issues', 'type': '[Issue]'}, - 'job': {'key': 'job', 'type': 'ReleaseTask'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseGates'}, - 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseGates'}, - 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_deploy_phases': {'key': 'releaseDeployPhases', 'type': '[ReleaseDeployPhase]'}, - 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, - 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} - } - - def __init__(self, attempt=None, deployment_id=None, error_log=None, has_started=None, id=None, issues=None, job=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deployment_gates=None, pre_deployment_gates=None, queued_on=None, reason=None, release_deploy_phases=None, requested_by=None, requested_for=None, run_plan_id=None, status=None, tasks=None): - super(DeploymentAttempt, self).__init__() - self.attempt = attempt - self.deployment_id = deployment_id - self.error_log = error_log - self.has_started = has_started - self.id = id - self.issues = issues - self.job = job - self.last_modified_by = last_modified_by - self.last_modified_on = last_modified_on - self.operation_status = operation_status - self.post_deployment_gates = post_deployment_gates - self.pre_deployment_gates = pre_deployment_gates - self.queued_on = queued_on - self.reason = reason - self.release_deploy_phases = release_deploy_phases - self.requested_by = requested_by - self.requested_for = requested_for - self.run_plan_id = run_plan_id - self.status = status - self.tasks = tasks - - -class DeploymentJob(Model): - """ - :param job: Parent task of all executed tasks. - :type job: :class:`ReleaseTask ` - :param tasks: List of executed tasks with in job. - :type tasks: list of :class:`ReleaseTask ` - """ - - _attribute_map = { - 'job': {'key': 'job', 'type': 'ReleaseTask'}, - 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} - } - - def __init__(self, job=None, tasks=None): - super(DeploymentJob, self).__init__() - self.job = job - self.tasks = tasks - - -class DeploymentQueryParameters(Model): - """ - :param artifact_source_id: Query deployments based specified artifact source id. - :type artifact_source_id: str - :param artifact_type_id: Query deployments based specified artifact type id. - :type artifact_type_id: str - :param artifact_versions: Query deployments based specified artifact versions. - :type artifact_versions: list of str - :param deployments_per_environment: Query deployments number of deployments per environment. - :type deployments_per_environment: int - :param deployment_status: Query deployment based on deployment status. - :type deployment_status: object - :param environments: Query deployments of specified environments. - :type environments: list of :class:`DefinitionEnvironmentReference ` - :param expands: Query deployments based specified expands. - :type expands: object - :param is_deleted: Specify deleted deployments should return or not. - :type is_deleted: bool - :param latest_deployments_only: - :type latest_deployments_only: bool - :param max_deployments_per_environment: - :type max_deployments_per_environment: int - :param max_modified_time: - :type max_modified_time: datetime - :param min_modified_time: - :type min_modified_time: datetime - :param operation_status: Query deployment based on deployment operation status. - :type operation_status: object - :param query_order: - :type query_order: object - :param query_type: Query deployments based query type. - :type query_type: object - :param source_branch: Query deployments based specified source branch. - :type source_branch: str - """ - - _attribute_map = { - 'artifact_source_id': {'key': 'artifactSourceId', 'type': 'str'}, - 'artifact_type_id': {'key': 'artifactTypeId', 'type': 'str'}, - 'artifact_versions': {'key': 'artifactVersions', 'type': '[str]'}, - 'deployments_per_environment': {'key': 'deploymentsPerEnvironment', 'type': 'int'}, - 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, - 'environments': {'key': 'environments', 'type': '[DefinitionEnvironmentReference]'}, - 'expands': {'key': 'expands', 'type': 'object'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'latest_deployments_only': {'key': 'latestDeploymentsOnly', 'type': 'bool'}, - 'max_deployments_per_environment': {'key': 'maxDeploymentsPerEnvironment', 'type': 'int'}, - 'max_modified_time': {'key': 'maxModifiedTime', 'type': 'iso-8601'}, - 'min_modified_time': {'key': 'minModifiedTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'object'}, - 'query_order': {'key': 'queryOrder', 'type': 'object'}, - 'query_type': {'key': 'queryType', 'type': 'object'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'} - } - - def __init__(self, artifact_source_id=None, artifact_type_id=None, artifact_versions=None, deployments_per_environment=None, deployment_status=None, environments=None, expands=None, is_deleted=None, latest_deployments_only=None, max_deployments_per_environment=None, max_modified_time=None, min_modified_time=None, operation_status=None, query_order=None, query_type=None, source_branch=None): - super(DeploymentQueryParameters, self).__init__() - self.artifact_source_id = artifact_source_id - self.artifact_type_id = artifact_type_id - self.artifact_versions = artifact_versions - self.deployments_per_environment = deployments_per_environment - self.deployment_status = deployment_status - self.environments = environments - self.expands = expands - self.is_deleted = is_deleted - self.latest_deployments_only = latest_deployments_only - self.max_deployments_per_environment = max_deployments_per_environment - self.max_modified_time = max_modified_time - self.min_modified_time = min_modified_time - self.operation_status = operation_status - self.query_order = query_order - self.query_type = query_type - self.source_branch = source_branch - - -class EmailRecipients(Model): - """ - :param email_addresses: List of email addresses. - :type email_addresses: list of str - :param tfs_ids: List of TFS IDs guids. - :type tfs_ids: list of str - """ - - _attribute_map = { - 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, - 'tfs_ids': {'key': 'tfsIds', 'type': '[str]'} - } - - def __init__(self, email_addresses=None, tfs_ids=None): - super(EmailRecipients, self).__init__() - self.email_addresses = email_addresses - self.tfs_ids = tfs_ids - - -class EnvironmentExecutionPolicy(Model): - """ - Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied. - - :param concurrency_count: This policy decides, how many environments would be with Environment Runner. - :type concurrency_count: int - :param queue_depth_count: Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running. - :type queue_depth_count: int - """ - - _attribute_map = { - 'concurrency_count': {'key': 'concurrencyCount', 'type': 'int'}, - 'queue_depth_count': {'key': 'queueDepthCount', 'type': 'int'} - } - - def __init__(self, concurrency_count=None, queue_depth_count=None): - super(EnvironmentExecutionPolicy, self).__init__() - self.concurrency_count = concurrency_count - self.queue_depth_count = queue_depth_count - - -class EnvironmentOptions(Model): - """ - :param auto_link_work_items: Gets and sets as the auto link workitems or not. - :type auto_link_work_items: bool - :param badge_enabled: Gets and sets as the badge enabled or not. - :type badge_enabled: bool - :param email_notification_type: - :type email_notification_type: str - :param email_recipients: - :type email_recipients: str - :param enable_access_token: - :type enable_access_token: bool - :param publish_deployment_status: Gets and sets as the publish deployment status or not. - :type publish_deployment_status: bool - :param pull_request_deployment_enabled: Gets and sets as the.pull request deployment enabled or not. - :type pull_request_deployment_enabled: bool - :param skip_artifacts_download: - :type skip_artifacts_download: bool - :param timeout_in_minutes: - :type timeout_in_minutes: int - """ - - _attribute_map = { - 'auto_link_work_items': {'key': 'autoLinkWorkItems', 'type': 'bool'}, - 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, - 'email_notification_type': {'key': 'emailNotificationType', 'type': 'str'}, - 'email_recipients': {'key': 'emailRecipients', 'type': 'str'}, - 'enable_access_token': {'key': 'enableAccessToken', 'type': 'bool'}, - 'publish_deployment_status': {'key': 'publishDeploymentStatus', 'type': 'bool'}, - 'pull_request_deployment_enabled': {'key': 'pullRequestDeploymentEnabled', 'type': 'bool'}, - 'skip_artifacts_download': {'key': 'skipArtifactsDownload', 'type': 'bool'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} - } - - def __init__(self, auto_link_work_items=None, badge_enabled=None, email_notification_type=None, email_recipients=None, enable_access_token=None, publish_deployment_status=None, pull_request_deployment_enabled=None, skip_artifacts_download=None, timeout_in_minutes=None): - super(EnvironmentOptions, self).__init__() - self.auto_link_work_items = auto_link_work_items - self.badge_enabled = badge_enabled - self.email_notification_type = email_notification_type - self.email_recipients = email_recipients - self.enable_access_token = enable_access_token - self.publish_deployment_status = publish_deployment_status - self.pull_request_deployment_enabled = pull_request_deployment_enabled - self.skip_artifacts_download = skip_artifacts_download - self.timeout_in_minutes = timeout_in_minutes - - -class EnvironmentRetentionPolicy(Model): - """ - :param days_to_keep: Gets and sets the number of days to keep environment. - :type days_to_keep: int - :param releases_to_keep: Gets and sets the number of releases to keep. - :type releases_to_keep: int - :param retain_build: Gets and sets as the build to be retained or not. - :type retain_build: bool - """ - - _attribute_map = { - 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'}, - 'releases_to_keep': {'key': 'releasesToKeep', 'type': 'int'}, - 'retain_build': {'key': 'retainBuild', 'type': 'bool'} - } - - def __init__(self, days_to_keep=None, releases_to_keep=None, retain_build=None): - super(EnvironmentRetentionPolicy, self).__init__() - self.days_to_keep = days_to_keep - self.releases_to_keep = releases_to_keep - self.retain_build = retain_build - - -class EnvironmentTrigger(Model): - """ - :param definition_environment_id: Definition environment ID on which this trigger applicable. - :type definition_environment_id: int - :param release_definition_id: ReleaseDefinition ID on which this trigger applicable. - :type release_definition_id: int - :param trigger_content: Gets or sets the trigger content. - :type trigger_content: str - :param trigger_type: Gets or sets the trigger type. - :type trigger_type: object - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, - 'trigger_content': {'key': 'triggerContent', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'object'} - } - - def __init__(self, definition_environment_id=None, release_definition_id=None, trigger_content=None, trigger_type=None): - super(EnvironmentTrigger, self).__init__() - self.definition_environment_id = definition_environment_id - self.release_definition_id = release_definition_id - self.trigger_content = trigger_content - self.trigger_type = trigger_type - - -class FavoriteItem(Model): - """ - Class to represent favorite entry. - - :param data: Application specific data for the entry. - :type data: str - :param id: Unique Id of the the entry. - :type id: str - :param name: Display text for favorite entry. - :type name: str - :param type: Application specific favorite entry type. Empty or Null represents that Favorite item is a Folder. - :type type: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, data=None, id=None, name=None, type=None): - super(FavoriteItem, self).__init__() - self.data = data - self.id = id - self.name = name - self.type = type - - -class Folder(Model): - """ - :param created_by: Identity who created this folder. - :type created_by: :class:`IdentityRef ` - :param created_on: Time when this folder created. - :type created_on: datetime - :param description: Description of the folder. - :type description: str - :param last_changed_by: Identity who last changed this folder. - :type last_changed_by: :class:`IdentityRef ` - :param last_changed_date: Time when this folder last changed. - :type last_changed_date: datetime - :param path: path of the folder. - :type path: str - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, - 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, - 'path': {'key': 'path', 'type': 'str'} - } - - def __init__(self, created_by=None, created_on=None, description=None, last_changed_by=None, last_changed_date=None, path=None): - super(Folder, self).__init__() - self.created_by = created_by - self.created_on = created_on - self.description = description - self.last_changed_by = last_changed_by - self.last_changed_date = last_changed_date - self.path = path - - -class GateUpdateMetadata(Model): - """ - :param comment: Comment. - :type comment: str - :param gates_to_ignore: Name of gate to be ignored. - :type gates_to_ignore: list of str - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'gates_to_ignore': {'key': 'gatesToIgnore', 'type': '[str]'} - } - - def __init__(self, comment=None, gates_to_ignore=None): - super(GateUpdateMetadata, self).__init__() - self.comment = comment - self.gates_to_ignore = gates_to_ignore - - -class GraphSubjectBase(Model): - """ - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None): - super(GraphSubjectBase, self).__init__() - self._links = _links - self.descriptor = descriptor - self.display_name = display_name - self.url = url - - -class IdentityRef(GraphSubjectBase): - """ - :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` - :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. - :type descriptor: str - :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. - :type display_name: str - :param url: This url is the full route to the source resource of this graph subject. - :type url: str - :param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary - :type directory_alias: str - :param id: - :type id: str - :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary - :type image_url: str - :param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary - :type inactive: bool - :param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) - :type is_aad_identity: bool - :param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) - :type is_container: bool - :param is_deleted_in_origin: - :type is_deleted_in_origin: bool - :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef - :type profile_url: str - :param unique_name: Deprecated - use Domain+PrincipalName instead - :type unique_name: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - 'inactive': {'key': 'inactive', 'type': 'bool'}, - 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, - 'is_container': {'key': 'isContainer', 'type': 'bool'}, - 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, - 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'} - } - - def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): - super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) - self.directory_alias = directory_alias - self.id = id - self.image_url = image_url - self.inactive = inactive - self.is_aad_identity = is_aad_identity - self.is_container = is_container - self.is_deleted_in_origin = is_deleted_in_origin - self.profile_url = profile_url - self.unique_name = unique_name - - -class IgnoredGate(Model): - """ - :param last_modified_on: Gets the date on which gate is last ignored. - :type last_modified_on: datetime - :param name: Name of gate ignored. - :type name: str - """ - - _attribute_map = { - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, last_modified_on=None, name=None): - super(IgnoredGate, self).__init__() - self.last_modified_on = last_modified_on - self.name = name - - -class InputDescriptor(Model): - """ - Describes an input for subscriptions. - - :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. - :type dependency_input_ids: list of str - :param description: Description of what this input is used for - :type description: str - :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. - :type group_name: str - :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. - :type has_dynamic_value_information: bool - :param id: Identifier for the subscription input - :type id: str - :param input_mode: Mode in which the value of this input should be entered - :type input_mode: object - :param is_confidential: Gets whether this input is confidential, such as for a password or application key - :type is_confidential: bool - :param name: Localized name which can be shown as a label for the subscription input - :type name: str - :param properties: Custom properties for the input which can be used by the service provider - :type properties: dict - :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. - :type type: str - :param use_in_default_description: Gets whether this input is included in the default generated action description. - :type use_in_default_description: bool - :param validation: Information to use to validate this input's value - :type validation: :class:`InputValidation ` - :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. - :type value_hint: str - :param values: Information about possible values for this input - :type values: :class:`InputValues ` - """ - - _attribute_map = { - 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, - 'id': {'key': 'id', 'type': 'str'}, - 'input_mode': {'key': 'inputMode', 'type': 'object'}, - 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, - 'validation': {'key': 'validation', 'type': 'InputValidation'}, - 'value_hint': {'key': 'valueHint', 'type': 'str'}, - 'values': {'key': 'values', 'type': 'InputValues'} - } - - def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): - super(InputDescriptor, self).__init__() - self.dependency_input_ids = dependency_input_ids - self.description = description - self.group_name = group_name - self.has_dynamic_value_information = has_dynamic_value_information - self.id = id - self.input_mode = input_mode - self.is_confidential = is_confidential - self.name = name - self.properties = properties - self.type = type - self.use_in_default_description = use_in_default_description - self.validation = validation - self.value_hint = value_hint - self.values = values - - -class InputValidation(Model): - """ - Describes what values are valid for a subscription input - - :param data_type: Gets or sets the data data type to validate. - :type data_type: object - :param is_required: Gets or sets if this is a required field. - :type is_required: bool - :param max_length: Gets or sets the maximum length of this descriptor. - :type max_length: int - :param max_value: Gets or sets the minimum value for this descriptor. - :type max_value: decimal - :param min_length: Gets or sets the minimum length of this descriptor. - :type min_length: int - :param min_value: Gets or sets the minimum value for this descriptor. - :type min_value: decimal - :param pattern: Gets or sets the pattern to validate. - :type pattern: str - :param pattern_mismatch_error_message: Gets or sets the error on pattern mismatch. - :type pattern_mismatch_error_message: str - """ - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'object'}, - 'is_required': {'key': 'isRequired', 'type': 'bool'}, - 'max_length': {'key': 'maxLength', 'type': 'int'}, - 'max_value': {'key': 'maxValue', 'type': 'decimal'}, - 'min_length': {'key': 'minLength', 'type': 'int'}, - 'min_value': {'key': 'minValue', 'type': 'decimal'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} - } - - def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): - super(InputValidation, self).__init__() - self.data_type = data_type - self.is_required = is_required - self.max_length = max_length - self.max_value = max_value - self.min_length = min_length - self.min_value = min_value - self.pattern = pattern - self.pattern_mismatch_error_message = pattern_mismatch_error_message - - -class InputValue(Model): - """ - Information about a single value for an input - - :param data: Any other data about this input - :type data: dict - :param display_value: The text to show for the display of this value - :type display_value: str - :param value: The value to store for this input - :type value: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{object}'}, - 'display_value': {'key': 'displayValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, data=None, display_value=None, value=None): - super(InputValue, self).__init__() - self.data = data - self.display_value = display_value - self.value = value - - -class InputValues(Model): - """ - Information about the possible/allowed values for a given subscription input - - :param default_value: The default value to use for this input - :type default_value: str - :param error: Errors encountered while computing dynamic values. - :type error: :class:`InputValuesError ` - :param input_id: The id of the input - :type input_id: str - :param is_disabled: Should this input be disabled - :type is_disabled: bool - :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) - :type is_limited_to_possible_values: bool - :param is_read_only: Should this input be made read-only - :type is_read_only: bool - :param possible_values: Possible values that this input can take - :type possible_values: list of :class:`InputValue ` - """ - - _attribute_map = { - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'InputValuesError'}, - 'input_id': {'key': 'inputId', 'type': 'str'}, - 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, - 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, - 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, - 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} - } - - def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): - super(InputValues, self).__init__() - self.default_value = default_value - self.error = error - self.input_id = input_id - self.is_disabled = is_disabled - self.is_limited_to_possible_values = is_limited_to_possible_values - self.is_read_only = is_read_only - self.possible_values = possible_values - - -class InputValuesError(Model): - """ - Error information related to a subscription input value. - - :param message: The error message. - :type message: str - """ - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, message=None): - super(InputValuesError, self).__init__() - self.message = message - - -class InputValuesQuery(Model): - """ - :param current_values: - :type current_values: dict - :param input_values: The input values to return on input, and the result from the consumer on output. - :type input_values: list of :class:`InputValues ` - :param resource: Subscription containing information about the publisher/consumer and the current input values - :type resource: object - """ - - _attribute_map = { - 'current_values': {'key': 'currentValues', 'type': '{str}'}, - 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, - 'resource': {'key': 'resource', 'type': 'object'} - } - - def __init__(self, current_values=None, input_values=None, resource=None): - super(InputValuesQuery, self).__init__() - self.current_values = current_values - self.input_values = input_values - self.resource = resource - - -class Issue(Model): - """ - :param data: Issue data. - :type data: dict - :param issue_type: Issue type, for example error, warning or info. - :type issue_type: str - :param message: Issue message. - :type message: str - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - 'issue_type': {'key': 'issueType', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, data=None, issue_type=None, message=None): - super(Issue, self).__init__() - self.data = data - self.issue_type = issue_type - self.message = message - - -class MailMessage(Model): - """ - :param body: Body of mail. - :type body: str - :param cc: Mail CC recipients. - :type cc: :class:`EmailRecipients ` - :param in_reply_to: Reply to. - :type in_reply_to: str - :param message_id: Message ID of the mail. - :type message_id: str - :param reply_by: Data when should be replied to mail. - :type reply_by: datetime - :param reply_to: Reply to Email recipients. - :type reply_to: :class:`EmailRecipients ` - :param sections: List of mail section types. - :type sections: list of MailSectionType - :param sender_type: Mail sender type. - :type sender_type: object - :param subject: Subject of the mail. - :type subject: str - :param to: Mail To recipients. - :type to: :class:`EmailRecipients ` - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'str'}, - 'cc': {'key': 'cc', 'type': 'EmailRecipients'}, - 'in_reply_to': {'key': 'inReplyTo', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'reply_by': {'key': 'replyBy', 'type': 'iso-8601'}, - 'reply_to': {'key': 'replyTo', 'type': 'EmailRecipients'}, - 'sections': {'key': 'sections', 'type': '[object]'}, - 'sender_type': {'key': 'senderType', 'type': 'object'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'EmailRecipients'} - } - - def __init__(self, body=None, cc=None, in_reply_to=None, message_id=None, reply_by=None, reply_to=None, sections=None, sender_type=None, subject=None, to=None): - super(MailMessage, self).__init__() - self.body = body - self.cc = cc - self.in_reply_to = in_reply_to - self.message_id = message_id - self.reply_by = reply_by - self.reply_to = reply_to - self.sections = sections - self.sender_type = sender_type - self.subject = subject - self.to = to - - -class ManualIntervention(Model): - """ - :param approver: Gets or sets the identity who should approve. - :type approver: :class:`IdentityRef ` - :param comments: Gets or sets comments for approval. - :type comments: str - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param id: Gets the unique identifier for manual intervention. - :type id: int - :param instructions: Gets or sets instructions for approval. - :type instructions: str - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets or sets the name. - :type name: str - :param release: Gets releaseReference for manual intervention. - :type release: :class:`ReleaseShallowReference ` - :param release_definition: Gets releaseDefinitionReference for manual intervention. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference for manual intervention. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param status: Gets or sets the status of the manual intervention. - :type status: object - :param task_instance_id: Get task instance identifier. - :type task_instance_id: str - :param url: Gets url to access the manual intervention. - :type url: str - """ - - _attribute_map = { - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'int'}, - 'instructions': {'key': 'instructions', 'type': 'str'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'status': {'key': 'status', 'type': 'object'}, - 'task_instance_id': {'key': 'taskInstanceId', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, approver=None, comments=None, created_on=None, id=None, instructions=None, modified_on=None, name=None, release=None, release_definition=None, release_environment=None, status=None, task_instance_id=None, url=None): - super(ManualIntervention, self).__init__() - self.approver = approver - self.comments = comments - self.created_on = created_on - self.id = id - self.instructions = instructions - self.modified_on = modified_on - self.name = name - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.status = status - self.task_instance_id = task_instance_id - self.url = url - - -class ManualInterventionUpdateMetadata(Model): - """ - :param comment: Sets the comment for manual intervention update. - :type comment: str - :param status: Sets the status of the manual intervention. - :type status: object - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, comment=None, status=None): - super(ManualInterventionUpdateMetadata, self).__init__() - self.comment = comment - self.status = status - - -class Metric(Model): - """ - :param name: Name of the Metric. - :type name: str - :param value: Value of the Metric. - :type value: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'} - } - - def __init__(self, name=None, value=None): - super(Metric, self).__init__() - self.name = name - self.value = value - - -class OrgPipelineReleaseSettings(Model): - """ - :param has_manage_pipeline_policies_permission: Defines whether user can manage pipeline settings. - :type has_manage_pipeline_policies_permission: bool - :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. - :type org_enforce_job_auth_scope: bool - """ - - _attribute_map = { - 'has_manage_pipeline_policies_permission': {'key': 'hasManagePipelinePoliciesPermission', 'type': 'bool'}, - 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} - } - - def __init__(self, has_manage_pipeline_policies_permission=None, org_enforce_job_auth_scope=None): - super(OrgPipelineReleaseSettings, self).__init__() - self.has_manage_pipeline_policies_permission = has_manage_pipeline_policies_permission - self.org_enforce_job_auth_scope = org_enforce_job_auth_scope - - -class OrgPipelineReleaseSettingsUpdateParameters(Model): - """ - :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. - :type org_enforce_job_auth_scope: bool - """ - - _attribute_map = { - 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'} - } - - def __init__(self, org_enforce_job_auth_scope=None): - super(OrgPipelineReleaseSettingsUpdateParameters, self).__init__() - self.org_enforce_job_auth_scope = org_enforce_job_auth_scope - - -class PipelineProcess(Model): - """ - :param type: Pipeline process type. - :type type: object - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'object'} - } - - def __init__(self, type=None): - super(PipelineProcess, self).__init__() - self.type = type - - -class ProcessParameters(Model): - """ - :param data_source_bindings: - :type data_source_bindings: list of :class:`DataSourceBindingBase ` - :param inputs: - :type inputs: list of :class:`TaskInputDefinitionBase ` - :param source_definitions: - :type source_definitions: list of :class:`TaskSourceDefinitionBase ` - """ - - _attribute_map = { - 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBindingBase]'}, - 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinitionBase]'}, - 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinitionBase]'} - } - - def __init__(self, data_source_bindings=None, inputs=None, source_definitions=None): - super(ProcessParameters, self).__init__() - self.data_source_bindings = data_source_bindings - self.inputs = inputs - self.source_definitions = source_definitions - - -class ProjectPipelineReleaseSettings(Model): - """ - :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. - :type enforce_job_auth_scope: bool - :param has_manage_settings_permission: Defines whether user can manage pipeline settings. - :type has_manage_settings_permission: bool - :param org_enforce_job_auth_scope: EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project. - :type org_enforce_job_auth_scope: bool - :param public_project: Defines whether project is public. - :type public_project: bool - """ - - _attribute_map = { - 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, - 'has_manage_settings_permission': {'key': 'hasManageSettingsPermission', 'type': 'bool'}, - 'org_enforce_job_auth_scope': {'key': 'orgEnforceJobAuthScope', 'type': 'bool'}, - 'public_project': {'key': 'publicProject', 'type': 'bool'} - } - - def __init__(self, enforce_job_auth_scope=None, has_manage_settings_permission=None, org_enforce_job_auth_scope=None, public_project=None): - super(ProjectPipelineReleaseSettings, self).__init__() - self.enforce_job_auth_scope = enforce_job_auth_scope - self.has_manage_settings_permission = has_manage_settings_permission - self.org_enforce_job_auth_scope = org_enforce_job_auth_scope - self.public_project = public_project - - -class ProjectPipelineReleaseSettingsUpdateParameters(Model): - """ - :param enforce_job_auth_scope: EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project. - :type enforce_job_auth_scope: bool - """ - - _attribute_map = { - 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'} - } - - def __init__(self, enforce_job_auth_scope=None): - super(ProjectPipelineReleaseSettingsUpdateParameters, self).__init__() - self.enforce_job_auth_scope = enforce_job_auth_scope - - -class ProjectReference(Model): - """ - :param id: Gets the unique identifier of this field. - :type id: str - :param name: Gets name of project. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, name=None): - super(ProjectReference, self).__init__() - self.id = id - self.name = name - - -class QueuedReleaseData(Model): - """ - :param project_id: Project ID of the release. - :type project_id: str - :param queue_position: Release queue position. - :type queue_position: int - :param release_id: Queued release ID. - :type release_id: int - """ - - _attribute_map = { - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'queue_position': {'key': 'queuePosition', 'type': 'int'}, - 'release_id': {'key': 'releaseId', 'type': 'int'} - } - - def __init__(self, project_id=None, queue_position=None, release_id=None): - super(QueuedReleaseData, self).__init__() - self.project_id = project_id - self.queue_position = queue_position - self.release_id = release_id - - -class ReferenceLinks(Model): - """ - The class to represent a collection of REST reference links. - - :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'} - } - - def __init__(self, links=None): - super(ReferenceLinks, self).__init__() - self.links = links - - -class Release(Model): - """ - :param _links: Gets links to access the release. - :type _links: :class:`ReferenceLinks ` - :param artifacts: Gets or sets the list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param comment: Gets or sets comment. - :type comment: str - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_for: Gets or sets the identity for whom release was created. - :type created_for: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param definition_snapshot_revision: Gets revision number of definition snapshot. - :type definition_snapshot_revision: int - :param description: Gets or sets description of release. - :type description: str - :param environments: Gets list of environments. - :type environments: list of :class:`ReleaseEnvironment ` - :param id: Gets the unique identifier of this field. - :type id: int - :param keep_forever: Whether to exclude the release from retention policies. - :type keep_forever: bool - :param logs_container_url: Gets logs container url. - :type logs_container_url: str - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets name. - :type name: str - :param pool_name: Gets pool name. - :type pool_name: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param properties: - :type properties: :class:`object ` - :param reason: Gets reason of release. - :type reason: object - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_definition_revision: Gets or sets the release definition revision. - :type release_definition_revision: int - :param release_name_format: Gets release name format. - :type release_name_format: str - :param status: Gets status. - :type status: object - :param tags: Gets or sets list of tags. - :type tags: list of str - :param triggering_artifact_alias: - :type triggering_artifact_alias: str - :param url: - :type url: str - :param variable_groups: Gets the list of variable groups. - :type variable_groups: list of :class:`VariableGroup ` - :param variables: Gets or sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_for': {'key': 'createdFor', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments': {'key': 'environments', 'type': '[ReleaseEnvironment]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, - 'logs_container_url': {'key': 'logsContainerUrl', 'type': 'str'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_definition_revision': {'key': 'releaseDefinitionRevision', 'type': 'int'}, - 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'triggering_artifact_alias': {'key': 'triggeringArtifactAlias', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, created_for=None, created_on=None, definition_snapshot_revision=None, description=None, environments=None, id=None, keep_forever=None, logs_container_url=None, modified_by=None, modified_on=None, name=None, pool_name=None, project_reference=None, properties=None, reason=None, release_definition=None, release_definition_revision=None, release_name_format=None, status=None, tags=None, triggering_artifact_alias=None, url=None, variable_groups=None, variables=None): - super(Release, self).__init__() - self._links = _links - self.artifacts = artifacts - self.comment = comment - self.created_by = created_by - self.created_for = created_for - self.created_on = created_on - self.definition_snapshot_revision = definition_snapshot_revision - self.description = description - self.environments = environments - self.id = id - self.keep_forever = keep_forever - self.logs_container_url = logs_container_url - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.pool_name = pool_name - self.project_reference = project_reference - self.properties = properties - self.reason = reason - self.release_definition = release_definition - self.release_definition_revision = release_definition_revision - self.release_name_format = release_name_format - self.status = status - self.tags = tags - self.triggering_artifact_alias = triggering_artifact_alias - self.url = url - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseApproval(Model): - """ - :param approval_type: Gets or sets the type of approval. - :type approval_type: object - :param approved_by: Gets the identity who approved. - :type approved_by: :class:`IdentityRef ` - :param approver: Gets or sets the identity who should approve. - :type approver: :class:`IdentityRef ` - :param attempt: Gets or sets attempt which specifies as which deployment attempt it belongs. - :type attempt: int - :param comments: Gets or sets comments for approval. - :type comments: str - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param history: Gets history which specifies all approvals associated with this approval. - :type history: list of :class:`ReleaseApprovalHistory ` - :param id: Gets the unique identifier of this field. - :type id: int - :param is_automated: Gets or sets as approval is automated or not. - :type is_automated: bool - :param is_notification_on: - :type is_notification_on: bool - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param rank: Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval. - :type rank: int - :param release: Gets releaseReference which specifies the reference of the release to which this approval is associated. - :type release: :class:`ReleaseShallowReference ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated. - :type release_environment: :class:`ReleaseEnvironmentShallowReference ` - :param revision: Gets the revision number. - :type revision: int - :param status: Gets or sets the status of the approval. - :type status: object - :param trial_number: - :type trial_number: int - :param url: Gets url to access the approval. - :type url: str - """ - - _attribute_map = { - 'approval_type': {'key': 'approvalType', 'type': 'object'}, - 'approved_by': {'key': 'approvedBy', 'type': 'IdentityRef'}, - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'attempt': {'key': 'attempt', 'type': 'int'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'history': {'key': 'history', 'type': '[ReleaseApprovalHistory]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, - 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'object'}, - 'trial_number': {'key': 'trialNumber', 'type': 'int'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, approval_type=None, approved_by=None, approver=None, attempt=None, comments=None, created_on=None, history=None, id=None, is_automated=None, is_notification_on=None, modified_on=None, rank=None, release=None, release_definition=None, release_environment=None, revision=None, status=None, trial_number=None, url=None): - super(ReleaseApproval, self).__init__() - self.approval_type = approval_type - self.approved_by = approved_by - self.approver = approver - self.attempt = attempt - self.comments = comments - self.created_on = created_on - self.history = history - self.id = id - self.is_automated = is_automated - self.is_notification_on = is_notification_on - self.modified_on = modified_on - self.rank = rank - self.release = release - self.release_definition = release_definition - self.release_environment = release_environment - self.revision = revision - self.status = status - self.trial_number = trial_number - self.url = url - - -class ReleaseApprovalHistory(Model): - """ - :param approver: Identity of the approver. - :type approver: :class:`IdentityRef ` - :param changed_by: Identity of the object who changed approval. - :type changed_by: :class:`IdentityRef ` - :param comments: Approval history comments. - :type comments: str - :param created_on: Time when this approval created. - :type created_on: datetime - :param modified_on: Time when this approval modified. - :type modified_on: datetime - :param revision: Approval history revision. - :type revision: int - """ - - _attribute_map = { - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'revision': {'key': 'revision', 'type': 'int'} - } - - def __init__(self, approver=None, changed_by=None, comments=None, created_on=None, modified_on=None, revision=None): - super(ReleaseApprovalHistory, self).__init__() - self.approver = approver - self.changed_by = changed_by - self.comments = comments - self.created_on = created_on - self.modified_on = modified_on - self.revision = revision - - -class ReleaseCondition(Condition): - """ - :param condition_type: Gets or sets the condition type. - :type condition_type: object - :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. - :type name: str - :param value: Gets or set value of the condition. - :type value: str - :param result: The release condition result. - :type result: bool - """ - - _attribute_map = { - 'condition_type': {'key': 'conditionType', 'type': 'object'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'result': {'key': 'result', 'type': 'bool'} - } - - def __init__(self, condition_type=None, name=None, value=None, result=None): - super(ReleaseCondition, self).__init__(condition_type=condition_type, name=name, value=value) - self.result = result - - -class ReleaseDefinitionApprovals(Model): - """ - :param approval_options: Gets or sets the approval options. - :type approval_options: :class:`ApprovalOptions ` - :param approvals: Gets or sets the approvals. - :type approvals: list of :class:`ReleaseDefinitionApprovalStep ` - """ - - _attribute_map = { - 'approval_options': {'key': 'approvalOptions', 'type': 'ApprovalOptions'}, - 'approvals': {'key': 'approvals', 'type': '[ReleaseDefinitionApprovalStep]'} - } - - def __init__(self, approval_options=None, approvals=None): - super(ReleaseDefinitionApprovals, self).__init__() - self.approval_options = approval_options - self.approvals = approvals - - -class ReleaseDefinitionEnvironment(Model): - """ - :param badge_url: Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment. - :type badge_url: str - :param conditions: Gets or sets the environment conditions. - :type conditions: list of :class:`Condition ` - :param current_release: Gets or sets the current release reference. - :type current_release: :class:`ReleaseShallowReference ` - :param demands: Gets or sets the demands. - :type demands: list of :class:`object ` - :param deploy_phases: Gets or sets the deploy phases of environment. - :type deploy_phases: list of :class:`object ` - :param deploy_step: Gets or sets the deploystep. - :type deploy_step: :class:`ReleaseDefinitionDeployStep ` - :param environment_options: Gets or sets the environment options. - :type environment_options: :class:`EnvironmentOptions ` - :param environment_triggers: Gets or sets the triggers on environment. - :type environment_triggers: list of :class:`EnvironmentTrigger ` - :param execution_policy: Gets or sets the environment execution policy. - :type execution_policy: :class:`EnvironmentExecutionPolicy ` - :param id: Gets and sets the ID of the ReleaseDefinitionEnvironment. - :type id: int - :param name: Gets and sets the name of the ReleaseDefinitionEnvironment. - :type name: str - :param owner: Gets and sets the Owner of the ReleaseDefinitionEnvironment. - :type owner: :class:`IdentityRef ` - :param post_deploy_approvals: Gets or sets the post deployment approvals. - :type post_deploy_approvals: :class:`ReleaseDefinitionApprovals ` - :param post_deployment_gates: Gets or sets the post deployment gates. - :type post_deployment_gates: :class:`ReleaseDefinitionGatesStep ` - :param pre_deploy_approvals: Gets or sets the pre deployment approvals. - :type pre_deploy_approvals: :class:`ReleaseDefinitionApprovals ` - :param pre_deployment_gates: Gets or sets the pre deployment gates. - :type pre_deployment_gates: :class:`ReleaseDefinitionGatesStep ` - :param process_parameters: Gets or sets the environment process parameters. - :type process_parameters: :class:`ProcessParameters ` - :param properties: Gets or sets the properties on environment. - :type properties: :class:`object ` - :param queue_id: Gets or sets the queue ID. - :type queue_id: int - :param rank: Gets and sets the rank of the ReleaseDefinitionEnvironment. - :type rank: int - :param retention_policy: Gets or sets the environment retention policy. - :type retention_policy: :class:`EnvironmentRetentionPolicy ` - :param run_options: - :type run_options: dict - :param schedules: Gets or sets the schedules - :type schedules: list of :class:`ReleaseSchedule ` - :param variable_groups: Gets or sets the variable groups. - :type variable_groups: list of int - :param variables: Gets and sets the variables. - :type variables: dict - """ - - _attribute_map = { - 'badge_url': {'key': 'badgeUrl', 'type': 'str'}, - 'conditions': {'key': 'conditions', 'type': '[Condition]'}, - 'current_release': {'key': 'currentRelease', 'type': 'ReleaseShallowReference'}, - 'demands': {'key': 'demands', 'type': '[object]'}, - 'deploy_phases': {'key': 'deployPhases', 'type': '[object]'}, - 'deploy_step': {'key': 'deployStep', 'type': 'ReleaseDefinitionDeployStep'}, - 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, - 'environment_triggers': {'key': 'environmentTriggers', 'type': '[EnvironmentTrigger]'}, - 'execution_policy': {'key': 'executionPolicy', 'type': 'EnvironmentExecutionPolicy'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'owner': {'key': 'owner', 'type': 'IdentityRef'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, - 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, - 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, - 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'queue_id': {'key': 'queueId', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, - 'run_options': {'key': 'runOptions', 'type': '{str}'}, - 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, badge_url=None, conditions=None, current_release=None, demands=None, deploy_phases=None, deploy_step=None, environment_options=None, environment_triggers=None, execution_policy=None, id=None, name=None, owner=None, post_deploy_approvals=None, post_deployment_gates=None, pre_deploy_approvals=None, pre_deployment_gates=None, process_parameters=None, properties=None, queue_id=None, rank=None, retention_policy=None, run_options=None, schedules=None, variable_groups=None, variables=None): - super(ReleaseDefinitionEnvironment, self).__init__() - self.badge_url = badge_url - self.conditions = conditions - self.current_release = current_release - self.demands = demands - self.deploy_phases = deploy_phases - self.deploy_step = deploy_step - self.environment_options = environment_options - self.environment_triggers = environment_triggers - self.execution_policy = execution_policy - self.id = id - self.name = name - self.owner = owner - self.post_deploy_approvals = post_deploy_approvals - self.post_deployment_gates = post_deployment_gates - self.pre_deploy_approvals = pre_deploy_approvals - self.pre_deployment_gates = pre_deployment_gates - self.process_parameters = process_parameters - self.properties = properties - self.queue_id = queue_id - self.rank = rank - self.retention_policy = retention_policy - self.run_options = run_options - self.schedules = schedules - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseDefinitionEnvironmentStep(Model): - """ - :param id: ID of the approval or deploy step. - :type id: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, id=None): - super(ReleaseDefinitionEnvironmentStep, self).__init__() - self.id = id - - -class ReleaseDefinitionEnvironmentSummary(Model): - """ - :param id: ID of ReleaseDefinition environment summary. - :type id: int - :param last_releases: List of release shallow reference deployed using this ReleaseDefinition. - :type last_releases: list of :class:`ReleaseShallowReference ` - :param name: Name of ReleaseDefinition environment summary. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'last_releases': {'key': 'lastReleases', 'type': '[ReleaseShallowReference]'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, id=None, last_releases=None, name=None): - super(ReleaseDefinitionEnvironmentSummary, self).__init__() - self.id = id - self.last_releases = last_releases - self.name = name - - -class ReleaseDefinitionEnvironmentTemplate(Model): - """ - :param can_delete: Indicates whether template can be deleted or not. - :type can_delete: bool - :param category: Category of the ReleaseDefinition environment template. - :type category: str - :param description: Description of the ReleaseDefinition environment template. - :type description: str - :param environment: ReleaseDefinition environment data which used to create this template. - :type environment: :class:`ReleaseDefinitionEnvironment ` - :param icon_task_id: ID of the task which used to display icon used for this template. - :type icon_task_id: str - :param icon_uri: Icon uri of the template. - :type icon_uri: str - :param id: ID of the ReleaseDefinition environment template. - :type id: str - :param is_deleted: Indicates whether template deleted or not. - :type is_deleted: bool - :param name: Name of the ReleaseDefinition environment template. - :type name: str - """ - - _attribute_map = { - 'can_delete': {'key': 'canDelete', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ReleaseDefinitionEnvironment'}, - 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, - 'icon_uri': {'key': 'iconUri', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'} - } - - def __init__(self, can_delete=None, category=None, description=None, environment=None, icon_task_id=None, icon_uri=None, id=None, is_deleted=None, name=None): - super(ReleaseDefinitionEnvironmentTemplate, self).__init__() - self.can_delete = can_delete - self.category = category - self.description = description - self.environment = environment - self.icon_task_id = icon_task_id - self.icon_uri = icon_uri - self.id = id - self.is_deleted = is_deleted - self.name = name - - -class ReleaseDefinitionGate(Model): - """ - :param tasks: Gets or sets the gates workflow. - :type tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, tasks=None): - super(ReleaseDefinitionGate, self).__init__() - self.tasks = tasks - - -class ReleaseDefinitionGatesOptions(Model): - """ - :param is_enabled: Gets or sets as the gates enabled or not. - :type is_enabled: bool - :param minimum_success_duration: Gets or sets the minimum duration for steady results after a successful gates evaluation. - :type minimum_success_duration: int - :param sampling_interval: Gets or sets the time between re-evaluation of gates. - :type sampling_interval: int - :param stabilization_time: Gets or sets the delay before evaluation. - :type stabilization_time: int - :param timeout: Gets or sets the timeout after which gates fail. - :type timeout: int - """ - - _attribute_map = { - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'minimum_success_duration': {'key': 'minimumSuccessDuration', 'type': 'int'}, - 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, - 'stabilization_time': {'key': 'stabilizationTime', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'int'} - } - - def __init__(self, is_enabled=None, minimum_success_duration=None, sampling_interval=None, stabilization_time=None, timeout=None): - super(ReleaseDefinitionGatesOptions, self).__init__() - self.is_enabled = is_enabled - self.minimum_success_duration = minimum_success_duration - self.sampling_interval = sampling_interval - self.stabilization_time = stabilization_time - self.timeout = timeout - - -class ReleaseDefinitionGatesStep(Model): - """ - :param gates: Gets or sets the gates. - :type gates: list of :class:`ReleaseDefinitionGate ` - :param gates_options: Gets or sets the gate options. - :type gates_options: :class:`ReleaseDefinitionGatesOptions ` - :param id: ID of the ReleaseDefinitionGateStep. - :type id: int - """ - - _attribute_map = { - 'gates': {'key': 'gates', 'type': '[ReleaseDefinitionGate]'}, - 'gates_options': {'key': 'gatesOptions', 'type': 'ReleaseDefinitionGatesOptions'}, - 'id': {'key': 'id', 'type': 'int'} - } - - def __init__(self, gates=None, gates_options=None, id=None): - super(ReleaseDefinitionGatesStep, self).__init__() - self.gates = gates - self.gates_options = gates_options - self.id = id - - -class ReleaseDefinitionRevision(Model): - """ - :param api_version: Gets api-version for revision object. - :type api_version: str - :param changed_by: Gets the identity who did change. - :type changed_by: :class:`IdentityRef ` - :param changed_date: Gets date on which ReleaseDefinition changed. - :type changed_date: datetime - :param change_type: Gets type of change. - :type change_type: object - :param comment: Gets comments for revision. - :type comment: str - :param definition_id: Get id of the definition. - :type definition_id: int - :param definition_url: Gets definition URL. - :type definition_url: str - :param revision: Get revision number of the definition. - :type revision: int - """ - - _attribute_map = { - 'api_version': {'key': 'apiVersion', 'type': 'str'}, - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'change_type': {'key': 'changeType', 'type': 'object'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'definition_id': {'key': 'definitionId', 'type': 'int'}, - 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'} - } - - def __init__(self, api_version=None, changed_by=None, changed_date=None, change_type=None, comment=None, definition_id=None, definition_url=None, revision=None): - super(ReleaseDefinitionRevision, self).__init__() - self.api_version = api_version - self.changed_by = changed_by - self.changed_date = changed_date - self.change_type = change_type - self.comment = comment - self.definition_id = definition_id - self.definition_url = definition_url - self.revision = revision - - -class ReleaseDefinitionShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release definition. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release definition. - :type id: int - :param name: Gets or sets the name of the release definition. - :type name: str - :param path: Gets or sets the path of the release definition. - :type path: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param url: Gets the REST API url to access the release definition. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None): - super(ReleaseDefinitionShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.path = path - self.project_reference = project_reference - self.url = url - - -class ReleaseDefinitionSummary(Model): - """ - :param environments: List of Release Definition environment summary. - :type environments: list of :class:`ReleaseDefinitionEnvironmentSummary ` - :param release_definition: Release Definition reference. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param releases: List of releases deployed using this Release Definition. - :type releases: list of :class:`Release ` - """ - - _attribute_map = { - 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironmentSummary]'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'releases': {'key': 'releases', 'type': '[Release]'} - } - - def __init__(self, environments=None, release_definition=None, releases=None): - super(ReleaseDefinitionSummary, self).__init__() - self.environments = environments - self.release_definition = release_definition - self.releases = releases - - -class ReleaseDefinitionUndeleteParameter(Model): - """ - :param comment: Gets or sets comment. - :type comment: str - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'} - } - - def __init__(self, comment=None): - super(ReleaseDefinitionUndeleteParameter, self).__init__() - self.comment = comment - - -class ReleaseDeployPhase(Model): - """ - :param deployment_jobs: Deployment jobs of the phase. - :type deployment_jobs: list of :class:`DeploymentJob ` - :param error_log: Phase execution error logs. - :type error_log: str - :param id: ID of the phase. - :type id: int - :param manual_interventions: List of manual intervention tasks execution information in phase. - :type manual_interventions: list of :class:`ManualIntervention ` - :param name: Name of the phase. - :type name: str - :param phase_id: ID of the phase. - :type phase_id: str - :param phase_type: Type of the phase. - :type phase_type: object - :param rank: Rank of the phase. - :type rank: int - :param run_plan_id: Run Plan ID of the phase. - :type run_plan_id: str - :param started_on: Phase start time. - :type started_on: datetime - :param status: Status of the phase. - :type status: object - """ - - _attribute_map = { - 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, - 'error_log': {'key': 'errorLog', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'manual_interventions': {'key': 'manualInterventions', 'type': '[ManualIntervention]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'phase_id': {'key': 'phaseId', 'type': 'str'}, - 'phase_type': {'key': 'phaseType', 'type': 'object'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, deployment_jobs=None, error_log=None, id=None, manual_interventions=None, name=None, phase_id=None, phase_type=None, rank=None, run_plan_id=None, started_on=None, status=None): - super(ReleaseDeployPhase, self).__init__() - self.deployment_jobs = deployment_jobs - self.error_log = error_log - self.id = id - self.manual_interventions = manual_interventions - self.name = name - self.phase_id = phase_id - self.phase_type = phase_type - self.rank = rank - self.run_plan_id = run_plan_id - self.started_on = started_on - self.status = status - - -class ReleaseEnvironment(Model): - """ - :param conditions: Gets list of conditions. - :type conditions: list of :class:`ReleaseCondition ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param definition_environment_id: Gets definition environment id. - :type definition_environment_id: int - :param demands: Gets demands. - :type demands: list of :class:`object ` - :param deploy_phases_snapshot: Gets list of deploy phases snapshot. - :type deploy_phases_snapshot: list of :class:`object ` - :param deploy_steps: Gets deploy steps. - :type deploy_steps: list of :class:`DeploymentAttempt ` - :param environment_options: Gets environment options. - :type environment_options: :class:`EnvironmentOptions ` - :param id: Gets the unique identifier of this field. - :type id: int - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets name. - :type name: str - :param next_scheduled_utc_time: Gets next scheduled UTC time. - :type next_scheduled_utc_time: datetime - :param owner: Gets the identity who is owner for release environment. - :type owner: :class:`IdentityRef ` - :param post_approvals_snapshot: Gets list of post deploy approvals snapshot. - :type post_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` - :param post_deploy_approvals: Gets list of post deploy approvals. - :type post_deploy_approvals: list of :class:`ReleaseApproval ` - :param post_deployment_gates_snapshot: Post deployment gates snapshot data. - :type post_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` - :param pre_approvals_snapshot: Gets list of pre deploy approvals snapshot. - :type pre_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` - :param pre_deploy_approvals: Gets list of pre deploy approvals. - :type pre_deploy_approvals: list of :class:`ReleaseApproval ` - :param pre_deployment_gates_snapshot: Pre deployment gates snapshot data. - :type pre_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` - :param process_parameters: Gets process parameters. - :type process_parameters: :class:`ProcessParameters ` - :param queue_id: Gets queue id. - :type queue_id: int - :param rank: Gets rank. - :type rank: int - :param release: Gets release reference which specifies the reference of the release to which this release environment is associated. - :type release: :class:`ReleaseShallowReference ` - :param release_created_by: Gets the identity who created release. - :type release_created_by: :class:`IdentityRef ` - :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release environment is associated. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param release_description: Gets release description. - :type release_description: str - :param release_id: Gets release id. - :type release_id: int - :param scheduled_deployment_time: Gets schedule deployment time of release environment. - :type scheduled_deployment_time: datetime - :param schedules: Gets list of schedules. - :type schedules: list of :class:`ReleaseSchedule ` - :param status: Gets environment status. - :type status: object - :param time_to_deploy: Gets time to deploy. - :type time_to_deploy: float - :param trigger_reason: Gets trigger reason. - :type trigger_reason: str - :param variable_groups: Gets the list of variable groups. - :type variable_groups: list of :class:`VariableGroup ` - :param variables: Gets the dictionary of variables. - :type variables: dict - :param workflow_tasks: Gets list of workflow tasks. - :type workflow_tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'conditions': {'key': 'conditions', 'type': '[ReleaseCondition]'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'demands': {'key': 'demands', 'type': '[object]'}, - 'deploy_phases_snapshot': {'key': 'deployPhasesSnapshot', 'type': '[object]'}, - 'deploy_steps': {'key': 'deploySteps', 'type': '[DeploymentAttempt]'}, - 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, - 'id': {'key': 'id', 'type': 'int'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'next_scheduled_utc_time': {'key': 'nextScheduledUtcTime', 'type': 'iso-8601'}, - 'owner': {'key': 'owner', 'type': 'IdentityRef'}, - 'post_approvals_snapshot': {'key': 'postApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, - 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, - 'post_deployment_gates_snapshot': {'key': 'postDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, - 'pre_approvals_snapshot': {'key': 'preApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, - 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, - 'pre_deployment_gates_snapshot': {'key': 'preDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, - 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, - 'queue_id': {'key': 'queueId', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, - 'release_created_by': {'key': 'releaseCreatedBy', 'type': 'IdentityRef'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'release_description': {'key': 'releaseDescription', 'type': 'str'}, - 'release_id': {'key': 'releaseId', 'type': 'int'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, - 'status': {'key': 'status', 'type': 'object'}, - 'time_to_deploy': {'key': 'timeToDeploy', 'type': 'float'}, - 'trigger_reason': {'key': 'triggerReason', 'type': 'str'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'}, - 'workflow_tasks': {'key': 'workflowTasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, conditions=None, created_on=None, definition_environment_id=None, demands=None, deploy_phases_snapshot=None, deploy_steps=None, environment_options=None, id=None, modified_on=None, name=None, next_scheduled_utc_time=None, owner=None, post_approvals_snapshot=None, post_deploy_approvals=None, post_deployment_gates_snapshot=None, pre_approvals_snapshot=None, pre_deploy_approvals=None, pre_deployment_gates_snapshot=None, process_parameters=None, queue_id=None, rank=None, release=None, release_created_by=None, release_definition=None, release_description=None, release_id=None, scheduled_deployment_time=None, schedules=None, status=None, time_to_deploy=None, trigger_reason=None, variable_groups=None, variables=None, workflow_tasks=None): - super(ReleaseEnvironment, self).__init__() - self.conditions = conditions - self.created_on = created_on - self.definition_environment_id = definition_environment_id - self.demands = demands - self.deploy_phases_snapshot = deploy_phases_snapshot - self.deploy_steps = deploy_steps - self.environment_options = environment_options - self.id = id - self.modified_on = modified_on - self.name = name - self.next_scheduled_utc_time = next_scheduled_utc_time - self.owner = owner - self.post_approvals_snapshot = post_approvals_snapshot - self.post_deploy_approvals = post_deploy_approvals - self.post_deployment_gates_snapshot = post_deployment_gates_snapshot - self.pre_approvals_snapshot = pre_approvals_snapshot - self.pre_deploy_approvals = pre_deploy_approvals - self.pre_deployment_gates_snapshot = pre_deployment_gates_snapshot - self.process_parameters = process_parameters - self.queue_id = queue_id - self.rank = rank - self.release = release - self.release_created_by = release_created_by - self.release_definition = release_definition - self.release_description = release_description - self.release_id = release_id - self.scheduled_deployment_time = scheduled_deployment_time - self.schedules = schedules - self.status = status - self.time_to_deploy = time_to_deploy - self.trigger_reason = trigger_reason - self.variable_groups = variable_groups - self.variables = variables - self.workflow_tasks = workflow_tasks - - -class ReleaseEnvironmentShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release environment. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release environment. - :type id: int - :param name: Gets or sets the name of the release environment. - :type name: str - :param url: Gets the REST API url to access the release environment. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, url=None): - super(ReleaseEnvironmentShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.url = url - - -class ReleaseEnvironmentUpdateMetadata(Model): - """ - :param comment: Gets or sets comment. - :type comment: str - :param scheduled_deployment_time: Gets or sets scheduled deployment time. - :type scheduled_deployment_time: datetime - :param status: Gets or sets status of environment. - :type status: object - :param variables: Sets list of environment variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, comment=None, scheduled_deployment_time=None, status=None, variables=None): - super(ReleaseEnvironmentUpdateMetadata, self).__init__() - self.comment = comment - self.scheduled_deployment_time = scheduled_deployment_time - self.status = status - self.variables = variables - - -class ReleaseGates(Model): - """ - :param deployment_jobs: Contains the gates job details of each evaluation. - :type deployment_jobs: list of :class:`DeploymentJob ` - :param id: ID of release gates. - :type id: int - :param ignored_gates: List of ignored gates. - :type ignored_gates: list of :class:`IgnoredGate ` - :param last_modified_on: Gates last modified time. - :type last_modified_on: datetime - :param run_plan_id: Run plan ID of the gates. - :type run_plan_id: str - :param stabilization_completed_on: Gates stabilization completed date and time. - :type stabilization_completed_on: datetime - :param started_on: Gates evaluation started time. - :type started_on: datetime - :param status: Status of release gates. - :type status: object - :param succeeding_since: Date and time at which all gates executed successfully. - :type succeeding_since: datetime - """ - - _attribute_map = { - 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, - 'id': {'key': 'id', 'type': 'int'}, - 'ignored_gates': {'key': 'ignoredGates', 'type': '[IgnoredGate]'}, - 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, - 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, - 'stabilization_completed_on': {'key': 'stabilizationCompletedOn', 'type': 'iso-8601'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'succeeding_since': {'key': 'succeedingSince', 'type': 'iso-8601'} - } - - def __init__(self, deployment_jobs=None, id=None, ignored_gates=None, last_modified_on=None, run_plan_id=None, stabilization_completed_on=None, started_on=None, status=None, succeeding_since=None): - super(ReleaseGates, self).__init__() - self.deployment_jobs = deployment_jobs - self.id = id - self.ignored_gates = ignored_gates - self.last_modified_on = last_modified_on - self.run_plan_id = run_plan_id - self.stabilization_completed_on = stabilization_completed_on - self.started_on = started_on - self.status = status - self.succeeding_since = succeeding_since - - -class ReleaseReference(Model): - """ - :param _links: Gets links to access the release. - :type _links: :class:`ReferenceLinks ` - :param artifacts: Gets list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param created_by: Gets the identity who created release. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on when this release created. - :type created_on: datetime - :param description: Gets description. - :type description: str - :param id: ID of the Release. - :type id: int - :param modified_by: Gets the identity who modified release. - :type modified_by: :class:`IdentityRef ` - :param name: Gets name of release. - :type name: str - :param reason: Gets reason for release. - :type reason: object - :param release_definition: Gets release definition shallow reference. - :type release_definition: :class:`ReleaseDefinitionShallowReference ` - :param url: - :type url: str - :param web_access_uri: - :type web_access_uri: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'name': {'key': 'name', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, - 'url': {'key': 'url', 'type': 'str'}, - 'web_access_uri': {'key': 'webAccessUri', 'type': 'str'} - } - - def __init__(self, _links=None, artifacts=None, created_by=None, created_on=None, description=None, id=None, modified_by=None, name=None, reason=None, release_definition=None, url=None, web_access_uri=None): - super(ReleaseReference, self).__init__() - self._links = _links - self.artifacts = artifacts - self.created_by = created_by - self.created_on = created_on - self.description = description - self.id = id - self.modified_by = modified_by - self.name = name - self.reason = reason - self.release_definition = release_definition - self.url = url - self.web_access_uri = web_access_uri - - -class ReleaseRevision(Model): - """ - :param changed_by: Gets or sets the identity who changed. - :type changed_by: :class:`IdentityRef ` - :param changed_date: Change date of the revision. - :type changed_date: datetime - :param change_details: Change details of the revision. - :type change_details: str - :param change_type: Change details of the revision. Typically ChangeDetails values are Add and Update. - :type change_type: str - :param comment: Comment of the revision. - :type comment: str - :param definition_snapshot_revision: Release ID of which this revision belongs. - :type definition_snapshot_revision: int - :param release_id: Gets or sets the release ID of which this revision belongs. - :type release_id: int - """ - - _attribute_map = { - 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, - 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, - 'change_details': {'key': 'changeDetails', 'type': 'str'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, - 'release_id': {'key': 'releaseId', 'type': 'int'} - } - - def __init__(self, changed_by=None, changed_date=None, change_details=None, change_type=None, comment=None, definition_snapshot_revision=None, release_id=None): - super(ReleaseRevision, self).__init__() - self.changed_by = changed_by - self.changed_date = changed_date - self.change_details = change_details - self.change_type = change_type - self.comment = comment - self.definition_snapshot_revision = definition_snapshot_revision - self.release_id = release_id - - -class ReleaseSchedule(Model): - """ - :param days_to_release: Days of the week to release. - :type days_to_release: object - :param job_id: Team Foundation Job Definition Job Id. - :type job_id: str - :param schedule_only_with_changes: Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed. - :type schedule_only_with_changes: bool - :param start_hours: Local time zone hour to start. - :type start_hours: int - :param start_minutes: Local time zone minute to start. - :type start_minutes: int - :param time_zone_id: Time zone Id of release schedule, such as 'UTC'. - :type time_zone_id: str - """ - - _attribute_map = { - 'days_to_release': {'key': 'daysToRelease', 'type': 'object'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'schedule_only_with_changes': {'key': 'scheduleOnlyWithChanges', 'type': 'bool'}, - 'start_hours': {'key': 'startHours', 'type': 'int'}, - 'start_minutes': {'key': 'startMinutes', 'type': 'int'}, - 'time_zone_id': {'key': 'timeZoneId', 'type': 'str'} - } - - def __init__(self, days_to_release=None, job_id=None, schedule_only_with_changes=None, start_hours=None, start_minutes=None, time_zone_id=None): - super(ReleaseSchedule, self).__init__() - self.days_to_release = days_to_release - self.job_id = job_id - self.schedule_only_with_changes = schedule_only_with_changes - self.start_hours = start_hours - self.start_minutes = start_minutes - self.time_zone_id = time_zone_id - - -class ReleaseSettings(Model): - """ - :param compliance_settings: Release Compliance settings. - :type compliance_settings: :class:`ComplianceSettings ` - :param retention_settings: Release retention settings. - :type retention_settings: :class:`RetentionSettings ` - """ - - _attribute_map = { - 'compliance_settings': {'key': 'complianceSettings', 'type': 'ComplianceSettings'}, - 'retention_settings': {'key': 'retentionSettings', 'type': 'RetentionSettings'} - } - - def __init__(self, compliance_settings=None, retention_settings=None): - super(ReleaseSettings, self).__init__() - self.compliance_settings = compliance_settings - self.retention_settings = retention_settings - - -class ReleaseShallowReference(Model): - """ - :param _links: Gets the links to related resources, APIs, and views for the release. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release. - :type id: int - :param name: Gets or sets the name of the release. - :type name: str - :param url: Gets the REST API url to access the release. - :type url: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, _links=None, id=None, name=None, url=None): - super(ReleaseShallowReference, self).__init__() - self._links = _links - self.id = id - self.name = name - self.url = url - - -class ReleaseStartEnvironmentMetadata(Model): - """ - :param definition_environment_id: Sets release definition environment id. - :type definition_environment_id: int - :param variables: Sets list of environments variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, definition_environment_id=None, variables=None): - super(ReleaseStartEnvironmentMetadata, self).__init__() - self.definition_environment_id = definition_environment_id - self.variables = variables - - -class ReleaseStartMetadata(Model): - """ - :param artifacts: Sets list of artifact to create a release. - :type artifacts: list of :class:`ArtifactMetadata ` - :param created_for: Optionally provide a requestor identity - :type created_for: str - :param definition_id: Sets definition Id to create a release. - :type definition_id: int - :param description: Sets description to create a release. - :type description: str - :param environments_metadata: Sets list of environments meta data. - :type environments_metadata: list of :class:`ReleaseStartEnvironmentMetadata ` - :param is_draft: Sets 'true' to create release in draft mode, 'false' otherwise. - :type is_draft: bool - :param manual_environments: Sets list of environments to manual as condition. - :type manual_environments: list of str - :param properties: - :type properties: :class:`object ` - :param reason: Sets reason to create a release. - :type reason: object - :param variables: Sets list of release variables to be overridden at deployment time. - :type variables: dict - """ - - _attribute_map = { - 'artifacts': {'key': 'artifacts', 'type': '[ArtifactMetadata]'}, - 'created_for': {'key': 'createdFor', 'type': 'str'}, - 'definition_id': {'key': 'definitionId', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments_metadata': {'key': 'environmentsMetadata', 'type': '[ReleaseStartEnvironmentMetadata]'}, - 'is_draft': {'key': 'isDraft', 'type': 'bool'}, - 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'reason': {'key': 'reason', 'type': 'object'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, artifacts=None, created_for=None, definition_id=None, description=None, environments_metadata=None, is_draft=None, manual_environments=None, properties=None, reason=None, variables=None): - super(ReleaseStartMetadata, self).__init__() - self.artifacts = artifacts - self.created_for = created_for - self.definition_id = definition_id - self.description = description - self.environments_metadata = environments_metadata - self.is_draft = is_draft - self.manual_environments = manual_environments - self.properties = properties - self.reason = reason - self.variables = variables - - -class ReleaseTask(Model): - """ - :param agent_name: Agent name on which task executed. - :type agent_name: str - :param date_ended: - :type date_ended: datetime - :param date_started: - :type date_started: datetime - :param finish_time: Finish time of the release task. - :type finish_time: datetime - :param id: ID of the release task. - :type id: int - :param issues: List of issues occurred while execution of task. - :type issues: list of :class:`Issue ` - :param line_count: Number of lines log release task has. - :type line_count: long - :param log_url: Log URL of the task. - :type log_url: str - :param name: Name of the task. - :type name: str - :param percent_complete: Task execution complete precent. - :type percent_complete: int - :param rank: Rank of the release task. - :type rank: int - :param result_code: Result code of the task. - :type result_code: str - :param start_time: ID of the release task. - :type start_time: datetime - :param status: Status of release task. - :type status: object - :param task: Workflow task reference. - :type task: :class:`WorkflowTaskReference ` - :param timeline_record_id: Timeline record ID of the release task. - :type timeline_record_id: str - """ - - _attribute_map = { - 'agent_name': {'key': 'agentName', 'type': 'str'}, - 'date_ended': {'key': 'dateEnded', 'type': 'iso-8601'}, - 'date_started': {'key': 'dateStarted', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'int'}, - 'issues': {'key': 'issues', 'type': '[Issue]'}, - 'line_count': {'key': 'lineCount', 'type': 'long'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'object'}, - 'task': {'key': 'task', 'type': 'WorkflowTaskReference'}, - 'timeline_record_id': {'key': 'timelineRecordId', 'type': 'str'} - } - - def __init__(self, agent_name=None, date_ended=None, date_started=None, finish_time=None, id=None, issues=None, line_count=None, log_url=None, name=None, percent_complete=None, rank=None, result_code=None, start_time=None, status=None, task=None, timeline_record_id=None): - super(ReleaseTask, self).__init__() - self.agent_name = agent_name - self.date_ended = date_ended - self.date_started = date_started - self.finish_time = finish_time - self.id = id - self.issues = issues - self.line_count = line_count - self.log_url = log_url - self.name = name - self.percent_complete = percent_complete - self.rank = rank - self.result_code = result_code - self.start_time = start_time - self.status = status - self.task = task - self.timeline_record_id = timeline_record_id - - -class ReleaseTaskAttachment(Model): - """ - :param _links: Reference links of task. - :type _links: :class:`ReferenceLinks ` - :param created_on: Data and time when it created. - :type created_on: datetime - :param modified_by: Identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Data and time when modified. - :type modified_on: datetime - :param name: Name of the task attachment. - :type name: str - :param record_id: Record ID of the task. - :type record_id: str - :param timeline_id: Timeline ID of the task. - :type timeline_id: str - :param type: Type of task attachment. - :type type: str - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'record_id': {'key': 'recordId', 'type': 'str'}, - 'timeline_id': {'key': 'timelineId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, _links=None, created_on=None, modified_by=None, modified_on=None, name=None, record_id=None, timeline_id=None, type=None): - super(ReleaseTaskAttachment, self).__init__() - self._links = _links - self.created_on = created_on - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.record_id = record_id - self.timeline_id = timeline_id - self.type = type - - -class ReleaseUpdateMetadata(Model): - """ - :param comment: Sets comment for release. - :type comment: str - :param keep_forever: Set 'true' to exclude the release from retention policies. - :type keep_forever: bool - :param manual_environments: Sets list of manual environments. - :type manual_environments: list of str - :param name: Sets name of the release. - :type name: str - :param status: Sets status of the release. - :type status: object - """ - - _attribute_map = { - 'comment': {'key': 'comment', 'type': 'str'}, - 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, - 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'} - } - - def __init__(self, comment=None, keep_forever=None, manual_environments=None, name=None, status=None): - super(ReleaseUpdateMetadata, self).__init__() - self.comment = comment - self.keep_forever = keep_forever - self.manual_environments = manual_environments - self.name = name - self.status = status - - -class ReleaseWorkItemRef(Model): - """ - :param assignee: - :type assignee: str - :param id: Gets or sets the ID. - :type id: str - :param provider: Gets or sets the provider. - :type provider: str - :param state: Gets or sets the state. - :type state: str - :param title: Gets or sets the title. - :type title: str - :param type: Gets or sets the type. - :type type: str - :param url: Gets or sets the workitem url. - :type url: str - """ - - _attribute_map = { - 'assignee': {'key': 'assignee', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} - } - - def __init__(self, assignee=None, id=None, provider=None, state=None, title=None, type=None, url=None): - super(ReleaseWorkItemRef, self).__init__() - self.assignee = assignee - self.id = id - self.provider = provider - self.state = state - self.title = title - self.type = type - self.url = url - - -class RetentionPolicy(Model): - """ - :param days_to_keep: Indicates the number of days to keep deployment. - :type days_to_keep: int - """ - - _attribute_map = { - 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'} - } - - def __init__(self, days_to_keep=None): - super(RetentionPolicy, self).__init__() - self.days_to_keep = days_to_keep - - -class RetentionSettings(Model): - """ - :param days_to_keep_deleted_releases: Number of days to keep deleted releases. - :type days_to_keep_deleted_releases: int - :param default_environment_retention_policy: Specifies the default environment retention policy. - :type default_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` - :param maximum_environment_retention_policy: Specifies the maximum environment retention policy. - :type maximum_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` - """ - - _attribute_map = { - 'days_to_keep_deleted_releases': {'key': 'daysToKeepDeletedReleases', 'type': 'int'}, - 'default_environment_retention_policy': {'key': 'defaultEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, - 'maximum_environment_retention_policy': {'key': 'maximumEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'} - } - - def __init__(self, days_to_keep_deleted_releases=None, default_environment_retention_policy=None, maximum_environment_retention_policy=None): - super(RetentionSettings, self).__init__() - self.days_to_keep_deleted_releases = days_to_keep_deleted_releases - self.default_environment_retention_policy = default_environment_retention_policy - self.maximum_environment_retention_policy = maximum_environment_retention_policy - - -class SourcePullRequestVersion(Model): - """ - :param iteration_id: Pull Request Iteration Id for which the release will publish status. - :type iteration_id: str - :param pull_request_id: Pull Request Id for which the release will publish status. - :type pull_request_id: str - :param pull_request_merged_at: Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request. - :type pull_request_merged_at: datetime - :param source_branch: Source branch of the Pull Request. - :type source_branch: str - :param source_branch_commit_id: Source branch commit Id of the Pull Request for which the release will publish status. - :type source_branch_commit_id: str - :param target_branch: Target branch of the Pull Request. - :type target_branch: str - """ - - _attribute_map = { - 'iteration_id': {'key': 'iterationId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', 'type': 'str'}, - 'pull_request_merged_at': {'key': 'pullRequestMergedAt', 'type': 'iso-8601'}, - 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, - 'source_branch_commit_id': {'key': 'sourceBranchCommitId', 'type': 'str'}, - 'target_branch': {'key': 'targetBranch', 'type': 'str'} - } - - def __init__(self, iteration_id=None, pull_request_id=None, pull_request_merged_at=None, source_branch=None, source_branch_commit_id=None, target_branch=None): - super(SourcePullRequestVersion, self).__init__() - self.iteration_id = iteration_id - self.pull_request_id = pull_request_id - self.pull_request_merged_at = pull_request_merged_at - self.source_branch = source_branch - self.source_branch_commit_id = source_branch_commit_id - self.target_branch = target_branch - - -class SummaryMailSection(Model): - """ - :param html_content: Html content of summary mail. - :type html_content: str - :param rank: Rank of the summary mail. - :type rank: int - :param section_type: Summary mail section type. MailSectionType has section types. - :type section_type: object - :param title: Title of the summary mail. - :type title: str - """ - - _attribute_map = { - 'html_content': {'key': 'htmlContent', 'type': 'str'}, - 'rank': {'key': 'rank', 'type': 'int'}, - 'section_type': {'key': 'sectionType', 'type': 'object'}, - 'title': {'key': 'title', 'type': 'str'} - } - - def __init__(self, html_content=None, rank=None, section_type=None, title=None): - super(SummaryMailSection, self).__init__() - self.html_content = html_content - self.rank = rank - self.section_type = section_type - self.title = title - - -class TaskInputDefinitionBase(Model): - """ - :param aliases: - :type aliases: list of str - :param default_value: - :type default_value: str - :param group_name: - :type group_name: str - :param help_mark_down: - :type help_mark_down: str - :param label: - :type label: str - :param name: - :type name: str - :param options: - :type options: dict - :param properties: - :type properties: dict - :param required: - :type required: bool - :param type: - :type type: str - :param validation: - :type validation: :class:`TaskInputValidation ` - :param visible_rule: - :type visible_rule: str - """ - - _attribute_map = { - 'aliases': {'key': 'aliases', 'type': '[str]'}, - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'options': {'key': 'options', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'required': {'key': 'required', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, - 'visible_rule': {'key': 'visibleRule', 'type': 'str'} - } - - def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): - super(TaskInputDefinitionBase, self).__init__() - self.aliases = aliases - self.default_value = default_value - self.group_name = group_name - self.help_mark_down = help_mark_down - self.label = label - self.name = name - self.options = options - self.properties = properties - self.required = required - self.type = type - self.validation = validation - self.visible_rule = visible_rule - - -class TaskInputValidation(Model): - """ - :param expression: Conditional expression - :type expression: str - :param message: Message explaining how user can correct if validation fails - :type message: str - """ - - _attribute_map = { - 'expression': {'key': 'expression', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'} - } - - def __init__(self, expression=None, message=None): - super(TaskInputValidation, self).__init__() - self.expression = expression - self.message = message - - -class TaskSourceDefinitionBase(Model): - """ - :param auth_key: - :type auth_key: str - :param endpoint: - :type endpoint: str - :param key_selector: - :type key_selector: str - :param selector: - :type selector: str - :param target: - :type target: str - """ - - _attribute_map = { - 'auth_key': {'key': 'authKey', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'key_selector': {'key': 'keySelector', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'} - } - - def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): - super(TaskSourceDefinitionBase, self).__init__() - self.auth_key = auth_key - self.endpoint = endpoint - self.key_selector = key_selector - self.selector = selector - self.target = target - - -class VariableGroup(Model): - """ - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param description: Gets or sets description. - :type description: str - :param id: Gets the unique identifier of this field. - :type id: int - :param is_shared: Denotes if a variable group is shared with other project or not. - :type is_shared: bool - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param name: Gets or sets name. - :type name: str - :param provider_data: Gets or sets provider data. - :type provider_data: :class:`VariableGroupProviderData ` - :param type: Gets or sets type. - :type type: str - :param variable_group_project_references: all project references where the variable group is shared with other projects. - :type variable_group_project_references: list of :class:`VariableGroupProjectReference ` - :param variables: Gets and sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'is_shared': {'key': 'isShared', 'type': 'bool'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provider_data': {'key': 'providerData', 'type': 'VariableGroupProviderData'}, - 'type': {'key': 'type', 'type': 'str'}, - 'variable_group_project_references': {'key': 'variableGroupProjectReferences', 'type': '[VariableGroupProjectReference]'}, - 'variables': {'key': 'variables', 'type': '{VariableValue}'} - } - - def __init__(self, created_by=None, created_on=None, description=None, id=None, is_shared=None, modified_by=None, modified_on=None, name=None, provider_data=None, type=None, variable_group_project_references=None, variables=None): - super(VariableGroup, self).__init__() - self.created_by = created_by - self.created_on = created_on - self.description = description - self.id = id - self.is_shared = is_shared - self.modified_by = modified_by - self.modified_on = modified_on - self.name = name - self.provider_data = provider_data - self.type = type - self.variable_group_project_references = variable_group_project_references - self.variables = variables - - -class VariableGroupProjectReference(Model): - """ - A variable group reference is a shallow reference to variable group. - - :param description: Gets or sets description of the variable group. - :type description: str - :param name: Gets or sets name of the variable group. - :type name: str - :param project_reference: Gets or sets project reference of the variable group. - :type project_reference: :class:`ProjectReference ` - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'} - } - - def __init__(self, description=None, name=None, project_reference=None): - super(VariableGroupProjectReference, self).__init__() - self.description = description - self.name = name - self.project_reference = project_reference - - -class VariableGroupProviderData(Model): - """ - """ - - _attribute_map = { - } - - def __init__(self): - super(VariableGroupProviderData, self).__init__() - - -class VariableValue(Model): - """ - :param is_read_only: Gets or sets if the variable is read only or not. - :type is_read_only: bool - :param is_secret: Gets or sets as the variable is secret or not. - :type is_secret: bool - :param value: Gets or sets the value. - :type value: str - """ - - _attribute_map = { - 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, is_read_only=None, is_secret=None, value=None): - super(VariableValue, self).__init__() - self.is_read_only = is_read_only - self.is_secret = is_secret - self.value = value - - -class WorkflowTask(Model): - """ - :param always_run: Gets or sets as the task always run or not. - :type always_run: bool - :param condition: Gets or sets the task condition. - :type condition: str - :param continue_on_error: Gets or sets as the task continue run on error or not. - :type continue_on_error: bool - :param definition_type: Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'. - :type definition_type: str - :param enabled: Gets or sets as the task enabled or not. - :type enabled: bool - :param environment: Gets or sets the task environment variables. - :type environment: dict - :param inputs: Gets or sets the task inputs. - :type inputs: dict - :param name: Gets or sets the name of the task. - :type name: str - :param override_inputs: Gets or sets the task override inputs. - :type override_inputs: dict - :param ref_name: Gets or sets the reference name of the task. - :type ref_name: str - :param task_id: Gets or sets the ID of the task. - :type task_id: str - :param timeout_in_minutes: Gets or sets the task timeout. - :type timeout_in_minutes: int - :param version: Gets or sets the version of the task. - :type version: str - """ - - _attribute_map = { - 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, - 'condition': {'key': 'condition', 'type': 'str'}, - 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, - 'definition_type': {'key': 'definitionType', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'environment': {'key': 'environment', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{str}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'override_inputs': {'key': 'overrideInputs', 'type': '{str}'}, - 'ref_name': {'key': 'refName', 'type': 'str'}, - 'task_id': {'key': 'taskId', 'type': 'str'}, - 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, always_run=None, condition=None, continue_on_error=None, definition_type=None, enabled=None, environment=None, inputs=None, name=None, override_inputs=None, ref_name=None, task_id=None, timeout_in_minutes=None, version=None): - super(WorkflowTask, self).__init__() - self.always_run = always_run - self.condition = condition - self.continue_on_error = continue_on_error - self.definition_type = definition_type - self.enabled = enabled - self.environment = environment - self.inputs = inputs - self.name = name - self.override_inputs = override_inputs - self.ref_name = ref_name - self.task_id = task_id - self.timeout_in_minutes = timeout_in_minutes - self.version = version - - -class WorkflowTaskReference(Model): - """ - :param id: Task identifier. - :type id: str - :param name: Name of the task. - :type name: str - :param version: Version of the task. - :type version: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, id=None, name=None, version=None): - super(WorkflowTaskReference, self).__init__() - self.id = id - self.name = name - self.version = version - - -class ReleaseDefinition(ReleaseDefinitionShallowReference): - """ - :param _links: Gets the links to related resources, APIs, and views for the release definition. - :type _links: :class:`ReferenceLinks ` - :param id: Gets the unique identifier of release definition. - :type id: int - :param name: Gets or sets the name of the release definition. - :type name: str - :param path: Gets or sets the path of the release definition. - :type path: str - :param project_reference: Gets or sets project reference. - :type project_reference: :class:`ProjectReference ` - :param url: Gets the REST API url to access the release definition. - :type url: str - :param artifacts: Gets or sets the list of artifacts. - :type artifacts: list of :class:`Artifact ` - :param comment: Gets or sets comment. - :type comment: str - :param created_by: Gets or sets the identity who created. - :type created_by: :class:`IdentityRef ` - :param created_on: Gets date on which it got created. - :type created_on: datetime - :param description: Gets or sets the description. - :type description: str - :param environments: Gets or sets the list of environments. - :type environments: list of :class:`ReleaseDefinitionEnvironment ` - :param is_deleted: Whether release definition is deleted. - :type is_deleted: bool - :param last_release: Gets the reference of last release. - :type last_release: :class:`ReleaseReference ` - :param modified_by: Gets or sets the identity who modified. - :type modified_by: :class:`IdentityRef ` - :param modified_on: Gets date on which it got modified. - :type modified_on: datetime - :param pipeline_process: Gets or sets pipeline process. - :type pipeline_process: :class:`PipelineProcess ` - :param properties: Gets or sets properties. - :type properties: :class:`object ` - :param release_name_format: Gets or sets the release name format. - :type release_name_format: str - :param retention_policy: - :type retention_policy: :class:`RetentionPolicy ` - :param revision: Gets the revision number. - :type revision: int - :param source: Gets or sets source of release definition. - :type source: object - :param tags: Gets or sets list of tags. - :type tags: list of str - :param triggers: Gets or sets the list of triggers. - :type triggers: list of :class:`object ` - :param variable_groups: Gets or sets the list of variable groups. - :type variable_groups: list of int - :param variables: Gets or sets the dictionary of variables. - :type variables: dict - """ - - _attribute_map = { - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, - 'url': {'key': 'url', 'type': 'str'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironment]'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_release': {'key': 'lastRelease', 'type': 'ReleaseReference'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'pipeline_process': {'key': 'pipelineProcess', 'type': 'PipelineProcess'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'source': {'key': 'source', 'type': 'object'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'triggers': {'key': 'triggers', 'type': '[object]'}, - 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, - 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} - } - - def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None, artifacts=None, comment=None, created_by=None, created_on=None, description=None, environments=None, is_deleted=None, last_release=None, modified_by=None, modified_on=None, pipeline_process=None, properties=None, release_name_format=None, retention_policy=None, revision=None, source=None, tags=None, triggers=None, variable_groups=None, variables=None): - super(ReleaseDefinition, self).__init__(_links=_links, id=id, name=name, path=path, project_reference=project_reference, url=url) - self.artifacts = artifacts - self.comment = comment - self.created_by = created_by - self.created_on = created_on - self.description = description - self.environments = environments - self.is_deleted = is_deleted - self.last_release = last_release - self.modified_by = modified_by - self.modified_on = modified_on - self.pipeline_process = pipeline_process - self.properties = properties - self.release_name_format = release_name_format - self.retention_policy = retention_policy - self.revision = revision - self.source = source - self.tags = tags - self.triggers = triggers - self.variable_groups = variable_groups - self.variables = variables - - -class ReleaseDefinitionApprovalStep(ReleaseDefinitionEnvironmentStep): - """ - :param id: ID of the approval or deploy step. - :type id: int - :param approver: Gets and sets the approver. - :type approver: :class:`IdentityRef ` - :param is_automated: Indicates whether the approval automated. - :type is_automated: bool - :param is_notification_on: Indicates whether the approval notification set. - :type is_notification_on: bool - :param rank: Gets or sets the rank of approval step. - :type rank: int - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'approver': {'key': 'approver', 'type': 'IdentityRef'}, - 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, - 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, - 'rank': {'key': 'rank', 'type': 'int'} - } - - def __init__(self, id=None, approver=None, is_automated=None, is_notification_on=None, rank=None): - super(ReleaseDefinitionApprovalStep, self).__init__(id=id) - self.approver = approver - self.is_automated = is_automated - self.is_notification_on = is_notification_on - self.rank = rank - - -class ReleaseDefinitionDeployStep(ReleaseDefinitionEnvironmentStep): - """ - :param id: ID of the approval or deploy step. - :type id: int - :param tasks: The list of steps for this definition. - :type tasks: list of :class:`WorkflowTask ` - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} - } - - def __init__(self, id=None, tasks=None): - super(ReleaseDefinitionDeployStep, self).__init__(id=id) - self.tasks = tasks - - -__all__ = [ - 'AgentArtifactDefinition', - 'ApprovalOptions', - 'Artifact', - 'ArtifactMetadata', - 'ArtifactSourceReference', - 'ArtifactTriggerConfiguration', - 'ArtifactTypeDefinition', - 'ArtifactVersion', - 'ArtifactVersionQueryResult', - 'AuthorizationHeader', - 'AutoTriggerIssue', - 'BuildVersion', - 'Change', - 'ComplianceSettings', - 'Condition', - 'ConfigurationVariableValue', - 'DataSourceBindingBase', - 'DefinitionEnvironmentReference', - 'Deployment', - 'DeploymentAttempt', - 'DeploymentJob', - 'DeploymentQueryParameters', - 'EmailRecipients', - 'EnvironmentExecutionPolicy', - 'EnvironmentOptions', - 'EnvironmentRetentionPolicy', - 'EnvironmentTrigger', - 'FavoriteItem', - 'Folder', - 'GateUpdateMetadata', - 'GraphSubjectBase', - 'IdentityRef', - 'IgnoredGate', - 'InputDescriptor', - 'InputValidation', - 'InputValue', - 'InputValues', - 'InputValuesError', - 'InputValuesQuery', - 'Issue', - 'MailMessage', - 'ManualIntervention', - 'ManualInterventionUpdateMetadata', - 'Metric', - 'OrgPipelineReleaseSettings', - 'OrgPipelineReleaseSettingsUpdateParameters', - 'PipelineProcess', - 'ProcessParameters', - 'ProjectPipelineReleaseSettings', - 'ProjectPipelineReleaseSettingsUpdateParameters', - 'ProjectReference', - 'QueuedReleaseData', - 'ReferenceLinks', - 'Release', - 'ReleaseApproval', - 'ReleaseApprovalHistory', - 'ReleaseCondition', - 'ReleaseDefinitionApprovals', - 'ReleaseDefinitionEnvironment', - 'ReleaseDefinitionEnvironmentStep', - 'ReleaseDefinitionEnvironmentSummary', - 'ReleaseDefinitionEnvironmentTemplate', - 'ReleaseDefinitionGate', - 'ReleaseDefinitionGatesOptions', - 'ReleaseDefinitionGatesStep', - 'ReleaseDefinitionRevision', - 'ReleaseDefinitionShallowReference', - 'ReleaseDefinitionSummary', - 'ReleaseDefinitionUndeleteParameter', - 'ReleaseDeployPhase', - 'ReleaseEnvironment', - 'ReleaseEnvironmentShallowReference', - 'ReleaseEnvironmentUpdateMetadata', - 'ReleaseGates', - 'ReleaseReference', - 'ReleaseRevision', - 'ReleaseSchedule', - 'ReleaseSettings', - 'ReleaseShallowReference', - 'ReleaseStartEnvironmentMetadata', - 'ReleaseStartMetadata', - 'ReleaseTask', - 'ReleaseTaskAttachment', - 'ReleaseUpdateMetadata', - 'ReleaseWorkItemRef', - 'RetentionPolicy', - 'RetentionSettings', - 'SourcePullRequestVersion', - 'SummaryMailSection', - 'TaskInputDefinitionBase', - 'TaskInputValidation', - 'TaskSourceDefinitionBase', - 'VariableGroup', - 'VariableGroupProjectReference', - 'VariableGroupProviderData', - 'VariableValue', - 'WorkflowTask', - 'WorkflowTaskReference', - 'ReleaseDefinition', - 'ReleaseDefinitionApprovalStep', - 'ReleaseDefinitionDeployStep', -] diff --git a/azure-devops/azure/devops/v6_0/release/release_client.py b/azure-devops/azure/devops/v6_0/release/release_client.py deleted file mode 100644 index a0381949..00000000 --- a/azure-devops/azure/devops/v6_0/release/release_client.py +++ /dev/null @@ -1,872 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ReleaseClient(Client): - """Release - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(ReleaseClient, 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 = 'efc2f575-36ef-48e9-b672-0c6fb4a48ac5' - - def get_approvals(self, project, assigned_to_filter=None, status_filter=None, release_ids_filter=None, type_filter=None, top=None, continuation_token=None, query_order=None, include_my_group_approvals=None): - """GetApprovals. - [Preview API] Get a list of approvals - :param str project: Project ID or project name - :param str assigned_to_filter: Approvals assigned to this user. - :param str status_filter: Approvals with this status. Default is 'pending'. - :param [int] release_ids_filter: Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. - :param str type_filter: Approval with this type. - :param int top: Number of approvals to get. Default is 50. - :param int continuation_token: Gets the approvals after the continuation token provided. - :param str query_order: Gets the results in the defined order of created approvals. Default is 'descending'. - :param bool include_my_group_approvals: 'true' to include my group approvals. Default is 'false'. - :rtype: :class:`<[ReleaseApproval]> ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if assigned_to_filter is not None: - query_parameters['assignedToFilter'] = self._serialize.query('assigned_to_filter', assigned_to_filter, 'str') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') - if release_ids_filter is not None: - release_ids_filter = ",".join(map(str, release_ids_filter)) - query_parameters['releaseIdsFilter'] = self._serialize.query('release_ids_filter', release_ids_filter, 'str') - if type_filter is not None: - query_parameters['typeFilter'] = self._serialize.query('type_filter', type_filter, 'str') - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if include_my_group_approvals is not None: - query_parameters['includeMyGroupApprovals'] = self._serialize.query('include_my_group_approvals', include_my_group_approvals, 'bool') - response = self._send(http_method='GET', - location_id='b47c6458-e73b-47cb-a770-4df1e8813a91', - version='6.0-preview.3', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) - - def update_release_approval(self, approval, project, approval_id): - """UpdateReleaseApproval. - [Preview API] Update status of an approval - :param :class:` ` approval: ReleaseApproval object having status, approver and comments. - :param str project: Project ID or project name - :param int approval_id: Id of the approval. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if approval_id is not None: - route_values['approvalId'] = self._serialize.url('approval_id', approval_id, 'int') - content = self._serialize.body(approval, 'ReleaseApproval') - response = self._send(http_method='PATCH', - location_id='9328e074-59fb-465a-89d9-b09c82ee5109', - version='6.0-preview.3', - route_values=route_values, - content=content) - return self._deserialize('ReleaseApproval', response) - - def get_release_task_attachment_content(self, project, release_id, environment_id, attempt_id, plan_id, timeline_id, record_id, type, name, **kwargs): - """GetReleaseTaskAttachmentContent. - [Preview API] Get a release task attachment. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :param int attempt_id: Attempt number of deployment. - :param str plan_id: Plan Id of the deploy phase. - :param str timeline_id: Timeline Id of the task. - :param str record_id: Record Id of attachment. - :param str type: Type of the attachment. - :param str name: Name of the attachment. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if attempt_id is not None: - route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') - if plan_id is not None: - route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') - if timeline_id is not None: - route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') - if record_id is not None: - route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - if name is not None: - route_values['name'] = self._serialize.url('name', name, 'str') - response = self._send(http_method='GET', - location_id='60b86efb-7b8c-4853-8f9f-aa142b77b479', - version='6.0-preview.1', - route_values=route_values, - accept_media_type='application/octet-stream') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_release_task_attachments(self, project, release_id, environment_id, attempt_id, plan_id, type): - """GetReleaseTaskAttachments. - [Preview API] Get the release task attachments. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :param int attempt_id: Attempt number of deployment. - :param str plan_id: Plan Id of the deploy phase. - :param str type: Type of the attachment. - :rtype: [ReleaseTaskAttachment] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if attempt_id is not None: - route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') - if plan_id is not None: - route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') - if type is not None: - route_values['type'] = self._serialize.url('type', type, 'str') - response = self._send(http_method='GET', - location_id='a4d06688-0dfa-4895-82a5-f43ec9452306', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('[ReleaseTaskAttachment]', self._unwrap_collection(response)) - - def create_release_definition(self, release_definition, project): - """CreateReleaseDefinition. - [Preview API] Create a release definition - :param :class:` ` release_definition: release definition object to create. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_definition, 'ReleaseDefinition') - response = self._send(http_method='POST', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='6.0-preview.4', - route_values=route_values, - content=content) - return self._deserialize('ReleaseDefinition', response) - - def delete_release_definition(self, project, definition_id, comment=None, force_delete=None): - """DeleteReleaseDefinition. - [Preview API] Delete a release definition. - :param str project: Project ID or project name - :param int definition_id: Id of the release definition. - :param str comment: Comment for deleting a release definition. - :param bool force_delete: 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - query_parameters = {} - if comment is not None: - query_parameters['comment'] = self._serialize.query('comment', comment, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query('force_delete', force_delete, 'bool') - self._send(http_method='DELETE', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='6.0-preview.4', - route_values=route_values, - query_parameters=query_parameters) - - def get_release_definition(self, project, definition_id, property_filters=None): - """GetReleaseDefinition. - [Preview API] Get a release definition. - :param str project: Project ID or project name - :param int definition_id: Id of the release definition. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - query_parameters = {} - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - response = self._send(http_method='GET', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='6.0-preview.4', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('ReleaseDefinition', response) - - def get_release_definitions(self, project, search_text=None, expand=None, artifact_type=None, artifact_source_id=None, top=None, continuation_token=None, query_order=None, path=None, is_exact_name_match=None, tag_filter=None, property_filters=None, definition_id_filter=None, is_deleted=None, search_text_contains_folder_name=None): - """GetReleaseDefinitions. - [Preview API] Get a list of release definitions. - :param str project: Project ID or project name - :param str search_text: Get release definitions with names containing searchText. - :param str expand: The properties that should be expanded in the list of Release definitions. - :param str artifact_type: Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - :param str artifact_source_id: Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - :param int top: Number of release definitions to get. - :param str continuation_token: Gets the release definitions after the continuation token provided. - :param str query_order: Gets the results in the defined order. Default is 'IdAscending'. - :param str path: Gets the release definitions under the specified path. - :param bool is_exact_name_match: 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. - :param [str] tag_filter: A comma-delimited list of tags. Only release definitions with these tags will be returned. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. - :param [str] definition_id_filter: A comma-delimited list of release definitions to retrieve. - :param bool is_deleted: 'true' to get release definitions that has been deleted. Default is 'false' - :param bool search_text_contains_folder_name: 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. - :rtype: :class:`<[ReleaseDefinition]> ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if search_text is not None: - query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if artifact_type is not None: - query_parameters['artifactType'] = self._serialize.query('artifact_type', artifact_type, 'str') - if artifact_source_id is not None: - query_parameters['artifactSourceId'] = self._serialize.query('artifact_source_id', artifact_source_id, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - if is_exact_name_match is not None: - query_parameters['isExactNameMatch'] = self._serialize.query('is_exact_name_match', is_exact_name_match, 'bool') - if tag_filter is not None: - tag_filter = ",".join(tag_filter) - query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if definition_id_filter is not None: - definition_id_filter = ",".join(definition_id_filter) - query_parameters['definitionIdFilter'] = self._serialize.query('definition_id_filter', definition_id_filter, 'str') - if is_deleted is not None: - query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') - if search_text_contains_folder_name is not None: - query_parameters['searchTextContainsFolderName'] = self._serialize.query('search_text_contains_folder_name', search_text_contains_folder_name, 'bool') - response = self._send(http_method='GET', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='6.0-preview.4', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) - - def update_release_definition(self, release_definition, project): - """UpdateReleaseDefinition. - [Preview API] Update a release definition. - :param :class:` ` release_definition: Release definition object to update. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_definition, 'ReleaseDefinition') - response = self._send(http_method='PUT', - location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', - version='6.0-preview.4', - route_values=route_values, - content=content) - return self._deserialize('ReleaseDefinition', response) - - def get_deployments(self, project, definition_id=None, definition_environment_id=None, created_by=None, min_modified_time=None, max_modified_time=None, deployment_status=None, operation_status=None, latest_attempts_only=None, query_order=None, top=None, continuation_token=None, created_for=None, min_started_time=None, max_started_time=None, source_branch=None): - """GetDeployments. - [Preview API] - :param str project: Project ID or project name - :param int definition_id: - :param int definition_environment_id: - :param str created_by: - :param datetime min_modified_time: - :param datetime max_modified_time: - :param str deployment_status: - :param str operation_status: - :param bool latest_attempts_only: - :param str query_order: - :param int top: - :param int continuation_token: - :param str created_for: - :param datetime min_started_time: - :param datetime max_started_time: - :param str source_branch: - :rtype: :class:`<[Deployment]> ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if definition_id is not None: - query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') - if definition_environment_id is not None: - query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') - if created_by is not None: - query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') - if min_modified_time is not None: - query_parameters['minModifiedTime'] = self._serialize.query('min_modified_time', min_modified_time, 'iso-8601') - if max_modified_time is not None: - query_parameters['maxModifiedTime'] = self._serialize.query('max_modified_time', max_modified_time, 'iso-8601') - if deployment_status is not None: - query_parameters['deploymentStatus'] = self._serialize.query('deployment_status', deployment_status, 'str') - if operation_status is not None: - query_parameters['operationStatus'] = self._serialize.query('operation_status', operation_status, 'str') - if latest_attempts_only is not None: - query_parameters['latestAttemptsOnly'] = self._serialize.query('latest_attempts_only', latest_attempts_only, 'bool') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if created_for is not None: - query_parameters['createdFor'] = self._serialize.query('created_for', created_for, 'str') - if min_started_time is not None: - query_parameters['minStartedTime'] = self._serialize.query('min_started_time', min_started_time, 'iso-8601') - if max_started_time is not None: - query_parameters['maxStartedTime'] = self._serialize.query('max_started_time', max_started_time, 'iso-8601') - if source_branch is not None: - query_parameters['sourceBranch'] = self._serialize.query('source_branch', source_branch, 'str') - response = self._send(http_method='GET', - location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', - version='6.0-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[Deployment]', self._unwrap_collection(response)) - - def get_release_environment(self, project, release_id, environment_id): - """GetReleaseEnvironment. - [Preview API] Get a release environment. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of the release environment. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - response = self._send(http_method='GET', - location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', - version='6.0-preview.6', - route_values=route_values) - return self._deserialize('ReleaseEnvironment', response) - - def update_release_environment(self, environment_update_data, project, release_id, environment_id): - """UpdateReleaseEnvironment. - [Preview API] Update the status of a release environment - :param :class:` ` environment_update_data: Environment update meta data. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of release environment. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - content = self._serialize.body(environment_update_data, 'ReleaseEnvironmentUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', - version='6.0-preview.6', - route_values=route_values, - content=content) - return self._deserialize('ReleaseEnvironment', response) - - def delete_folder(self, project, path): - """DeleteFolder. - [Preview API] Deletes a definition folder for given folder name and path and all it's existing definitions. - :param str project: Project ID or project name - :param str path: Path of the folder to delete. - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - self._send(http_method='DELETE', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='6.0-preview.2', - route_values=route_values) - - def get_folders(self, project, path=None, query_order=None): - """GetFolders. - [Preview API] Gets folders. - :param str project: Project ID or project name - :param str path: Path of the folder. - :param str query_order: Gets the results in the defined order. Default is 'None'. - :rtype: [Folder] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - query_parameters = {} - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - response = self._send(http_method='GET', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='6.0-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[Folder]', self._unwrap_collection(response)) - - def update_folder(self, folder, project, path): - """UpdateFolder. - [Preview API] Updates an existing folder at given existing path. - :param :class:` ` folder: folder. - :param str project: Project ID or project name - :param str path: Path of the folder to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if path is not None: - route_values['path'] = self._serialize.url('path', path, 'str') - content = self._serialize.body(folder, 'Folder') - response = self._send(http_method='PATCH', - location_id='f7ddf76d-ce0c-4d68-94ff-becaec5d9dea', - version='6.0-preview.2', - route_values=route_values, - content=content) - return self._deserialize('Folder', response) - - def update_gates(self, gate_update_metadata, project, gate_step_id): - """UpdateGates. - [Preview API] Updates the gate for a deployment. - :param :class:` ` gate_update_metadata: Metadata to patch the Release Gates. - :param str project: Project ID or project name - :param int gate_step_id: Gate step Id. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if gate_step_id is not None: - route_values['gateStepId'] = self._serialize.url('gate_step_id', gate_step_id, 'int') - content = self._serialize.body(gate_update_metadata, 'GateUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='2666a539-2001-4f80-bcc7-0379956749d4', - version='6.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('ReleaseGates', response) - - def get_logs(self, project, release_id, **kwargs): - """GetLogs. - [Preview API] Get logs for a release Id. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - response = self._send(http_method='GET', - location_id='c37fbab5-214b-48e4-a55b-cb6b4f6e4038', - version='6.0-preview.2', - route_values=route_values, - accept_media_type='application/zip') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): - """GetTaskLog. - [Preview API] Gets the task log of a release as a plain text file. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int environment_id: Id of release environment. - :param int release_deploy_phase_id: Release deploy phase Id. - :param int task_id: ReleaseTask Id for the log. - :param long start_line: Starting line number for logs - :param long end_line: Ending line number for logs - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if environment_id is not None: - route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') - if release_deploy_phase_id is not None: - route_values['releaseDeployPhaseId'] = self._serialize.url('release_deploy_phase_id', release_deploy_phase_id, 'int') - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'int') - query_parameters = {} - if start_line is not None: - query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') - if end_line is not None: - query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') - response = self._send(http_method='GET', - location_id='17c91af7-09fd-4256-bff1-c24ee4f73bc0', - version='6.0-preview.2', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_manual_intervention(self, project, release_id, manual_intervention_id): - """GetManualIntervention. - [Preview API] Get manual intervention for a given release and manual intervention id. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if manual_intervention_id is not None: - route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') - response = self._send(http_method='GET', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('ManualIntervention', response) - - def get_manual_interventions(self, project, release_id): - """GetManualInterventions. - [Preview API] List all manual interventions for a given release. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :rtype: [ManualIntervention] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - response = self._send(http_method='GET', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('[ManualIntervention]', self._unwrap_collection(response)) - - def update_manual_intervention(self, manual_intervention_update_metadata, project, release_id, manual_intervention_id): - """UpdateManualIntervention. - [Preview API] Update manual intervention. - :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int manual_intervention_id: Id of the manual intervention. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - if manual_intervention_id is not None: - route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') - content = self._serialize.body(manual_intervention_update_metadata, 'ManualInterventionUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', - version='6.0-preview.1', - route_values=route_values, - content=content) - return self._deserialize('ManualIntervention', response) - - def get_releases(self, project=None, definition_id=None, definition_environment_id=None, search_text=None, created_by=None, status_filter=None, environment_status_filter=None, min_created_time=None, max_created_time=None, query_order=None, top=None, continuation_token=None, expand=None, artifact_type_id=None, source_id=None, artifact_version_id=None, source_branch_filter=None, is_deleted=None, tag_filter=None, property_filters=None, release_id_filter=None, path=None): - """GetReleases. - [Preview API] Get a list of releases - :param str project: Project ID or project name - :param int definition_id: Releases from this release definition Id. - :param int definition_environment_id: - :param str search_text: Releases with names containing searchText. - :param str created_by: Releases created by this user. - :param str status_filter: Releases that have this status. - :param int environment_status_filter: - :param datetime min_created_time: Releases that were created after this time. - :param datetime max_created_time: Releases that were created before this time. - :param str query_order: Gets the results in the defined order of created date for releases. Default is descending. - :param int top: Number of releases to get. Default is 50. - :param int continuation_token: Gets the releases after the continuation token provided. - :param str expand: The property that should be expanded in the list of releases. - :param str artifact_type_id: Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - :param str source_id: Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - :param str artifact_version_id: Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. - :param str source_branch_filter: Releases with given sourceBranchFilter will be returned. - :param bool is_deleted: Gets the soft deleted releases, if true. - :param [str] tag_filter: A comma-delimited list of tags. Only releases with these tags will be returned. - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. - :param [int] release_id_filter: A comma-delimited list of releases Ids. Only releases with these Ids will be returned. - :param str path: Releases under this folder path will be returned - :rtype: :class:`<[Release]> ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if definition_id is not None: - query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') - if definition_environment_id is not None: - query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') - if search_text is not None: - query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') - if created_by is not None: - query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') - if status_filter is not None: - query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') - if environment_status_filter is not None: - query_parameters['environmentStatusFilter'] = self._serialize.query('environment_status_filter', environment_status_filter, 'int') - if min_created_time is not None: - query_parameters['minCreatedTime'] = self._serialize.query('min_created_time', min_created_time, 'iso-8601') - if max_created_time is not None: - query_parameters['maxCreatedTime'] = self._serialize.query('max_created_time', max_created_time, 'iso-8601') - if query_order is not None: - query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if artifact_type_id is not None: - query_parameters['artifactTypeId'] = self._serialize.query('artifact_type_id', artifact_type_id, 'str') - if source_id is not None: - query_parameters['sourceId'] = self._serialize.query('source_id', source_id, 'str') - if artifact_version_id is not None: - query_parameters['artifactVersionId'] = self._serialize.query('artifact_version_id', artifact_version_id, 'str') - if source_branch_filter is not None: - query_parameters['sourceBranchFilter'] = self._serialize.query('source_branch_filter', source_branch_filter, 'str') - if is_deleted is not None: - query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') - if tag_filter is not None: - tag_filter = ",".join(tag_filter) - query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if release_id_filter is not None: - release_id_filter = ",".join(map(str, release_id_filter)) - query_parameters['releaseIdFilter'] = self._serialize.query('release_id_filter', release_id_filter, 'str') - if path is not None: - query_parameters['path'] = self._serialize.query('path', path, 'str') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[Release]', self._unwrap_collection(response)) - - def create_release(self, release_start_metadata, project): - """CreateRelease. - [Preview API] Create a release. - :param :class:` ` release_start_metadata: Metadata to create a release. - :param str project: Project ID or project name - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(release_start_metadata, 'ReleaseStartMetadata') - response = self._send(http_method='POST', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def get_release(self, project, release_id, approval_filters=None, property_filters=None, expand=None, top_gate_records=None): - """GetRelease. - [Preview API] Get a Release - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param str approval_filters: A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default - :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - :param str expand: A property that should be expanded in the release. - :param int top_gate_records: Number of release gate records to get. Default is 5. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - query_parameters = {} - if approval_filters is not None: - query_parameters['approvalFilters'] = self._serialize.query('approval_filters', approval_filters, 'str') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - if top_gate_records is not None: - query_parameters['$topGateRecords'] = self._serialize.query('top_gate_records', top_gate_records, 'int') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Release', response) - - def get_release_revision(self, project, release_id, definition_snapshot_revision, **kwargs): - """GetReleaseRevision. - [Preview API] Get release for a given revision number. - :param str project: Project ID or project name - :param int release_id: Id of the release. - :param int definition_snapshot_revision: Definition snapshot revision number. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - query_parameters = {} - if definition_snapshot_revision is not None: - query_parameters['definitionSnapshotRevision'] = self._serialize.query('definition_snapshot_revision', definition_snapshot_revision, 'int') - response = self._send(http_method='GET', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - query_parameters=query_parameters, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def update_release(self, release, project, release_id): - """UpdateRelease. - [Preview API] Update a complete release object. - :param :class:` ` release: Release object for update. - :param str project: Project ID or project name - :param int release_id: Id of the release to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - content = self._serialize.body(release, 'Release') - response = self._send(http_method='PUT', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def update_release_resource(self, release_update_metadata, project, release_id): - """UpdateReleaseResource. - [Preview API] Update few properties of a release. - :param :class:` ` release_update_metadata: Properties of release to update. - :param str project: Project ID or project name - :param int release_id: Id of the release to update. - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if release_id is not None: - route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') - content = self._serialize.body(release_update_metadata, 'ReleaseUpdateMetadata') - response = self._send(http_method='PATCH', - location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', - version='6.0-preview.8', - route_values=route_values, - content=content) - return self._deserialize('Release', response) - - def get_definition_revision(self, project, definition_id, revision, **kwargs): - """GetDefinitionRevision. - [Preview API] Get release definition for a given definitionId and revision - :param str project: Project ID or project name - :param int definition_id: Id of the definition. - :param int revision: Id of the revision. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - if revision is not None: - route_values['revision'] = self._serialize.url('revision', revision, 'int') - response = self._send(http_method='GET', - location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', - version='6.0-preview.1', - route_values=route_values, - accept_media_type='text/plain') - if "callback" in kwargs: - callback = kwargs["callback"] - else: - callback = None - return self._client.stream_download(response, callback=callback) - - def get_release_definition_history(self, project, definition_id): - """GetReleaseDefinitionHistory. - [Preview API] Get revision history for a release definition - :param str project: Project ID or project name - :param int definition_id: Id of the definition. - :rtype: [ReleaseDefinitionRevision] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - response = self._send(http_method='GET', - location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', - version='6.0-preview.1', - route_values=route_values) - return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v6_0/token_administration/models.py b/azure-devops/azure/devops/v6_0/token_administration/models.py deleted file mode 100644 index 01ba324f..00000000 --- a/azure-devops/azure/devops/v6_0/token_administration/models.py +++ /dev/null @@ -1,153 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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.serialization import Model - - -class SessionToken(Model): - """ - :param access_id: - :type access_id: str - :param alternate_token: This is populated when user requests a compact token. The alternate token value is self describing token. - :type alternate_token: str - :param authorization_id: - :type authorization_id: str - :param claims: - :type claims: dict - :param client_id: - :type client_id: str - :param display_name: - :type display_name: str - :param host_authorization_id: - :type host_authorization_id: str - :param is_public: - :type is_public: bool - :param is_valid: - :type is_valid: bool - :param public_data: - :type public_data: str - :param scope: - :type scope: str - :param source: - :type source: str - :param target_accounts: - :type target_accounts: list of str - :param token: This is computed and not returned in Get queries - :type token: str - :param user_id: - :type user_id: str - :param valid_from: - :type valid_from: datetime - :param valid_to: - :type valid_to: datetime - """ - - _attribute_map = { - 'access_id': {'key': 'accessId', 'type': 'str'}, - 'alternate_token': {'key': 'alternateToken', 'type': 'str'}, - 'authorization_id': {'key': 'authorizationId', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': '{str}'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'host_authorization_id': {'key': 'hostAuthorizationId', 'type': 'str'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, - 'is_valid': {'key': 'isValid', 'type': 'bool'}, - 'public_data': {'key': 'publicData', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target_accounts': {'key': 'targetAccounts', 'type': '[str]'}, - 'token': {'key': 'token', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} - } - - def __init__(self, access_id=None, alternate_token=None, authorization_id=None, claims=None, client_id=None, display_name=None, host_authorization_id=None, is_public=None, is_valid=None, public_data=None, scope=None, source=None, target_accounts=None, token=None, user_id=None, valid_from=None, valid_to=None): - super(SessionToken, self).__init__() - self.access_id = access_id - self.alternate_token = alternate_token - self.authorization_id = authorization_id - self.claims = claims - self.client_id = client_id - self.display_name = display_name - self.host_authorization_id = host_authorization_id - self.is_public = is_public - self.is_valid = is_valid - self.public_data = public_data - self.scope = scope - self.source = source - self.target_accounts = target_accounts - self.token = token - self.user_id = user_id - self.valid_from = valid_from - self.valid_to = valid_to - - -class TokenAdministrationRevocation(Model): - """ - :param audience: A list of audience (target accounts) to limit the revocations to - :type audience: list of str - :param authorization_ids: A list of authorization ID of the OAuth authorization to revoke. - :type authorization_ids: list of str - """ - - _attribute_map = { - 'audience': {'key': 'audience', 'type': '[str]'}, - 'authorization_ids': {'key': 'authorizationIds', 'type': '[str]'} - } - - def __init__(self, audience=None, authorization_ids=None): - super(TokenAdministrationRevocation, self).__init__() - self.audience = audience - self.authorization_ids = authorization_ids - - -class TokenAdminPagedSessionTokens(Model): - """ - A paginated list of session tokens. Session tokens correspond to OAuth credentials such as personal access tokens (PATs) and other OAuth authorizations. - - :param continuation_token: The continuation token that can be used to retrieve the next page of session tokens, or null if there is no next page. - :type continuation_token: str - :param value: The list of all session tokens in the current page. - :type value: list of :class:`SessionToken ` - """ - - _attribute_map = { - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SessionToken]'} - } - - def __init__(self, continuation_token=None, value=None): - super(TokenAdminPagedSessionTokens, self).__init__() - self.continuation_token = continuation_token - self.value = value - - -class TokenAdminRevocation(Model): - """ - A request to revoke a particular delegated authorization. - - :param authorization_id: The authorization ID of the OAuth authorization to revoke. - :type authorization_id: str - """ - - _attribute_map = { - 'authorization_id': {'key': 'authorizationId', 'type': 'str'} - } - - def __init__(self, authorization_id=None): - super(TokenAdminRevocation, self).__init__() - self.authorization_id = authorization_id - - -__all__ = [ - 'SessionToken', - 'TokenAdministrationRevocation', - 'TokenAdminPagedSessionTokens', - 'TokenAdminRevocation', -] diff --git a/azure-devops/azure/devops/v6_0/token_administration/token_administration_client.py b/azure-devops/azure/devops/v6_0/token_administration/token_administration_client.py deleted file mode 100644 index c72a973b..00000000 --- a/azure-devops/azure/devops/v6_0/token_administration/token_administration_client.py +++ /dev/null @@ -1,95 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 TokenAdministrationClient(Client): - """TokenAdministration - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(TokenAdministrationClient, 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 = '95935461-9e54-44bd-b9fb-04f4dd05d640' - - def list_identities_with_global_access_tokens(self, revocations, is_public=None): - """ListIdentitiesWithGlobalAccessTokens. - [Preview API] Revokes the listed OAuth authorizations. - :param [TokenAdminRevocation] revocations: The list of identities containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be checked for global access tokens. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: [str] - """ - query_parameters = {} - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(revocations, '[TokenAdminRevocation]') - response = self._send(http_method='POST', - location_id='30d3a12b-66c3-4669-b016-ecb0706c8d0f', - version='6.0-preview.1', - query_parameters=query_parameters, - content=content) - return self._deserialize('[str]', self._unwrap_collection(response)) - - def list_personal_access_tokens(self, audience, subject_descriptor, page_size=None, continuation_token=None, is_public=None): - """ListPersonalAccessTokens. - [Preview API] Lists of all the session token details of the personal access tokens (PATs) for a particular user. - :param [str] audience: - :param :class:` ` subject_descriptor: The descriptor of the target user. - :param int page_size: The maximum number of results to return on each page. - :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: :class:` ` - """ - route_values = {} - if subject_descriptor is not None: - route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') - query_parameters = {} - if page_size is not None: - query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(audience, '[str]') - response = self._send(http_method='POST', - location_id='1bb7db14-87c5-4762-bf77-a70ad34a9ab3', - version='6.0-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('TokenAdminPagedSessionTokens', response) - - def revoke_authorizations(self, revocations, host_id, is_public=None): - """RevokeAuthorizations. - [Preview API] Revokes the listed OAuth authorizations. - :param :class:` ` revocations: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked. - :param str host_id: Host Id to display on the notification page to manage tokens. - :param bool is_public: Set to false for PAT tokens and true for SSH tokens. - :rtype: [SessionToken] - """ - query_parameters = {} - if host_id is not None: - query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') - if is_public is not None: - query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') - content = self._serialize.body(revocations, 'TokenAdministrationRevocation') - response = self._send(http_method='POST', - location_id='a2e4520b-1cc8-4526-871e-f3a8f865f221', - version='6.0-preview.1', - query_parameters=query_parameters, - content=content) - return self._deserialize('[SessionToken]', self._unwrap_collection(response)) - diff --git a/azure-devops/azure/devops/v5_1/__init__.py b/azure-devops/azure/devops/v7_0/__init__.py similarity index 100% rename from azure-devops/azure/devops/v5_1/__init__.py rename to azure-devops/azure/devops/v7_0/__init__.py diff --git a/azure-devops/azure/devops/v5_1/accounts/__init__.py b/azure-devops/azure/devops/v7_0/accounts/__init__.py similarity index 100% rename from azure-devops/azure/devops/v5_1/accounts/__init__.py rename to azure-devops/azure/devops/v7_0/accounts/__init__.py diff --git a/azure-devops/azure/devops/v5_1/accounts/accounts_client.py b/azure-devops/azure/devops/v7_0/accounts/accounts_client.py similarity index 94% rename from azure-devops/azure/devops/v5_1/accounts/accounts_client.py rename to azure-devops/azure/devops/v7_0/accounts/accounts_client.py index bf218aae..0d9b8265 100644 --- a/azure-devops/azure/devops/v5_1/accounts/accounts_client.py +++ b/azure-devops/azure/devops/v7_0/accounts/accounts_client.py @@ -27,7 +27,7 @@ def __init__(self, base_url=None, creds=None): def get_accounts(self, owner_id=None, member_id=None, properties=None): """GetAccounts. - Get a list of accounts for a specific owner or a specific member. + Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: @@ -42,7 +42,7 @@ def get_accounts(self, owner_id=None, member_id=None, properties=None): query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) diff --git a/azure-devops/azure/devops/v5_1/accounts/models.py b/azure-devops/azure/devops/v7_0/accounts/models.py similarity index 97% rename from azure-devops/azure/devops/v5_1/accounts/models.py rename to azure-devops/azure/devops/v7_0/accounts/models.py index 07715637..6d5c5bd9 100644 --- a/azure-devops/azure/devops/v5_1/accounts/models.py +++ b/azure-devops/azure/devops/v7_0/accounts/models.py @@ -40,7 +40,7 @@ class Account(Model): :param organization_name: Organization that created the account :type organization_name: str :param properties: Extended properties - :type properties: :class:`object ` + :type properties: :class:`object ` :param status_reason: Reason for current status :type status_reason: str """ @@ -93,9 +93,9 @@ class AccountCreateInfoInternal(Model): :param organization: :type organization: str :param preferences: - :type preferences: :class:`AccountPreferencesInternal ` + :type preferences: :class:`AccountPreferencesInternal ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param service_definitions: :type service_definitions: list of { key: str; value: str } """ diff --git a/azure-devops/azure/devops/v6_0/audit/__init__.py b/azure-devops/azure/devops/v7_0/audit/__init__.py similarity index 100% rename from azure-devops/azure/devops/v6_0/audit/__init__.py rename to azure-devops/azure/devops/v7_0/audit/__init__.py diff --git a/azure-devops/azure/devops/v6_0/audit/audit_client.py b/azure-devops/azure/devops/v7_0/audit/audit_client.py similarity index 90% rename from azure-devops/azure/devops/v6_0/audit/audit_client.py rename to azure-devops/azure/devops/v7_0/audit/audit_client.py index 16a6ca2b..5b61a293 100644 --- a/azure-devops/azure/devops/v6_0/audit/audit_client.py +++ b/azure-devops/azure/devops/v7_0/audit/audit_client.py @@ -36,7 +36,7 @@ def get_actions(self, area_name=None): query_parameters['areaName'] = self._serialize.query('area_name', area_name, 'str') response = self._send(http_method='GET', location_id='6fa30b9a-9558-4e3b-a95f-a12572caa6e6', - version='6.0-preview.1', + version='7.0-preview.1', query_parameters=query_parameters) return self._deserialize('[AuditActionInfo]', self._unwrap_collection(response)) @@ -48,7 +48,7 @@ def query_log(self, start_time=None, end_time=None, batch_size=None, continuatio :param int batch_size: Max number of results to return. Optional :param str continuation_token: Token used for returning next set of results from previous query. Optional :param bool skip_aggregation: Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog. - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if start_time is not None: @@ -63,7 +63,7 @@ def query_log(self, start_time=None, end_time=None, batch_size=None, continuatio query_parameters['skipAggregation'] = self._serialize.query('skip_aggregation', skip_aggregation, 'bool') response = self._send(http_method='GET', location_id='4e5fa14f-7097-4b73-9c85-00abc7353c61', - version='6.0-preview.1', + version='7.0-preview.1', query_parameters=query_parameters) return self._deserialize('AuditLogQueryResult', response) @@ -84,7 +84,7 @@ def download_log(self, format, start_time=None, end_time=None, **kwargs): query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') response = self._send(http_method='GET', location_id='b7b98a76-04e8-4f4d-ac72-9d46492caaac', - version='6.0-preview.1', + version='7.0-preview.1', query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: @@ -96,9 +96,9 @@ def download_log(self, format, start_time=None, end_time=None, **kwargs): def create_stream(self, stream, days_to_backfill): """CreateStream. [Preview API] Create new Audit Stream - :param :class:` ` stream: Stream entry + :param :class:` ` stream: Stream entry :param int days_to_backfill: The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed. - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if days_to_backfill is not None: @@ -106,7 +106,7 @@ def create_stream(self, stream, days_to_backfill): content = self._serialize.body(stream, 'AuditStream') response = self._send(http_method='POST', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1', + version='7.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('AuditStream', response) @@ -121,7 +121,7 @@ def delete_stream(self, stream_id): route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') self._send(http_method='DELETE', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1', + version='7.0-preview.1', route_values=route_values) def query_all_streams(self): @@ -131,21 +131,21 @@ def query_all_streams(self): """ response = self._send(http_method='GET', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1') + version='7.0-preview.1') return self._deserialize('[AuditStream]', self._unwrap_collection(response)) def query_stream_by_id(self, stream_id): """QueryStreamById. [Preview API] Return Audit Stream with id of streamId if one exists otherwise throw :param int stream_id: Id of stream entry to retrieve - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if stream_id is not None: route_values['streamId'] = self._serialize.url('stream_id', stream_id, 'int') response = self._send(http_method='GET', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1', + version='7.0-preview.1', route_values=route_values) return self._deserialize('AuditStream', response) @@ -154,7 +154,7 @@ def update_status(self, stream_id, status): [Preview API] Update existing Audit Stream status :param int stream_id: Id of stream entry to be updated :param str status: Status of the stream - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if stream_id is not None: @@ -164,7 +164,7 @@ def update_status(self, stream_id, status): query_parameters['status'] = self._serialize.query('status', status, 'str') response = self._send(http_method='PUT', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AuditStream', response) @@ -172,13 +172,13 @@ def update_status(self, stream_id, status): def update_stream(self, stream): """UpdateStream. [Preview API] Update existing Audit Stream - :param :class:` ` stream: Stream entry - :rtype: :class:` ` + :param :class:` ` stream: Stream entry + :rtype: :class:` ` """ content = self._serialize.body(stream, 'AuditStream') response = self._send(http_method='PUT', location_id='77d60bf9-1882-41c5-a90d-3a6d3c13fd3b', - version='6.0-preview.1', + version='7.0-preview.1', content=content) return self._deserialize('AuditStream', response) diff --git a/azure-devops/azure/devops/v6_0/audit/models.py b/azure-devops/azure/devops/v7_0/audit/models.py similarity index 99% rename from azure-devops/azure/devops/v6_0/audit/models.py rename to azure-devops/azure/devops/v7_0/audit/models.py index c6df3726..a3fddd37 100644 --- a/azure-devops/azure/devops/v6_0/audit/models.py +++ b/azure-devops/azure/devops/v7_0/audit/models.py @@ -110,7 +110,7 @@ class AuditLogQueryResult(Model): :param continuation_token: The continuation token to pass to get the next set of results :type continuation_token: str :param decorated_audit_log_entries: The list of audit log entries - :type decorated_audit_log_entries: list of :class:`DecoratedAuditLogEntry ` + :type decorated_audit_log_entries: list of :class:`DecoratedAuditLogEntry ` :param has_more: True when there are more matching results to be fetched, false otherwise. :type has_more: bool """ diff --git a/azure-devops/azure/devops/v6_0/build/__init__.py b/azure-devops/azure/devops/v7_0/build/__init__.py similarity index 95% rename from azure-devops/azure/devops/v6_0/build/__init__.py rename to azure-devops/azure/devops/v7_0/build/__init__.py index 16d1b55d..c0d17df7 100644 --- a/azure-devops/azure/devops/v6_0/build/__init__.py +++ b/azure-devops/azure/devops/v7_0/build/__init__.py @@ -46,14 +46,16 @@ 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', + 'BuildRetentionHistory', + 'BuildRetentionSample', 'BuildSettings', - 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', + 'Change', 'IdentityRef', 'Issue', 'JobReference', @@ -71,6 +73,7 @@ 'RepositoryWebhook', 'ResourceRef', 'RetentionLease', + 'RetentionLeaseUpdate', 'RetentionPolicy', 'RetentionSetting', 'SourceProviderAttributes', @@ -95,9 +98,11 @@ 'UpdateProjectRetentionSettingModel', 'UpdateRetentionSettingModel', 'UpdateStageParameters', + 'UpdateTagParameters', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', + 'YamlBuild', 'BuildClient' ] diff --git a/azure-devops/azure/devops/v5_1/build/build_client.py b/azure-devops/azure/devops/v7_0/build/build_client.py similarity index 77% rename from azure-devops/azure/devops/v5_1/build/build_client.py rename to azure-devops/azure/devops/v7_0/build/build_client.py index 84c85473..fb1c6689 100644 --- a/azure-devops/azure/devops/v5_1/build/build_client.py +++ b/azure-devops/azure/devops/v7_0/build/build_client.py @@ -28,10 +28,10 @@ def __init__(self, base_url=None, creds=None): def create_artifact(self, artifact, project, build_id): """CreateArtifact. Associates an artifact with a build. - :param :class:` ` artifact: The artifact. + :param :class:` ` artifact: The artifact. :param str project: Project ID or project name :param int build_id: The ID of the build. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -41,7 +41,7 @@ def create_artifact(self, artifact, project, build_id): content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildArtifact', response) @@ -52,7 +52,7 @@ def get_artifact(self, project, build_id, artifact_name): :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -64,7 +64,7 @@ def get_artifact(self, project, build_id, artifact_name): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildArtifact', response) @@ -87,7 +87,7 @@ def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -111,7 +111,7 @@ def get_artifacts(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildArtifact]', self._unwrap_collection(response)) @@ -139,7 +139,7 @@ def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwarg query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') @@ -151,7 +151,7 @@ def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwarg def get_attachments(self, project, build_id, type): """GetAttachments. - [Preview API] Gets the list of attachments of a specific type that are associated with a build. + Gets the list of attachments of a specific type that are associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: The type of attachment. @@ -166,13 +166,13 @@ def get_attachments(self, project, build_id, type): route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='f2192269-89fa-4f94-baf6-8fb128c55159', - version='5.1-preview.2', + version='7.0', route_values=route_values) return self._deserialize('[Attachment]', self._unwrap_collection(response)) def get_attachment(self, project, build_id, timeline_id, record_id, type, name, **kwargs): """GetAttachment. - [Preview API] Gets a specific attachment. + Gets a specific attachment. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str timeline_id: The ID of the timeline. @@ -196,7 +196,7 @@ def get_attachment(self, project, build_id, timeline_id, record_id, type, name, route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='af5122d3-3438-485e-a25a-2dbbfde84ee6', - version='5.1-preview.2', + version='7.0', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: @@ -218,7 +218,7 @@ def authorize_project_resources(self, resources, project): content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) @@ -241,14 +241,14 @@ def get_project_resources(self, project, type=None, id=None): query_parameters['id'] = self._serialize.query('id', id, 'str') response = self._send(http_method='GET', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def list_branches(self, project, provider_name, service_endpoint_id=None, repository=None, branch_name=None): """ListBranches. - [Preview API] Gets a list of branches for the given source code repository. + Gets a list of branches for the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_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. TFVC or TFGit. @@ -270,7 +270,7 @@ def list_branches(self, project, provider_name, service_endpoint_id=None, reposi query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='e05d4403-9b81-4244-8763-20fde28d1976', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -282,7 +282,7 @@ def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -296,7 +296,7 @@ def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildBadge', response) @@ -322,11 +322,29 @@ def get_build_badge_data(self, project, repo_type, repo_id=None, branch_name=Non query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) + def get_retention_leases_for_build(self, project, build_id): + """GetRetentionLeasesForBuild. + Gets all retention leases that apply to a specific build. + :param str project: Project ID or project name + :param int build_id: The ID of the build. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + response = self._send(http_method='GET', + location_id='3da19a6a-f088-45c4-83ce-2ad3a87be6c4', + version='7.0', + route_values=route_values) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + def delete_build(self, project, build_id): """DeleteBuild. Deletes a build. @@ -340,7 +358,7 @@ def delete_build(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values) def get_build(self, project, build_id, property_filters=None): @@ -349,7 +367,7 @@ def get_build(self, project, build_id, property_filters=None): :param str project: Project ID or project name :param int build_id: :param str property_filters: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -361,7 +379,7 @@ def get_build(self, project, build_id, property_filters=None): query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) @@ -390,7 +408,7 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, :param [int] build_ids: A comma-delimited list that specifies the IDs of builds to retrieve. :param str repository_id: If specified, filters to builds that built from this repository. :param str repository_type: If specified, filters to builds that built from repositories of this type. - :rtype: :class:`` + :rtype: :class:`<[Build]> ` """ route_values = {} if project is not None: @@ -443,35 +461,21 @@ def get_builds(self, project, definitions=None, queues=None, build_number=None, query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[Build]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetBuildsResponseValue(response_value, continuation_token) - - class GetBuildsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_builds method - - :param value: - :type value: :class:`<[Build]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): + return self._deserialize('[Build]', self._unwrap_collection(response)) + + def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None, definition_id=None): """QueueBuild. Queues a build - :param :class:` ` build: + :param :class:` ` build: :param str project: Project ID or project name :param bool ignore_warnings: :param str check_in_ticket: :param int source_build_id: - :rtype: :class:` ` + :param int definition_id: Optional definition id to queue a build without a body. Ignored if there's a valid body + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -483,10 +487,12 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None query_parameters['checkInTicket'] = self._serialize.query('check_in_ticket', check_in_ticket, 'str') if source_build_id is not None: query_parameters['sourceBuildId'] = self._serialize.query('source_build_id', source_build_id, 'int') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -495,11 +501,11 @@ def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None def update_build(self, build, project, build_id, retry=None): """UpdateBuild. Updates a build. - :param :class:` ` build: The build. + :param :class:` ` build: The build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param bool retry: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -512,7 +518,7 @@ def update_build(self, build, project, build_id, retry=None): content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -531,93 +537,23 @@ def update_builds(self, builds, project): content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) - def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): - """GetBuildChanges. - Gets the changes associated with a build - :param str project: Project ID or project name - :param int build_id: - :param str continuation_token: - :param int top: The maximum number of changes to return - :param bool include_source_change: - :rtype: :class:`` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if build_id is not None: - route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') - query_parameters = {} - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - if include_source_change is not None: - query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') - response = self._send(http_method='GET', - location_id='54572c7b-bbd3-45d4-80dc-28be08941620', - version='5.1', - route_values=route_values, - query_parameters=query_parameters) - response_value = self._deserialize('[Change]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetBuildChangesResponseValue(response_value, continuation_token) - - class GetBuildChangesResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_build_changes method - - :param value: - :type value: :class:`<[Change]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token - - def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): - """GetChangesBetweenBuilds. - [Preview API] Gets the changes made to the repository between two given builds. - :param str project: Project ID or project name - :param int from_build_id: The ID of the first build. - :param int to_build_id: The ID of the last build. - :param int top: The maximum number of changes to return. - :rtype: [Change] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if from_build_id is not None: - query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') - if to_build_id is not None: - query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', - version='5.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('[Change]', self._unwrap_collection(response)) - def get_build_controller(self, controller_id): """GetBuildController. Gets a controller :param int controller_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BuildController', response) @@ -632,18 +568,18 @@ def get_build_controllers(self, name=None): query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', - version='5.1', + version='7.0', query_parameters=query_parameters) return self._deserialize('[BuildController]', self._unwrap_collection(response)) def create_definition(self, definition, project, definition_to_clone_id=None, definition_to_clone_revision=None): """CreateDefinition. Creates a new definition. - :param :class:` ` definition: The definition. + :param :class:` ` definition: The definition. :param str project: Project ID or project name :param int definition_to_clone_id: :param int definition_to_clone_revision: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -656,7 +592,7 @@ def create_definition(self, definition, project, definition_to_clone_id=None, de content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -675,7 +611,7 @@ def delete_definition(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values) def get_definition(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): @@ -687,7 +623,7 @@ def get_definition(self, project, definition_id, revision=None, min_metrics_time :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [str] property_filters: A comma-delimited list of properties to include in the results. :param bool include_latest_builds: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -706,7 +642,7 @@ def get_definition(self, project, definition_id, revision=None, min_metrics_time query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) @@ -730,8 +666,8 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ :param bool include_latest_builds: Indicates whether to return the latest and latest completed builds for this definition. :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. - :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. - :rtype: :class:`` + :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true + :rtype: :class:`<[BuildDefinitionReference]> ` """ route_values = {} if project is not None: @@ -772,25 +708,10 @@ def get_definitions(self, project, name=None, repository_id=None, repository_typ query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) - response_value = self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) - continuation_token = self._get_continuation_token(response) - return self.GetDefinitionsResponseValue(response_value, continuation_token) - - class GetDefinitionsResponseValue(object): - def __init__(self, value, continuation_token): - """ - Response for the get_definitions method - - :param value: - :type value: :class:`<[BuildDefinitionReference]> ` - :param continuation_token: The continuation token to be used to get the next page of results. - :type continuation_token: str - """ - self.value = value - self.continuation_token = continuation_token + return self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) def restore_definition(self, project, definition_id, deleted): """RestoreDefinition. @@ -798,7 +719,7 @@ def restore_definition(self, project, definition_id, deleted): :param str project: Project ID or project name :param int definition_id: The identifier of the definition to restore. :param bool deleted: When false, restores a deleted definition. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -810,20 +731,20 @@ def restore_definition(self, project, definition_id, deleted): query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def update_definition(self, definition, project, definition_id, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. - Updates an existing definition. - :param :class:` ` definition: The new version of the definition. + Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT. + :param :class:` ` definition: The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int secrets_source_definition_id: :param int secrets_source_definition_revision: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -838,7 +759,7 @@ def update_definition(self, definition, project, definition_id, secrets_source_d content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -846,7 +767,7 @@ def update_definition(self, definition, project, definition_id, secrets_source_d def get_file_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None, **kwargs): """GetFileContents. - [Preview API] Gets the contents of a file in the given source code repository. + Gets the contents of a file in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_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. TFVC or TFGit. @@ -871,7 +792,7 @@ def get_file_contents(self, project, provider_name, service_endpoint_id=None, re query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='29d12225-b1d9-425f-b668-6c594a981313', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -884,10 +805,10 @@ def get_file_contents(self, project, provider_name, service_endpoint_id=None, re def create_folder(self, folder, project, path): """CreateFolder. [Preview API] Creates a new folder. - :param :class:` ` folder: The folder. + :param :class:` ` folder: The folder. :param str project: Project ID or project name :param str path: The full path of the folder. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -898,7 +819,7 @@ def create_folder(self, folder, project, path): content = self._serialize.body(folder, 'Folder') response = self._send(http_method='PUT', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) @@ -918,7 +839,7 @@ def delete_folder(self, project, path): query_parameters['path'] = self._serialize.query('path', path, 'str') self._send(http_method='DELETE', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters) @@ -940,7 +861,7 @@ def get_folders(self, project, path=None, query_order=None): query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Folder]', self._unwrap_collection(response)) @@ -948,10 +869,10 @@ def get_folders(self, project, path=None, query_order=None): def update_folder(self, folder, project, path): """UpdateFolder. [Preview API] Updates an existing folder at given existing path - :param :class:` ` folder: The new version of the folder. + :param :class:` ` folder: The new version of the folder. :param str project: Project ID or project name :param str path: The full path to the folder. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -962,19 +883,122 @@ def update_folder(self, folder, project, path): content = self._serialize.body(folder, 'Folder') response = self._send(http_method='POST', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', - version='5.1-preview.2', + version='7.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Folder', response) + def get_build_general_settings(self, project): + """GetBuildGeneralSettings. + Gets pipeline general settings. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values) + return self._deserialize('PipelineGeneralSettings', response) + + def update_build_general_settings(self, new_settings, project): + """UpdateBuildGeneralSettings. + Updates pipeline general settings. + :param :class:` ` new_settings: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_settings, 'PipelineGeneralSettings') + response = self._send(http_method='PATCH', + location_id='c4aefd19-30ff-405b-80ad-aca021e7242a', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('PipelineGeneralSettings', response) + + def get_retention_history(self, days_to_lookback=None): + """GetRetentionHistory. + Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline. + :param int days_to_lookback: + :rtype: :class:` ` + """ + query_parameters = {} + if days_to_lookback is not None: + query_parameters['daysToLookback'] = self._serialize.query('days_to_lookback', days_to_lookback, 'int') + response = self._send(http_method='GET', + location_id='1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf', + version='7.0', + query_parameters=query_parameters) + return self._deserialize('BuildRetentionHistory', response) + + def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): + """GetBuildChanges. + Gets the changes associated with a build + :param str project: Project ID or project name + :param int build_id: + :param str continuation_token: + :param int top: The maximum number of changes to return + :param bool include_source_change: + :rtype: :class:`<[Change]> ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if continuation_token is not None: + query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + if include_source_change is not None: + query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') + response = self._send(http_method='GET', + location_id='54572c7b-bbd3-45d4-80dc-28be08941620', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(response)) + + def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): + """GetChangesBetweenBuilds. + Gets the changes made to the repository between two given builds. + :param str project: Project ID or project name + :param int from_build_id: The ID of the first build. + :param int to_build_id: The ID of the last build. + :param int top: The maximum number of changes to return. + :rtype: [Change] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if from_build_id is not None: + query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') + if to_build_id is not None: + query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query('top', top, 'int') + response = self._send(http_method='GET', + location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[Change]', self._unwrap_collection(response)) + def get_latest_build(self, project, definition, branch_name=None): """GetLatestBuild. [Preview API] Gets the latest build for a definition, optionally scoped to a specific branch. :param str project: Project ID or project name :param str definition: definition name with optional leading folder path, or the definition id - :param str branch_name: optional parameter that indicates the specific branch to use - :rtype: :class:` ` + :param str branch_name: optional parameter that indicates the specific branch to use. If not specified, the default branch is used. + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -986,11 +1010,160 @@ def get_latest_build(self, project, definition, branch_name=None): query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='54481611-01f4-47f3-998f-160da0f0c229', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) + def add_retention_leases(self, new_leases, project): + """AddRetentionLeases. + Adds new leases for pipeline runs. + :param [NewRetentionLease] new_leases: + :param str project: Project ID or project name + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(new_leases, '[NewRetentionLease]') + response = self._send(http_method='POST', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def delete_retention_leases_by_id(self, project, ids): + """DeleteRetentionLeasesById. + Removes specific retention leases. + :param str project: Project ID or project name + :param [int] ids: + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if ids is not None: + ids = ",".join(map(str, ids)) + query_parameters['ids'] = self._serialize.query('ids', ids, 'str') + self._send(http_method='DELETE', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + + def get_retention_lease(self, project, lease_id): + """GetRetentionLease. + Returns the details of the retention lease given a lease id. + :param str project: Project ID or project name + :param int lease_id: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values) + return self._deserialize('RetentionLease', response) + + def get_retention_leases_by_minimal_retention_leases(self, project, leases_to_fetch): + """GetRetentionLeasesByMinimalRetentionLeases. + Returns any leases matching the specified MinimalRetentionLeases + :param str project: Project ID or project name + :param [MinimalRetentionLease] leases_to_fetch: List of JSON-serialized MinimalRetentionLeases separated by '|' + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if leases_to_fetch is not None: + leases_to_fetch = "|".join(map(str, leases_to_fetch)) + query_parameters['leasesToFetch'] = self._serialize.query('leases_to_fetch', leases_to_fetch, 'str') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_owner_id(self, project, owner_id=None, definition_id=None, run_id=None): + """GetRetentionLeasesByOwnerId. + Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str owner_id: + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if owner_id is not None: + query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def get_retention_leases_by_user_id(self, project, user_owner_id, definition_id=None, run_id=None): + """GetRetentionLeasesByUserId. + Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run. + :param str project: Project ID or project name + :param str user_owner_id: The user id to search for. + :param int definition_id: An optional parameter to limit the search to a specific pipeline definition. + :param int run_id: An optional parameter to limit the search to a single pipeline run. Requires definitionId. + :rtype: [RetentionLease] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + query_parameters = {} + if user_owner_id is not None: + query_parameters['userOwnerId'] = self._serialize.query('user_owner_id', user_owner_id, 'str') + if definition_id is not None: + query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') + if run_id is not None: + query_parameters['runId'] = self._serialize.query('run_id', run_id, 'int') + response = self._send(http_method='GET', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('[RetentionLease]', self._unwrap_collection(response)) + + def update_retention_lease(self, lease_update, project, lease_id): + """UpdateRetentionLease. + Updates the duration or pipeline protection status of a retention lease. + :param :class:` ` lease_update: The new data for the retention lease. + :param str project: Project ID or project name + :param int lease_id: The ID of the lease to update. + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if lease_id is not None: + route_values['leaseId'] = self._serialize.url('lease_id', lease_id, 'int') + content = self._serialize.body(lease_update, 'RetentionLeaseUpdate') + response = self._send(http_method='PATCH', + location_id='272051e4-9af1-45b5-ae22-8d960a5539d4', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('RetentionLease', response) + def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLog. Gets an individual log file for a build. @@ -1015,7 +1188,7 @@ def get_build_log(self, project, build_id, log_id, start_line=None, end_line=Non query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') @@ -1049,7 +1222,7 @@ def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_li query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1068,7 +1241,7 @@ def get_build_logs(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildLog]', self._unwrap_collection(response)) @@ -1086,7 +1259,7 @@ def get_build_logs_zip(self, project, build_id, **kwargs): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: @@ -1119,7 +1292,7 @@ def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') @@ -1147,7 +1320,7 @@ def get_project_metrics(self, project, metric_aggregation_type=None, min_metrics query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='7433fae7-a6bc-41dc-a6e2-eef9005ce41a', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) @@ -1170,7 +1343,7 @@ def get_definition_metrics(self, project, definition_id, min_metrics_time=None): query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='d973b939-0ce0-4fec-91d8-da3940fa1827', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) @@ -1186,13 +1359,13 @@ def get_build_option_definitions(self, project=None): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) def get_path_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None): """GetPathContents. - [Preview API] Gets the contents of a directory in the given source code repository. + Gets the contents of a directory in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_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. TFVC or TFGit. @@ -1217,18 +1390,18 @@ def get_path_contents(self, project, provider_name, service_endpoint_id=None, re query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='7944d6fb-df01-4709-920a-7a189aa34037', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SourceRepositoryItem]', self._unwrap_collection(response)) def get_build_properties(self, project, build_id, filter=None): """GetBuildProperties. - [Preview API] Gets properties for a build. + Gets properties for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1241,18 +1414,18 @@ def get_build_properties(self, project, build_id, filter=None): query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_build_properties(self, document, project, build_id): """UpdateBuildProperties. - [Preview API] Updates properties for a build. - :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. + Updates properties for a build. + :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int build_id: The ID of the build. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1262,7 +1435,7 @@ def update_build_properties(self, document, project, build_id): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content, media_type='application/json-patch+json') @@ -1270,11 +1443,11 @@ def update_build_properties(self, document, project, build_id): def get_definition_properties(self, project, definition_id, filter=None): """GetDefinitionProperties. - [Preview API] Gets properties for a definition. + Gets properties for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1287,18 +1460,18 @@ def get_definition_properties(self, project, definition_id, filter=None): query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_definition_properties(self, document, project, definition_id): """UpdateDefinitionProperties. - [Preview API] Updates properties for a definition. - :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. + Updates properties for a definition. + :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int definition_id: The ID of the definition. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1308,7 +1481,7 @@ def update_definition_properties(self, document, project, definition_id): content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', - version='5.1-preview.1', + version='7.0', route_values=route_values, content=content, media_type='application/json-patch+json') @@ -1316,13 +1489,13 @@ def update_definition_properties(self, document, project, definition_id): def get_pull_request(self, project, provider_name, pull_request_id, repository_id=None, service_endpoint_id=None): """GetPullRequest. - [Preview API] Gets a pull request object from source provider. + Gets a pull request object from source provider. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str pull_request_id: Vendor-specific id of the pull request. :param str repository_id: Vendor-specific identifier or the name of the repository that contains the pull request. :param str service_endpoint_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. TFVC or TFGit. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1338,18 +1511,18 @@ def get_pull_request(self, project, provider_name, pull_request_id, repository_i query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') response = self._send(http_method='GET', location_id='d8763ec7-9ff0-4fb4-b2b2-9d757906ff14', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PullRequest', response) def get_build_report(self, project, build_id, type=None): """GetBuildReport. - [Preview API] Gets a build report. + Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1361,14 +1534,14 @@ def get_build_report(self, project, build_id, type=None): query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', - version='5.1-preview.2', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildReportMetadata', response) def get_build_report_html_content(self, project, build_id, type=None, **kwargs): """GetBuildReportHtmlContent. - [Preview API] Gets a build report. + Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: @@ -1384,7 +1557,7 @@ def get_build_report_html_content(self, project, build_id, type=None, **kwargs): query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', - version='5.1-preview.2', + version='7.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/html') @@ -1396,7 +1569,7 @@ def get_build_report_html_content(self, project, build_id, type=None, **kwargs): def list_repositories(self, project, provider_name, service_endpoint_id=None, repository=None, result_set=None, page_results=None, continuation_token=None): """ListRepositories. - [Preview API] Gets a list of source code repositories. + Gets a list of source code repositories. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_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. TFVC or TFGit. @@ -1404,7 +1577,7 @@ def list_repositories(self, project, provider_name, service_endpoint_id=None, re :param str result_set: 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set. :param bool page_results: If set to true, this will limit the set of results and will return a continuation token to continue the query. :param str continuation_token: When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1424,7 +1597,7 @@ def list_repositories(self, project, provider_name, service_endpoint_id=None, re query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='d44d1680-f978-4834-9b93-8c6e132329c9', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('SourceRepositories', response) @@ -1445,7 +1618,7 @@ def authorize_definition_resources(self, resources, project, definition_id): content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) @@ -1464,20 +1637,53 @@ def get_definition_resources(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_resource_usage(self): """GetResourceUsage. [Preview API] Gets information about build resources in the system. - :rtype: :class:` ` + :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='3813d06c-9e36-4ea1-aac3-61a485d60e3d', - version='5.1-preview.2') + version='7.0-preview.2') return self._deserialize('BuildResourceUsage', response) + def get_retention_settings(self, project): + """GetRetentionSettings. + Gets the project's retention settings. + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values) + return self._deserialize('ProjectRetentionSetting', response) + + def update_retention_settings(self, update_model, project): + """UpdateRetentionSettings. + Updates the project's retention settings. + :param :class:` ` update_model: + :param str project: Project ID or project name + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + content = self._serialize.body(update_model, 'UpdateProjectRetentionSettingModel') + response = self._send(http_method='PATCH', + location_id='dadb46e7-5851-4c72-820e-ae8abb82f59f', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('ProjectRetentionSetting', response) + def get_definition_revisions(self, project, definition_id): """GetDefinitionRevisions. Gets all revisions of a definition. @@ -1492,7 +1698,7 @@ def get_definition_revisions(self, project, definition_id): route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) @@ -1500,23 +1706,23 @@ def get_build_settings(self, project=None): """GetBuildSettings. Gets the build settings. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. Updates the build settings. - :param :class:` ` settings: The new settings. + :param :class:` ` settings: The new settings. :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1524,14 +1730,14 @@ def update_build_settings(self, settings, project=None): content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) def list_source_providers(self, project): """ListSourceProviders. - [Preview API] Get a list of source providers and their capabilities. + Get a list of source providers and their capabilities. :param str project: Project ID or project name :rtype: [SourceProviderAttributes] """ @@ -1540,16 +1746,38 @@ def list_source_providers(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='3ce81729-954f-423d-a581-9fea01d25186', - version='5.1-preview.1', + version='7.0', route_values=route_values) return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) + def update_stage(self, update_parameters, build_id, stage_ref_name, project=None): + """UpdateStage. + Update a build stage + :param :class:` ` update_parameters: + :param int build_id: + :param str stage_ref_name: + :param str project: Project ID or project name + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + if stage_ref_name is not None: + route_values['stageRefName'] = self._serialize.url('stage_ref_name', stage_ref_name, 'str') + content = self._serialize.body(update_parameters, 'UpdateStageParameters') + self._send(http_method='PATCH', + location_id='b8aac6c9-744b-46e1-88fc-3550969f9313', + version='7.0', + route_values=route_values, + content=content) + def get_status_badge(self, project, definition, branch_name=None, stage_name=None, job_name=None, configuration=None, label=None): """GetStatusBadge. [Preview API]

Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.

If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.

:param str project: Project ID or project name :param str definition: Either the definition name with optional leading folder path, or the definition id. - :param str branch_name: Only consider the most recent build for this branch. + :param str branch_name: Only consider the most recent build for this branch. If not specified, the default branch is used. :param str stage_name: Use this stage within the pipeline to render the status. :param str job_name: Use this job within a stage of the pipeline to render the status. :param str configuration: Use this job configuration to render the status @@ -1574,7 +1802,7 @@ def get_status_badge(self, project, definition, branch_name=None, stage_name=Non query_parameters['label'] = self._serialize.query('label', label, 'str') response = self._send(http_method='GET', location_id='07acfdce-4757-4439-b422-ddd13a2fcc10', - version='5.1-preview.1', + version='7.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) @@ -1596,7 +1824,7 @@ def add_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1616,14 +1844,14 @@ def add_build_tags(self, tags, project, build_id): content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_build_tag(self, project, build_id, tag): """DeleteBuildTag. - Removes a tag from a build. + Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to remove. @@ -1638,7 +1866,7 @@ def delete_build_tag(self, project, build_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) @@ -1656,28 +1884,34 @@ def get_build_tags(self, project, build_id): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) - def get_tags(self, project): - """GetTags. - Gets a list of all build and definition tags in the project. + def update_build_tags(self, update_parameters, project, build_id): + """UpdateBuildTags. + Adds/Removes tags from a build. + :param :class:` ` update_parameters: The tags to add/remove. :param str project: Project ID or project name + :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - response = self._send(http_method='GET', - location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', - version='5.1', - route_values=route_values) + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + content = self._serialize.body(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', + version='7.0', + route_values=route_values, + content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tag(self, project, definition_id, tag): """AddDefinitionTag. - [Preview API] Adds a tag to a definition + Adds a tag to a definition :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to add. @@ -1692,13 +1926,13 @@ def add_definition_tag(self, project, definition_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.1-preview.2', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tags(self, tags, project, definition_id): """AddDefinitionTags. - [Preview API] Adds multiple tags to a definition. + Adds multiple tags to a definition. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int definition_id: The ID of the definition. @@ -1712,14 +1946,14 @@ def add_definition_tags(self, tags, project, definition_id): content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.1-preview.2', + version='7.0', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_definition_tag(self, project, definition_id, tag): """DeleteDefinitionTag. - [Preview API] Removes a tag from a definition. + Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to remove. @@ -1734,13 +1968,13 @@ def delete_definition_tag(self, project, definition_id, tag): route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.1-preview.2', + version='7.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_definition_tags(self, project, definition_id, revision=None): """GetDefinitionTags. - [Preview API] Gets the tags for a definition. + Gets the tags for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The definition revision number. If not specified, uses the latest revision of the definition. @@ -1756,11 +1990,65 @@ def get_definition_tags(self, project, definition_id, revision=None): query_parameters['revision'] = self._serialize.query('revision', revision, 'int') response = self._send(http_method='GET', location_id='cb894432-134a-4d31-a839-83beceaace4b', - version='5.1-preview.2', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) + def update_definition_tags(self, update_parameters, project, definition_id): + """UpdateDefinitionTags. + Adds/Removes tags from a definition. + :param :class:` ` update_parameters: The tags to add/remove. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + content = self._serialize.body(update_parameters, 'UpdateTagParameters') + response = self._send(http_method='PATCH', + location_id='cb894432-134a-4d31-a839-83beceaace4b', + version='7.0', + route_values=route_values, + content=content) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def delete_tag(self, project, tag): + """DeleteTag. + Removes a tag from builds, definitions, and from the tag store + :param str project: Project ID or project name + :param str tag: The tag to remove. + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if tag is not None: + route_values['tag'] = self._serialize.url('tag', tag, 'str') + response = self._send(http_method='DELETE', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + + def get_tags(self, project): + """GetTags. + Gets a list of all build tags in the project. + :param str project: Project ID or project name + :rtype: [str] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', + version='7.0', + route_values=route_values) + return self._deserialize('[str]', self._unwrap_collection(response)) + def delete_template(self, project, template_id): """DeleteTemplate. Deletes a build definition template. @@ -1774,7 +2062,7 @@ def delete_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) def get_template(self, project, template_id): @@ -1782,7 +2070,7 @@ def get_template(self, project, template_id): Gets a specific build definition template. :param str project: Project ID or project name :param str template_id: The ID of the requested template. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1791,7 +2079,7 @@ def get_template(self, project, template_id): route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) @@ -1806,17 +2094,17 @@ def get_templates(self, project): route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values) return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) def save_template(self, template, project, template_id): """SaveTemplate. Updates an existing build definition template. - :param :class:` ` template: The new version of the template. + :param :class:` ` template: The new version of the template. :param str project: Project ID or project name :param str template_id: The ID of the template. - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1826,7 +2114,7 @@ def save_template(self, template, project, template_id): content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', - version='5.1', + version='7.0', route_values=route_values, content=content) return self._deserialize('BuildDefinitionTemplate', response) @@ -1839,7 +2127,7 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None :param str timeline_id: :param int change_id: :param str plan_id: - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -1855,14 +2143,14 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def restore_webhooks(self, trigger_types, project, provider_name, service_endpoint_id=None, repository=None): """RestoreWebhooks. - [Preview API] Recreates the webhooks for the specified triggers in the given source code repository. + Recreates the webhooks for the specified triggers in the given source code repository. :param [DefinitionTriggerType] trigger_types: The types of triggers to restore webhooks for. :param str project: Project ID or project name :param str provider_name: The name of the source provider. @@ -1882,14 +2170,14 @@ def restore_webhooks(self, trigger_types, project, provider_name, service_endpoi content = self._serialize.body(trigger_types, '[DefinitionTriggerType]') self._send(http_method='POST', location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): """ListWebhooks. - [Preview API] Gets a list of webhooks installed in the given source code repository. + Gets a list of webhooks installed in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_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. TFVC or TFGit. @@ -1908,14 +2196,14 @@ def list_webhooks(self, project, provider_name, service_endpoint_id=None, reposi query_parameters['repository'] = self._serialize.query('repository', repository, 'str') response = self._send(http_method='GET', location_id='8f20ff82-9498-4812-9f6e-9c01bdc50e99', - version='5.1-preview.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RepositoryWebhook]', self._unwrap_collection(response)) def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. - Gets the work items associated with a build. + Gets the work items associated with a build. Only work items in the same project are returned. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return. @@ -1931,7 +2219,7 @@ def get_build_work_items_refs(self, project, build_id, top=None): query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) @@ -1956,7 +2244,7 @@ def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', - version='5.1', + version='7.0', route_values=route_values, query_parameters=query_parameters, content=content) @@ -1964,7 +2252,7 @@ def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, def get_work_items_between_builds(self, project, from_build_id, to_build_id, top=None): """GetWorkItemsBetweenBuilds. - [Preview API] Gets all the work items between two builds. + Gets all the work items between two builds. :param str project: Project ID or project name :param int from_build_id: The ID of the first build. :param int to_build_id: The ID of the last build. @@ -1983,8 +2271,41 @@ def get_work_items_between_builds(self, project, from_build_id, to_build_id, top query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='52ba8915-5518-42e3-a4bb-b0182d159e2d', - version='5.1-preview.2', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) + def get_definition_yaml(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): + """GetDefinitionYaml. + Converts a definition to YAML, optionally at a specific revision. + :param str project: Project ID or project name + :param int definition_id: The ID of the definition. + :param int revision: The revision number to retrieve. If this is not specified, the latest version will be returned. + :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. + :param [str] property_filters: A comma-delimited list of properties to include in the results. + :param bool include_latest_builds: + :rtype: :class:` ` + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + if definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if revision is not None: + query_parameters['revision'] = self._serialize.query('revision', revision, 'int') + if min_metrics_time is not None: + query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') + if property_filters is not None: + property_filters = ",".join(property_filters) + query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') + if include_latest_builds is not None: + query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') + response = self._send(http_method='GET', + location_id='7c3df3a1-7e51-4150-8cf7-540347f8697f', + version='7.0', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('YamlBuild', response) + diff --git a/azure-devops/azure/devops/v6_0/build/models.py b/azure-devops/azure/devops/v7_0/build/models.py similarity index 90% rename from azure-devops/azure/devops/v6_0/build/models.py rename to azure-devops/azure/devops/v7_0/build/models.py index 33cd2852..36b6eea8 100644 --- a/azure-devops/azure/devops/v6_0/build/models.py +++ b/azure-devops/azure/devops/v7_0/build/models.py @@ -14,13 +14,13 @@ class AgentPoolQueue(Model): Represents a queue for running builds. :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param id: The ID of the queue. :type id: int :param name: The name of the queue. :type name: str :param pool: The pool used by this queue. - :type pool: :class:`TaskAgentPoolReference ` + :type pool: :class:`TaskAgentPoolReference ` :param url: The full http link to the resource. :type url: str """ @@ -66,11 +66,11 @@ class AggregatedResultsAnalysis(Model): :param not_reported_results_by_outcome: :type not_reported_results_by_outcome: dict :param previous_context: - :type previous_context: :class:`TestResultsContext ` + :type previous_context: :class:`TestResultsContext ` :param results_by_outcome: :type results_by_outcome: dict :param results_difference: - :type results_difference: :class:`AggregatedResultsDifference ` + :type results_difference: :class:`AggregatedResultsDifference ` :param run_summary_by_outcome: :type run_summary_by_outcome: dict :param run_summary_by_state: @@ -217,7 +217,7 @@ def __init__(self, results_by_outcome=None, runs_count=None, state=None): class ArtifactResource(Model): """ :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param data: Type-specific data about the artifact. :type data: str :param download_url: A link to download the resource. @@ -293,7 +293,7 @@ class Attachment(Model): Represents an attachment to a build. :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param name: The name of the attachment. :type name: str """ @@ -333,27 +333,27 @@ class Build(Model): Data representation of a build. :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param agent_specification: The agent specification for the build. - :type agent_specification: :class:`AgentSpecification ` + :type agent_specification: :class:`AgentSpecification ` :param build_number: The build number/name of the build. :type build_number: str :param build_number_revision: The build number revision. :type build_number_revision: int :param controller: The build controller. This is only set if the definition type is Xaml. - :type controller: :class:`BuildController ` + :type controller: :class:`BuildController ` :param definition: The definition associated with the build. - :type definition: :class:`DefinitionReference ` + :type definition: :class:`DefinitionReference ` :param deleted: Indicates whether the build has been deleted. :type deleted: bool :param deleted_by: The identity of the process or person that deleted the build. - :type deleted_by: :class:`IdentityRef ` + :type deleted_by: :class:`IdentityRef ` :param deleted_date: The date the build was deleted. :type deleted_date: datetime :param deleted_reason: The description of how the build was deleted. :type deleted_reason: str :param demands: A list of demands that represents the agent capabilities required by this build. - :type demands: list of :class:`object ` + :type demands: list of :class:`object ` :param finish_time: The time that the build was completed. :type finish_time: datetime :param id: The ID of the build. @@ -361,27 +361,27 @@ class Build(Model): :param keep_forever: Indicates whether the build should be skipped by retention policies. :type keep_forever: bool :param last_changed_by: The identity representing the process or person that last changed the build. - :type last_changed_by: :class:`IdentityRef ` + :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the build was last changed. :type last_changed_date: datetime :param logs: Information about the build logs. - :type logs: :class:`BuildLogReference ` + :type logs: :class:`BuildLogReference ` :param orchestration_plan: The orchestration plan for the build. - :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` + :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` :param parameters: The parameters for the build. :type parameters: str :param plans: Orchestration plans associated with the build (build, cleanup) - :type plans: list of :class:`TaskOrchestrationPlanReference ` + :type plans: list of :class:`TaskOrchestrationPlanReference ` :param priority: The build's priority. :type priority: object :param project: The team project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param quality: The quality of the xaml build (good, bad, etc.) :type quality: str - :param queue: The queue. This is only set if the definition type is Build. - :type queue: :class:`AgentPoolQueue ` + :param queue: The queue. This is only set if the definition type is Build. WARNING: this field is deprecated and does not corresponds to the jobs queues. + :type queue: :class:`AgentPoolQueue ` :param queue_options: Additional options for queueing the build. :type queue_options: object :param queue_position: The current position of the build in the queue. @@ -391,11 +391,11 @@ class Build(Model): :param reason: The reason that the build was created. :type reason: object :param repository: The repository. - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param requested_by: The identity that queued the build. - :type requested_by: :class:`IdentityRef ` + :type requested_by: :class:`IdentityRef ` :param requested_for: The identity on whose behalf the build was queued. - :type requested_for: :class:`IdentityRef ` + :type requested_for: :class:`IdentityRef ` :param result: The build result. :type result: object :param retained_by_release: Indicates whether the build is retained by a release. @@ -410,8 +410,10 @@ class Build(Model): :type status: object :param tags: :type tags: list of str + :param template_parameters: Parameters to template expression evaluation + :type template_parameters: dict :param triggered_by_build: The build that triggered this build via a Build completion trigger. - :type triggered_by_build: :class:`Build ` + :type triggered_by_build: :class:`Build ` :param trigger_info: Sourceprovider-specific information about what triggered the build :type trigger_info: dict :param uri: The URI of the build. @@ -419,7 +421,7 @@ class Build(Model): :param url: The REST URL of the build. :type url: str :param validation_results: - :type validation_results: list of :class:`BuildRequestValidationResult ` + :type validation_results: list of :class:`BuildRequestValidationResult ` """ _attribute_map = { @@ -462,6 +464,7 @@ class Build(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, + 'template_parameters': {'key': 'templateParameters', 'type': '{str}'}, 'triggered_by_build': {'key': 'triggeredByBuild', 'type': 'Build'}, 'trigger_info': {'key': 'triggerInfo', 'type': '{str}'}, 'uri': {'key': 'uri', 'type': 'str'}, @@ -469,7 +472,7 @@ class Build(Model): 'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'} } - 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): + 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, template_parameters=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 @@ -510,6 +513,7 @@ def __init__(self, _links=None, agent_specification=None, build_number=None, bui self.start_time = start_time self.status = status self.tags = tags + self.template_parameters = template_parameters self.triggered_by_build = triggered_by_build self.trigger_info = trigger_info self.uri = uri @@ -526,7 +530,7 @@ class BuildArtifact(Model): :param name: The name of the artifact. :type name: str :param resource: The actual resource. - :type resource: :class:`ArtifactResource ` + :type resource: :class:`ArtifactResource ` :param source: The artifact source, which will be the ID of the job that produced this artifact. If an artifact is associated with multiple sources, this points to the first source. :type source: str """ @@ -571,16 +575,16 @@ class BuildDefinitionRevision(Model): """ Represents a revision of a build definition. + :param comment: The comment associated with the change. + :type comment: str + :param definition_url: A link to the definition at this revision. + :type definition_url: str :param changed_by: The identity of the person or process that changed the definition. - :type changed_by: :class:`IdentityRef ` + :type changed_by: :class:`IdentityRef ` :param changed_date: The date and time that the definition was changed. :type changed_date: datetime :param change_type: The change type (add, edit, delete). :type change_type: object - :param comment: The comment associated with the change. - :type comment: str - :param definition_url: A link to the definition at this revision. - :type definition_url: str :param name: The name of the definition. :type name: str :param revision: The revision number. @@ -588,22 +592,22 @@ class BuildDefinitionRevision(Model): """ _attribute_map = { + 'comment': {'key': 'comment', 'type': 'str'}, + 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_type': {'key': 'changeType', 'type': 'object'}, - 'comment': {'key': 'comment', 'type': 'str'}, - 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } - def __init__(self, changed_by=None, changed_date=None, change_type=None, comment=None, definition_url=None, name=None, revision=None): + def __init__(self, comment=None, definition_url=None, changed_by=None, changed_date=None, change_type=None, name=None, revision=None): super(BuildDefinitionRevision, self).__init__() + self.comment = comment + self.definition_url = definition_url self.changed_by = changed_by self.changed_date = changed_date self.change_type = change_type - self.comment = comment - self.definition_url = definition_url self.name = name self.revision = revision @@ -628,8 +632,10 @@ class BuildDefinitionStep(Model): :type inputs: dict :param ref_name: The reference name for this step. :type ref_name: str + :param retry_count_on_task_failure: Number of retries. + :type retry_count_on_task_failure: int :param task: The task associated with this step. - :type task: :class:`TaskDefinitionReference ` + :type task: :class:`TaskDefinitionReference ` :param timeout_in_minutes: The time, in minutes, that this step is allowed to run. :type timeout_in_minutes: int """ @@ -643,11 +649,12 @@ class BuildDefinitionStep(Model): 'environment': {'key': 'environment', 'type': '{str}'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'ref_name': {'key': 'refName', 'type': 'str'}, + 'retry_count_on_task_failure': {'key': 'retryCountOnTaskFailure', 'type': 'int'}, 'task': {'key': 'task', 'type': 'TaskDefinitionReference'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } - def __init__(self, always_run=None, condition=None, continue_on_error=None, display_name=None, enabled=None, environment=None, inputs=None, ref_name=None, task=None, timeout_in_minutes=None): + def __init__(self, always_run=None, condition=None, continue_on_error=None, display_name=None, enabled=None, environment=None, inputs=None, ref_name=None, retry_count_on_task_failure=None, task=None, timeout_in_minutes=None): super(BuildDefinitionStep, self).__init__() self.always_run = always_run self.condition = condition @@ -657,6 +664,7 @@ def __init__(self, always_run=None, condition=None, continue_on_error=None, disp self.environment = environment self.inputs = inputs self.ref_name = ref_name + self.retry_count_on_task_failure = retry_count_on_task_failure self.task = task self.timeout_in_minutes = timeout_in_minutes @@ -682,7 +690,7 @@ class BuildDefinitionTemplate(Model): :param name: The name of the template. :type name: str :param template: The actual template. - :type template: :class:`BuildDefinition ` + :type template: :class:`BuildDefinition ` """ _attribute_map = { @@ -731,7 +739,7 @@ class BuildDefinitionTemplate3_2(Model): :param name: :type name: str :param template: - :type template: :class:`BuildDefinition3_2 ` + :type template: :class:`BuildDefinition3_2 ` """ _attribute_map = { @@ -843,7 +851,7 @@ class BuildOption(Model): Represents the application of an optional behavior to a build definition. :param definition: A reference to the build option. - :type definition: :class:`BuildOptionDefinitionReference ` + :type definition: :class:`BuildOptionDefinitionReference ` :param enabled: Indicates whether the behavior is enabled. :type enabled: bool :param inputs: @@ -983,12 +991,12 @@ class BuildRepository(Model): """ Represents a repository used by a build definition. - :param checkout_submodules: Indicates whether to checkout submodules. - :type checkout_submodules: bool :param clean: Indicates whether to clean the target folder when getting code from the repository. :type clean: str :param default_branch: The name of the default branch. :type default_branch: str + :param checkout_submodules: Indicates whether to checkout submodules. + :type checkout_submodules: bool :param id: The ID of the repository. :type id: str :param name: The friendly name of the repository. @@ -1004,9 +1012,9 @@ class BuildRepository(Model): """ _attribute_map = { - 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, 'clean': {'key': 'clean', 'type': 'str'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, + 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, @@ -1015,11 +1023,11 @@ class BuildRepository(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, checkout_submodules=None, clean=None, default_branch=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): + def __init__(self, clean=None, default_branch=None, checkout_submodules=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): super(BuildRepository, self).__init__() - self.checkout_submodules = checkout_submodules self.clean = clean self.default_branch = default_branch + self.checkout_submodules = checkout_submodules self.id = id self.name = name self.properties = properties @@ -1078,6 +1086,52 @@ def __init__(self, distributed_task_agents=None, paid_private_agent_slots=None, self.xaml_controllers = xaml_controllers +class BuildRetentionHistory(Model): + """ + A historical overview of build retention information. This includes a list of snapshots taken about build retention usage, and a list of builds that have exceeded the default 30 day retention policy. + + :param build_retention_samples: A list of builds that are older than the default retention policy, but are not marked as retained. Something is causing these builds to not get cleaned up. + :type build_retention_samples: list of :class:`BuildRetentionSample ` + """ + + _attribute_map = { + 'build_retention_samples': {'key': 'buildRetentionSamples', 'type': '[BuildRetentionSample]'} + } + + def __init__(self, build_retention_samples=None): + super(BuildRetentionHistory, self).__init__() + self.build_retention_samples = build_retention_samples + + +class BuildRetentionSample(Model): + """ + A snapshot of build retention information. This class takes a sample at the given time. It provides information about retained builds, files associated with those retained builds, and number of files being retained. + + :param builds: Summary of retention by build + :type builds: str + :param definitions: List of build definitions + :type definitions: str + :param files: Summary of files consumed by retained builds + :type files: str + :param sample_time: The date and time when the sample was taken + :type sample_time: datetime + """ + + _attribute_map = { + 'builds': {'key': 'builds', 'type': 'str'}, + 'definitions': {'key': 'definitions', 'type': 'str'}, + 'files': {'key': 'files', 'type': 'str'}, + 'sample_time': {'key': 'sampleTime', 'type': 'iso-8601'} + } + + def __init__(self, builds=None, definitions=None, files=None, sample_time=None): + super(BuildRetentionSample, self).__init__() + self.builds = builds + self.definitions = definitions + self.files = files + self.sample_time = sample_time + + class BuildSettings(Model): """ Represents system-wide build settings. @@ -1085,9 +1139,9 @@ class BuildSettings(Model): :param days_to_keep_deleted_builds_before_destroy: The number of days to keep records of deleted builds. :type days_to_keep_deleted_builds_before_destroy: int :param default_retention_policy: The default retention policy. - :type default_retention_policy: :class:`RetentionPolicy ` + :type default_retention_policy: :class:`RetentionPolicy ` :param maximum_retention_policy: The maximum retention policy. - :type maximum_retention_policy: :class:`RetentionPolicy ` + :type maximum_retention_policy: :class:`RetentionPolicy ` """ _attribute_map = { @@ -1103,55 +1157,6 @@ def __init__(self, days_to_keep_deleted_builds_before_destroy=None, default_rete self.maximum_retention_policy = maximum_retention_policy -class Change(Model): - """ - Represents a change associated with a build. - - :param author: The author of the change. - :type author: :class:`IdentityRef ` - :param display_uri: The location of a user-friendly representation of the resource. - :type display_uri: str - :param id: The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID. - :type id: str - :param location: The location of the full representation of the resource. - :type location: str - :param message: The description of the change. This might be a commit message or changeset description. - :type message: str - :param message_truncated: Indicates whether the message was truncated. - :type message_truncated: bool - :param pusher: The person or process that pushed the change. - :type pusher: str - :param timestamp: The timestamp for the change. - :type timestamp: datetime - :param type: The type of change. "commit", "changeset", etc. - :type type: str - """ - - _attribute_map = { - 'author': {'key': 'author', 'type': 'IdentityRef'}, - 'display_uri': {'key': 'displayUri', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_truncated': {'key': 'messageTruncated', 'type': 'bool'}, - 'pusher': {'key': 'pusher', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'type': {'key': 'type', 'type': 'str'} - } - - def __init__(self, author=None, display_uri=None, id=None, location=None, message=None, message_truncated=None, pusher=None, timestamp=None, type=None): - super(Change, self).__init__() - self.author = author - self.display_uri = display_uri - self.id = id - self.location = location - self.message = message - self.message_truncated = message_truncated - self.pusher = pusher - self.timestamp = timestamp - self.type = type - - class DataSourceBindingBase(Model): """ Represents binding of data source for the service endpoint request. @@ -1167,7 +1172,7 @@ class DataSourceBindingBase(Model): :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. - :type headers: list of :class:`AuthorizationHeader ` + :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. @@ -1230,7 +1235,7 @@ class DefinitionReference(Model): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. @@ -1319,19 +1324,19 @@ class Folder(Model): Represents a folder that contains build definitions. :param created_by: The process or person who created the folder. - :type created_by: :class:`IdentityRef ` + :type created_by: :class:`IdentityRef ` :param created_on: The date the folder was created. :type created_on: datetime :param description: The description. :type description: str :param last_changed_by: The process or person that last changed the folder. - :type last_changed_by: :class:`IdentityRef ` + :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the folder was last changed. :type last_changed_date: datetime :param path: The full path. :type path: str :param project: The project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` """ _attribute_map = { @@ -1358,7 +1363,7 @@ def __init__(self, created_by=None, created_on=None, description=None, last_chan class GraphSubjectBase(Model): """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. @@ -1382,10 +1387,59 @@ def __init__(self, _links=None, descriptor=None, display_name=None, url=None): self.url = url +class Change(Model): + """ + Represents a change associated with a build. + + :param author: The author of the change. + :type author: :class:`IdentityRef ` + :param display_uri: The location of a user-friendly representation of the resource. + :type display_uri: str + :param id: The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID. + :type id: str + :param location: The location of the full representation of the resource. + :type location: str + :param message: The description of the change. This might be a commit message or changeset description. + :type message: str + :param message_truncated: Indicates whether the message was truncated. + :type message_truncated: bool + :param pusher: The person or process that pushed the change. + :type pusher: str + :param timestamp: The timestamp for the change. + :type timestamp: datetime + :param type: The type of change. "commit", "changeset", etc. + :type type: str + """ + + _attribute_map = { + 'author': {'key': 'author', 'type': 'IdentityRef'}, + 'display_uri': {'key': 'displayUri', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_truncated': {'key': 'messageTruncated', 'type': 'bool'}, + 'pusher': {'key': 'pusher', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'} + } + + def __init__(self, author=None, display_uri=None, id=None, location=None, message=None, message_truncated=None, pusher=None, timestamp=None, type=None): + super(Change, self).__init__() + self.author = author + self.display_uri = display_uri + self.id = id + self.location = location + self.message = message + self.message_truncated = message_truncated + self.pusher = pusher + self.timestamp = timestamp + self.type = type + + class IdentityRef(GraphSubjectBase): """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. @@ -1545,7 +1599,9 @@ def __init__(self, definition_id=None, owner_id=None, run_id=None): class NewRetentionLease(Model): """ - :param days_valid: The number of days to consider the lease valid. + Required information to create a new retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". :type days_valid: int :param definition_id: The pipeline definition of the run. :type definition_id: int @@ -1599,8 +1655,10 @@ class PipelineGeneralSettings(Model): """ Contains pipeline general settings. - :param enforce_job_auth_scope: If enabled, scope of access for all pipelines reduces to the current project. + :param enforce_job_auth_scope: If enabled, scope of access for all non-release pipelines reduces to the current project. :type enforce_job_auth_scope: bool + :param enforce_job_auth_scope_for_releases: If enabled, scope of access for all release pipelines reduces to the current project. + :type enforce_job_auth_scope_for_releases: bool :param enforce_referenced_repo_scoped_token: Restricts the scope of access for all pipelines to only repositories explicitly referenced by the pipeline. :type enforce_referenced_repo_scoped_token: bool :param enforce_settable_var: If enabled, only those variables that are explicitly marked as "Settable at queue time" can be set at queue time. @@ -1613,15 +1671,17 @@ class PipelineGeneralSettings(Model): _attribute_map = { 'enforce_job_auth_scope': {'key': 'enforceJobAuthScope', 'type': 'bool'}, + 'enforce_job_auth_scope_for_releases': {'key': 'enforceJobAuthScopeForReleases', 'type': 'bool'}, 'enforce_referenced_repo_scoped_token': {'key': 'enforceReferencedRepoScopedToken', 'type': 'bool'}, 'enforce_settable_var': {'key': 'enforceSettableVar', 'type': 'bool'}, 'publish_pipeline_metadata': {'key': 'publishPipelineMetadata', 'type': 'bool'}, 'status_badges_are_private': {'key': 'statusBadgesArePrivate', 'type': 'bool'} } - def __init__(self, enforce_job_auth_scope=None, enforce_referenced_repo_scoped_token=None, enforce_settable_var=None, publish_pipeline_metadata=None, status_badges_are_private=None): + def __init__(self, enforce_job_auth_scope=None, enforce_job_auth_scope_for_releases=None, enforce_referenced_repo_scoped_token=None, enforce_settable_var=None, publish_pipeline_metadata=None, status_badges_are_private=None): super(PipelineGeneralSettings, self).__init__() self.enforce_job_auth_scope = enforce_job_auth_scope + self.enforce_job_auth_scope_for_releases = enforce_job_auth_scope_for_releases self.enforce_referenced_repo_scoped_token = enforce_referenced_repo_scoped_token self.enforce_settable_var = enforce_settable_var self.publish_pipeline_metadata = publish_pipeline_metadata @@ -1633,13 +1693,13 @@ class PipelineReference(Model): Pipeline reference :param job_reference: Reference of the job - :type job_reference: :class:`JobReference ` + :type job_reference: :class:`JobReference ` :param phase_reference: Reference of the phase. - :type phase_reference: :class:`PhaseReference ` + :type phase_reference: :class:`PhaseReference ` :param pipeline_id: Reference of the pipeline with which this pipeline instance is related. :type pipeline_id: int :param stage_reference: Reference of the stage. - :type stage_reference: :class:`StageReference ` + :type stage_reference: :class:`StageReference ` """ _attribute_map = { @@ -1660,11 +1720,11 @@ def __init__(self, job_reference=None, phase_reference=None, pipeline_id=None, s class ProcessParameters(Model): """ :param data_source_bindings: - :type data_source_bindings: list of :class:`DataSourceBindingBase ` + :type data_source_bindings: list of :class:`DataSourceBindingBase ` :param inputs: - :type inputs: list of :class:`TaskInputDefinitionBase ` + :type inputs: list of :class:`TaskInputDefinitionBase ` :param source_definitions: - :type source_definitions: list of :class:`TaskSourceDefinitionBase ` + :type source_definitions: list of :class:`TaskSourceDefinitionBase ` """ _attribute_map = { @@ -1685,13 +1745,13 @@ class ProjectRetentionSetting(Model): Contains the settings for the retention rules. :param purge_artifacts: The rules for artifact retention. Artifacts can not live longer than a run, so will be overridden by a shorter run purge setting. - :type purge_artifacts: :class:`RetentionSetting ` + :type purge_artifacts: :class:`RetentionSetting ` :param purge_pull_request_runs: The rules for pull request pipeline run retention. - :type purge_pull_request_runs: :class:`RetentionSetting ` + :type purge_pull_request_runs: :class:`RetentionSetting ` :param purge_runs: The rules for pipeline run retention. - :type purge_runs: :class:`RetentionSetting ` + :type purge_runs: :class:`RetentionSetting ` :param retain_runs_per_protected_branch: The rules for retaining runs per protected branch. - :type retain_runs_per_protected_branch: :class:`RetentionSetting ` + :type retain_runs_per_protected_branch: :class:`RetentionSetting ` """ _attribute_map = { @@ -1714,13 +1774,15 @@ class PullRequest(Model): Represents a pull request object. These are retrieved from Source Providers. :param _links: The links to other objects related to this object. - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param author: Author of the pull request. - :type author: :class:`IdentityRef ` + :type author: :class:`IdentityRef ` :param current_state: Current state of the pull request, e.g. open, merged, closed, conflicts, etc. :type current_state: str :param description: Description for the pull request. :type description: str + :param draft: Returns if pull request is draft + :type draft: bool :param id: Unique identifier for the pull request :type id: str :param provider_name: The name of the provider this pull request is associated with. @@ -1742,6 +1804,7 @@ class PullRequest(Model): 'author': {'key': 'author', 'type': 'IdentityRef'}, 'current_state': {'key': 'currentState', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'provider_name': {'key': 'providerName', 'type': 'str'}, 'source_branch_ref': {'key': 'sourceBranchRef', 'type': 'str'}, @@ -1751,12 +1814,13 @@ class PullRequest(Model): 'title': {'key': 'title', 'type': 'str'} } - def __init__(self, _links=None, author=None, current_state=None, description=None, id=None, provider_name=None, source_branch_ref=None, source_repository_owner=None, target_branch_ref=None, target_repository_owner=None, title=None): + def __init__(self, _links=None, author=None, current_state=None, description=None, draft=None, id=None, provider_name=None, source_branch_ref=None, source_repository_owner=None, target_branch_ref=None, target_repository_owner=None, title=None): super(PullRequest, self).__init__() self._links = _links self.author = author self.current_state = current_state self.description = description + self.draft = draft self.id = id self.provider_name = provider_name self.source_branch_ref = source_branch_ref @@ -1789,11 +1853,11 @@ class ReleaseReference(Model): :param attempt: Number of Release Attempt. :type attempt: int - :param creation_date: Release Creation Date. + :param creation_date: Release Creation Date(UTC). :type creation_date: datetime :param definition_id: Release definition ID. :type definition_id: int - :param environment_creation_date: Environment creation Date. + :param environment_creation_date: Environment creation Date(UTC). :type environment_creation_date: datetime :param environment_definition_id: Release environment definition ID. :type environment_definition_id: int @@ -1892,6 +1956,8 @@ class RetentionLease(Model): :type lease_id: int :param owner_id: Non-unique string that identifies the owner of a retention lease. :type owner_id: str + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool :param run_id: The pipeline run protected by this lease. :type run_id: int :param valid_until: The last day the lease is considered valid. @@ -1903,20 +1969,43 @@ class RetentionLease(Model): 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'lease_id': {'key': 'leaseId', 'type': 'int'}, 'owner_id': {'key': 'ownerId', 'type': 'str'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'}, 'run_id': {'key': 'runId', 'type': 'int'}, 'valid_until': {'key': 'validUntil', 'type': 'iso-8601'} } - def __init__(self, created_on=None, definition_id=None, lease_id=None, owner_id=None, run_id=None, valid_until=None): + def __init__(self, created_on=None, definition_id=None, lease_id=None, owner_id=None, protect_pipeline=None, run_id=None, valid_until=None): super(RetentionLease, self).__init__() self.created_on = created_on self.definition_id = definition_id self.lease_id = lease_id self.owner_id = owner_id + self.protect_pipeline = protect_pipeline self.run_id = run_id self.valid_until = valid_until +class RetentionLeaseUpdate(Model): + """ + An update to the retention parameters of a retention lease. + + :param days_valid: The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build "forever". + :type days_valid: int + :param protect_pipeline: If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. + :type protect_pipeline: bool + """ + + _attribute_map = { + 'days_valid': {'key': 'daysValid', 'type': 'int'}, + 'protect_pipeline': {'key': 'protectPipeline', 'type': 'bool'} + } + + def __init__(self, days_valid=None, protect_pipeline=None): + super(RetentionLeaseUpdate, self).__init__() + self.days_valid = days_valid + self.protect_pipeline = protect_pipeline + + class RetentionPolicy(Model): """ Represents a retention policy for a build definition. @@ -1990,7 +2079,7 @@ class SourceProviderAttributes(Model): :param supported_capabilities: The capabilities supported by this source provider. :type supported_capabilities: dict :param supported_triggers: The types of triggers supported by this source provider. - :type supported_triggers: list of :class:`SupportedTrigger ` + :type supported_triggers: list of :class:`SupportedTrigger ` """ _attribute_map = { @@ -2015,7 +2104,7 @@ class SourceRepositories(Model): :param page_length: The number of repositories requested for each page :type page_length: int :param repositories: A list of repositories - :type repositories: list of :class:`SourceRepository ` + :type repositories: list of :class:`SourceRepository ` :param total_page_count: The total number of pages, or '-1' if unknown :type total_page_count: int """ @@ -2226,7 +2315,7 @@ class TaskInputDefinitionBase(Model): :param type: :type type: str :param validation: - :type validation: :class:`TaskInputValidation ` + :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ @@ -2414,13 +2503,13 @@ def __init__(self, abbreviation=None, default_team_image_url=None, description=N class TestResultsContext(Model): """ :param build: - :type build: :class:`BuildReference ` + :type build: :class:`BuildReference ` :param context_type: :type context_type: object :param pipeline_reference: - :type pipeline_reference: :class:`PipelineReference ` + :type pipeline_reference: :class:`PipelineReference ` :param release: - :type release: :class:`ReleaseReference ` + :type release: :class:`ReleaseReference ` """ _attribute_map = { @@ -2466,29 +2555,29 @@ class TimelineRecord(Model): Represents an entry in a build's timeline. :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param attempt: Attempt number of record. :type attempt: int - :param change_id: The change ID. - :type change_id: int :param current_operation: A string that indicates the current operation. :type current_operation: str :param details: A reference to a sub-timeline. - :type details: :class:`TimelineReference ` + :type details: :class:`TimelineReference ` :param error_count: The number of errors produced by this operation. :type error_count: int :param finish_time: The finish time. :type finish_time: datetime + :param change_id: The change ID. + :type change_id: int :param id: The ID of the record. :type id: str :param identifier: String identifier that is consistent across attempts. :type identifier: str :param issues: - :type issues: list of :class:`Issue ` + :type issues: list of :class:`Issue ` :param last_modified: The time the record was last modified. :type last_modified: datetime :param log: A reference to the log produced by this operation. - :type log: :class:`BuildLogReference ` + :type log: :class:`BuildLogReference ` :param name: The name. :type name: str :param order: An ordinal value relative to other records. @@ -2498,7 +2587,7 @@ class TimelineRecord(Model): :param percent_complete: The current completion percentage. :type percent_complete: int :param previous_attempts: - :type previous_attempts: list of :class:`TimelineAttempt ` + :type previous_attempts: list of :class:`TimelineAttempt ` :param queue_id: The queue ID of the queue that the operation ran on. :type queue_id: int :param result: The result. @@ -2510,7 +2599,7 @@ class TimelineRecord(Model): :param state: The state of the record. :type state: object :param task: A reference to the task represented by this timeline record. - :type task: :class:`TaskReference ` + :type task: :class:`TaskReference ` :param type: The type of the record. :type type: str :param url: The REST URL of the timeline record. @@ -2524,11 +2613,11 @@ class TimelineRecord(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'attempt': {'key': 'attempt', 'type': 'int'}, - 'change_id': {'key': 'changeId', 'type': 'int'}, 'current_operation': {'key': 'currentOperation', 'type': 'str'}, 'details': {'key': 'details', 'type': 'TimelineReference'}, 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, @@ -2551,15 +2640,15 @@ class TimelineRecord(Model): 'worker_name': {'key': 'workerName', 'type': 'str'} } - def __init__(self, _links=None, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, identifier=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, queue_id=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): + def __init__(self, _links=None, attempt=None, current_operation=None, details=None, error_count=None, finish_time=None, change_id=None, id=None, identifier=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, queue_id=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): super(TimelineRecord, self).__init__() self._links = _links self.attempt = attempt - self.change_id = change_id self.current_operation = current_operation self.details = details self.error_count = error_count self.finish_time = finish_time + self.change_id = change_id self.id = id self.identifier = identifier self.issues = issues @@ -2612,13 +2701,13 @@ class UpdateProjectRetentionSettingModel(Model): Contains members for updating the retention settings values. All fields are optional. :param artifacts_retention: - :type artifacts_retention: :class:`UpdateRetentionSettingModel ` + :type artifacts_retention: :class:`UpdateRetentionSettingModel ` :param pull_request_run_retention: - :type pull_request_run_retention: :class:`UpdateRetentionSettingModel ` + :type pull_request_run_retention: :class:`UpdateRetentionSettingModel ` :param retain_runs_per_protected_branch: - :type retain_runs_per_protected_branch: :class:`UpdateRetentionSettingModel ` + :type retain_runs_per_protected_branch: :class:`UpdateRetentionSettingModel ` :param run_retention: - :type run_retention: :class:`UpdateRetentionSettingModel ` + :type run_retention: :class:`UpdateRetentionSettingModel ` """ _attribute_map = { @@ -2653,19 +2742,42 @@ def __init__(self, value=None): class UpdateStageParameters(Model): """ + :param force_retry_all_jobs: + :type force_retry_all_jobs: bool :param state: :type state: object """ _attribute_map = { + 'force_retry_all_jobs': {'key': 'forceRetryAllJobs', 'type': 'bool'}, 'state': {'key': 'state', 'type': 'object'} } - def __init__(self, state=None): + def __init__(self, force_retry_all_jobs=None, state=None): super(UpdateStageParameters, self).__init__() + self.force_retry_all_jobs = force_retry_all_jobs self.state = state +class UpdateTagParameters(Model): + """ + :param tags_to_add: + :type tags_to_add: list of str + :param tags_to_remove: + :type tags_to_remove: list of str + """ + + _attribute_map = { + 'tags_to_add': {'key': 'tagsToAdd', 'type': '[str]'}, + 'tags_to_remove': {'key': 'tagsToRemove', 'type': '[str]'} + } + + def __init__(self, tags_to_add=None, tags_to_remove=None): + super(UpdateTagParameters, self).__init__() + self.tags_to_add = tags_to_add + self.tags_to_remove = tags_to_remove + + class VariableGroupReference(Model): """ Represents a reference to a variable group. @@ -2729,6 +2841,23 @@ def __init__(self, id=None, name=None, url=None): self.url = url +class YamlBuild(Model): + """ + Represents a yaml build. + + :param yaml: The yaml used to define the build + :type yaml: str + """ + + _attribute_map = { + 'yaml': {'key': 'yaml', 'type': 'str'} + } + + def __init__(self, yaml=None): + super(YamlBuild, self).__init__() + self.yaml = yaml + + class BuildController(XamlBuildControllerReference): """ :param id: Id of the resource @@ -2738,7 +2867,7 @@ class BuildController(XamlBuildControllerReference): :param url: Full http link to the resource :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param created_date: The date the controller was created. :type created_date: datetime :param description: The description of the controller. @@ -2790,7 +2919,7 @@ class BuildDefinitionReference(DefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. @@ -2802,23 +2931,23 @@ class BuildDefinitionReference(DefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. - :type draft_of: :class:`DefinitionReference ` + :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. - :type drafts: list of :class:`DefinitionReference ` + :type drafts: list of :class:`DefinitionReference ` :param latest_build: - :type latest_build: :class:`Build ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. - :type queue: :class:`AgentPoolQueue ` + :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { @@ -2869,7 +2998,7 @@ class BuildDefinitionReference3_2(DefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. @@ -2881,19 +3010,19 @@ class BuildDefinitionReference3_2(DefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. - :type draft_of: :class:`DefinitionReference ` + :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. - :type drafts: list of :class:`DefinitionReference ` + :type drafts: list of :class:`DefinitionReference ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. - :type queue: :class:`AgentPoolQueue ` + :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { @@ -2970,9 +3099,9 @@ class BuildOptionDefinition(BuildOptionDefinitionReference): :param description: The description. :type description: str :param groups: The list of input groups defined for the build option. - :type groups: list of :class:`BuildOptionGroupDefinition ` + :type groups: list of :class:`BuildOptionGroupDefinition ` :param inputs: The list of inputs defined for the build option. - :type inputs: list of :class:`BuildOptionInputDefinition ` + :type inputs: list of :class:`BuildOptionInputDefinition ` :param name: The name of the build option. :type name: str :param ordinal: A value that indicates the relative order in which the behavior should be applied. @@ -3012,7 +3141,7 @@ class Timeline(TimelineReference): :param last_changed_on: The time the timeline was last changed. :type last_changed_on: datetime :param records: - :type records: list of :class:`TimelineRecord ` + :type records: list of :class:`TimelineRecord ` """ _attribute_map = { @@ -3079,7 +3208,7 @@ class BuildDefinition(BuildDefinitionReference): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. @@ -3091,23 +3220,23 @@ class BuildDefinition(BuildDefinitionReference): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. - :type draft_of: :class:`DefinitionReference ` + :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. - :type drafts: list of :class:`DefinitionReference ` + :type drafts: list of :class:`DefinitionReference ` :param latest_build: - :type latest_build: :class:`Build ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. - :type queue: :class:`AgentPoolQueue ` + :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition. :type badge_enabled: bool :param build_number_format: The build number format. @@ -3115,7 +3244,7 @@ class BuildDefinition(BuildDefinitionReference): :param comment: A save-time comment for the definition. :type comment: str :param demands: - :type demands: list of :class:`object ` + :type demands: list of :class:`object ` :param description: The description. :type description: str :param drop_location: The drop location for the definition. @@ -3127,23 +3256,23 @@ class BuildDefinition(BuildDefinitionReference): :param job_timeout_in_minutes: The job execution timeout (in minutes) for builds queued against this definition. :type job_timeout_in_minutes: int :param options: - :type options: list of :class:`BuildOption ` + :type options: list of :class:`BuildOption ` :param process: The build process. - :type process: :class:`object ` + :type process: :class:`object ` :param process_parameters: The process parameters for this definition. - :type process_parameters: :class:`ProcessParameters ` + :type process_parameters: :class:`ProcessParameters ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param repository: The repository. - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param retention_rules: - :type retention_rules: list of :class:`RetentionPolicy ` + :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: - :type triggers: list of :class:`object ` + :type triggers: list of :class:`object ` :param variable_groups: - :type variable_groups: list of :class:`VariableGroup ` + :type variable_groups: list of :class:`VariableGroup ` :param variables: :type variables: dict """ @@ -3225,7 +3354,7 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :param path: The folder path of the definition. :type path: str :param project: A reference to the project. - :type project: :class:`TeamProjectReference ` + :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. @@ -3237,29 +3366,29 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :param url: The REST URL of the definition. :type url: str :param _links: - :type _links: :class:`ReferenceLinks ` + :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. - :type authored_by: :class:`IdentityRef ` + :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. - :type draft_of: :class:`DefinitionReference ` + :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. - :type drafts: list of :class:`DefinitionReference ` + :type drafts: list of :class:`DefinitionReference ` :param metrics: - :type metrics: list of :class:`BuildMetric ` + :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. - :type queue: :class:`AgentPoolQueue ` + :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition :type badge_enabled: bool :param build: - :type build: list of :class:`BuildDefinitionStep ` + :type build: list of :class:`BuildDefinitionStep ` :param build_number_format: The build number format :type build_number_format: str :param comment: The comment entered when saving the definition :type comment: str :param demands: - :type demands: list of :class:`object ` + :type demands: list of :class:`object ` :param description: The description :type description: str :param drop_location: The drop location for the definition @@ -3271,23 +3400,23 @@ class BuildDefinition3_2(BuildDefinitionReference3_2): :param job_timeout_in_minutes: The job execution timeout in minutes for builds which are queued against this definition :type job_timeout_in_minutes: int :param latest_build: - :type latest_build: :class:`Build ` + :type latest_build: :class:`Build ` :param latest_completed_build: - :type latest_completed_build: :class:`Build ` + :type latest_completed_build: :class:`Build ` :param options: - :type options: list of :class:`BuildOption ` + :type options: list of :class:`BuildOption ` :param process_parameters: Process Parameters - :type process_parameters: :class:`ProcessParameters ` + :type process_parameters: :class:`ProcessParameters ` :param properties: - :type properties: :class:`object ` + :type properties: :class:`object ` :param repository: The repository - :type repository: :class:`BuildRepository ` + :type repository: :class:`BuildRepository ` :param retention_rules: - :type retention_rules: list of :class:`RetentionPolicy ` + :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: - :type triggers: list of :class:`object ` + :type triggers: list of :class:`object ` :param variables: :type variables: dict """ @@ -3386,14 +3515,16 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', + 'BuildRetentionHistory', + 'BuildRetentionSample', 'BuildSettings', - 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', + 'Change', 'IdentityRef', 'Issue', 'JobReference', @@ -3411,6 +3542,7 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non 'RepositoryWebhook', 'ResourceRef', 'RetentionLease', + 'RetentionLeaseUpdate', 'RetentionPolicy', 'RetentionSetting', 'SourceProviderAttributes', @@ -3434,9 +3566,11 @@ def __init__(self, created_date=None, id=None, name=None, path=None, project=Non 'UpdateProjectRetentionSettingModel', 'UpdateRetentionSettingModel', 'UpdateStageParameters', + 'UpdateTagParameters', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', + 'YamlBuild', 'BuildController', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', diff --git a/azure-devops/azure/devops/v6_0/cix/__init__.py b/azure-devops/azure/devops/v7_0/cix/__init__.py similarity index 88% rename from azure-devops/azure/devops/v6_0/cix/__init__.py rename to azure-devops/azure/devops/v7_0/cix/__init__.py index b654a5ef..28165779 100644 --- a/azure-devops/azure/devops/v6_0/cix/__init__.py +++ b/azure-devops/azure/devops/v7_0/cix/__init__.py @@ -23,11 +23,6 @@ 'ResourceCreationParameter', 'TeamProject', 'TeamProjectReference', - 'Template', - 'TemplateAsset', - 'TemplateDataSourceBinding', - 'TemplateParameterDefinition', - 'TemplateParameters', 'WebApiTeamRef', 'CixClient' ] diff --git a/azure-devops/azure/devops/v5_1/cix/cix_client.py b/azure-devops/azure/devops/v7_0/cix/cix_client.py similarity index 63% rename from azure-devops/azure/devops/v5_1/cix/cix_client.py rename to azure-devops/azure/devops/v7_0/cix/cix_client.py index f6e35ae1..3c82565c 100644 --- a/azure-devops/azure/devops/v5_1/cix/cix_client.py +++ b/azure-devops/azure/devops/v7_0/cix/cix_client.py @@ -27,7 +27,7 @@ def __init__(self, base_url=None, creds=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. + 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) @@ -49,17 +49,17 @@ def get_configurations(self, project, repository_type=None, repository_id=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', + version='7.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response)) def create_project_connection(self, create_connection_inputs, project): """CreateProjectConnection. - [Preview API] Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created. - :param :class:` ` create_connection_inputs: + Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created. + :param :class:` ` create_connection_inputs: :param str project: - :rtype: :class:` ` + :rtype: :class:` ` """ query_parameters = {} if project is not None: @@ -67,14 +67,14 @@ def create_project_connection(self, create_connection_inputs, project): 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', + version='7.0', 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. + 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) @@ -99,46 +99,16 @@ def get_detected_build_frameworks(self, project, repository_type=None, repositor 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', + version='7.0', 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 create_resources(self, creation_parameters, project): """CreateResources. - [Preview API] :param {ResourceCreationParameter} creation_parameters: :param str project: Project ID or project name - :rtype: :class:` ` + :rtype: :class:` ` """ route_values = {} if project is not None: @@ -146,26 +116,8 @@ def create_resources(self, creation_parameters, project): 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', + version='7.0', route_values=route_values, content=content) return self._deserialize('CreatedResources', response) - def render_template(self, template_parameters, template_id): - """RenderTemplate. - [Preview API] - :param :class:` ` template_parameters: - :param str template_id: - :rtype: :class:`