diff --git a/vsts/vsts/build/v4_1/build_client.py b/vsts/vsts/build/v4_1/build_client.py index 4c360b27..50a718ce 100644 --- a/vsts/vsts/build/v4_1/build_client.py +++ b/vsts/vsts/build/v4_1/build_client.py @@ -111,6 +111,58 @@ def get_artifacts(self, build_id, project=None): returns_collection=True) return self._deserialize('[BuildArtifact]', response) + 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. + :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='4.1-preview.1', + route_values=route_values, + returns_collection=True) + return self._deserialize('[Attachment]', response) + + def get_attachment(self, project, build_id, timeline_id, record_id, type, name): + """GetAttachment. + [Preview API] 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='4.1-preview.1', + route_values=route_values) + return self._deserialize('object', response) + def get_badge(self, project, definition_id, branch_name=None): """GetBadge. [Preview API] Gets a badge that indicates the status of the most recent build for a definition. @@ -139,7 +191,7 @@ def list_branches(self, project, provider_name, service_endpoint_id=None, reposi [Preview API] 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 use service endpoints, e.g. TFVC or TFGit. + :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. :rtype: [str] """ @@ -226,15 +278,15 @@ def delete_build(self, build_id, project=None): route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', + version='4.1-preview.4', route_values=route_values) def get_build(self, build_id, project=None, property_filters=None): """GetBuild. - [Preview API] Gets a build. - :param int build_id: The ID of the build. + [Preview API] Gets a build + :param int build_id: :param str project: Project ID or project name - :param str property_filters: A comma-delimited list of properties to include in the results. + :param str property_filters: :rtype: :class:` ` """ route_values = {} @@ -247,7 +299,7 @@ def get_build(self, build_id, project=None, 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='4.1-preview.3', + version='4.1-preview.4', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) @@ -329,7 +381,7 @@ def get_builds(self, project=None, definitions=None, queues=None, build_number=N 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='4.1-preview.3', + version='4.1-preview.4', route_values=route_values, query_parameters=query_parameters, returns_collection=True) @@ -355,7 +407,7 @@ def queue_build(self, build, project=None, ignore_warnings=None, check_in_ticket content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', + version='4.1-preview.4', route_values=route_values, query_parameters=query_parameters, content=content) @@ -377,7 +429,7 @@ def update_build(self, build, build_id, project=None): content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', + version='4.1-preview.4', route_values=route_values, content=content) return self._deserialize('Build', response) @@ -395,7 +447,7 @@ def update_builds(self, builds, project=None): content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', - version='4.1-preview.3', + version='4.1-preview.4', route_values=route_values, content=content, returns_collection=True) @@ -403,11 +455,11 @@ def update_builds(self, builds, project=None): def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): """GetBuildChanges. - [Preview API] Gets the changes associated with a build. + [Preview API] Gets the changes associated with a build :param str project: Project ID or project name - :param int build_id: The build ID. + :param int build_id: :param str continuation_token: - :param int top: The maximum number of changes to return. + :param int top: The maximum number of changes to return :param bool include_source_change: :rtype: [Change] """ @@ -625,6 +677,54 @@ def get_definitions(self, project=None, name=None, repository_id=None, repositor returns_collection=True) return self._deserialize('[BuildDefinitionReference]', response) + def reset_counter(self, definition_id, counter_id, project=None): + """ResetCounter. + [Preview API] Resets the counter variable Value back to the Seed. + :param int definition_id: The ID of the definition. + :param int counter_id: The ID of the counter. + :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 definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if counter_id is not None: + query_parameters['counterId'] = self._serialize.query('counter_id', counter_id, 'int') + self._send(http_method='POST', + location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', + version='4.1-preview.6', + route_values=route_values, + query_parameters=query_parameters) + + def update_counter_seed(self, definition_id, counter_id, new_seed, reset_value, project=None): + """UpdateCounterSeed. + [Preview API] Changes the counter variable Seed, and optionally resets the Value to this new Seed. Note that if Seed is being set above Value, then Value will be updated regardless. + :param int definition_id: The ID of the definition. + :param int counter_id: The ID of the counter. + :param long new_seed: The new Seed value. + :param bool reset_value: Flag indicating if Value should also be reset. + :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 definition_id is not None: + route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') + query_parameters = {} + if counter_id is not None: + query_parameters['counterId'] = self._serialize.query('counter_id', counter_id, 'int') + if new_seed is not None: + query_parameters['newSeed'] = self._serialize.query('new_seed', new_seed, 'long') + if reset_value is not None: + query_parameters['resetValue'] = self._serialize.query('reset_value', reset_value, 'bool') + self._send(http_method='POST', + location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', + version='4.1-preview.6', + route_values=route_values, + query_parameters=query_parameters) + def update_definition(self, definition, definition_id, project=None, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. [Preview API] Updates an existing definition. @@ -654,6 +754,38 @@ def update_definition(self, definition, definition_id, project=None, secrets_sou 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): + """GetFileContents. + [Preview API] 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='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + def create_folder(self, folder, project, path): """CreateFolder. [Preview API] Creates a new folder. @@ -896,6 +1028,39 @@ def get_build_option_definitions(self, project=None): returns_collection=True) return self._deserialize('[BuildOptionDefinition]', 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. + :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 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 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='7944d6fb-df01-4709-920a-7a189aa34037', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[SourceRepositoryItem]', response) + def get_build_properties(self, project, build_id, filter=None): """GetBuildProperties. [Preview API] Gets properties for a build. @@ -1034,13 +1199,17 @@ def get_build_report_html_content(self, project, build_id, type=None): query_parameters=query_parameters) return self._deserialize('object', response) - def list_repositories(self, project, provider_name, service_endpoint_id=None): + 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. :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 use service endpoints, e.g. TFVC or TFGit. - :rtype: [SourceRepository] + :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: @@ -1050,13 +1219,20 @@ def list_repositories(self, project, provider_name, service_endpoint_id=None): 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='4.1-preview.1', route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[SourceRepository]', response) + query_parameters=query_parameters) + return self._deserialize('SourceRepositories', response) def get_resource_usage(self): """GetResourceUsage. @@ -1388,14 +1564,54 @@ def save_template(self, template, project, template_id): content=content) return self._deserialize('BuildDefinitionTemplate', response) + def get_ticketed_artifact_content_zip(self, build_id, project_id, artifact_name, download_ticket): + """GetTicketedArtifactContentZip. + [Preview API] Gets a Zip file of the artifact with the given name for a build. + :param int build_id: The ID of the build. + :param str project_id: The project ID. + :param str artifact_name: The name of the artifact. + :param String download_ticket: A valid ticket that gives permission to download artifacts + :rtype: object + """ + route_values = {} + if build_id is not None: + route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') + query_parameters = {} + if project_id is not None: + query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') + if artifact_name is not None: + query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') + response = self._send(http_method='GET', + location_id='731b7e7a-0b6c-4912-af75-de04fe4899db', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def get_ticketed_logs_content_zip(self, build_id, download_ticket): + """GetTicketedLogsContentZip. + [Preview API] Gets a Zip file of the logs for a given build. + :param int build_id: The ID of the build. + :param String download_ticket: A valid ticket that gives permission to download the logs. + :rtype: object + """ + route_values = {} + 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='917890d1-a6b5-432d-832a-6afcf6bb0734', + version='4.1-preview.1', + route_values=route_values) + return self._deserialize('object', response) + def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None, plan_id=None): """GetBuildTimeline. - [Preview API] Gets a timeline for a build. + [Preview API] Gets details for a build :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. If not specified, uses the main timeline for the plan. + :param int build_id: + :param str timeline_id: :param int change_id: - :param str plan_id: The ID of the plan. If not specified, uses the primary plan for the build. + :param str plan_id: :rtype: :class:` ` """ route_values = {} @@ -1417,6 +1633,60 @@ def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None 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. + :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='4.1-preview.1', + 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. + :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='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[RepositoryWebhook]', response) + def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. [Preview API] Gets the work items associated with a build. diff --git a/vsts/vsts/build/v4_1/models/__init__.py b/vsts/vsts/build/v4_1/models/__init__.py index 11182e19..ed1d399e 100644 --- a/vsts/vsts/build/v4_1/models/__init__.py +++ b/vsts/vsts/build/v4_1/models/__init__.py @@ -7,7 +7,13 @@ # -------------------------------------------------------------------------------------------- from .agent_pool_queue import AgentPoolQueue +from .aggregated_results_analysis import AggregatedResultsAnalysis +from .aggregated_results_by_outcome import AggregatedResultsByOutcome +from .aggregated_results_difference import AggregatedResultsDifference +from .aggregated_runs_by_state import AggregatedRunsByState from .artifact_resource import ArtifactResource +from .associated_work_item import AssociatedWorkItem +from .attachment import Attachment from .authorization_header import AuthorizationHeader from .build import Build from .build_artifact import BuildArtifact @@ -15,6 +21,7 @@ from .build_controller import BuildController from .build_definition import BuildDefinition from .build_definition3_2 import BuildDefinition3_2 +from .build_definition_counter import BuildDefinitionCounter from .build_definition_reference import BuildDefinitionReference from .build_definition_reference3_2 import BuildDefinitionReference3_2 from .build_definition_revision import BuildDefinitionRevision @@ -42,15 +49,20 @@ from .definition_reference import DefinitionReference from .deployment import Deployment from .folder import Folder +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .issue import Issue from .json_patch_operation import JsonPatchOperation from .process_parameters import ProcessParameters from .reference_links import ReferenceLinks +from .release_reference import ReleaseReference +from .repository_webhook import RepositoryWebhook from .resource_ref import ResourceRef from .retention_policy import RetentionPolicy from .source_provider_attributes import SourceProviderAttributes +from .source_repositories import SourceRepositories from .source_repository import SourceRepository +from .source_repository_item import SourceRepositoryItem from .supported_trigger import SupportedTrigger from .task_agent_pool_reference import TaskAgentPoolReference from .task_definition_reference import TaskDefinitionReference @@ -60,6 +72,7 @@ from .task_reference import TaskReference from .task_source_definition_base import TaskSourceDefinitionBase from .team_project_reference import TeamProjectReference +from .test_results_context import TestResultsContext from .timeline import Timeline from .timeline_record import TimelineRecord from .timeline_reference import TimelineReference @@ -70,7 +83,13 @@ __all__ = [ 'AgentPoolQueue', + 'AggregatedResultsAnalysis', + 'AggregatedResultsByOutcome', + 'AggregatedResultsDifference', + 'AggregatedRunsByState', 'ArtifactResource', + 'AssociatedWorkItem', + 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', @@ -78,6 +97,7 @@ 'BuildController', 'BuildDefinition', 'BuildDefinition3_2', + 'BuildDefinitionCounter', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildDefinitionRevision', @@ -105,15 +125,20 @@ 'DefinitionReference', 'Deployment', 'Folder', + 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'ReferenceLinks', + 'ReleaseReference', + 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', + 'SourceRepositories', 'SourceRepository', + 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', @@ -123,6 +148,7 @@ 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', + 'TestResultsContext', 'Timeline', 'TimelineRecord', 'TimelineReference', diff --git a/vsts/vsts/build/v4_1/models/artifact_resource.py b/vsts/vsts/build/v4_1/models/artifact_resource.py index 49e52950..5d9174e3 100644 --- a/vsts/vsts/build/v4_1/models/artifact_resource.py +++ b/vsts/vsts/build/v4_1/models/artifact_resource.py @@ -16,6 +16,8 @@ class ArtifactResource(Model): :type _links: :class:`ReferenceLinks ` :param data: Type-specific data about the artifact. :type data: str + :param download_ticket: A secret that can be sent in a request header to retrieve an artifact anonymously. Valid for a limited amount of time. Optional. + :type download_ticket: str :param download_url: A link to download the resource. :type download_url: str :param properties: Type-specific properties of the artifact. @@ -29,16 +31,18 @@ class ArtifactResource(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'data': {'key': 'data', 'type': 'str'}, + 'download_ticket': {'key': 'downloadTicket', 'type': 'str'}, 'download_url': {'key': 'downloadUrl', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, _links=None, data=None, download_url=None, properties=None, type=None, url=None): + def __init__(self, _links=None, data=None, download_ticket=None, download_url=None, properties=None, type=None, url=None): super(ArtifactResource, self).__init__() self._links = _links self.data = data + self.download_ticket = download_ticket self.download_url = download_url self.properties = properties self.type = type diff --git a/vsts/vsts/build/v4_1/models/build.py b/vsts/vsts/build/v4_1/models/build.py index f7eada17..4a8f2566 100644 --- a/vsts/vsts/build/v4_1/models/build.py +++ b/vsts/vsts/build/v4_1/models/build.py @@ -88,6 +88,8 @@ class Build(Model): :type status: object :param tags: :type tags: list of str + :param triggered_by_build: The build that triggered this build via a Build completion trigger. + :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. @@ -137,13 +139,14 @@ class Build(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, + 'triggered_by_build': {'key': 'triggeredByBuild', 'type': 'Build'}, 'trigger_info': {'key': 'triggerInfo', 'type': '{str}'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'} } - def __init__(self, _links=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, trigger_info=None, uri=None, url=None, validation_results=None): + def __init__(self, _links=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, triggered_by_build=None, trigger_info=None, uri=None, url=None, validation_results=None): super(Build, self).__init__() self._links = _links self.build_number = build_number @@ -183,6 +186,7 @@ def __init__(self, _links=None, build_number=None, build_number_revision=None, c self.start_time = start_time self.status = status self.tags = tags + self.triggered_by_build = triggered_by_build self.trigger_info = trigger_info self.uri = uri self.url = url diff --git a/vsts/vsts/build/v4_1/models/build_definition.py b/vsts/vsts/build/v4_1/models/build_definition.py index 2eb2d342..d443d215 100644 --- a/vsts/vsts/build/v4_1/models/build_definition.py +++ b/vsts/vsts/build/v4_1/models/build_definition.py @@ -56,6 +56,8 @@ class BuildDefinition(BuildDefinitionReference): :type build_number_format: str :param comment: A save-time comment for the definition. :type comment: str + :param counters: + :type counters: dict :param demands: :type demands: list of :class:`object ` :param description: The description. @@ -113,6 +115,7 @@ class BuildDefinition(BuildDefinitionReference): 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'build_number_format': {'key': 'buildNumberFormat', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, + 'counters': {'key': 'counters', 'type': '{BuildDefinitionCounter}'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'description': {'key': 'description', 'type': 'str'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, @@ -131,11 +134,12 @@ class BuildDefinition(BuildDefinitionReference): 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } - def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None, badge_enabled=None, build_number_format=None, comment=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, options=None, process=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variable_groups=None, variables=None): + def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None, badge_enabled=None, build_number_format=None, comment=None, counters=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, options=None, process=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variable_groups=None, variables=None): super(BuildDefinition, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url, _links=_links, authored_by=authored_by, draft_of=draft_of, drafts=drafts, latest_build=latest_build, latest_completed_build=latest_completed_build, metrics=metrics, quality=quality, queue=queue) self.badge_enabled = badge_enabled self.build_number_format = build_number_format self.comment = comment + self.counters = counters self.demands = demands self.description = description self.drop_location = drop_location diff --git a/vsts/vsts/build/v4_1/models/build_definition_template.py b/vsts/vsts/build/v4_1/models/build_definition_template.py index bcd59370..50efc44c 100644 --- a/vsts/vsts/build/v4_1/models/build_definition_template.py +++ b/vsts/vsts/build/v4_1/models/build_definition_template.py @@ -16,6 +16,8 @@ class BuildDefinitionTemplate(Model): :type can_delete: bool :param category: The template category. :type category: str + :param default_hosted_queue: An optional hosted agent queue for the template to use by default. + :type default_hosted_queue: str :param description: A description of the template. :type description: str :param icons: @@ -33,6 +35,7 @@ class BuildDefinitionTemplate(Model): _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, + 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, @@ -41,10 +44,11 @@ class BuildDefinitionTemplate(Model): 'template': {'key': 'template', 'type': 'BuildDefinition'} } - def __init__(self, can_delete=None, category=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): + def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate, self).__init__() self.can_delete = can_delete self.category = category + self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id diff --git a/vsts/vsts/build/v4_1/models/build_definition_template3_2.py b/vsts/vsts/build/v4_1/models/build_definition_template3_2.py index 8bd0c687..e497668d 100644 --- a/vsts/vsts/build/v4_1/models/build_definition_template3_2.py +++ b/vsts/vsts/build/v4_1/models/build_definition_template3_2.py @@ -16,6 +16,8 @@ class BuildDefinitionTemplate3_2(Model): :type can_delete: bool :param category: :type category: str + :param default_hosted_queue: + :type default_hosted_queue: str :param description: :type description: str :param icons: @@ -33,6 +35,7 @@ class BuildDefinitionTemplate3_2(Model): _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, + 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, @@ -41,10 +44,11 @@ class BuildDefinitionTemplate3_2(Model): 'template': {'key': 'template', 'type': 'BuildDefinition3_2'} } - def __init__(self, can_delete=None, category=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): + def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate3_2, self).__init__() self.can_delete = can_delete self.category = category + self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id diff --git a/vsts/vsts/build/v4_1/models/data_source_binding_base.py b/vsts/vsts/build/v4_1/models/data_source_binding_base.py index fe92a446..04638445 100644 --- a/vsts/vsts/build/v4_1/models/data_source_binding_base.py +++ b/vsts/vsts/build/v4_1/models/data_source_binding_base.py @@ -12,21 +12,21 @@ class DataSourceBindingBase(Model): """DataSourceBindingBase. - :param data_source_name: + :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str - :param endpoint_id: + :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str - :param endpoint_url: + :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str - :param headers: + :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` - :param parameters: + :param parameters: Gets or sets the parameters for the data source. :type parameters: dict - :param result_selector: + :param result_selector: Gets or sets the result selector. :type result_selector: str - :param result_template: + :param result_template: Gets or sets the result template. :type result_template: str - :param target: + :param target: Gets or sets the target of the data source. :type target: str """ diff --git a/vsts/vsts/build/v4_1/models/identity_ref.py b/vsts/vsts/build/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/build/v4_1/models/identity_ref.py +++ b/vsts/vsts/build/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/contributions/v4_1/models/__init__.py b/vsts/vsts/contributions/v4_1/models/__init__.py index a2b2f347..475ee422 100644 --- a/vsts/vsts/contributions/v4_1/models/__init__.py +++ b/vsts/vsts/contributions/v4_1/models/__init__.py @@ -6,6 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- +from .client_contribution import ClientContribution +from .client_contribution_node import ClientContributionNode +from .client_contribution_provider_details import ClientContributionProviderDetails from .client_data_provider_query import ClientDataProviderQuery from .contribution import Contribution from .contribution_base import ContributionBase @@ -13,7 +16,6 @@ from .contribution_node_query import ContributionNodeQuery from .contribution_node_query_result import ContributionNodeQueryResult from .contribution_property_description import ContributionPropertyDescription -from .contribution_provider_details import ContributionProviderDetails from .contribution_type import ContributionType from .data_provider_context import DataProviderContext from .data_provider_exception_details import DataProviderExceptionDetails @@ -29,9 +31,11 @@ from .installed_extension_state_issue import InstalledExtensionStateIssue from .licensing_override import LicensingOverride from .resolved_data_provider import ResolvedDataProvider -from .serialized_contribution_node import SerializedContributionNode __all__ = [ + 'ClientContribution', + 'ClientContributionNode', + 'ClientContributionProviderDetails', 'ClientDataProviderQuery', 'Contribution', 'ContributionBase', @@ -39,7 +43,6 @@ 'ContributionNodeQuery', 'ContributionNodeQueryResult', 'ContributionPropertyDescription', - 'ContributionProviderDetails', 'ContributionType', 'DataProviderContext', 'DataProviderExceptionDetails', @@ -55,5 +58,4 @@ 'InstalledExtensionStateIssue', 'LicensingOverride', 'ResolvedDataProvider', - 'SerializedContributionNode', ] diff --git a/vsts/vsts/contributions/v4_1/models/contribution.py b/vsts/vsts/contributions/v4_1/models/contribution.py index 4debccec..5a48a8b7 100644 --- a/vsts/vsts/contributions/v4_1/models/contribution.py +++ b/vsts/vsts/contributions/v4_1/models/contribution.py @@ -24,6 +24,8 @@ class Contribution(ContributionBase): :type includes: list of str :param properties: Properties/attributes of this contribution :type properties: :class:`object ` + :param restricted_to: List of demanded claims in order for the user to see this contribution (like anonymous, public, member...). + :type restricted_to: list of str :param targets: The ids of the contribution(s) that this contribution targets. (parent contributions) :type targets: list of str :param type: Id of the Contribution Type @@ -37,14 +39,16 @@ class Contribution(ContributionBase): 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'includes': {'key': 'includes', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'str'} } - def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, targets=None, type=None): + def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, restricted_to=None, targets=None, type=None): super(Contribution, self).__init__(description=description, id=id, visible_to=visible_to) self.constraints = constraints self.includes = includes self.properties = properties + self.restricted_to = restricted_to self.targets = targets self.type = type diff --git a/vsts/vsts/contributions/v4_1/models/contribution_constraint.py b/vsts/vsts/contributions/v4_1/models/contribution_constraint.py index 44869a8e..a26d702e 100644 --- a/vsts/vsts/contributions/v4_1/models/contribution_constraint.py +++ b/vsts/vsts/contributions/v4_1/models/contribution_constraint.py @@ -14,9 +14,11 @@ class ContributionConstraint(Model): :param group: An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). :type group: int + :param id: Fully qualified identifier of a shared constraint + :type id: str :param inverse: If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) :type inverse: bool - :param name: Name of the IContributionFilter class + :param name: Name of the IContributionFilter plugin :type name: str :param properties: Properties that are fed to the contribution filter class :type properties: :class:`object ` @@ -26,15 +28,17 @@ class ContributionConstraint(Model): _attribute_map = { 'group': {'key': 'group', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, 'inverse': {'key': 'inverse', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'relationships': {'key': 'relationships', 'type': '[str]'} } - def __init__(self, group=None, inverse=None, name=None, properties=None, relationships=None): + def __init__(self, group=None, id=None, inverse=None, name=None, properties=None, relationships=None): super(ContributionConstraint, self).__init__() self.group = group + self.id = id self.inverse = inverse self.name = name self.properties = properties diff --git a/vsts/vsts/contributions/v4_1/models/contribution_node_query_result.py b/vsts/vsts/contributions/v4_1/models/contribution_node_query_result.py index 902bac31..4fc173df 100644 --- a/vsts/vsts/contributions/v4_1/models/contribution_node_query_result.py +++ b/vsts/vsts/contributions/v4_1/models/contribution_node_query_result.py @@ -19,8 +19,8 @@ class ContributionNodeQueryResult(Model): """ _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '{SerializedContributionNode}'}, - 'provider_details': {'key': 'providerDetails', 'type': '{ContributionProviderDetails}'} + 'nodes': {'key': 'nodes', 'type': '{ClientContributionNode}'}, + 'provider_details': {'key': 'providerDetails', 'type': '{ClientContributionProviderDetails}'} } def __init__(self, nodes=None, provider_details=None): diff --git a/vsts/vsts/contributions/v4_1/models/contribution_provider_details.py b/vsts/vsts/contributions/v4_1/models/contribution_provider_details.py deleted file mode 100644 index 0cdda303..00000000 --- a/vsts/vsts/contributions/v4_1/models/contribution_provider_details.py +++ /dev/null @@ -1,37 +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 ContributionProviderDetails(Model): - """ContributionProviderDetails. - - :param display_name: Friendly name for the provider. - :type display_name: str - :param name: Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes - :type name: str - :param properties: Properties associated with the provider - :type properties: dict - :param version: Version of contributions assoicated with this contribution provider. - :type version: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, display_name=None, name=None, properties=None, version=None): - super(ContributionProviderDetails, self).__init__() - self.display_name = display_name - self.name = name - self.properties = properties - self.version = version diff --git a/vsts/vsts/contributions/v4_1/models/data_provider_result.py b/vsts/vsts/contributions/v4_1/models/data_provider_result.py index 8b3ec9ec..0d9783d5 100644 --- a/vsts/vsts/contributions/v4_1/models/data_provider_result.py +++ b/vsts/vsts/contributions/v4_1/models/data_provider_result.py @@ -20,6 +20,10 @@ class DataProviderResult(Model): :type exceptions: dict :param resolved_providers: List of data providers resolved in the data-provider query :type resolved_providers: list of :class:`ResolvedDataProvider ` + :param scope_name: Scope name applied to this data provider result. + :type scope_name: str + :param scope_value: Scope value applied to this data provider result. + :type scope_value: str :param shared_data: Property bag of shared data that was contributed to by any of the individual data providers :type shared_data: dict """ @@ -29,13 +33,17 @@ class DataProviderResult(Model): 'data': {'key': 'data', 'type': '{object}'}, 'exceptions': {'key': 'exceptions', 'type': '{DataProviderExceptionDetails}'}, 'resolved_providers': {'key': 'resolvedProviders', 'type': '[ResolvedDataProvider]'}, + 'scope_name': {'key': 'scopeName', 'type': 'str'}, + 'scope_value': {'key': 'scopeValue', 'type': 'str'}, 'shared_data': {'key': 'sharedData', 'type': '{object}'} } - def __init__(self, client_providers=None, data=None, exceptions=None, resolved_providers=None, shared_data=None): + def __init__(self, client_providers=None, data=None, exceptions=None, resolved_providers=None, scope_name=None, scope_value=None, shared_data=None): super(DataProviderResult, self).__init__() self.client_providers = client_providers self.data = data self.exceptions = exceptions self.resolved_providers = resolved_providers + self.scope_name = scope_name + self.scope_value = scope_value self.shared_data = shared_data diff --git a/vsts/vsts/contributions/v4_1/models/extension_file.py b/vsts/vsts/contributions/v4_1/models/extension_file.py index ba792fd5..1b505e97 100644 --- a/vsts/vsts/contributions/v4_1/models/extension_file.py +++ b/vsts/vsts/contributions/v4_1/models/extension_file.py @@ -14,44 +14,20 @@ class ExtensionFile(Model): :param asset_type: :type asset_type: str - :param content_type: - :type content_type: str - :param file_id: - :type file_id: int - :param is_default: - :type is_default: bool - :param is_public: - :type is_public: bool :param language: :type language: str - :param short_description: - :type short_description: str :param source: :type source: str - :param version: - :type version: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'file_id': {'key': 'fileId', 'type': 'int'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'language': {'key': 'language', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} + 'source': {'key': 'source', 'type': 'str'} } - def __init__(self, asset_type=None, content_type=None, file_id=None, is_default=None, is_public=None, language=None, short_description=None, source=None, version=None): + def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type - self.content_type = content_type - self.file_id = file_id - self.is_default = is_default - self.is_public = is_public self.language = language - self.short_description = short_description self.source = source - self.version = version diff --git a/vsts/vsts/contributions/v4_1/models/extension_manifest.py b/vsts/vsts/contributions/v4_1/models/extension_manifest.py index 322974cb..2b8a5c1e 100644 --- a/vsts/vsts/contributions/v4_1/models/extension_manifest.py +++ b/vsts/vsts/contributions/v4_1/models/extension_manifest.py @@ -14,6 +14,8 @@ class ExtensionManifest(Model): :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str + :param constraints: List of shared constraints defined by this extension + :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension @@ -30,6 +32,8 @@ class ExtensionManifest(Model): :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: number + :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. + :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed @@ -38,6 +42,7 @@ class ExtensionManifest(Model): _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, + 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, @@ -46,13 +51,15 @@ class ExtensionManifest(Model): 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'number'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'} } - def __init__(self, base_uri=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, scopes=None, service_instance_type=None): + def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None): super(ExtensionManifest, self).__init__() self.base_uri = base_uri + self.constraints = constraints self.contributions = contributions self.contribution_types = contribution_types self.demands = demands @@ -61,5 +68,6 @@ def __init__(self, base_uri=None, contributions=None, contribution_types=None, d self.language = language self.licensing = licensing self.manifest_version = manifest_version + self.restricted_to = restricted_to self.scopes = scopes self.service_instance_type = service_instance_type diff --git a/vsts/vsts/contributions/v4_1/models/installed_extension.py b/vsts/vsts/contributions/v4_1/models/installed_extension.py index 6fca7357..af0c7ff1 100644 --- a/vsts/vsts/contributions/v4_1/models/installed_extension.py +++ b/vsts/vsts/contributions/v4_1/models/installed_extension.py @@ -14,6 +14,8 @@ class InstalledExtension(ExtensionManifest): :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str + :param constraints: List of shared constraints defined by this extension + :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension @@ -30,6 +32,8 @@ class InstalledExtension(ExtensionManifest): :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: number + :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. + :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed @@ -58,6 +62,7 @@ class InstalledExtension(ExtensionManifest): _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, + 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, @@ -66,6 +71,7 @@ class InstalledExtension(ExtensionManifest): 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'number'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, @@ -80,8 +86,8 @@ class InstalledExtension(ExtensionManifest): 'version': {'key': 'version', 'type': 'str'} } - def __init__(self, base_uri=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): - super(InstalledExtension, self).__init__(base_uri=base_uri, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, scopes=scopes, service_instance_type=service_instance_type) + def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): + super(InstalledExtension, self).__init__(base_uri=base_uri, constraints=constraints, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, restricted_to=restricted_to, scopes=scopes, service_instance_type=service_instance_type) self.extension_id = extension_id self.extension_name = extension_name self.files = files diff --git a/vsts/vsts/contributions/v4_1/models/serialized_contribution_node.py b/vsts/vsts/contributions/v4_1/models/serialized_contribution_node.py deleted file mode 100644 index 7fa2214d..00000000 --- a/vsts/vsts/contributions/v4_1/models/serialized_contribution_node.py +++ /dev/null @@ -1,33 +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 SerializedContributionNode(Model): - """SerializedContributionNode. - - :param children: List of ids for contributions which are children to the current contribution. - :type children: list of str - :param contribution: Contribution associated with this node. - :type contribution: :class:`Contribution ` - :param parents: List of ids for contributions which are parents to the current contribution. - :type parents: list of str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[str]'}, - 'contribution': {'key': 'contribution', 'type': 'Contribution'}, - 'parents': {'key': 'parents', 'type': '[str]'} - } - - def __init__(self, children=None, contribution=None, parents=None): - super(SerializedContributionNode, self).__init__() - self.children = children - self.contribution = contribution - self.parents = parents diff --git a/vsts/vsts/core/v4_1/models/__init__.py b/vsts/vsts/core/v4_1/models/__init__.py index a6c2908e..9291542a 100644 --- a/vsts/vsts/core/v4_1/models/__init__.py +++ b/vsts/vsts/core/v4_1/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- +from .graph_subject_base import GraphSubjectBase from .identity_data import IdentityData from .identity_ref import IdentityRef from .json_patch_operation import JsonPatchOperation @@ -30,6 +31,7 @@ from .web_api_team_ref import WebApiTeamRef __all__ = [ + 'GraphSubjectBase', 'IdentityData', 'IdentityRef', 'JsonPatchOperation', diff --git a/vsts/vsts/core/v4_1/models/identity_ref.py b/vsts/vsts/core/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/core/v4_1/models/identity_ref.py +++ b/vsts/vsts/core/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/core/v4_1/models/web_api_team.py b/vsts/vsts/core/v4_1/models/web_api_team.py index 872de4a1..43906199 100644 --- a/vsts/vsts/core/v4_1/models/web_api_team.py +++ b/vsts/vsts/core/v4_1/models/web_api_team.py @@ -22,6 +22,10 @@ class WebApiTeam(WebApiTeamRef): :type description: str :param identity_url: Identity REST API Url to this team :type identity_url: str + :param project_id: + :type project_id: str + :param project_name: + :type project_name: str """ _attribute_map = { @@ -29,10 +33,14 @@ class WebApiTeam(WebApiTeamRef): 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'identity_url': {'key': 'identityUrl', 'type': 'str'} + 'identity_url': {'key': 'identityUrl', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'} } - def __init__(self, id=None, name=None, url=None, description=None, identity_url=None): + def __init__(self, id=None, name=None, url=None, description=None, identity_url=None, project_id=None, project_name=None): super(WebApiTeam, self).__init__(id=id, name=name, url=url) self.description = description self.identity_url = identity_url + self.project_id = project_id + self.project_name = project_name diff --git a/vsts/vsts/dashboard/v4_0/dashboard_client.py b/vsts/vsts/dashboard/v4_0/dashboard_client.py index 89d9acfe..c7de62b2 100644 --- a/vsts/vsts/dashboard/v4_0/dashboard_client.py +++ b/vsts/vsts/dashboard/v4_0/dashboard_client.py @@ -36,11 +36,11 @@ def create_dashboard(self, dashboard, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -67,11 +67,11 @@ def delete_dashboard(self, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -98,11 +98,11 @@ def get_dashboard(self, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -129,11 +129,11 @@ def get_dashboards(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -160,11 +160,11 @@ def replace_dashboard(self, dashboard, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -194,11 +194,11 @@ def replace_dashboards(self, group, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -227,11 +227,11 @@ def create_widget(self, widget, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -262,11 +262,11 @@ def delete_widget(self, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -297,11 +297,11 @@ def get_widget(self, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -333,11 +333,11 @@ def replace_widget(self, widget, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -371,11 +371,11 @@ def update_widget(self, widget, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team diff --git a/vsts/vsts/dashboard/v4_1/dashboard_client.py b/vsts/vsts/dashboard/v4_1/dashboard_client.py index 60365655..945244ed 100644 --- a/vsts/vsts/dashboard/v4_1/dashboard_client.py +++ b/vsts/vsts/dashboard/v4_1/dashboard_client.py @@ -36,11 +36,11 @@ def create_dashboard(self, dashboard, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -67,11 +67,11 @@ def delete_dashboard(self, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -98,11 +98,11 @@ def get_dashboard(self, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -129,11 +129,11 @@ def get_dashboards(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -160,11 +160,11 @@ def replace_dashboard(self, dashboard, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -194,11 +194,11 @@ def replace_dashboards(self, group, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -227,11 +227,11 @@ def create_widget(self, widget, team_context, dashboard_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -262,11 +262,11 @@ def delete_widget(self, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -297,11 +297,11 @@ def get_widget(self, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -333,11 +333,11 @@ def replace_widget(self, widget, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -371,11 +371,11 @@ def update_widget(self, widget, team_context, dashboard_id, widget_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team diff --git a/vsts/vsts/dashboard/v4_1/models/widget.py b/vsts/vsts/dashboard/v4_1/models/widget.py index cac98ab6..3b4d3450 100644 --- a/vsts/vsts/dashboard/v4_1/models/widget.py +++ b/vsts/vsts/dashboard/v4_1/models/widget.py @@ -16,6 +16,8 @@ class Widget(Model): :type _links: :class:`ReferenceLinks ` :param allowed_sizes: Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget :type allowed_sizes: list of :class:`WidgetSize ` + :param are_settings_blocked_for_user: Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user. + :type are_settings_blocked_for_user: bool :param artifact_id: Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact. :type artifact_id: str :param configuration_contribution_id: @@ -59,6 +61,7 @@ class Widget(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allowed_sizes': {'key': 'allowedSizes', 'type': '[WidgetSize]'}, + 'are_settings_blocked_for_user': {'key': 'areSettingsBlockedForUser', 'type': 'bool'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'configuration_contribution_id': {'key': 'configurationContributionId', 'type': 'str'}, 'configuration_contribution_relative_id': {'key': 'configurationContributionRelativeId', 'type': 'str'}, @@ -80,10 +83,11 @@ class Widget(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, _links=None, allowed_sizes=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): + def __init__(self, _links=None, allowed_sizes=None, are_settings_blocked_for_user=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): super(Widget, self).__init__() self._links = _links self.allowed_sizes = allowed_sizes + self.are_settings_blocked_for_user = are_settings_blocked_for_user self.artifact_id = artifact_id self.configuration_contribution_id = configuration_contribution_id self.configuration_contribution_relative_id = configuration_contribution_relative_id diff --git a/vsts/vsts/dashboard/v4_1/models/widget_response.py b/vsts/vsts/dashboard/v4_1/models/widget_response.py index 6e9f37e6..7a955db6 100644 --- a/vsts/vsts/dashboard/v4_1/models/widget_response.py +++ b/vsts/vsts/dashboard/v4_1/models/widget_response.py @@ -16,6 +16,8 @@ class WidgetResponse(Widget): :type _links: :class:`ReferenceLinks ` :param allowed_sizes: Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget :type allowed_sizes: list of :class:`WidgetSize ` + :param are_settings_blocked_for_user: Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user. + :type are_settings_blocked_for_user: bool :param artifact_id: Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact. :type artifact_id: str :param configuration_contribution_id: @@ -59,6 +61,7 @@ class WidgetResponse(Widget): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allowed_sizes': {'key': 'allowedSizes', 'type': '[WidgetSize]'}, + 'are_settings_blocked_for_user': {'key': 'areSettingsBlockedForUser', 'type': 'bool'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'configuration_contribution_id': {'key': 'configurationContributionId', 'type': 'str'}, 'configuration_contribution_relative_id': {'key': 'configurationContributionRelativeId', 'type': 'str'}, @@ -80,5 +83,5 @@ class WidgetResponse(Widget): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self, _links=None, allowed_sizes=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): - super(WidgetResponse, self).__init__(_links=_links, allowed_sizes=allowed_sizes, artifact_id=artifact_id, configuration_contribution_id=configuration_contribution_id, configuration_contribution_relative_id=configuration_contribution_relative_id, content_uri=content_uri, contribution_id=contribution_id, dashboard=dashboard, eTag=eTag, id=id, is_enabled=is_enabled, is_name_configurable=is_name_configurable, lightbox_options=lightbox_options, loading_image_url=loading_image_url, name=name, position=position, settings=settings, settings_version=settings_version, size=size, type_id=type_id, url=url) + def __init__(self, _links=None, allowed_sizes=None, are_settings_blocked_for_user=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): + super(WidgetResponse, self).__init__(_links=_links, allowed_sizes=allowed_sizes, are_settings_blocked_for_user=are_settings_blocked_for_user, artifact_id=artifact_id, configuration_contribution_id=configuration_contribution_id, configuration_contribution_relative_id=configuration_contribution_relative_id, content_uri=content_uri, contribution_id=contribution_id, dashboard=dashboard, eTag=eTag, id=id, is_enabled=is_enabled, is_name_configurable=is_name_configurable, lightbox_options=lightbox_options, loading_image_url=loading_image_url, name=name, position=position, settings=settings, settings_version=settings_version, size=size, type_id=type_id, url=url) diff --git a/vsts/vsts/extension_management/v4_1/models/__init__.py b/vsts/vsts/extension_management/v4_1/models/__init__.py index b6ac34af..a7e852a0 100644 --- a/vsts/vsts/extension_management/v4_1/models/__init__.py +++ b/vsts/vsts/extension_management/v4_1/models/__init__.py @@ -31,6 +31,7 @@ from .extension_state import ExtensionState from .extension_statistic import ExtensionStatistic from .extension_version import ExtensionVersion +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .installation_target import InstallationTarget from .installed_extension import InstalledExtension @@ -40,6 +41,7 @@ from .licensing_override import LicensingOverride from .published_extension import PublishedExtension from .publisher_facts import PublisherFacts +from .reference_links import ReferenceLinks from .requested_extension import RequestedExtension from .user_extension_policy import UserExtensionPolicy @@ -69,6 +71,7 @@ 'ExtensionState', 'ExtensionStatistic', 'ExtensionVersion', + 'GraphSubjectBase', 'IdentityRef', 'InstallationTarget', 'InstalledExtension', @@ -78,6 +81,7 @@ 'LicensingOverride', 'PublishedExtension', 'PublisherFacts', + 'ReferenceLinks', 'RequestedExtension', 'UserExtensionPolicy', ] diff --git a/vsts/vsts/extension_management/v4_1/models/contribution.py b/vsts/vsts/extension_management/v4_1/models/contribution.py index e9c1b950..ff967faf 100644 --- a/vsts/vsts/extension_management/v4_1/models/contribution.py +++ b/vsts/vsts/extension_management/v4_1/models/contribution.py @@ -24,6 +24,8 @@ class Contribution(ContributionBase): :type includes: list of str :param properties: Properties/attributes of this contribution :type properties: :class:`object ` + :param restricted_to: List of demanded claims in order for the user to see this contribution (like anonymous, public, member...). + :type restricted_to: list of str :param targets: The ids of the contribution(s) that this contribution targets. (parent contributions) :type targets: list of str :param type: Id of the Contribution Type @@ -37,14 +39,16 @@ class Contribution(ContributionBase): 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'includes': {'key': 'includes', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'str'} } - def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, targets=None, type=None): + def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, restricted_to=None, targets=None, type=None): super(Contribution, self).__init__(description=description, id=id, visible_to=visible_to) self.constraints = constraints self.includes = includes self.properties = properties + self.restricted_to = restricted_to self.targets = targets self.type = type diff --git a/vsts/vsts/extension_management/v4_1/models/contribution_constraint.py b/vsts/vsts/extension_management/v4_1/models/contribution_constraint.py index a16f994d..0791c5dd 100644 --- a/vsts/vsts/extension_management/v4_1/models/contribution_constraint.py +++ b/vsts/vsts/extension_management/v4_1/models/contribution_constraint.py @@ -14,9 +14,11 @@ class ContributionConstraint(Model): :param group: An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). :type group: int + :param id: Fully qualified identifier of a shared constraint + :type id: str :param inverse: If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) :type inverse: bool - :param name: Name of the IContributionFilter class + :param name: Name of the IContributionFilter plugin :type name: str :param properties: Properties that are fed to the contribution filter class :type properties: :class:`object ` @@ -26,15 +28,17 @@ class ContributionConstraint(Model): _attribute_map = { 'group': {'key': 'group', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, 'inverse': {'key': 'inverse', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'relationships': {'key': 'relationships', 'type': '[str]'} } - def __init__(self, group=None, inverse=None, name=None, properties=None, relationships=None): + def __init__(self, group=None, id=None, inverse=None, name=None, properties=None, relationships=None): super(ContributionConstraint, self).__init__() self.group = group + self.id = id self.inverse = inverse self.name = name self.properties = properties diff --git a/vsts/vsts/extension_management/v4_1/models/extension_file.py b/vsts/vsts/extension_management/v4_1/models/extension_file.py index ba792fd5..1b505e97 100644 --- a/vsts/vsts/extension_management/v4_1/models/extension_file.py +++ b/vsts/vsts/extension_management/v4_1/models/extension_file.py @@ -14,44 +14,20 @@ class ExtensionFile(Model): :param asset_type: :type asset_type: str - :param content_type: - :type content_type: str - :param file_id: - :type file_id: int - :param is_default: - :type is_default: bool - :param is_public: - :type is_public: bool :param language: :type language: str - :param short_description: - :type short_description: str :param source: :type source: str - :param version: - :type version: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'file_id': {'key': 'fileId', 'type': 'int'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'language': {'key': 'language', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} + 'source': {'key': 'source', 'type': 'str'} } - def __init__(self, asset_type=None, content_type=None, file_id=None, is_default=None, is_public=None, language=None, short_description=None, source=None, version=None): + def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type - self.content_type = content_type - self.file_id = file_id - self.is_default = is_default - self.is_public = is_public self.language = language - self.short_description = short_description self.source = source - self.version = version diff --git a/vsts/vsts/extension_management/v4_1/models/extension_manifest.py b/vsts/vsts/extension_management/v4_1/models/extension_manifest.py index 2a25d2d8..46be29c9 100644 --- a/vsts/vsts/extension_management/v4_1/models/extension_manifest.py +++ b/vsts/vsts/extension_management/v4_1/models/extension_manifest.py @@ -14,6 +14,8 @@ class ExtensionManifest(Model): :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str + :param constraints: List of shared constraints defined by this extension + :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension @@ -30,6 +32,8 @@ class ExtensionManifest(Model): :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: number + :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. + :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed @@ -38,6 +42,7 @@ class ExtensionManifest(Model): _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, + 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, @@ -46,13 +51,15 @@ class ExtensionManifest(Model): 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'number'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'} } - def __init__(self, base_uri=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, scopes=None, service_instance_type=None): + def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None): super(ExtensionManifest, self).__init__() self.base_uri = base_uri + self.constraints = constraints self.contributions = contributions self.contribution_types = contribution_types self.demands = demands @@ -61,5 +68,6 @@ def __init__(self, base_uri=None, contributions=None, contribution_types=None, d self.language = language self.licensing = licensing self.manifest_version = manifest_version + self.restricted_to = restricted_to self.scopes = scopes self.service_instance_type = service_instance_type diff --git a/vsts/vsts/extension_management/v4_1/models/identity_ref.py b/vsts/vsts/extension_management/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/extension_management/v4_1/models/identity_ref.py +++ b/vsts/vsts/extension_management/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/extension_management/v4_1/models/installation_target.py b/vsts/vsts/extension_management/v4_1/models/installation_target.py index 572aaae0..4d622d4a 100644 --- a/vsts/vsts/extension_management/v4_1/models/installation_target.py +++ b/vsts/vsts/extension_management/v4_1/models/installation_target.py @@ -12,14 +12,6 @@ class InstallationTarget(Model): """InstallationTarget. - :param max_inclusive: - :type max_inclusive: bool - :param max_version: - :type max_version: str - :param min_inclusive: - :type min_inclusive: bool - :param min_version: - :type min_version: str :param target: :type target: str :param target_version: @@ -27,19 +19,11 @@ class InstallationTarget(Model): """ _attribute_map = { - 'max_inclusive': {'key': 'maxInclusive', 'type': 'bool'}, - 'max_version': {'key': 'maxVersion', 'type': 'str'}, - 'min_inclusive': {'key': 'minInclusive', 'type': 'bool'}, - 'min_version': {'key': 'minVersion', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'target_version': {'key': 'targetVersion', 'type': 'str'} } - def __init__(self, max_inclusive=None, max_version=None, min_inclusive=None, min_version=None, target=None, target_version=None): + def __init__(self, target=None, target_version=None): super(InstallationTarget, self).__init__() - self.max_inclusive = max_inclusive - self.max_version = max_version - self.min_inclusive = min_inclusive - self.min_version = min_version self.target = target self.target_version = target_version diff --git a/vsts/vsts/extension_management/v4_1/models/installed_extension.py b/vsts/vsts/extension_management/v4_1/models/installed_extension.py index c7c69c21..27297904 100644 --- a/vsts/vsts/extension_management/v4_1/models/installed_extension.py +++ b/vsts/vsts/extension_management/v4_1/models/installed_extension.py @@ -14,6 +14,8 @@ class InstalledExtension(ExtensionManifest): :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str + :param constraints: List of shared constraints defined by this extension + :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension @@ -30,6 +32,8 @@ class InstalledExtension(ExtensionManifest): :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: number + :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. + :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed @@ -58,6 +62,7 @@ class InstalledExtension(ExtensionManifest): _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, + 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, @@ -66,6 +71,7 @@ class InstalledExtension(ExtensionManifest): 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'number'}, + 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, @@ -80,8 +86,8 @@ class InstalledExtension(ExtensionManifest): 'version': {'key': 'version', 'type': 'str'} } - def __init__(self, base_uri=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): - super(InstalledExtension, self).__init__(base_uri=base_uri, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, scopes=scopes, service_instance_type=service_instance_type) + def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): + super(InstalledExtension, self).__init__(base_uri=base_uri, constraints=constraints, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, restricted_to=restricted_to, scopes=scopes, service_instance_type=service_instance_type) self.extension_id = extension_id self.extension_name = extension_name self.files = files diff --git a/vsts/vsts/gallery/v4_1/gallery_client.py b/vsts/vsts/gallery/v4_1/gallery_client.py index 0053d060..42e3abb9 100644 --- a/vsts/vsts/gallery/v4_1/gallery_client.py +++ b/vsts/vsts/gallery/v4_1/gallery_client.py @@ -888,7 +888,7 @@ def send_notifications(self, notification_data): def get_package(self, publisher_name, extension_name, version, account_token=None, accept_default=None): """GetPackage. - [Preview API] + [Preview API] This endpoint gets hit when you download a VSTS extension from the Web UI :param str publisher_name: :param str extension_name: :param str version: @@ -950,6 +950,70 @@ def get_asset_with_token(self, publisher_name, extension_name, version, asset_ty query_parameters=query_parameters) return self._deserialize('object', response) + def delete_publisher_asset(self, publisher_name, asset_type=None): + """DeletePublisherAsset. + [Preview API] Delete publisher asset like logo + :param str publisher_name: Internal name of the publisher + :param str asset_type: Type of asset. Default value is 'logo'. + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if asset_type is not None: + query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') + self._send(http_method='DELETE', + location_id='21143299-34f9-4c62-8ca8-53da691192f9', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + + def get_publisher_asset(self, publisher_name, asset_type=None): + """GetPublisherAsset. + [Preview API] Get publisher asset like logo as a stream + :param str publisher_name: Internal name of the publisher + :param str asset_type: Type of asset. Default value is 'logo'. + :rtype: object + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if asset_type is not None: + query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') + response = self._send(http_method='GET', + location_id='21143299-34f9-4c62-8ca8-53da691192f9', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('object', response) + + def update_publisher_asset(self, upload_stream, publisher_name, asset_type=None, file_name=None): + """UpdatePublisherAsset. + [Preview API] Update publisher asset like logo. It accepts asset file as an octet stream and file name is passed in header values. + :param object upload_stream: Stream to upload + :param str publisher_name: Internal name of the publisher + :param str asset_type: Type of asset. Default value is 'logo'. + :param String file_name: Header to pass the filename of the uploaded data + :rtype: {str} + """ + route_values = {} + if publisher_name is not None: + route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') + query_parameters = {} + if asset_type is not None: + query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') + content = self._serialize.body(upload_stream, 'object') + response = self._send(http_method='PUT', + location_id='21143299-34f9-4c62-8ca8-53da691192f9', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/octet-stream', + returns_collection=True) + return self._deserialize('{str}', response) + def query_publishers(self, publisher_query): """QueryPublishers. [Preview API] diff --git a/vsts/vsts/gallery/v4_1/models/__init__.py b/vsts/vsts/gallery/v4_1/models/__init__.py index d4025196..39d656a4 100644 --- a/vsts/vsts/gallery/v4_1/models/__init__.py +++ b/vsts/vsts/gallery/v4_1/models/__init__.py @@ -45,6 +45,7 @@ from .product_category import ProductCategory from .published_extension import PublishedExtension from .publisher import Publisher +from .publisher_base import PublisherBase from .publisher_facts import PublisherFacts from .publisher_filter_result import PublisherFilterResult from .publisher_query import PublisherQuery @@ -54,6 +55,7 @@ from .question import Question from .questions_result import QuestionsResult from .rating_count_per_rating import RatingCountPerRating +from .reference_links import ReferenceLinks from .response import Response from .review import Review from .review_patch import ReviewPatch @@ -104,6 +106,7 @@ 'ProductCategory', 'PublishedExtension', 'Publisher', + 'PublisherBase', 'PublisherFacts', 'PublisherFilterResult', 'PublisherQuery', @@ -113,6 +116,7 @@ 'Question', 'QuestionsResult', 'RatingCountPerRating', + 'ReferenceLinks', 'Response', 'Review', 'ReviewPatch', diff --git a/vsts/vsts/gallery/v4_1/models/extension_draft_asset.py b/vsts/vsts/gallery/v4_1/models/extension_draft_asset.py index 7aa65f81..695659a0 100644 --- a/vsts/vsts/gallery/v4_1/models/extension_draft_asset.py +++ b/vsts/vsts/gallery/v4_1/models/extension_draft_asset.py @@ -14,35 +14,17 @@ class ExtensionDraftAsset(ExtensionFile): :param asset_type: :type asset_type: str - :param content_type: - :type content_type: str - :param file_id: - :type file_id: int - :param is_default: - :type is_default: bool - :param is_public: - :type is_public: bool :param language: :type language: str - :param short_description: - :type short_description: str :param source: :type source: str - :param version: - :type version: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'file_id': {'key': 'fileId', 'type': 'int'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'language': {'key': 'language', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, asset_type=None, content_type=None, file_id=None, is_default=None, is_public=None, language=None, short_description=None, source=None, version=None): - super(ExtensionDraftAsset, self).__init__(asset_type=asset_type, content_type=content_type, file_id=file_id, is_default=is_default, is_public=is_public, language=language, short_description=short_description, source=source, version=version) + def __init__(self, asset_type=None, language=None, source=None): + super(ExtensionDraftAsset, self).__init__(asset_type=asset_type, language=language, source=source) diff --git a/vsts/vsts/gallery/v4_1/models/extension_file.py b/vsts/vsts/gallery/v4_1/models/extension_file.py index ba792fd5..1b505e97 100644 --- a/vsts/vsts/gallery/v4_1/models/extension_file.py +++ b/vsts/vsts/gallery/v4_1/models/extension_file.py @@ -14,44 +14,20 @@ class ExtensionFile(Model): :param asset_type: :type asset_type: str - :param content_type: - :type content_type: str - :param file_id: - :type file_id: int - :param is_default: - :type is_default: bool - :param is_public: - :type is_public: bool :param language: :type language: str - :param short_description: - :type short_description: str :param source: :type source: str - :param version: - :type version: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'file_id': {'key': 'fileId', 'type': 'int'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'language': {'key': 'language', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} + 'source': {'key': 'source', 'type': 'str'} } - def __init__(self, asset_type=None, content_type=None, file_id=None, is_default=None, is_public=None, language=None, short_description=None, source=None, version=None): + def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type - self.content_type = content_type - self.file_id = file_id - self.is_default = is_default - self.is_public = is_public self.language = language - self.short_description = short_description self.source = source - self.version = version diff --git a/vsts/vsts/gallery/v4_1/models/installation_target.py b/vsts/vsts/gallery/v4_1/models/installation_target.py index 572aaae0..4d622d4a 100644 --- a/vsts/vsts/gallery/v4_1/models/installation_target.py +++ b/vsts/vsts/gallery/v4_1/models/installation_target.py @@ -12,14 +12,6 @@ class InstallationTarget(Model): """InstallationTarget. - :param max_inclusive: - :type max_inclusive: bool - :param max_version: - :type max_version: str - :param min_inclusive: - :type min_inclusive: bool - :param min_version: - :type min_version: str :param target: :type target: str :param target_version: @@ -27,19 +19,11 @@ class InstallationTarget(Model): """ _attribute_map = { - 'max_inclusive': {'key': 'maxInclusive', 'type': 'bool'}, - 'max_version': {'key': 'maxVersion', 'type': 'str'}, - 'min_inclusive': {'key': 'minInclusive', 'type': 'bool'}, - 'min_version': {'key': 'minVersion', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'target_version': {'key': 'targetVersion', 'type': 'str'} } - def __init__(self, max_inclusive=None, max_version=None, min_inclusive=None, min_version=None, target=None, target_version=None): + def __init__(self, target=None, target_version=None): super(InstallationTarget, self).__init__() - self.max_inclusive = max_inclusive - self.max_version = max_version - self.min_inclusive = min_inclusive - self.min_version = min_version self.target = target self.target_version = target_version diff --git a/vsts/vsts/gallery/v4_1/models/publisher.py b/vsts/vsts/gallery/v4_1/models/publisher.py index 9359bba0..e9bdf8cc 100644 --- a/vsts/vsts/gallery/v4_1/models/publisher.py +++ b/vsts/vsts/gallery/v4_1/models/publisher.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .publisher_base import PublisherBase -class Publisher(Model): +class Publisher(PublisherBase): """Publisher. :param display_name: @@ -30,6 +30,8 @@ class Publisher(Model): :type publisher_name: str :param short_description: :type short_description: str + :param _links: + :type _links: :class:`ReferenceLinks ` """ _attribute_map = { @@ -41,17 +43,10 @@ class Publisher(Model): 'long_description': {'key': 'longDescription', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'} + 'short_description': {'key': 'shortDescription', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'} } - def __init__(self, display_name=None, email_address=None, extensions=None, flags=None, last_updated=None, long_description=None, publisher_id=None, publisher_name=None, short_description=None): - super(Publisher, self).__init__() - self.display_name = display_name - self.email_address = email_address - self.extensions = extensions - self.flags = flags - self.last_updated = last_updated - self.long_description = long_description - self.publisher_id = publisher_id - self.publisher_name = publisher_name - self.short_description = short_description + def __init__(self, display_name=None, email_address=None, extensions=None, flags=None, last_updated=None, long_description=None, publisher_id=None, publisher_name=None, short_description=None, _links=None): + super(Publisher, self).__init__(display_name=display_name, email_address=email_address, extensions=extensions, flags=flags, last_updated=last_updated, long_description=long_description, publisher_id=publisher_id, publisher_name=publisher_name, short_description=short_description) + self._links = _links diff --git a/vsts/vsts/git/v4_1/git_client_base.py b/vsts/vsts/git/v4_1/git_client_base.py index 345923d9..ab401152 100644 --- a/vsts/vsts/git/v4_1/git_client_base.py +++ b/vsts/vsts/git/v4_1/git_client_base.py @@ -71,7 +71,7 @@ def get_blob(self, repository_id, sha1, project=None, download=None, file_name=N """GetBlob. [Preview API] Get a single blob. :param str repository_id: The name or ID of the repository. - :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the “Git/Items/Get Item” endpoint. + :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :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. @@ -100,7 +100,7 @@ def get_blob_content(self, repository_id, sha1, project=None, download=None, fil """GetBlobContent. [Preview API] Get a single blob. :param str repository_id: The name or ID of the repository. - :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the “Git/Items/Get Item” endpoint. + :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :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. @@ -155,7 +155,7 @@ def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_na """GetBlobZip. [Preview API] Get a single blob. :param str repository_id: The name or ID of the repository. - :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the “Git/Items/Get Item” endpoint. + :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :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. @@ -754,7 +754,7 @@ def update_import_request(self, import_request_to_update, project, repository_id 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): + 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): """GetItem. [Preview API] 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 Id of the repository. @@ -766,6 +766,7 @@ def get_item(self, repository_id, path, project=None, scope_path=None, recursion :param bool latest_processed_change: Set to true to include the lastest 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 null. + :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: :class:` ` """ route_values = {} @@ -793,6 +794,8 @@ def get_item(self, repository_id, path, project=None, scope_path=None, recursion query_parameters['versionDescriptor.Version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.VersionOptions'] = version_descriptor.version_options + 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='fb93c0db-47ed-4a31-8c20-47552878fb44', version='4.1-preview.1', @@ -800,7 +803,7 @@ def get_item(self, repository_id, path, project=None, scope_path=None, recursion 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): + 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): """GetItemContent. [Preview API] 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 Id of the repository. @@ -812,6 +815,7 @@ def get_item_content(self, repository_id, path, project=None, scope_path=None, r :param bool latest_processed_change: Set to true to include the lastest 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 null. + :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} @@ -839,6 +843,8 @@ def get_item_content(self, repository_id, path, project=None, scope_path=None, r query_parameters['versionDescriptor.Version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.VersionOptions'] = version_descriptor.version_options + 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='fb93c0db-47ed-4a31-8c20-47552878fb44', version='4.1-preview.1', @@ -893,7 +899,7 @@ def get_items(self, repository_id, project=None, scope_path=None, recursion_leve returns_collection=True) return self._deserialize('[GitItem]', 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): + 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): """GetItemText. [Preview API] 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 Id of the repository. @@ -905,6 +911,7 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu :param bool latest_processed_change: Set to true to include the lastest 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 null. + :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} @@ -932,6 +939,8 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu query_parameters['versionDescriptor.Version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.VersionOptions'] = version_descriptor.version_options + 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='fb93c0db-47ed-4a31-8c20-47552878fb44', version='4.1-preview.1', @@ -939,7 +948,7 @@ def get_item_text(self, repository_id, path, project=None, scope_path=None, recu query_parameters=query_parameters) return self._deserialize('object', response) - 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): + 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): """GetItemZip. [Preview API] 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 Id of the repository. @@ -951,6 +960,7 @@ def get_item_zip(self, repository_id, path, project=None, scope_path=None, recur :param bool latest_processed_change: Set to true to include the lastest 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 null. + :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} @@ -978,6 +988,8 @@ def get_item_zip(self, repository_id, path, project=None, scope_path=None, recur query_parameters['versionDescriptor.Version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.VersionOptions'] = version_descriptor.version_options + 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='fb93c0db-47ed-4a31-8c20-47552878fb44', version='4.1-preview.1', @@ -2402,13 +2414,13 @@ def update_thread(self, comment_thread, repository_id, pull_request_id, thread_i content=content) return self._deserialize('GitPullRequestCommentThread', response) - def get_pull_request_work_items(self, repository_id, pull_request_id, project=None): - """GetPullRequestWorkItems. + def get_pull_request_work_item_refs(self, repository_id, pull_request_id, project=None): + """GetPullRequestWorkItemRefs. [Preview API] Retrieve a list of work items associated with a 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 - :rtype: [AssociatedWorkItem] + :rtype: [ResourceRef] """ route_values = {} if project is not None: @@ -2422,7 +2434,7 @@ def get_pull_request_work_items(self, repository_id, pull_request_id, project=No version='4.1-preview.1', route_values=route_values, returns_collection=True) - return self._deserialize('[AssociatedWorkItem]', response) + return self._deserialize('[ResourceRef]', response) def create_push(self, push, repository_id, project=None): """CreatePush. @@ -2515,6 +2527,59 @@ def get_pushes(self, repository_id, project=None, skip=None, top=None, search_cr returns_collection=True) return self._deserialize('[GitPush]', response) + def delete_repository_from_recycle_bin(self, project, repository_id): + """DeleteRepositoryFromRecycleBin. + [Preview API] 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='4.1-preview.1', + route_values=route_values) + + def get_recycle_bin_repositories(self, project): + """GetRecycleBinRepositories. + [Preview API] 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='4.1-preview.1', + route_values=route_values, + returns_collection=True) + return self._deserialize('[GitDeletedRepository]', response) + + def restore_repository_from_recycle_bin(self, repository_details, project, repository_id): + """RestoreRepositoryFromRecycleBin. + [Preview API] 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='4.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('GitRepository', response) + def get_refs(self, repository_id, project=None, filter=None, include_links=None, latest_statuses_only=None): """GetRefs. [Preview API] Queries the provided repository for its refs and returns them. diff --git a/vsts/vsts/git/v4_1/models/__init__.py b/vsts/vsts/git/v4_1/models/__init__.py index 3b8af05a..8bfc5b18 100644 --- a/vsts/vsts/git/v4_1/models/__init__.py +++ b/vsts/vsts/git/v4_1/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .associated_work_item import AssociatedWorkItem from .attachment import Attachment from .change import Change from .change_count_dictionary import ChangeCountDictionary @@ -66,6 +65,7 @@ from .git_push_search_criteria import GitPushSearchCriteria from .git_query_branch_stats_criteria import GitQueryBranchStatsCriteria from .git_query_commits_criteria import GitQueryCommitsCriteria +from .git_recycle_bin_repository_details import GitRecycleBinRepositoryDetails from .git_ref import GitRef from .git_ref_favorite import GitRefFavorite from .git_ref_update import GitRefUpdate @@ -88,6 +88,7 @@ from .git_user_date import GitUserDate from .git_version_descriptor import GitVersionDescriptor from .global_git_repository_key import GlobalGitRepositoryKey +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .identity_ref_with_vote import IdentityRefWithVote from .import_repository_validation import ImportRepositoryValidation @@ -105,7 +106,6 @@ from .web_api_tag_definition import WebApiTagDefinition __all__ = [ - 'AssociatedWorkItem', 'Attachment', 'Change', 'ChangeCountDictionary', @@ -165,6 +165,7 @@ 'GitPushSearchCriteria', 'GitQueryBranchStatsCriteria', 'GitQueryCommitsCriteria', + 'GitRecycleBinRepositoryDetails', 'GitRef', 'GitRefFavorite', 'GitRefUpdate', @@ -187,6 +188,7 @@ 'GitUserDate', 'GitVersionDescriptor', 'GlobalGitRepositoryKey', + 'GraphSubjectBase', 'IdentityRef', 'IdentityRefWithVote', 'ImportRepositoryValidation', diff --git a/vsts/vsts/git/v4_1/models/associated_work_item.py b/vsts/vsts/git/v4_1/models/associated_work_item.py deleted file mode 100644 index 1f491dad..00000000 --- a/vsts/vsts/git/v4_1/models/associated_work_item.py +++ /dev/null @@ -1,49 +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 AssociatedWorkItem(Model): - """AssociatedWorkItem. - - :param assigned_to: - :type assigned_to: str - :param id: Id of associated the work item. - :type id: int - :param state: - :type state: str - :param title: - :type title: str - :param url: REST Url of the work item. - :type url: str - :param web_url: - :type web_url: str - :param work_item_type: - :type work_item_type: str - """ - - _attribute_map = { - 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'int'}, - 'state': {'key': 'state', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'web_url': {'key': 'webUrl', 'type': 'str'}, - 'work_item_type': {'key': 'workItemType', 'type': 'str'} - } - - def __init__(self, assigned_to=None, id=None, state=None, title=None, url=None, web_url=None, work_item_type=None): - super(AssociatedWorkItem, self).__init__() - self.assigned_to = assigned_to - self.id = id - self.state = state - self.title = title - self.url = url - self.web_url = web_url - self.work_item_type = work_item_type diff --git a/vsts/vsts/git/v4_1/models/git_fork_ref.py b/vsts/vsts/git/v4_1/models/git_fork_ref.py index 46f8ab5f..b5f8b9f0 100644 --- a/vsts/vsts/git/v4_1/models/git_fork_ref.py +++ b/vsts/vsts/git/v4_1/models/git_fork_ref.py @@ -14,6 +14,8 @@ class GitForkRef(GitRef): :param _links: :type _links: :class:`ReferenceLinks ` + :param creator: + :type creator: :class:`IdentityRef ` :param is_locked: :type is_locked: bool :param is_locked_by: @@ -34,6 +36,7 @@ class GitForkRef(GitRef): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'creator': {'key': 'creator', 'type': 'IdentityRef'}, 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'is_locked_by': {'key': 'isLockedBy', 'type': 'IdentityRef'}, 'name': {'key': 'name', 'type': 'str'}, @@ -44,6 +47,6 @@ class GitForkRef(GitRef): 'repository': {'key': 'repository', 'type': 'GitRepository'} } - def __init__(self, _links=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None, repository=None): - super(GitForkRef, self).__init__(_links=_links, is_locked=is_locked, is_locked_by=is_locked_by, name=name, object_id=object_id, peeled_object_id=peeled_object_id, statuses=statuses, url=url) + def __init__(self, _links=None, creator=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None, repository=None): + super(GitForkRef, self).__init__(_links=_links, creator=creator, is_locked=is_locked, is_locked_by=is_locked_by, name=name, object_id=object_id, peeled_object_id=peeled_object_id, statuses=statuses, url=url) self.repository = repository diff --git a/vsts/vsts/git/v4_1/models/git_item.py b/vsts/vsts/git/v4_1/models/git_item.py index 0980208b..8b5dd309 100644 --- a/vsts/vsts/git/v4_1/models/git_item.py +++ b/vsts/vsts/git/v4_1/models/git_item.py @@ -14,6 +14,8 @@ class GitItem(ItemModel): :param _links: :type _links: :class:`ReferenceLinks ` + :param content: + :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: @@ -38,6 +40,7 @@ class GitItem(ItemModel): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, @@ -50,8 +53,8 @@ class GitItem(ItemModel): 'original_object_id': {'key': 'originalObjectId', 'type': 'str'} } - def __init__(self, _links=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, commit_id=None, git_object_type=None, latest_processed_change=None, object_id=None, original_object_id=None): - super(GitItem, self).__init__(_links=_links, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) + def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, commit_id=None, git_object_type=None, latest_processed_change=None, object_id=None, original_object_id=None): + super(GitItem, self).__init__(_links=_links, content=content, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) self.commit_id = commit_id self.git_object_type = git_object_type self.latest_processed_change = latest_processed_change diff --git a/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py b/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py index 0dff7101..f2a86044 100644 --- a/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py +++ b/vsts/vsts/git/v4_1/models/git_pull_request_merge_options.py @@ -12,14 +12,18 @@ class GitPullRequestMergeOptions(Model): """GitPullRequestMergeOptions. + :param detect_rename_false_positives: + :type detect_rename_false_positives: bool :param disable_renames: If true, rename detection will not be performed during the merge. :type disable_renames: bool """ _attribute_map = { + 'detect_rename_false_positives': {'key': 'detectRenameFalsePositives', 'type': 'bool'}, 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} } - def __init__(self, disable_renames=None): + def __init__(self, detect_rename_false_positives=None, disable_renames=None): super(GitPullRequestMergeOptions, self).__init__() + self.detect_rename_false_positives = detect_rename_false_positives self.disable_renames = disable_renames diff --git a/vsts/vsts/git/v4_1/models/git_ref.py b/vsts/vsts/git/v4_1/models/git_ref.py index b549bebc..3da3c2ec 100644 --- a/vsts/vsts/git/v4_1/models/git_ref.py +++ b/vsts/vsts/git/v4_1/models/git_ref.py @@ -14,6 +14,8 @@ class GitRef(Model): :param _links: :type _links: :class:`ReferenceLinks ` + :param creator: + :type creator: :class:`IdentityRef ` :param is_locked: :type is_locked: bool :param is_locked_by: @@ -32,6 +34,7 @@ class GitRef(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'creator': {'key': 'creator', 'type': 'IdentityRef'}, 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'is_locked_by': {'key': 'isLockedBy', 'type': 'IdentityRef'}, 'name': {'key': 'name', 'type': 'str'}, @@ -41,9 +44,10 @@ class GitRef(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, _links=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None): + def __init__(self, _links=None, creator=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None): super(GitRef, self).__init__() self._links = _links + self.creator = creator self.is_locked = is_locked self.is_locked_by = is_locked_by self.name = name diff --git a/vsts/vsts/git/v4_1/models/identity_ref.py b/vsts/vsts/git/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/git/v4_1/models/identity_ref.py +++ b/vsts/vsts/git/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py b/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py index 2830b26b..30be999e 100644 --- a/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py +++ b/vsts/vsts/git/v4_1/models/identity_ref_with_vote.py @@ -12,10 +12,16 @@ class IdentityRefWithVote(IdentityRef): """IdentityRefWithVote. + :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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,8 +36,6 @@ class IdentityRefWithVote(IdentityRef): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str :param is_required: Indicates if this is a required reviewer for this pull request.
Branches can have policies that require particular reviewers are required for pull requests. :type is_required: bool :param reviewer_url: URL to retrieve information about this identity @@ -43,8 +47,11 @@ class IdentityRefWithVote(IdentityRef): """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, @@ -52,15 +59,14 @@ class IdentityRefWithVote(IdentityRef): 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'reviewer_url': {'key': 'reviewerUrl', 'type': 'str'}, 'vote': {'key': 'vote', 'type': 'int'}, 'voted_for': {'key': 'votedFor', 'type': '[IdentityRefWithVote]'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, is_required=None, reviewer_url=None, vote=None, voted_for=None): - super(IdentityRefWithVote, self).__init__(directory_alias=directory_alias, display_name=display_name, id=id, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) + 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, profile_url=None, unique_name=None, is_required=None, reviewer_url=None, vote=None, voted_for=None): + super(IdentityRefWithVote, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, directory_alias=directory_alias, id=id, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name) self.is_required = is_required self.reviewer_url = reviewer_url self.vote = vote diff --git a/vsts/vsts/git/v4_1/models/item_model.py b/vsts/vsts/git/v4_1/models/item_model.py index 2bc23b37..f77a2638 100644 --- a/vsts/vsts/git/v4_1/models/item_model.py +++ b/vsts/vsts/git/v4_1/models/item_model.py @@ -14,6 +14,8 @@ class ItemModel(Model): :param _links: :type _links: :class:`ReferenceLinks ` + :param content: + :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: @@ -28,6 +30,7 @@ class ItemModel(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, @@ -35,9 +38,10 @@ class ItemModel(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, _links=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): + def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): super(ItemModel, self).__init__() self._links = _links + self.content = content self.content_metadata = content_metadata self.is_folder = is_folder self.is_sym_link = is_sym_link diff --git a/vsts/vsts/identity/v4_1/models/__init__.py b/vsts/vsts/identity/v4_1/models/__init__.py index 1580aa8a..08a68e1a 100644 --- a/vsts/vsts/identity/v4_1/models/__init__.py +++ b/vsts/vsts/identity/v4_1/models/__init__.py @@ -14,6 +14,7 @@ from .framework_identity_info import FrameworkIdentityInfo from .group_membership import GroupMembership from .identity import Identity +from .identity_base import IdentityBase from .identity_batch_info import IdentityBatchInfo from .identity_scope import IdentityScope from .identity_self import IdentitySelf @@ -32,6 +33,7 @@ 'FrameworkIdentityInfo', 'GroupMembership', 'Identity', + 'IdentityBase', 'IdentityBatchInfo', 'IdentityScope', 'IdentitySelf', diff --git a/vsts/vsts/identity/v4_1/models/identity.py b/vsts/vsts/identity/v4_1/models/identity.py index 2622bc22..018ffb12 100644 --- a/vsts/vsts/identity/v4_1/models/identity.py +++ b/vsts/vsts/identity/v4_1/models/identity.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .identity_base import IdentityBase -class Identity(Model): +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) @@ -59,23 +59,8 @@ class Identity(Model): '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'} + '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__() - 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 + 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) diff --git a/vsts/vsts/licensing/v4_1/licensing_client.py b/vsts/vsts/licensing/v4_1/licensing_client.py index a844d977..82b513ad 100644 --- a/vsts/vsts/licensing/v4_1/licensing_client.py +++ b/vsts/vsts/licensing/v4_1/licensing_client.py @@ -81,11 +81,12 @@ def get_client_rights(self, right_name=None, product_version=None, edition=None, query_parameters=query_parameters) return self._deserialize('ClientRightsContainer', response) - def assign_available_account_entitlement(self, user_id, dont_notify_user=None): + 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 = {} @@ -93,6 +94,8 @@ def assign_available_account_entitlement(self, user_id, dont_notify_user=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='4.1-preview.1', @@ -128,12 +131,13 @@ def get_account_entitlements(self, top=None, skip=None): returns_collection=True) return self._deserialize('[AccountEntitlement]', response) - def assign_account_entitlement_for_user(self, body, user_id, dont_notify_user=None): + 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 = {} @@ -142,6 +146,8 @@ def assign_account_entitlement_for_user(self, body, user_id, dont_notify_user=No 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', @@ -395,19 +401,3 @@ def get_account_licenses_usage(self): returns_collection=True) return self._deserialize('[AccountLicenseUsage]', response) - def get_usage_rights(self, right_name=None): - """GetUsageRights. - [Preview API] - :param str right_name: - :rtype: [IUsageRight] - """ - route_values = {} - if right_name is not None: - route_values['rightName'] = self._serialize.url('right_name', right_name, 'str') - response = self._send(http_method='GET', - location_id='d09ac573-58fe-4948-af97-793db40a7e16', - version='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[IUsageRight]', response) - diff --git a/vsts/vsts/licensing/v4_1/models/__init__.py b/vsts/vsts/licensing/v4_1/models/__init__.py index f915040d..fcbb5647 100644 --- a/vsts/vsts/licensing/v4_1/models/__init__.py +++ b/vsts/vsts/licensing/v4_1/models/__init__.py @@ -19,10 +19,11 @@ from .extension_operation_result import ExtensionOperationResult from .extension_rights_result import ExtensionRightsResult from .extension_source import ExtensionSource +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef -from .iUsage_right import IUsageRight from .license import License from .msdn_entitlement import MsdnEntitlement +from .reference_links import ReferenceLinks __all__ = [ 'AccountEntitlement', @@ -38,8 +39,9 @@ 'ExtensionOperationResult', 'ExtensionRightsResult', 'ExtensionSource', + 'GraphSubjectBase', 'IdentityRef', - 'IUsageRight', 'License', 'MsdnEntitlement', + 'ReferenceLinks', ] diff --git a/vsts/vsts/licensing/v4_1/models/account_entitlement.py b/vsts/vsts/licensing/v4_1/models/account_entitlement.py index 907ffad1..f66f89da 100644 --- a/vsts/vsts/licensing/v4_1/models/account_entitlement.py +++ b/vsts/vsts/licensing/v4_1/models/account_entitlement.py @@ -22,6 +22,8 @@ class AccountEntitlement(Model): :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 @@ -38,19 +40,21 @@ class AccountEntitlement(Model): 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, '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, last_accessed_date=None, license=None, rights=None, status=None, user=None, user_id=None): + def __init__(self, account_id=None, assignment_date=None, assignment_source=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.last_accessed_date = last_accessed_date self.license = license + self.origin = origin self.rights = rights self.status = status self.user = user diff --git a/vsts/vsts/licensing/v4_1/models/iUsage_right.py b/vsts/vsts/licensing/v4_1/models/iUsage_right.py deleted file mode 100644 index d35c93c7..00000000 --- a/vsts/vsts/licensing/v4_1/models/iUsage_right.py +++ /dev/null @@ -1,37 +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 IUsageRight(Model): - """IUsageRight. - - :param attributes: Rights data - :type attributes: dict - :param expiration_date: Rights expiration - :type expiration_date: datetime - :param name: Name, uniquely identifying a usage right - :type name: str - :param version: Version - :type version: str - """ - - _attribute_map = { - 'attributes': {'key': 'attributes', 'type': '{object}'}, - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'} - } - - def __init__(self, attributes=None, expiration_date=None, name=None, version=None): - super(IUsageRight, self).__init__() - self.attributes = attributes - self.expiration_date = expiration_date - self.name = name - self.version = version diff --git a/vsts/vsts/licensing/v4_1/models/identity_ref.py b/vsts/vsts/licensing/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/licensing/v4_1/models/identity_ref.py +++ b/vsts/vsts/licensing/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/location/v4_1/location_client.py b/vsts/vsts/location/v4_1/location_client.py index a284b28f..bef06422 100644 --- a/vsts/vsts/location/v4_1/location_client.py +++ b/vsts/vsts/location/v4_1/location_client.py @@ -46,29 +46,81 @@ def get_connection_data(self, connect_options=None, last_change_id=None, last_ch query_parameters=query_parameters) return self._deserialize('ConnectionData', response) - def get_resource_area(self, area_id): + def get_resource_area(self, area_id, organization_name=None, account_name=None): """GetResourceArea. [Preview API] :param str area_id: + :param str organization_name: + :param str account_name: :rtype: :class:` ` """ route_values = {} if area_id is not None: route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') + query_parameters = {} + if organization_name is not None: + query_parameters['organizationName'] = self._serialize.query('organization_name', organization_name, 'str') + if account_name is not None: + query_parameters['accountName'] = self._serialize.query('account_name', account_name, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='4.1-preview.1', - route_values=route_values) + route_values=route_values, + query_parameters=query_parameters) return self._deserialize('ResourceAreaInfo', response) - def get_resource_areas(self): + def get_resource_area_by_host(self, area_id, host_id): + """GetResourceAreaByHost. + [Preview API] + :param str area_id: + :param str host_id: + :rtype: :class:` ` + """ + route_values = {} + if area_id is not None: + route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') + query_parameters = {} + if host_id is not None: + query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') + response = self._send(http_method='GET', + location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('ResourceAreaInfo', response) + + def get_resource_areas(self, organization_name=None, account_name=None): """GetResourceAreas. [Preview API] + :param str organization_name: + :param str account_name: + :rtype: [ResourceAreaInfo] + """ + query_parameters = {} + if organization_name is not None: + query_parameters['organizationName'] = self._serialize.query('organization_name', organization_name, 'str') + if account_name is not None: + query_parameters['accountName'] = self._serialize.query('account_name', account_name, 'str') + response = self._send(http_method='GET', + location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', + version='4.1-preview.1', + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[ResourceAreaInfo]', response) + + def get_resource_areas_by_host(self, host_id): + """GetResourceAreasByHost. + [Preview API] + :param str host_id: :rtype: [ResourceAreaInfo] """ + query_parameters = {} + if host_id is not None: + query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='4.1-preview.1', + query_parameters=query_parameters, returns_collection=True) return self._deserialize('[ResourceAreaInfo]', response) diff --git a/vsts/vsts/location/v4_1/models/__init__.py b/vsts/vsts/location/v4_1/models/__init__.py index dbde91d7..61ed73d1 100644 --- a/vsts/vsts/location/v4_1/models/__init__.py +++ b/vsts/vsts/location/v4_1/models/__init__.py @@ -9,6 +9,7 @@ from .access_mapping import AccessMapping from .connection_data import ConnectionData from .identity import Identity +from .identity_base import IdentityBase from .location_mapping import LocationMapping from .location_service_data import LocationServiceData from .resource_area_info import ResourceAreaInfo @@ -18,6 +19,7 @@ 'AccessMapping', 'ConnectionData', 'Identity', + 'IdentityBase', 'LocationMapping', 'LocationServiceData', 'ResourceAreaInfo', diff --git a/vsts/vsts/location/v4_1/models/identity.py b/vsts/vsts/location/v4_1/models/identity.py index 65172c4a..96628e6c 100644 --- a/vsts/vsts/location/v4_1/models/identity.py +++ b/vsts/vsts/location/v4_1/models/identity.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .identity_base import IdentityBase -class Identity(Model): +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) @@ -59,23 +59,8 @@ class Identity(Model): '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'} + '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__() - 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 + 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) diff --git a/vsts/vsts/notification/v4_1/models/__init__.py b/vsts/vsts/notification/v4_1/models/__init__.py index 56c91337..f51b3477 100644 --- a/vsts/vsts/notification/v4_1/models/__init__.py +++ b/vsts/vsts/notification/v4_1/models/__init__.py @@ -17,13 +17,16 @@ from .expression_filter_model import ExpressionFilterModel from .field_input_values import FieldInputValues from .field_values_query import FieldValuesQuery +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef +from .iNotification_diagnostic_log import INotificationDiagnosticLog from .input_value import InputValue from .input_values import InputValues from .input_values_error import InputValuesError from .input_values_query import InputValuesQuery from .iSubscription_channel import ISubscriptionChannel from .iSubscription_filter import ISubscriptionFilter +from .notification_diagnostic_log_message import NotificationDiagnosticLogMessage from .notification_event_field import NotificationEventField from .notification_event_field_operator import NotificationEventFieldOperator from .notification_event_field_type import NotificationEventFieldType @@ -47,6 +50,7 @@ from .reference_links import ReferenceLinks from .subscription_admin_settings import SubscriptionAdminSettings from .subscription_channel_with_address import SubscriptionChannelWithAddress +from .subscription_diagnostics import SubscriptionDiagnostics from .subscription_evaluation_request import SubscriptionEvaluationRequest from .subscription_evaluation_result import SubscriptionEvaluationResult from .subscription_evaluation_settings import SubscriptionEvaluationSettings @@ -54,7 +58,10 @@ from .subscription_query import SubscriptionQuery from .subscription_query_condition import SubscriptionQueryCondition from .subscription_scope import SubscriptionScope +from .subscription_tracing import SubscriptionTracing from .subscription_user_settings import SubscriptionUserSettings +from .update_subscripiton_diagnostics_parameters import UpdateSubscripitonDiagnosticsParameters +from .update_subscripiton_tracing_parameters import UpdateSubscripitonTracingParameters from .value_definition import ValueDefinition from .vss_notification_event import VssNotificationEvent @@ -70,13 +77,16 @@ 'ExpressionFilterModel', 'FieldInputValues', 'FieldValuesQuery', + 'GraphSubjectBase', 'IdentityRef', + 'INotificationDiagnosticLog', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'ISubscriptionChannel', 'ISubscriptionFilter', + 'NotificationDiagnosticLogMessage', 'NotificationEventField', 'NotificationEventFieldOperator', 'NotificationEventFieldType', @@ -100,6 +110,7 @@ 'ReferenceLinks', 'SubscriptionAdminSettings', 'SubscriptionChannelWithAddress', + 'SubscriptionDiagnostics', 'SubscriptionEvaluationRequest', 'SubscriptionEvaluationResult', 'SubscriptionEvaluationSettings', @@ -107,7 +118,10 @@ 'SubscriptionQuery', 'SubscriptionQueryCondition', 'SubscriptionScope', + 'SubscriptionTracing', 'SubscriptionUserSettings', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', 'ValueDefinition', 'VssNotificationEvent', ] diff --git a/vsts/vsts/notification/v4_1/models/identity_ref.py b/vsts/vsts/notification/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/notification/v4_1/models/identity_ref.py +++ b/vsts/vsts/notification/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/notification/v4_1/models/notification_subscription.py b/vsts/vsts/notification/v4_1/models/notification_subscription.py index 6ef3c8be..46030af2 100644 --- a/vsts/vsts/notification/v4_1/models/notification_subscription.py +++ b/vsts/vsts/notification/v4_1/models/notification_subscription.py @@ -20,6 +20,8 @@ class NotificationSubscription(Model): :type channel: :class:`ISubscriptionChannel ` :param description: Description of the subscription. Typically describes filter criteria which helps identity the subscription. :type description: str + :param diagnostics: Diagnostics for this subscription. + :type diagnostics: :class:`SubscriptionDiagnostics ` :param extended_properties: Any extra properties like detailed description for different contexts, user/group contexts :type extended_properties: dict :param filter: Matching criteria for the subscription. ExpressionFilter @@ -53,6 +55,7 @@ class NotificationSubscription(Model): 'admin_settings': {'key': 'adminSettings', 'type': 'SubscriptionAdminSettings'}, 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, 'description': {'key': 'description', 'type': 'str'}, + 'diagnostics': {'key': 'diagnostics', 'type': 'SubscriptionDiagnostics'}, 'extended_properties': {'key': 'extendedProperties', 'type': '{str}'}, 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'flags': {'key': 'flags', 'type': 'object'}, @@ -68,12 +71,13 @@ class NotificationSubscription(Model): 'user_settings': {'key': 'userSettings', 'type': 'SubscriptionUserSettings'} } - def __init__(self, _links=None, admin_settings=None, channel=None, description=None, extended_properties=None, filter=None, flags=None, id=None, last_modified_by=None, modified_date=None, permissions=None, scope=None, status=None, status_message=None, subscriber=None, url=None, user_settings=None): + def __init__(self, _links=None, admin_settings=None, channel=None, description=None, diagnostics=None, extended_properties=None, filter=None, flags=None, id=None, last_modified_by=None, modified_date=None, permissions=None, scope=None, status=None, status_message=None, subscriber=None, url=None, user_settings=None): super(NotificationSubscription, self).__init__() self._links = _links self.admin_settings = admin_settings self.channel = channel self.description = description + self.diagnostics = diagnostics self.extended_properties = extended_properties self.filter = filter self.flags = flags diff --git a/vsts/vsts/notification/v4_1/notification_client.py b/vsts/vsts/notification/v4_1/notification_client.py index b5eae874..64f104c0 100644 --- a/vsts/vsts/notification/v4_1/notification_client.py +++ b/vsts/vsts/notification/v4_1/notification_client.py @@ -25,6 +25,79 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = None + def list_logs(self, source, entry_id=None, start_time=None, end_time=None): + """ListLogs. + [Preview API] List diagnostic logs this service. + :param str source: + :param str entry_id: + :param datetime start_time: + :param datetime end_time: + :rtype: [INotificationDiagnosticLog] + """ + route_values = {} + if source is not None: + route_values['source'] = self._serialize.url('source', source, 'str') + if entry_id is not None: + route_values['entryId'] = self._serialize.url('entry_id', entry_id, 'str') + 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') + response = self._send(http_method='GET', + location_id='991842f3-eb16-4aea-ac81-81353ef2b75c', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[INotificationDiagnosticLog]', response) + + def get_subscription_diagnostics(self, subscription_id): + """GetSubscriptionDiagnostics. + [Preview API] + :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='20f1929d-4be7-4c2e-a74e-d47640ff3418', + version='4.1-preview.1', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + [Preview API] + :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='20f1929d-4be7-4c2e-a74e-d47640ff3418', + version='4.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionDiagnostics', response) + + def publish_event(self, notification_event): + """PublishEvent. + [Preview API] Publish an event. + :param :class:` ` notification_event: + :rtype: :class:` ` + """ + content = self._serialize.body(notification_event, 'VssNotificationEvent') + response = self._send(http_method='POST', + location_id='14c57b7a-c0e6-4555-9f51-e067188fdd8e', + version='4.1-preview.1', + content=content) + return self._deserialize('VssNotificationEvent', response) + def get_event_type(self, event_type): """GetEventType. [Preview API] Get a specific event type. diff --git a/vsts/vsts/policy/v4_1/models/__init__.py b/vsts/vsts/policy/v4_1/models/__init__.py index 15df3183..a1e4a4bc 100644 --- a/vsts/vsts/policy/v4_1/models/__init__.py +++ b/vsts/vsts/policy/v4_1/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .policy_configuration import PolicyConfiguration from .policy_configuration_ref import PolicyConfigurationRef @@ -16,6 +17,7 @@ from .versioned_policy_configuration_ref import VersionedPolicyConfigurationRef __all__ = [ + 'GraphSubjectBase', 'IdentityRef', 'PolicyConfiguration', 'PolicyConfigurationRef', diff --git a/vsts/vsts/policy/v4_1/models/identity_ref.py b/vsts/vsts/policy/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/policy/v4_1/models/identity_ref.py +++ b/vsts/vsts/policy/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/policy/v4_1/policy_client.py b/vsts/vsts/policy/v4_1/policy_client.py index a317a76a..ad21d1b6 100644 --- a/vsts/vsts/policy/v4_1/policy_client.py +++ b/vsts/vsts/policy/v4_1/policy_client.py @@ -80,11 +80,12 @@ def get_policy_configuration(self, project, configuration_id): route_values=route_values) return self._deserialize('PolicyConfiguration', response) - def get_policy_configurations(self, project, scope=None): + def get_policy_configurations(self, project, scope=None, policy_type=None): """GetPolicyConfigurations. [Preview API] Get a list of policy configurations in a project. :param str project: Project ID or project name :param str scope: The scope on which a subset of policies is applied. + :param str policy_type: Filter returned policies to only this type :rtype: [PolicyConfiguration] """ route_values = {} @@ -93,6 +94,8 @@ def get_policy_configurations(self, project, scope=None): query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') + if policy_type is not None: + 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='4.1-preview.1', diff --git a/vsts/vsts/project_analysis/v4_1/models/__init__.py b/vsts/vsts/project_analysis/v4_1/models/__init__.py index 58847dd7..34df4d66 100644 --- a/vsts/vsts/project_analysis/v4_1/models/__init__.py +++ b/vsts/vsts/project_analysis/v4_1/models/__init__.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------------------------- from .code_change_trend_item import CodeChangeTrendItem +from .language_metrics_secured_object import LanguageMetricsSecuredObject from .language_statistics import LanguageStatistics from .project_activity_metrics import ProjectActivityMetrics from .project_language_analytics import ProjectLanguageAnalytics @@ -15,6 +16,7 @@ __all__ = [ 'CodeChangeTrendItem', + 'LanguageMetricsSecuredObject', 'LanguageStatistics', 'ProjectActivityMetrics', 'ProjectLanguageAnalytics', diff --git a/vsts/vsts/project_analysis/v4_1/models/language_statistics.py b/vsts/vsts/project_analysis/v4_1/models/language_statistics.py index 517f0038..2f777576 100644 --- a/vsts/vsts/project_analysis/v4_1/models/language_statistics.py +++ b/vsts/vsts/project_analysis/v4_1/models/language_statistics.py @@ -6,12 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .language_metrics_secured_object import LanguageMetricsSecuredObject -class LanguageStatistics(Model): +class LanguageStatistics(LanguageMetricsSecuredObject): """LanguageStatistics. + :param namespace_id: + :type namespace_id: str + :param project_id: + :type project_id: str + :param required_permissions: + :type required_permissions: int :param bytes: :type bytes: long :param files: @@ -25,6 +31,9 @@ class LanguageStatistics(Model): """ _attribute_map = { + 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'bytes': {'key': 'bytes', 'type': 'long'}, 'files': {'key': 'files', 'type': 'int'}, 'files_percentage': {'key': 'filesPercentage', 'type': 'number'}, @@ -32,8 +41,8 @@ class LanguageStatistics(Model): 'name': {'key': 'name', 'type': 'str'} } - def __init__(self, bytes=None, files=None, files_percentage=None, language_percentage=None, name=None): - super(LanguageStatistics, self).__init__() + def __init__(self, namespace_id=None, project_id=None, required_permissions=None, bytes=None, files=None, files_percentage=None, language_percentage=None, name=None): + super(LanguageStatistics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.bytes = bytes self.files = files self.files_percentage = files_percentage diff --git a/vsts/vsts/project_analysis/v4_1/models/project_language_analytics.py b/vsts/vsts/project_analysis/v4_1/models/project_language_analytics.py index bf08c8de..284e8f99 100644 --- a/vsts/vsts/project_analysis/v4_1/models/project_language_analytics.py +++ b/vsts/vsts/project_analysis/v4_1/models/project_language_analytics.py @@ -6,12 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .language_metrics_secured_object import LanguageMetricsSecuredObject -class ProjectLanguageAnalytics(Model): +class ProjectLanguageAnalytics(LanguageMetricsSecuredObject): """ProjectLanguageAnalytics. + :param namespace_id: + :type namespace_id: str + :param project_id: + :type project_id: str + :param required_permissions: + :type required_permissions: int :param id: :type id: str :param language_breakdown: @@ -25,6 +31,9 @@ class ProjectLanguageAnalytics(Model): """ _attribute_map = { + 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'language_breakdown': {'key': 'languageBreakdown', 'type': '[LanguageStatistics]'}, 'repository_language_analytics': {'key': 'repositoryLanguageAnalytics', 'type': '[RepositoryLanguageAnalytics]'}, @@ -32,8 +41,8 @@ class ProjectLanguageAnalytics(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, id=None, language_breakdown=None, repository_language_analytics=None, result_phase=None, url=None): - super(ProjectLanguageAnalytics, self).__init__() + def __init__(self, namespace_id=None, project_id=None, required_permissions=None, id=None, language_breakdown=None, repository_language_analytics=None, result_phase=None, url=None): + super(ProjectLanguageAnalytics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.id = id self.language_breakdown = language_breakdown self.repository_language_analytics = repository_language_analytics diff --git a/vsts/vsts/project_analysis/v4_1/models/repository_language_analytics.py b/vsts/vsts/project_analysis/v4_1/models/repository_language_analytics.py index 6d3cecbe..52799cc6 100644 --- a/vsts/vsts/project_analysis/v4_1/models/repository_language_analytics.py +++ b/vsts/vsts/project_analysis/v4_1/models/repository_language_analytics.py @@ -6,12 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .language_metrics_secured_object import LanguageMetricsSecuredObject -class RepositoryLanguageAnalytics(Model): +class RepositoryLanguageAnalytics(LanguageMetricsSecuredObject): """RepositoryLanguageAnalytics. + :param namespace_id: + :type namespace_id: str + :param project_id: + :type project_id: str + :param required_permissions: + :type required_permissions: int :param id: :type id: str :param language_breakdown: @@ -25,6 +31,9 @@ class RepositoryLanguageAnalytics(Model): """ _attribute_map = { + 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'language_breakdown': {'key': 'languageBreakdown', 'type': '[LanguageStatistics]'}, 'name': {'key': 'name', 'type': 'str'}, @@ -32,8 +41,8 @@ class RepositoryLanguageAnalytics(Model): 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'} } - def __init__(self, id=None, language_breakdown=None, name=None, result_phase=None, updated_time=None): - super(RepositoryLanguageAnalytics, self).__init__() + def __init__(self, namespace_id=None, project_id=None, required_permissions=None, id=None, language_breakdown=None, name=None, result_phase=None, updated_time=None): + super(RepositoryLanguageAnalytics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.id = id self.language_breakdown = language_breakdown self.name = name diff --git a/vsts/vsts/release/v4_1/models/__init__.py b/vsts/vsts/release/v4_1/models/__init__.py index 5bcb7df2..252e58aa 100644 --- a/vsts/vsts/release/v4_1/models/__init__.py +++ b/vsts/vsts/release/v4_1/models/__init__.py @@ -33,6 +33,7 @@ from .environment_retention_policy import EnvironmentRetentionPolicy from .favorite_item import FavoriteItem from .folder import Folder +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .input_descriptor import InputDescriptor from .input_validation import InputValidation @@ -45,6 +46,7 @@ from .manual_intervention import ManualIntervention from .manual_intervention_update_metadata import ManualInterventionUpdateMetadata from .metric import Metric +from .pipeline_process import PipelineProcess from .process_parameters import ProcessParameters from .project_reference import ProjectReference from .queued_release_data import QueuedReleaseData @@ -80,6 +82,7 @@ from .release_shallow_reference import ReleaseShallowReference from .release_start_metadata import ReleaseStartMetadata from .release_task import ReleaseTask +from .release_task_attachment import ReleaseTaskAttachment from .release_trigger_base import ReleaseTriggerBase from .release_update_metadata import ReleaseUpdateMetadata from .release_work_item_ref import ReleaseWorkItemRef @@ -123,6 +126,7 @@ 'EnvironmentRetentionPolicy', 'FavoriteItem', 'Folder', + 'GraphSubjectBase', 'IdentityRef', 'InputDescriptor', 'InputValidation', @@ -135,6 +139,7 @@ 'ManualIntervention', 'ManualInterventionUpdateMetadata', 'Metric', + 'PipelineProcess', 'ProcessParameters', 'ProjectReference', 'QueuedReleaseData', @@ -170,6 +175,7 @@ 'ReleaseShallowReference', 'ReleaseStartMetadata', 'ReleaseTask', + 'ReleaseTaskAttachment', 'ReleaseTriggerBase', 'ReleaseUpdateMetadata', 'ReleaseWorkItemRef', diff --git a/vsts/vsts/release/v4_1/models/artifact_type_definition.py b/vsts/vsts/release/v4_1/models/artifact_type_definition.py index 0c34624f..c5afc1c1 100644 --- a/vsts/vsts/release/v4_1/models/artifact_type_definition.py +++ b/vsts/vsts/release/v4_1/models/artifact_type_definition.py @@ -14,6 +14,8 @@ class ArtifactTypeDefinition(Model): :param display_name: :type display_name: str + :param endpoint_type_id: + :type endpoint_type_id: str :param input_descriptors: :type input_descriptors: list of :class:`InputDescriptor ` :param name: @@ -24,14 +26,16 @@ class ArtifactTypeDefinition(Model): _attribute_map = { '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, display_name=None, input_descriptors=None, name=None, unique_source_identifier=None): + def __init__(self, display_name=None, endpoint_type_id=None, input_descriptors=None, name=None, unique_source_identifier=None): super(ArtifactTypeDefinition, self).__init__() 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 diff --git a/vsts/vsts/release/v4_1/models/authorization_header.py b/vsts/vsts/release/v4_1/models/authorization_header.py index 015e6775..337b6013 100644 --- a/vsts/vsts/release/v4_1/models/authorization_header.py +++ b/vsts/vsts/release/v4_1/models/authorization_header.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class AuthorizationHeader(Model): +class AuthorizationHeader(BaseSecuredObject): """AuthorizationHeader. :param name: diff --git a/vsts/vsts/release/v4_1/models/build_version.py b/vsts/vsts/release/v4_1/models/build_version.py index 519cef9b..945389d1 100644 --- a/vsts/vsts/release/v4_1/models/build_version.py +++ b/vsts/vsts/release/v4_1/models/build_version.py @@ -12,12 +12,16 @@ class BuildVersion(Model): """BuildVersion. + :param commit_message: + :type commit_message: str :param id: :type id: str :param name: :type name: str :param source_branch: :type source_branch: str + :param source_pull_request_id: PullRequestId or Commit Id for the Pull Request for which the release will publish status + :type source_pull_request_id: str :param source_repository_id: :type source_repository_id: str :param source_repository_type: @@ -27,19 +31,23 @@ class BuildVersion(Model): """ _attribute_map = { + 'commit_message': {'key': 'commitMessage', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, + 'source_pull_request_id': {'key': 'sourcePullRequestId', 'type': 'str'}, 'source_repository_id': {'key': 'sourceRepositoryId', 'type': 'str'}, 'source_repository_type': {'key': 'sourceRepositoryType', 'type': 'str'}, 'source_version': {'key': 'sourceVersion', 'type': 'str'} } - def __init__(self, id=None, name=None, source_branch=None, source_repository_id=None, source_repository_type=None, source_version=None): + def __init__(self, commit_message=None, id=None, name=None, source_branch=None, source_pull_request_id=None, source_repository_id=None, source_repository_type=None, source_version=None): super(BuildVersion, self).__init__() + self.commit_message = commit_message self.id = id self.name = name self.source_branch = source_branch + self.source_pull_request_id = source_pull_request_id self.source_repository_id = source_repository_id self.source_repository_type = source_repository_type self.source_version = source_version diff --git a/vsts/vsts/release/v4_1/models/data_source_binding_base.py b/vsts/vsts/release/v4_1/models/data_source_binding_base.py index fe92a446..8d11fcdf 100644 --- a/vsts/vsts/release/v4_1/models/data_source_binding_base.py +++ b/vsts/vsts/release/v4_1/models/data_source_binding_base.py @@ -6,27 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class DataSourceBindingBase(Model): +class DataSourceBindingBase(BaseSecuredObject): """DataSourceBindingBase. - :param data_source_name: + :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str - :param endpoint_id: + :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str - :param endpoint_url: + :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str - :param headers: + :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` - :param parameters: + :param parameters: Gets or sets the parameters for the data source. :type parameters: dict - :param result_selector: + :param result_selector: Gets or sets the result selector. :type result_selector: str - :param result_template: + :param result_template: Gets or sets the result template. :type result_template: str - :param target: + :param target: Gets or sets the target of the data source. :type target: str """ diff --git a/vsts/vsts/release/v4_1/models/deployment.py b/vsts/vsts/release/v4_1/models/deployment.py index 834806a2..8cb4a228 100644 --- a/vsts/vsts/release/v4_1/models/deployment.py +++ b/vsts/vsts/release/v4_1/models/deployment.py @@ -16,6 +16,8 @@ class Deployment(Model): :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. @@ -57,6 +59,7 @@ class Deployment(Model): _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'}, @@ -77,10 +80,11 @@ class Deployment(Model): 'started_on': {'key': 'startedOn', 'type': 'iso-8601'} } - def __init__(self, _links=None, attempt=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, 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): + 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, 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 diff --git a/vsts/vsts/release/v4_1/models/deployment_attempt.py b/vsts/vsts/release/v4_1/models/deployment_attempt.py index 0fc1fd35..9f2bf5e1 100644 --- a/vsts/vsts/release/v4_1/models/deployment_attempt.py +++ b/vsts/vsts/release/v4_1/models/deployment_attempt.py @@ -22,6 +22,8 @@ class DeploymentAttempt(Model): :type has_started: bool :param id: :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: @@ -58,6 +60,7 @@ class DeploymentAttempt(Model): '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'}, @@ -74,13 +77,14 @@ class DeploymentAttempt(Model): 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} } - def __init__(self, attempt=None, deployment_id=None, error_log=None, has_started=None, id=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): + 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 diff --git a/vsts/vsts/release/v4_1/models/environment_options.py b/vsts/vsts/release/v4_1/models/environment_options.py index e4afe484..497bf25d 100644 --- a/vsts/vsts/release/v4_1/models/environment_options.py +++ b/vsts/vsts/release/v4_1/models/environment_options.py @@ -12,6 +12,10 @@ class EnvironmentOptions(Model): """EnvironmentOptions. + :param auto_link_work_items: + :type auto_link_work_items: bool + :param badge_enabled: + :type badge_enabled: bool :param email_notification_type: :type email_notification_type: str :param email_recipients: @@ -27,6 +31,8 @@ class EnvironmentOptions(Model): """ _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'}, @@ -35,8 +41,10 @@ class EnvironmentOptions(Model): 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } - def __init__(self, email_notification_type=None, email_recipients=None, enable_access_token=None, publish_deployment_status=None, skip_artifacts_download=None, timeout_in_minutes=None): + 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, 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 diff --git a/vsts/vsts/release/v4_1/models/identity_ref.py b/vsts/vsts/release/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/release/v4_1/models/identity_ref.py +++ b/vsts/vsts/release/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/release/v4_1/models/process_parameters.py b/vsts/vsts/release/v4_1/models/process_parameters.py index 657d9485..d87b7635 100644 --- a/vsts/vsts/release/v4_1/models/process_parameters.py +++ b/vsts/vsts/release/v4_1/models/process_parameters.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class ProcessParameters(Model): +class ProcessParameters(BaseSecuredObject): """ProcessParameters. :param data_source_bindings: diff --git a/vsts/vsts/release/v4_1/models/release_definition.py b/vsts/vsts/release/v4_1/models/release_definition.py index 58a8fe5f..47346209 100644 --- a/vsts/vsts/release/v4_1/models/release_definition.py +++ b/vsts/vsts/release/v4_1/models/release_definition.py @@ -40,6 +40,8 @@ class ReleaseDefinition(Model): :type name: str :param path: Gets or sets the path. :type path: str + :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. @@ -77,6 +79,7 @@ class ReleaseDefinition(Model): 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, + 'pipeline_process': {'key': 'pipelineProcess', 'type': 'PipelineProcess'}, 'properties': {'key': 'properties', 'type': 'object'}, 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, @@ -89,7 +92,7 @@ class ReleaseDefinition(Model): 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } - def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, created_on=None, description=None, environments=None, id=None, is_deleted=None, last_release=None, modified_by=None, modified_on=None, name=None, path=None, properties=None, release_name_format=None, retention_policy=None, revision=None, source=None, tags=None, triggers=None, url=None, variable_groups=None, variables=None): + def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, created_on=None, description=None, environments=None, id=None, is_deleted=None, last_release=None, modified_by=None, modified_on=None, name=None, path=None, pipeline_process=None, properties=None, release_name_format=None, retention_policy=None, revision=None, source=None, tags=None, triggers=None, url=None, variable_groups=None, variables=None): super(ReleaseDefinition, self).__init__() self._links = _links self.artifacts = artifacts @@ -105,6 +108,7 @@ def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, c self.modified_on = modified_on self.name = name self.path = path + self.pipeline_process = pipeline_process self.properties = properties self.release_name_format = release_name_format self.retention_policy = retention_policy diff --git a/vsts/vsts/release/v4_1/models/release_definition_environment.py b/vsts/vsts/release/v4_1/models/release_definition_environment.py index d621b288..1fe164f6 100644 --- a/vsts/vsts/release/v4_1/models/release_definition_environment.py +++ b/vsts/vsts/release/v4_1/models/release_definition_environment.py @@ -12,6 +12,8 @@ class ReleaseDefinitionEnvironment(Model): """ReleaseDefinitionEnvironment. + :param badge_url: + :type badge_url: str :param conditions: :type conditions: list of :class:`Condition ` :param demands: @@ -59,6 +61,7 @@ class ReleaseDefinitionEnvironment(Model): """ _attribute_map = { + 'badge_url': {'key': 'badgeUrl', 'type': 'str'}, 'conditions': {'key': 'conditions', 'type': '[Condition]'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'deploy_phases': {'key': 'deployPhases', 'type': '[DeployPhase]'}, @@ -83,8 +86,9 @@ class ReleaseDefinitionEnvironment(Model): 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } - def __init__(self, conditions=None, demands=None, deploy_phases=None, deploy_step=None, environment_options=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): + def __init__(self, badge_url=None, conditions=None, demands=None, deploy_phases=None, deploy_step=None, environment_options=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.demands = demands self.deploy_phases = deploy_phases diff --git a/vsts/vsts/release/v4_1/models/release_deploy_phase.py b/vsts/vsts/release/v4_1/models/release_deploy_phase.py index 00e70278..9c56f011 100644 --- a/vsts/vsts/release/v4_1/models/release_deploy_phase.py +++ b/vsts/vsts/release/v4_1/models/release_deploy_phase.py @@ -20,6 +20,10 @@ class ReleaseDeployPhase(Model): :type id: int :param manual_interventions: :type manual_interventions: list of :class:`ManualIntervention ` + :param name: + :type name: str + :param phase_id: + :type phase_id: str :param phase_type: :type phase_type: object :param rank: @@ -35,18 +39,22 @@ class ReleaseDeployPhase(Model): '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'}, 'status': {'key': 'status', 'type': 'object'} } - def __init__(self, deployment_jobs=None, error_log=None, id=None, manual_interventions=None, phase_type=None, rank=None, run_plan_id=None, status=None): + 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, 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 diff --git a/vsts/vsts/release/v4_1/models/task_input_definition_base.py b/vsts/vsts/release/v4_1/models/task_input_definition_base.py index 1b4e68ff..0d84190d 100644 --- a/vsts/vsts/release/v4_1/models/task_input_definition_base.py +++ b/vsts/vsts/release/v4_1/models/task_input_definition_base.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskInputDefinitionBase(Model): +class TaskInputDefinitionBase(BaseSecuredObject): """TaskInputDefinitionBase. :param aliases: diff --git a/vsts/vsts/release/v4_1/models/task_input_validation.py b/vsts/vsts/release/v4_1/models/task_input_validation.py index 42524013..cc51abdd 100644 --- a/vsts/vsts/release/v4_1/models/task_input_validation.py +++ b/vsts/vsts/release/v4_1/models/task_input_validation.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskInputValidation(Model): +class TaskInputValidation(BaseSecuredObject): """TaskInputValidation. :param expression: Conditional expression diff --git a/vsts/vsts/release/v4_1/models/task_source_definition_base.py b/vsts/vsts/release/v4_1/models/task_source_definition_base.py index c8a6b6d6..79ba6579 100644 --- a/vsts/vsts/release/v4_1/models/task_source_definition_base.py +++ b/vsts/vsts/release/v4_1/models/task_source_definition_base.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskSourceDefinitionBase(Model): +class TaskSourceDefinitionBase(BaseSecuredObject): """TaskSourceDefinitionBase. :param auth_key: diff --git a/vsts/vsts/release/v4_1/release_client.py b/vsts/vsts/release/v4_1/release_client.py index e5ad6e7b..06ecf5cc 100644 --- a/vsts/vsts/release/v4_1/release_client.py +++ b/vsts/vsts/release/v4_1/release_client.py @@ -62,7 +62,7 @@ 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='4.1-preview.1', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters, returns_collection=True) @@ -84,11 +84,78 @@ 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='4.1-preview.1', + version='4.1-preview.3', route_values=route_values, content=content) return self._deserialize('ReleaseApproval', response) + def get_task_attachment_content(self, project, release_id, environment_id, attempt_id, timeline_id, record_id, type, name): + """GetTaskAttachmentContent. + [Preview API] + :param str project: Project ID or project name + :param int release_id: + :param int environment_id: + :param int attempt_id: + :param str timeline_id: + :param str record_id: + :param str type: + :param str name: + :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 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='c4071f6d-3697-46ca-858e-8b10ff09e52f', + version='4.1-preview.1', + route_values=route_values) + return self._deserialize('object', response) + + def get_task_attachments(self, project, release_id, environment_id, attempt_id, timeline_id, type): + """GetTaskAttachments. + [Preview API] + :param str project: Project ID or project name + :param int release_id: + :param int environment_id: + :param int attempt_id: + :param str timeline_id: + :param str type: + :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 timeline_id is not None: + route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') + if type is not None: + route_values['type'] = self._serialize.url('type', type, 'str') + response = self._send(http_method='GET', + location_id='214111ee-2415-4df2-8ed2-74417f7d61f9', + version='4.1-preview.1', + route_values=route_values, + returns_collection=True) + return self._deserialize('[ReleaseTaskAttachment]', response) + def create_release_definition(self, release_definition, project): """CreateReleaseDefinition. [Preview API] Create a release definition @@ -233,7 +300,7 @@ def update_release_definition(self, release_definition, project): 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): + 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): """GetDeployments. [Preview API] :param str project: Project ID or project name @@ -249,6 +316,8 @@ def get_deployments(self, project, definition_id=None, definition_environment_id :param int top: :param int continuation_token: :param str created_for: + :param datetime min_started_time: + :param datetime max_started_time: :rtype: [Deployment] """ route_values = {} @@ -279,6 +348,10 @@ def get_deployments(self, project, definition_id=None, definition_environment_id 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') response = self._send(http_method='GET', location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', version='4.1-preview.2', @@ -329,7 +402,7 @@ def get_logs(self, project, release_id): route_values=route_values) return self._deserialize('object', response) - def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id): + def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None): """GetTaskLog. [Preview API] Gets the task log of a release as a plain text file. :param str project: Project ID or project name @@ -337,6 +410,8 @@ def get_task_log(self, project, release_id, environment_id, release_deploy_phase :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 = {} @@ -350,10 +425,16 @@ def get_task_log(self, project, release_id, environment_id, release_deploy_phase 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='4.1-preview.2', - route_values=route_values) + route_values=route_values, + query_parameters=query_parameters) return self._deserialize('object', response) def get_manual_intervention(self, project, release_id, manual_intervention_id): @@ -519,12 +600,12 @@ def create_release(self, release_start_metadata, project): content=content) return self._deserialize('Release', response) - def get_release(self, project, release_id, include_all_approvals=None, property_filters=None): + def get_release(self, project, release_id, approval_filters=None, property_filters=None): """GetRelease. [Preview API] Get a Release :param str project: Project ID or project name :param int release_id: Id of the release. - :param bool include_all_approvals: Include all approvals in the result. Default is 'true'. + :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 properties to include in the results. :rtype: :class:` ` """ @@ -534,8 +615,8 @@ def get_release(self, project, release_id, include_all_approvals=None, property_ if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') query_parameters = {} - if include_all_approvals is not None: - query_parameters['includeAllApprovals'] = self._serialize.query('include_all_approvals', include_all_approvals, 'bool') + 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') diff --git a/vsts/vsts/service_hooks/v4_1/models/__init__.py b/vsts/vsts/service_hooks/v4_1/models/__init__.py index 30e3e5ee..5548104e 100644 --- a/vsts/vsts/service_hooks/v4_1/models/__init__.py +++ b/vsts/vsts/service_hooks/v4_1/models/__init__.py @@ -12,6 +12,7 @@ from .event_type_descriptor import EventTypeDescriptor from .external_configuration_descriptor import ExternalConfigurationDescriptor from .formatted_event_message import FormattedEventMessage +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .input_descriptor import InputDescriptor from .input_filter import InputFilter @@ -33,7 +34,11 @@ from .resource_container import ResourceContainer from .session_token import SessionToken from .subscription import Subscription +from .subscription_diagnostics import SubscriptionDiagnostics from .subscriptions_query import SubscriptionsQuery +from .subscription_tracing import SubscriptionTracing +from .update_subscripiton_diagnostics_parameters import UpdateSubscripitonDiagnosticsParameters +from .update_subscripiton_tracing_parameters import UpdateSubscripitonTracingParameters from .versioned_resource import VersionedResource __all__ = [ @@ -43,6 +48,7 @@ 'EventTypeDescriptor', 'ExternalConfigurationDescriptor', 'FormattedEventMessage', + 'GraphSubjectBase', 'IdentityRef', 'InputDescriptor', 'InputFilter', @@ -64,6 +70,10 @@ 'ResourceContainer', 'SessionToken', 'Subscription', + 'SubscriptionDiagnostics', 'SubscriptionsQuery', + 'SubscriptionTracing', + 'UpdateSubscripitonDiagnosticsParameters', + 'UpdateSubscripitonTracingParameters', 'VersionedResource', ] diff --git a/vsts/vsts/service_hooks/v4_1/models/identity_ref.py b/vsts/vsts/service_hooks/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/service_hooks/v4_1/models/identity_ref.py +++ b/vsts/vsts/service_hooks/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/service_hooks/v4_1/service_hooks_client.py b/vsts/vsts/service_hooks/v4_1/service_hooks_client.py index cd0e3349..5f873e8d 100644 --- a/vsts/vsts/service_hooks/v4_1/service_hooks_client.py +++ b/vsts/vsts/service_hooks/v4_1/service_hooks_client.py @@ -105,6 +105,39 @@ def list_consumers(self, publisher_id=None): returns_collection=True) return self._deserialize('[Consumer]', response) + def get_subscription_diagnostics(self, subscription_id): + """GetSubscriptionDiagnostics. + [Preview API] + :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='4.1-preview.1', + route_values=route_values) + return self._deserialize('SubscriptionDiagnostics', response) + + def update_subscription_diagnostics(self, update_parameters, subscription_id): + """UpdateSubscriptionDiagnostics. + [Preview API] + :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='4.1-preview.1', + route_values=route_values, + content=content) + return self._deserialize('SubscriptionDiagnostics', response) + def get_event_type(self, publisher_id, event_type_id): """GetEventType. [Preview API] Get a specific event type. diff --git a/vsts/vsts/task_agent/v4_1/models/__init__.py b/vsts/vsts/task_agent/v4_1/models/__init__.py index 0d39ec76..93b24edf 100644 --- a/vsts/vsts/task_agent/v4_1/models/__init__.py +++ b/vsts/vsts/task_agent/v4_1/models/__init__.py @@ -12,6 +12,7 @@ from .authorization_header import AuthorizationHeader from .azure_subscription import AzureSubscription from .azure_subscription_query_result import AzureSubscriptionQueryResult +from .client_certificate import ClientCertificate from .data_source import DataSource from .data_source_binding import DataSourceBinding from .data_source_binding_base import DataSourceBindingBase @@ -20,14 +21,19 @@ from .dependency_data import DependencyData from .depends_on import DependsOn from .deployment_group import DeploymentGroup +from .deployment_group_create_parameter import DeploymentGroupCreateParameter +from .deployment_group_create_parameter_pool_property import DeploymentGroupCreateParameterPoolProperty from .deployment_group_metrics import DeploymentGroupMetrics from .deployment_group_reference import DeploymentGroupReference +from .deployment_group_update_parameter import DeploymentGroupUpdateParameter from .deployment_machine import DeploymentMachine from .deployment_machine_group import DeploymentMachineGroup from .deployment_machine_group_reference import DeploymentMachineGroupReference from .deployment_pool_summary import DeploymentPoolSummary +from .deployment_target_update_parameter import DeploymentTargetUpdateParameter from .endpoint_authorization import EndpointAuthorization from .endpoint_url import EndpointUrl +from .graph_subject_base import GraphSubjectBase from .help_link import HelpLink from .identity_ref import IdentityRef from .input_descriptor import InputDescriptor @@ -39,6 +45,8 @@ from .metrics_column_meta_data import MetricsColumnMetaData from .metrics_columns_header import MetricsColumnsHeader from .metrics_row import MetricsRow +from .oAuth_configuration import OAuthConfiguration +from .oAuth_configuration_params import OAuthConfigurationParams from .package_metadata import PackageMetadata from .package_version import PackageVersion from .project_reference import ProjectReference @@ -100,6 +108,7 @@ from .task_version import TaskVersion from .validation_item import ValidationItem from .variable_group import VariableGroup +from .variable_group_parameters import VariableGroupParameters from .variable_group_provider_data import VariableGroupProviderData from .variable_value import VariableValue @@ -110,6 +119,7 @@ 'AuthorizationHeader', 'AzureSubscription', 'AzureSubscriptionQueryResult', + 'ClientCertificate', 'DataSource', 'DataSourceBinding', 'DataSourceBindingBase', @@ -118,14 +128,19 @@ 'DependencyData', 'DependsOn', 'DeploymentGroup', + 'DeploymentGroupCreateParameter', + 'DeploymentGroupCreateParameterPoolProperty', 'DeploymentGroupMetrics', 'DeploymentGroupReference', + 'DeploymentGroupUpdateParameter', 'DeploymentMachine', 'DeploymentMachineGroup', 'DeploymentMachineGroupReference', 'DeploymentPoolSummary', + 'DeploymentTargetUpdateParameter', 'EndpointAuthorization', 'EndpointUrl', + 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', @@ -137,6 +152,8 @@ 'MetricsColumnMetaData', 'MetricsColumnsHeader', 'MetricsRow', + 'OAuthConfiguration', + 'OAuthConfigurationParams', 'PackageMetadata', 'PackageVersion', 'ProjectReference', @@ -198,6 +215,7 @@ 'TaskVersion', 'ValidationItem', 'VariableGroup', + 'VariableGroupParameters', 'VariableGroupProviderData', 'VariableValue', ] diff --git a/vsts/vsts/task_agent/v4_1/models/authorization_header.py b/vsts/vsts/task_agent/v4_1/models/authorization_header.py index 015e6775..3657c7a3 100644 --- a/vsts/vsts/task_agent/v4_1/models/authorization_header.py +++ b/vsts/vsts/task_agent/v4_1/models/authorization_header.py @@ -12,9 +12,9 @@ class AuthorizationHeader(Model): """AuthorizationHeader. - :param name: + :param name: Gets or sets the name of authorization header. :type name: str - :param value: + :param value: Gets or sets the value of authorization header. :type value: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/data_source_binding.py b/vsts/vsts/task_agent/v4_1/models/data_source_binding.py index 65023c0d..c4867160 100644 --- a/vsts/vsts/task_agent/v4_1/models/data_source_binding.py +++ b/vsts/vsts/task_agent/v4_1/models/data_source_binding.py @@ -12,21 +12,21 @@ class DataSourceBinding(DataSourceBindingBase): """DataSourceBinding. - :param data_source_name: + :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str - :param endpoint_id: + :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str - :param endpoint_url: + :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str - :param headers: + :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` - :param parameters: + :param parameters: Gets or sets the parameters for the data source. :type parameters: dict - :param result_selector: + :param result_selector: Gets or sets the result selector. :type result_selector: str - :param result_template: + :param result_template: Gets or sets the result template. :type result_template: str - :param target: + :param target: Gets or sets the target of the data source. :type target: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/data_source_binding_base.py b/vsts/vsts/task_agent/v4_1/models/data_source_binding_base.py index fe92a446..8d11fcdf 100644 --- a/vsts/vsts/task_agent/v4_1/models/data_source_binding_base.py +++ b/vsts/vsts/task_agent/v4_1/models/data_source_binding_base.py @@ -6,27 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class DataSourceBindingBase(Model): +class DataSourceBindingBase(BaseSecuredObject): """DataSourceBindingBase. - :param data_source_name: + :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str - :param endpoint_id: + :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str - :param endpoint_url: + :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str - :param headers: + :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` - :param parameters: + :param parameters: Gets or sets the parameters for the data source. :type parameters: dict - :param result_selector: + :param result_selector: Gets or sets the result selector. :type result_selector: str - :param result_template: + :param result_template: Gets or sets the result template. :type result_template: str - :param target: + :param target: Gets or sets the target of the data source. :type target: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/deployment_group.py b/vsts/vsts/task_agent/v4_1/models/deployment_group.py index 9bcf9a9d..54f7c88b 100644 --- a/vsts/vsts/task_agent/v4_1/models/deployment_group.py +++ b/vsts/vsts/task_agent/v4_1/models/deployment_group.py @@ -12,21 +12,21 @@ class DeploymentGroup(DeploymentGroupReference): """DeploymentGroup. - :param id: + :param id: Deployment group identifier. :type id: int - :param name: + :param name: Name of the deployment group. :type name: str - :param pool: + :param pool: Deployment pool in which deployment agents are registered. :type pool: :class:`TaskAgentPoolReference ` - :param project: + :param project: Project to which the deployment group belongs. :type project: :class:`ProjectReference ` - :param description: + :param description: Description of the deployment group. :type description: str - :param machine_count: + :param machine_count: Number of deployment targets in the deployment group. :type machine_count: int - :param machines: + :param machines: List of deployment targets in the deployment group. :type machines: list of :class:`DeploymentMachine ` - :param machine_tags: + :param machine_tags: List of unique tags across all deployment targets in the deployment group. :type machine_tags: list of str """ diff --git a/vsts/vsts/task_agent/v4_1/models/deployment_group_metrics.py b/vsts/vsts/task_agent/v4_1/models/deployment_group_metrics.py index 6bdbfb74..d6edc350 100644 --- a/vsts/vsts/task_agent/v4_1/models/deployment_group_metrics.py +++ b/vsts/vsts/task_agent/v4_1/models/deployment_group_metrics.py @@ -12,11 +12,11 @@ class DeploymentGroupMetrics(Model): """DeploymentGroupMetrics. - :param columns_header: + :param columns_header: List of deployment group properties. And types of metrics provided for those properties. :type columns_header: :class:`MetricsColumnsHeader ` - :param deployment_group: + :param deployment_group: Deployment group. :type deployment_group: :class:`DeploymentGroupReference ` - :param rows: + :param rows: Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'. :type rows: list of :class:`MetricsRow ` """ diff --git a/vsts/vsts/task_agent/v4_1/models/deployment_group_reference.py b/vsts/vsts/task_agent/v4_1/models/deployment_group_reference.py index ca94099d..2e9bc655 100644 --- a/vsts/vsts/task_agent/v4_1/models/deployment_group_reference.py +++ b/vsts/vsts/task_agent/v4_1/models/deployment_group_reference.py @@ -12,13 +12,13 @@ class DeploymentGroupReference(Model): """DeploymentGroupReference. - :param id: + :param id: Deployment group identifier. :type id: int - :param name: + :param name: Name of the deployment group. :type name: str - :param pool: + :param pool: Deployment pool in which deployment agents are registered. :type pool: :class:`TaskAgentPoolReference ` - :param project: + :param project: Project to which the deployment group belongs. :type project: :class:`ProjectReference ` """ diff --git a/vsts/vsts/task_agent/v4_1/models/deployment_machine.py b/vsts/vsts/task_agent/v4_1/models/deployment_machine.py index 71af8f16..b13fcafa 100644 --- a/vsts/vsts/task_agent/v4_1/models/deployment_machine.py +++ b/vsts/vsts/task_agent/v4_1/models/deployment_machine.py @@ -12,11 +12,11 @@ class DeploymentMachine(Model): """DeploymentMachine. - :param agent: + :param agent: Deployment agent. :type agent: :class:`TaskAgent ` - :param id: + :param id: Deployment target Identifier. :type id: int - :param tags: + :param tags: Tags of the deployment target. :type tags: list of str """ diff --git a/vsts/vsts/task_agent/v4_1/models/deployment_pool_summary.py b/vsts/vsts/task_agent/v4_1/models/deployment_pool_summary.py index 7401d3b9..50a96b60 100644 --- a/vsts/vsts/task_agent/v4_1/models/deployment_pool_summary.py +++ b/vsts/vsts/task_agent/v4_1/models/deployment_pool_summary.py @@ -12,13 +12,13 @@ class DeploymentPoolSummary(Model): """DeploymentPoolSummary. - :param deployment_groups: + :param deployment_groups: List of deployment groups referring to the deployment pool. :type deployment_groups: list of :class:`DeploymentGroupReference ` - :param offline_agents_count: + :param offline_agents_count: Number of deployment agents that are offline. :type offline_agents_count: int - :param online_agents_count: + :param online_agents_count: Number of deployment agents that are online. :type online_agents_count: int - :param pool: + :param pool: Deployment pool. :type pool: :class:`TaskAgentPoolReference ` """ diff --git a/vsts/vsts/task_agent/v4_1/models/endpoint_authorization.py b/vsts/vsts/task_agent/v4_1/models/endpoint_authorization.py index 5a8f642c..6fc33ab8 100644 --- a/vsts/vsts/task_agent/v4_1/models/endpoint_authorization.py +++ b/vsts/vsts/task_agent/v4_1/models/endpoint_authorization.py @@ -12,9 +12,9 @@ class EndpointAuthorization(Model): """EndpointAuthorization. - :param parameters: + :param parameters: Gets or sets the parameters for the selected authorization scheme. :type parameters: dict - :param scheme: + :param scheme: Gets or sets the scheme used for service endpoint authentication. :type scheme: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/endpoint_url.py b/vsts/vsts/task_agent/v4_1/models/endpoint_url.py index 62161498..c1bc7ceb 100644 --- a/vsts/vsts/task_agent/v4_1/models/endpoint_url.py +++ b/vsts/vsts/task_agent/v4_1/models/endpoint_url.py @@ -12,15 +12,15 @@ class EndpointUrl(Model): """EndpointUrl. - :param depends_on: + :param depends_on: Gets or sets the dependency bindings. :type depends_on: :class:`DependsOn ` - :param display_name: + :param display_name: Gets or sets the display name of service endpoint url. :type display_name: str - :param help_text: + :param help_text: Gets or sets the help text of service endpoint url. :type help_text: str - :param is_visible: + :param is_visible: Gets or sets the visibility of service endpoint url. :type is_visible: str - :param value: + :param value: Gets or sets the value of service endpoint url. :type value: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/identity_ref.py b/vsts/vsts/task_agent/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/task_agent/v4_1/models/identity_ref.py +++ b/vsts/vsts/task_agent/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/task_agent/v4_1/models/metrics_column_meta_data.py b/vsts/vsts/task_agent/v4_1/models/metrics_column_meta_data.py index 8fde3da2..242e669c 100644 --- a/vsts/vsts/task_agent/v4_1/models/metrics_column_meta_data.py +++ b/vsts/vsts/task_agent/v4_1/models/metrics_column_meta_data.py @@ -12,9 +12,9 @@ class MetricsColumnMetaData(Model): """MetricsColumnMetaData. - :param column_name: + :param column_name: Name. :type column_name: str - :param column_value_type: + :param column_value_type: Data type. :type column_value_type: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/metrics_columns_header.py b/vsts/vsts/task_agent/v4_1/models/metrics_columns_header.py index 12b391ac..70cda63d 100644 --- a/vsts/vsts/task_agent/v4_1/models/metrics_columns_header.py +++ b/vsts/vsts/task_agent/v4_1/models/metrics_columns_header.py @@ -12,9 +12,9 @@ class MetricsColumnsHeader(Model): """MetricsColumnsHeader. - :param dimensions: + :param dimensions: Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState :type dimensions: list of :class:`MetricsColumnMetaData ` - :param metrics: + :param metrics: The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets. :type metrics: list of :class:`MetricsColumnMetaData ` """ diff --git a/vsts/vsts/task_agent/v4_1/models/metrics_row.py b/vsts/vsts/task_agent/v4_1/models/metrics_row.py index 225673ad..4aabc669 100644 --- a/vsts/vsts/task_agent/v4_1/models/metrics_row.py +++ b/vsts/vsts/task_agent/v4_1/models/metrics_row.py @@ -12,9 +12,9 @@ class MetricsRow(Model): """MetricsRow. - :param dimensions: + :param dimensions: The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets. :type dimensions: list of str - :param metrics: + :param metrics: Metrics in serialized format. Should be deserialized based on the data type provided in header. :type metrics: list of str """ diff --git a/vsts/vsts/task_agent/v4_1/models/service_endpoint.py b/vsts/vsts/task_agent/v4_1/models/service_endpoint.py index 3d33ba8f..67b32233 100644 --- a/vsts/vsts/task_agent/v4_1/models/service_endpoint.py +++ b/vsts/vsts/task_agent/v4_1/models/service_endpoint.py @@ -12,15 +12,15 @@ class ServiceEndpoint(Model): """ServiceEndpoint. - :param administrators_group: + :param administrators_group: Gets or sets the identity reference for the administrators group of the service endpoint. :type administrators_group: :class:`IdentityRef ` :param authorization: Gets or sets the authorization data for talking to the endpoint. :type authorization: :class:`EndpointAuthorization ` - :param created_by: The Gets or sets Identity reference for the user who created the Service endpoint + :param created_by: Gets or sets the identity reference for the user who created the Service endpoint. :type created_by: :class:`IdentityRef ` :param data: :type data: dict - :param description: Gets or Sets description of endpoint + :param description: Gets or sets the description of endpoint. :type description: str :param group_scope_id: :type group_scope_id: str @@ -32,7 +32,7 @@ class ServiceEndpoint(Model): :type name: str :param operation_status: Error message during creation/deletion of endpoint :type operation_status: :class:`object ` - :param readers_group: + :param readers_group: Gets or sets the identity reference for the readers group of the service endpoint. :type readers_group: :class:`IdentityRef ` :param type: Gets or sets the type of the endpoint. :type type: str diff --git a/vsts/vsts/task_agent/v4_1/models/service_endpoint_authentication_scheme.py b/vsts/vsts/task_agent/v4_1/models/service_endpoint_authentication_scheme.py index f8cfe08d..580b49bc 100644 --- a/vsts/vsts/task_agent/v4_1/models/service_endpoint_authentication_scheme.py +++ b/vsts/vsts/task_agent/v4_1/models/service_endpoint_authentication_scheme.py @@ -12,26 +12,30 @@ class ServiceEndpointAuthenticationScheme(Model): """ServiceEndpointAuthenticationScheme. - :param authorization_headers: + :param authorization_headers: Gets or sets the authorization headers of service endpoint authentication scheme. :type authorization_headers: list of :class:`AuthorizationHeader ` - :param display_name: + :param client_certificates: Gets or sets the certificates of service endpoint authentication scheme. + :type client_certificates: list of :class:`ClientCertificate ` + :param display_name: Gets or sets the display name for the service endpoint authentication scheme. :type display_name: str - :param input_descriptors: + :param input_descriptors: Gets or sets the input descriptors for the service endpoint authentication scheme. :type input_descriptors: list of :class:`InputDescriptor ` - :param scheme: + :param scheme: Gets or sets the scheme for service endpoint authentication. :type scheme: str """ _attribute_map = { 'authorization_headers': {'key': 'authorizationHeaders', 'type': '[AuthorizationHeader]'}, + 'client_certificates': {'key': 'clientCertificates', 'type': '[ClientCertificate]'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'scheme': {'key': 'scheme', 'type': 'str'} } - def __init__(self, authorization_headers=None, display_name=None, input_descriptors=None, scheme=None): + def __init__(self, authorization_headers=None, client_certificates=None, display_name=None, input_descriptors=None, scheme=None): super(ServiceEndpointAuthenticationScheme, self).__init__() self.authorization_headers = authorization_headers + self.client_certificates = client_certificates self.display_name = display_name self.input_descriptors = input_descriptors self.scheme = scheme diff --git a/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_data.py b/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_data.py index c887acf3..0d4063ff 100644 --- a/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_data.py +++ b/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_data.py @@ -12,19 +12,19 @@ class ServiceEndpointExecutionData(Model): """ServiceEndpointExecutionData. - :param definition: + :param definition: Gets the definition of service endpoint execution owner. :type definition: :class:`TaskOrchestrationOwner ` - :param finish_time: + :param finish_time: Gets the finish time of service endpoint execution. :type finish_time: datetime - :param id: + :param id: Gets the Id of service endpoint execution data. :type id: long - :param owner: + :param owner: Gets the owner of service endpoint execution data. :type owner: :class:`TaskOrchestrationOwner ` - :param plan_type: + :param plan_type: Gets the plan type of service endpoint execution data. :type plan_type: str - :param result: + :param result: Gets the result of service endpoint execution. :type result: object - :param start_time: + :param start_time: Gets the start time of service endpoint execution. :type start_time: datetime """ diff --git a/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_record.py b/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_record.py index 8d32d8c4..8bd39125 100644 --- a/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_record.py +++ b/vsts/vsts/task_agent/v4_1/models/service_endpoint_execution_record.py @@ -12,9 +12,9 @@ class ServiceEndpointExecutionRecord(Model): """ServiceEndpointExecutionRecord. - :param data: + :param data: Gets the execution data of service endpoint execution. :type data: :class:`ServiceEndpointExecutionData ` - :param endpoint_id: + :param endpoint_id: Gets the Id of service endpoint. :type endpoint_id: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/service_endpoint_type.py b/vsts/vsts/task_agent/v4_1/models/service_endpoint_type.py index bcc7648a..8b0f011c 100644 --- a/vsts/vsts/task_agent/v4_1/models/service_endpoint_type.py +++ b/vsts/vsts/task_agent/v4_1/models/service_endpoint_type.py @@ -12,31 +12,31 @@ class ServiceEndpointType(Model): """ServiceEndpointType. - :param authentication_schemes: + :param authentication_schemes: Authentication scheme of service endpoint type. :type authentication_schemes: list of :class:`ServiceEndpointAuthenticationScheme ` - :param data_sources: + :param data_sources: Data sources of service endpoint type. :type data_sources: list of :class:`DataSource ` - :param dependency_data: + :param dependency_data: Dependency data of service endpoint type. :type dependency_data: list of :class:`DependencyData ` - :param description: + :param description: Gets or sets the description of service endpoint type. :type description: str - :param display_name: + :param display_name: Gets or sets the display name of service endpoint type. :type display_name: str - :param endpoint_url: + :param endpoint_url: Gets or sets the endpoint url of service endpoint type. :type endpoint_url: :class:`EndpointUrl ` - :param help_link: + :param help_link: Gets or sets the help link of service endpoint type. :type help_link: :class:`HelpLink ` :param help_mark_down: :type help_mark_down: str - :param icon_url: + :param icon_url: Gets or sets the icon url of service endpoint type. :type icon_url: str - :param input_descriptors: + :param input_descriptors: Input descriptor of service endpoint type. :type input_descriptors: list of :class:`InputDescriptor ` - :param name: + :param name: Gets or sets the name of service endpoint type. :type name: str - :param trusted_hosts: + :param trusted_hosts: Trusted hosts of a service endpoint type. :type trusted_hosts: list of str - :param ui_contribution_id: + :param ui_contribution_id: Gets or sets the ui contribution id of service endpoint type. :type ui_contribution_id: str """ diff --git a/vsts/vsts/task_agent/v4_1/models/task_agent_pool.py b/vsts/vsts/task_agent/v4_1/models/task_agent_pool.py index 7eb55422..137808dc 100644 --- a/vsts/vsts/task_agent/v4_1/models/task_agent_pool.py +++ b/vsts/vsts/task_agent/v4_1/models/task_agent_pool.py @@ -30,6 +30,8 @@ class TaskAgentPool(TaskAgentPoolReference): :type created_by: :class:`IdentityRef ` :param created_on: Gets the date/time of the pool creation. :type created_on: datetime + :param owner: Gets the identity who owns or administrates this pool. + :type owner: :class:`IdentityRef ` :param properties: :type properties: :class:`object ` """ @@ -44,12 +46,14 @@ class TaskAgentPool(TaskAgentPoolReference): 'auto_provision': {'key': 'autoProvision', 'type': 'bool'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'properties': {'key': 'properties', 'type': 'object'} } - def __init__(self, id=None, is_hosted=None, name=None, pool_type=None, scope=None, size=None, auto_provision=None, created_by=None, created_on=None, properties=None): + def __init__(self, id=None, is_hosted=None, name=None, pool_type=None, scope=None, size=None, auto_provision=None, created_by=None, created_on=None, owner=None, properties=None): super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, name=name, pool_type=pool_type, scope=scope, size=size) self.auto_provision = auto_provision self.created_by = created_by self.created_on = created_on + self.owner = owner self.properties = properties diff --git a/vsts/vsts/task_agent/v4_1/models/task_input_definition_base.py b/vsts/vsts/task_agent/v4_1/models/task_input_definition_base.py index 1b4e68ff..0d84190d 100644 --- a/vsts/vsts/task_agent/v4_1/models/task_input_definition_base.py +++ b/vsts/vsts/task_agent/v4_1/models/task_input_definition_base.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskInputDefinitionBase(Model): +class TaskInputDefinitionBase(BaseSecuredObject): """TaskInputDefinitionBase. :param aliases: diff --git a/vsts/vsts/task_agent/v4_1/models/task_input_validation.py b/vsts/vsts/task_agent/v4_1/models/task_input_validation.py index 42524013..cc51abdd 100644 --- a/vsts/vsts/task_agent/v4_1/models/task_input_validation.py +++ b/vsts/vsts/task_agent/v4_1/models/task_input_validation.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskInputValidation(Model): +class TaskInputValidation(BaseSecuredObject): """TaskInputValidation. :param expression: Conditional expression diff --git a/vsts/vsts/task_agent/v4_1/models/task_source_definition_base.py b/vsts/vsts/task_agent/v4_1/models/task_source_definition_base.py index c8a6b6d6..79ba6579 100644 --- a/vsts/vsts/task_agent/v4_1/models/task_source_definition_base.py +++ b/vsts/vsts/task_agent/v4_1/models/task_source_definition_base.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class TaskSourceDefinitionBase(Model): +class TaskSourceDefinitionBase(BaseSecuredObject): """TaskSourceDefinitionBase. :param auth_key: diff --git a/vsts/vsts/task_agent/v4_1/models/variable_group.py b/vsts/vsts/task_agent/v4_1/models/variable_group.py index 322bb040..fa38154c 100644 --- a/vsts/vsts/task_agent/v4_1/models/variable_group.py +++ b/vsts/vsts/task_agent/v4_1/models/variable_group.py @@ -12,25 +12,25 @@ class VariableGroup(Model): """VariableGroup. - :param created_by: + :param created_by: Gets or sets the identity who created the variable group. :type created_by: :class:`IdentityRef ` - :param created_on: + :param created_on: Gets or sets the time when variable group was created. :type created_on: datetime - :param description: + :param description: Gets or sets description of the variable group. :type description: str - :param id: + :param id: Gets or sets id of the variable group. :type id: int - :param modified_by: + :param modified_by: Gets or sets the identity who modified the variable group. :type modified_by: :class:`IdentityRef ` - :param modified_on: + :param modified_on: Gets or sets the time when variable group was modified :type modified_on: datetime - :param name: + :param name: Gets or sets name of the variable group. :type name: str - :param provider_data: + :param provider_data: Gets or sets provider data. :type provider_data: :class:`VariableGroupProviderData ` - :param type: + :param type: Gets or sets type of the variable group. :type type: str - :param variables: + :param variables: Gets or sets variables contained in the variable group. :type variables: dict """ diff --git a/vsts/vsts/task_agent/v4_1/task_agent_client.py b/vsts/vsts/task_agent/v4_1/task_agent_client.py index a072a629..f58d1bbf 100644 --- a/vsts/vsts/task_agent/v4_1/task_agent_client.py +++ b/vsts/vsts/task_agent/v4_1/task_agent_client.py @@ -25,1858 +25,130 @@ def __init__(self, base_url=None, creds=None): resource_area_identifier = 'a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd' - def add_agent(self, agent, pool_id): - """AddAgent. - [Preview API] - :param :class:` ` agent: - :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(agent, 'TaskAgent') - response = self._send(http_method='POST', - location_id='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgent', response) - - def delete_agent(self, pool_id, agent_id): - """DeleteAgent. - [Preview API] - :param int pool_id: - :param int agent_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - self._send(http_method='DELETE', - location_id='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values) - - def get_agent(self, pool_id, agent_id, include_capabilities=None, include_assigned_request=None, property_filters=None): - """GetAgent. - [Preview API] - :param int pool_id: - :param int agent_id: - :param bool include_capabilities: - :param bool include_assigned_request: - :param [str] property_filters: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - query_parameters = {} - if include_capabilities is not None: - query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') - if include_assigned_request is not None: - query_parameters['includeAssignedRequest'] = self._serialize.query('include_assigned_request', include_assigned_request, '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='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TaskAgent', response) - - def get_agents(self, pool_id, agent_name=None, include_capabilities=None, include_assigned_request=None, property_filters=None, demands=None): - """GetAgents. - [Preview API] - :param int pool_id: - :param str agent_name: - :param bool include_capabilities: - :param bool include_assigned_request: - :param [str] property_filters: - :param [str] demands: - :rtype: [TaskAgent] - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - query_parameters = {} - if agent_name is not None: - query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') - if include_capabilities is not None: - query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') - if include_assigned_request is not None: - query_parameters['includeAssignedRequest'] = self._serialize.query('include_assigned_request', include_assigned_request, 'bool') - if property_filters is not None: - property_filters = ",".join(property_filters) - query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') - if demands is not None: - demands = ",".join(demands) - query_parameters['demands'] = self._serialize.query('demands', demands, 'str') - response = self._send(http_method='GET', - location_id='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgent]', response) - - def replace_agent(self, agent, pool_id, agent_id): - """ReplaceAgent. - [Preview API] - :param :class:` ` agent: - :param int pool_id: - :param int agent_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - content = self._serialize.body(agent, 'TaskAgent') - response = self._send(http_method='PUT', - location_id='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgent', response) - - def update_agent(self, agent, pool_id, agent_id): - """UpdateAgent. - [Preview API] - :param :class:` ` agent: - :param int pool_id: - :param int agent_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - content = self._serialize.body(agent, 'TaskAgent') - response = self._send(http_method='PATCH', - location_id='e298ef32-5878-4cab-993c-043836571f42', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgent', response) - - def get_azure_subscriptions(self): - """GetAzureSubscriptions. - [Preview API] Returns list of azure subscriptions - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='bcd6189c-0303-471f-a8e1-acb22b74d700', - version='4.1-preview.1') - return self._deserialize('AzureSubscriptionQueryResult', response) - - def generate_deployment_group_access_token(self, project, deployment_group_id): - """GenerateDeploymentGroupAccessToken. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :rtype: str - """ - 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') - response = self._send(http_method='POST', - location_id='3d197ba2-c3e9-4253-882f-0ee2440f8174', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) - - def add_deployment_group(self, deployment_group, project): - """AddDeploymentGroup. - [Preview API] - :param :class:` ` deployment_group: - :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, 'DeploymentGroup') - response = self._send(http_method='POST', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentGroup', response) - - def delete_deployment_group(self, project, deployment_group_id): - """DeleteDeploymentGroup. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - """ - 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='4.1-preview.1', - route_values=route_values) - - def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): - """GetDeploymentGroup. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param str action_filter: - :param str expand: - :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='4.1-preview.1', - 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. - [Preview API] - :param str project: Project ID or project name - :param str name: - :param str action_filter: - :param str expand: - :param str continuation_token: - :param int top: - :param [int] ids: - :rtype: [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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentGroup]', response) - - def update_deployment_group(self, deployment_group, project, deployment_group_id): - """UpdateDeploymentGroup. - [Preview API] - :param :class:` ` deployment_group: - :param str project: Project ID or project name - :param int deployment_group_id: - :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, 'DeploymentGroup') - response = self._send(http_method='PATCH', - location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentGroup', response) - - def get_deployment_groups_metrics(self, project, deployment_group_name=None, continuation_token=None, top=None): - """GetDeploymentGroupsMetrics. - [Preview API] - :param str project: Project ID or project name - :param str deployment_group_name: - :param str continuation_token: - :param int top: - :rtype: [DeploymentGroupMetrics] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if deployment_group_name is not None: - query_parameters['deploymentGroupName'] = self._serialize.query('deployment_group_name', deployment_group_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='281c6308-427a-49e1-b83a-dac0f4862189', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentGroupMetrics]', response) - - def get_agent_requests_for_deployment_machine(self, project, deployment_group_id, machine_id, completed_request_count=None): - """GetAgentRequestsForDeploymentMachine. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param int machine_id: - :param int completed_request_count: - :rtype: [TaskAgentJobRequest] - """ - 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 machine_id is not None: - query_parameters['machineId'] = self._serialize.query('machine_id', machine_id, 'int') - if completed_request_count is not None: - query_parameters['completedRequestCount'] = self._serialize.query('completed_request_count', completed_request_count, 'int') - response = self._send(http_method='GET', - location_id='a3540e5b-f0dc-4668-963b-b752459be545', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentJobRequest]', response) - - def get_agent_requests_for_deployment_machines(self, project, deployment_group_id, machine_ids=None, completed_request_count=None): - """GetAgentRequestsForDeploymentMachines. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param [int] machine_ids: - :param int completed_request_count: - :rtype: [TaskAgentJobRequest] - """ - 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 machine_ids is not None: - machine_ids = ",".join(map(str, machine_ids)) - query_parameters['machineIds'] = self._serialize.query('machine_ids', machine_ids, 'str') - if completed_request_count is not None: - query_parameters['completedRequestCount'] = self._serialize.query('completed_request_count', completed_request_count, 'int') - response = self._send(http_method='GET', - location_id='a3540e5b-f0dc-4668-963b-b752459be545', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentJobRequest]', response) - - def refresh_deployment_machines(self, project, deployment_group_id): - """RefreshDeploymentMachines. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - """ - 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='POST', - location_id='91006ac4-0f68-4d82-a2bc-540676bd73ce', - version='4.1-preview.1', - route_values=route_values) - - def generate_deployment_pool_access_token(self, pool_id): - """GenerateDeploymentPoolAccessToken. - [Preview API] - :param int pool_id: - :rtype: str - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - response = self._send(http_method='POST', - location_id='e077ee4a-399b-420b-841f-c43fbc058e0b', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) - - def get_deployment_pools_summary(self, pool_name=None, expands=None): - """GetDeploymentPoolsSummary. - [Preview API] Get the deployment pools summary. - :param str pool_name: Get summary of deployment pools with name containing poolName. - :param str expands: Populate Deployment groups references if set to DeploymentGroups. Default is **None** - :rtype: [DeploymentPoolSummary] - """ - query_parameters = {} - if pool_name is not None: - query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') - if expands is not None: - query_parameters['expands'] = self._serialize.query('expands', expands, 'str') - response = self._send(http_method='GET', - location_id='6525d6c6-258f-40e0-a1a9-8a24a3957625', - version='4.1-preview.1', - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentPoolSummary]', response) - - def get_agent_requests_for_deployment_target(self, project, deployment_group_id, target_id, completed_request_count=None): - """GetAgentRequestsForDeploymentTarget. - [Preview API] Get agent requests for a deployment target. - :param str project: Project ID or project name - :param int deployment_group_id: Id of the deployment group to which target belongs. - :param int target_id: Id of the deployment target to get. - :param int completed_request_count: Maximum count of completed requests to get. - :rtype: [TaskAgentJobRequest] - """ - 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 target_id is not None: - query_parameters['targetId'] = self._serialize.query('target_id', target_id, 'int') - if completed_request_count is not None: - query_parameters['completedRequestCount'] = self._serialize.query('completed_request_count', completed_request_count, 'int') - response = self._send(http_method='GET', - location_id='2fac0be3-8c8f-4473-ab93-c1389b08a2c9', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentJobRequest]', response) - - def get_agent_requests_for_deployment_targets(self, project, deployment_group_id, target_ids=None, completed_request_count=None): - """GetAgentRequestsForDeploymentTargets. - [Preview API] Get agent requests for deployment targets. - :param str project: Project ID or project name - :param int deployment_group_id: Id of the deployment group to which targets belongs. - :param [int] target_ids: Ids of the deployment target to get. - :param int completed_request_count: Maximum count of completed requests to get. - :rtype: [TaskAgentJobRequest] - """ - 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 target_ids is not None: - target_ids = ",".join(map(str, target_ids)) - query_parameters['targetIds'] = self._serialize.query('target_ids', target_ids, 'str') - if completed_request_count is not None: - query_parameters['completedRequestCount'] = self._serialize.query('completed_request_count', completed_request_count, 'int') - response = self._send(http_method='GET', - location_id='2fac0be3-8c8f-4473-ab93-c1389b08a2c9', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentJobRequest]', response) - - def query_endpoint(self, endpoint): - """QueryEndpoint. - [Preview API] Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. - :param :class:` ` endpoint: Describes the URL to fetch. - :rtype: [str] - """ - content = self._serialize.body(endpoint, 'TaskDefinitionEndpoint') - response = self._send(http_method='POST', - location_id='f223b809-8c33-4b7d-b53f-07232569b5d6', - version='4.1-preview.1', - content=content, - returns_collection=True) - return self._deserialize('[str]', response) - - def get_service_endpoint_execution_records(self, project, endpoint_id, top=None): - """GetServiceEndpointExecutionRecords. - [Preview API] - :param str project: Project ID or project name - :param str endpoint_id: - :param int top: - :rtype: [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') - response = self._send(http_method='GET', - location_id='3ad71e20-7586-45f9-a6c8-0342e00835ac', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ServiceEndpointExecutionRecord]', response) - - def add_service_endpoint_execution_records(self, input, project): - """AddServiceEndpointExecutionRecords. - [Preview API] - :param :class:` ` input: - :param str project: Project ID or project name - :rtype: [ServiceEndpointExecutionRecord] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(input, 'ServiceEndpointExecutionRecordsInput') - response = self._send(http_method='POST', - location_id='11a45c69-2cce-4ade-a361-c9f5a37239ee', - version='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[ServiceEndpointExecutionRecord]', response) - - def validate_inputs(self, input_validation_request): - """ValidateInputs. - [Preview API] - :param :class:` ` input_validation_request: - :rtype: :class:` ` - """ - content = self._serialize.body(input_validation_request, 'InputValidationRequest') - response = self._send(http_method='POST', - location_id='58475b1e-adaf-4155-9bc1-e04bf1fff4c2', - version='4.1-preview.1', - content=content) - return self._deserialize('InputValidationRequest', response) - - def generate_deployment_machine_group_access_token(self, project, machine_group_id): - """GenerateDeploymentMachineGroupAccessToken. - [Preview API] - :param str project: Project ID or project name - :param int machine_group_id: - :rtype: str - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_id, 'int') - response = self._send(http_method='POST', - location_id='f8c7c0de-ac0d-469b-9cb1-c21f72d67693', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) - - def add_deployment_machine_group(self, machine_group, project): - """AddDeploymentMachineGroup. - [Preview API] - :param :class:` ` machine_group: - :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(machine_group, 'DeploymentMachineGroup') - response = self._send(http_method='POST', - location_id='d4adf50f-80c6-4ac8-9ca1-6e4e544286e9', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachineGroup', response) - - def delete_deployment_machine_group(self, project, machine_group_id): - """DeleteDeploymentMachineGroup. - [Preview API] - :param str project: Project ID or project name - :param int machine_group_id: - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_id, 'int') - self._send(http_method='DELETE', - location_id='d4adf50f-80c6-4ac8-9ca1-6e4e544286e9', - version='4.1-preview.1', - route_values=route_values) - - def get_deployment_machine_group(self, project, machine_group_id, action_filter=None): - """GetDeploymentMachineGroup. - [Preview API] - :param str project: Project ID or project name - :param int machine_group_id: - :param str action_filter: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_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='d4adf50f-80c6-4ac8-9ca1-6e4e544286e9', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('DeploymentMachineGroup', response) - - def get_deployment_machine_groups(self, project, machine_group_name=None, action_filter=None): - """GetDeploymentMachineGroups. - [Preview API] - :param str project: Project ID or project name - :param str machine_group_name: - :param str action_filter: - :rtype: [DeploymentMachineGroup] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if machine_group_name is not None: - query_parameters['machineGroupName'] = self._serialize.query('machine_group_name', machine_group_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='d4adf50f-80c6-4ac8-9ca1-6e4e544286e9', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentMachineGroup]', response) - - def update_deployment_machine_group(self, machine_group, project, machine_group_id): - """UpdateDeploymentMachineGroup. - [Preview API] - :param :class:` ` machine_group: - :param str project: Project ID or project name - :param int machine_group_id: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_id, 'int') - content = self._serialize.body(machine_group, 'DeploymentMachineGroup') - response = self._send(http_method='PATCH', - location_id='d4adf50f-80c6-4ac8-9ca1-6e4e544286e9', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachineGroup', response) - - def get_deployment_machine_group_machines(self, project, machine_group_id, tag_filters=None): - """GetDeploymentMachineGroupMachines. - [Preview API] - :param str project: Project ID or project name - :param int machine_group_id: - :param [str] tag_filters: - :rtype: [DeploymentMachine] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_id, 'int') - query_parameters = {} - if tag_filters is not None: - tag_filters = ",".join(tag_filters) - query_parameters['tagFilters'] = self._serialize.query('tag_filters', tag_filters, 'str') - response = self._send(http_method='GET', - location_id='966c3874-c347-4b18-a90c-d509116717fd', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentMachine]', response) - - def update_deployment_machine_group_machines(self, deployment_machines, project, machine_group_id): - """UpdateDeploymentMachineGroupMachines. - [Preview API] - :param [DeploymentMachine] deployment_machines: - :param str project: Project ID or project name - :param int machine_group_id: - :rtype: [DeploymentMachine] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if machine_group_id is not None: - route_values['machineGroupId'] = self._serialize.url('machine_group_id', machine_group_id, 'int') - content = self._serialize.body(deployment_machines, '[DeploymentMachine]') - response = self._send(http_method='PATCH', - location_id='966c3874-c347-4b18-a90c-d509116717fd', - version='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[DeploymentMachine]', response) - - def add_deployment_machine(self, machine, project, deployment_group_id): - """AddDeploymentMachine. - [Preview API] - :param :class:` ` machine: - :param str project: Project ID or project name - :param int deployment_group_id: - :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(machine, 'DeploymentMachine') - response = self._send(http_method='POST', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachine', response) - - def delete_deployment_machine(self, project, deployment_group_id, machine_id): - """DeleteDeploymentMachine. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param int machine_id: - """ - 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 machine_id is not None: - route_values['machineId'] = self._serialize.url('machine_id', machine_id, 'int') - self._send(http_method='DELETE', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values) - - def get_deployment_machine(self, project, deployment_group_id, machine_id, expand=None): - """GetDeploymentMachine. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param int machine_id: - :param str expand: - :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 machine_id is not None: - route_values['machineId'] = self._serialize.url('machine_id', machine_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='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('DeploymentMachine', response) - - def get_deployment_machines(self, project, deployment_group_id, tags=None, name=None, expand=None): - """GetDeploymentMachines. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param [str] tags: - :param str name: - :param str expand: - :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') - 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 expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - response = self._send(http_method='GET', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[DeploymentMachine]', response) - - def replace_deployment_machine(self, machine, project, deployment_group_id, machine_id): - """ReplaceDeploymentMachine. - [Preview API] - :param :class:` ` machine: - :param str project: Project ID or project name - :param int deployment_group_id: - :param int machine_id: - :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 machine_id is not None: - route_values['machineId'] = self._serialize.url('machine_id', machine_id, 'int') - content = self._serialize.body(machine, 'DeploymentMachine') - response = self._send(http_method='PUT', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachine', response) - - def update_deployment_machine(self, machine, project, deployment_group_id, machine_id): - """UpdateDeploymentMachine. - [Preview API] - :param :class:` ` machine: - :param str project: Project ID or project name - :param int deployment_group_id: - :param int machine_id: - :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 machine_id is not None: - route_values['machineId'] = self._serialize.url('machine_id', machine_id, 'int') - content = self._serialize.body(machine, 'DeploymentMachine') - response = self._send(http_method='PATCH', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachine', response) - - def update_deployment_machines(self, machines, project, deployment_group_id): - """UpdateDeploymentMachines. - [Preview API] - :param [DeploymentMachine] machines: - :param str project: Project ID or project name - :param int deployment_group_id: - :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, '[DeploymentMachine]') - response = self._send(http_method='PATCH', - location_id='6f6d406f-cfe6-409c-9327-7009928077e7', - version='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[DeploymentMachine]', response) - - def create_agent_pool_maintenance_definition(self, definition, pool_id): - """CreateAgentPoolMaintenanceDefinition. - [Preview API] - :param :class:` ` definition: - :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(definition, 'TaskAgentPoolMaintenanceDefinition') - response = self._send(http_method='POST', - location_id='80572e16-58f0-4419-ac07-d19fde32195c', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgentPoolMaintenanceDefinition', response) - - def delete_agent_pool_maintenance_definition(self, pool_id, definition_id): - """DeleteAgentPoolMaintenanceDefinition. - [Preview API] - :param int pool_id: - :param int definition_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - self._send(http_method='DELETE', - location_id='80572e16-58f0-4419-ac07-d19fde32195c', - version='4.1-preview.1', - route_values=route_values) - - def get_agent_pool_maintenance_definition(self, pool_id, definition_id): - """GetAgentPoolMaintenanceDefinition. - [Preview API] - :param int pool_id: - :param int definition_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - 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='80572e16-58f0-4419-ac07-d19fde32195c', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('TaskAgentPoolMaintenanceDefinition', response) - - def get_agent_pool_maintenance_definitions(self, pool_id): - """GetAgentPoolMaintenanceDefinitions. - [Preview API] - :param int pool_id: - :rtype: [TaskAgentPoolMaintenanceDefinition] - """ - 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='80572e16-58f0-4419-ac07-d19fde32195c', - version='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[TaskAgentPoolMaintenanceDefinition]', response) - - def update_agent_pool_maintenance_definition(self, definition, pool_id, definition_id): - """UpdateAgentPoolMaintenanceDefinition. - [Preview API] - :param :class:` ` definition: - :param int pool_id: - :param int definition_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if definition_id is not None: - route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') - content = self._serialize.body(definition, 'TaskAgentPoolMaintenanceDefinition') - response = self._send(http_method='PUT', - location_id='80572e16-58f0-4419-ac07-d19fde32195c', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgentPoolMaintenanceDefinition', response) - - def delete_agent_pool_maintenance_job(self, pool_id, job_id): - """DeleteAgentPoolMaintenanceJob. - [Preview API] - :param int pool_id: - :param int job_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if job_id is not None: - route_values['jobId'] = self._serialize.url('job_id', job_id, 'int') - self._send(http_method='DELETE', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values) - - def get_agent_pool_maintenance_job(self, pool_id, job_id): - """GetAgentPoolMaintenanceJob. - [Preview API] - :param int pool_id: - :param int job_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if job_id is not None: - route_values['jobId'] = self._serialize.url('job_id', job_id, 'int') - response = self._send(http_method='GET', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('TaskAgentPoolMaintenanceJob', response) - - def get_agent_pool_maintenance_job_logs(self, pool_id, job_id): - """GetAgentPoolMaintenanceJobLogs. - [Preview API] - :param int pool_id: - :param int job_id: - :rtype: object - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if job_id is not None: - route_values['jobId'] = self._serialize.url('job_id', job_id, 'int') - response = self._send(http_method='GET', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('object', response) - - def get_agent_pool_maintenance_jobs(self, pool_id, definition_id=None): - """GetAgentPoolMaintenanceJobs. - [Preview API] - :param int pool_id: - :param int definition_id: - :rtype: [TaskAgentPoolMaintenanceJob] - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - query_parameters = {} - if definition_id is not None: - query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') - response = self._send(http_method='GET', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentPoolMaintenanceJob]', response) - - def queue_agent_pool_maintenance_job(self, job, pool_id): - """QueueAgentPoolMaintenanceJob. - [Preview API] - :param :class:` ` job: - :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(job, 'TaskAgentPoolMaintenanceJob') - response = self._send(http_method='POST', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgentPoolMaintenanceJob', response) - - def update_agent_pool_maintenance_job(self, job, pool_id, job_id): - """UpdateAgentPoolMaintenanceJob. - [Preview API] - :param :class:` ` job: - :param int pool_id: - :param int job_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if job_id is not None: - route_values['jobId'] = self._serialize.url('job_id', job_id, 'int') - content = self._serialize.body(job, 'TaskAgentPoolMaintenanceJob') - response = self._send(http_method='PATCH', - location_id='15e7ab6e-abce-4601-a6d8-e111fe148f46', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgentPoolMaintenanceJob', response) - - def delete_message(self, pool_id, message_id, session_id): - """DeleteMessage. - [Preview API] - :param int pool_id: - :param long message_id: - :param str session_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if message_id is not None: - route_values['messageId'] = self._serialize.url('message_id', message_id, 'long') - query_parameters = {} - if session_id is not None: - query_parameters['sessionId'] = self._serialize.query('session_id', session_id, 'str') - self._send(http_method='DELETE', - location_id='c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - - def get_message(self, pool_id, session_id, last_message_id=None): - """GetMessage. - [Preview API] - :param int pool_id: - :param str session_id: - :param long last_message_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - query_parameters = {} - if session_id is not None: - query_parameters['sessionId'] = self._serialize.query('session_id', session_id, 'str') - if last_message_id is not None: - query_parameters['lastMessageId'] = self._serialize.query('last_message_id', last_message_id, 'long') - response = self._send(http_method='GET', - location_id='c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TaskAgentMessage', response) - - def refresh_agent(self, pool_id, agent_id): - """RefreshAgent. - [Preview API] - :param int pool_id: - :param int agent_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - query_parameters = {} - if agent_id is not None: - query_parameters['agentId'] = self._serialize.query('agent_id', agent_id, 'int') - self._send(http_method='POST', - location_id='c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - - def refresh_agents(self, pool_id): - """RefreshAgents. - [Preview API] - :param int pool_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - self._send(http_method='POST', - location_id='c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7', - version='4.1-preview.1', - route_values=route_values) - - def send_message(self, message, pool_id, request_id): - """SendMessage. - [Preview API] - :param :class:` ` message: - :param int pool_id: - :param long request_id: - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - query_parameters = {} - if request_id is not None: - query_parameters['requestId'] = self._serialize.query('request_id', request_id, 'long') - content = self._serialize.body(message, 'TaskAgentMessage') - self._send(http_method='POST', - location_id='c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - - def get_package(self, package_type, platform, version): - """GetPackage. - [Preview API] - :param str package_type: - :param str platform: - :param str version: - :rtype: :class:` ` - """ - route_values = {} - if package_type is not None: - route_values['packageType'] = self._serialize.url('package_type', package_type, 'str') - if platform is not None: - route_values['platform'] = self._serialize.url('platform', platform, 'str') - if version is not None: - route_values['version'] = self._serialize.url('version', version, 'str') - response = self._send(http_method='GET', - location_id='8ffcd551-079c-493a-9c02-54346299d144', - version='4.1-preview.2', - route_values=route_values) - return self._deserialize('PackageMetadata', response) - - def get_packages(self, package_type, platform=None, top=None): - """GetPackages. - [Preview API] - :param str package_type: - :param str platform: - :param int top: - :rtype: [PackageMetadata] - """ - route_values = {} - if package_type is not None: - route_values['packageType'] = self._serialize.url('package_type', package_type, 'str') - if platform is not None: - route_values['platform'] = self._serialize.url('platform', platform, 'str') - query_parameters = {} - if top is not None: - query_parameters['$top'] = self._serialize.query('top', top, 'int') - response = self._send(http_method='GET', - location_id='8ffcd551-079c-493a-9c02-54346299d144', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[PackageMetadata]', response) - - def add_agent_queue(self, queue, project=None): - """AddAgentQueue. - [Preview API] - :param :class:` ` queue: - :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(queue, 'TaskAgentQueue') - response = self._send(http_method='POST', - location_id='900fa995-c559-4923-aae7-f8424fe4fbea', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgentQueue', response) - - def create_team_project(self, project=None): - """CreateTeamProject. - [Preview API] - :param str project: Project ID or project name - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - self._send(http_method='PUT', - location_id='900fa995-c559-4923-aae7-f8424fe4fbea', - version='4.1-preview.1', - route_values=route_values) - - def delete_agent_queue(self, queue_id, project=None): - """DeleteAgentQueue. - [Preview API] - :param int queue_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 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='4.1-preview.1', - route_values=route_values) - - def get_agent_queue(self, queue_id, project=None, action_filter=None): - """GetAgentQueue. - [Preview API] - :param int queue_id: - :param str project: Project ID or project name - :param str action_filter: - :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='4.1-preview.1', - 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. - [Preview API] - :param str project: Project ID or project name - :param str queue_name: - :param str action_filter: - :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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentQueue]', response) - - def get_agent_queues_by_ids(self, queue_ids, project=None, action_filter=None): - """GetAgentQueuesByIds. - [Preview API] - :param [int] queue_ids: - :param str project: Project ID or project name - :param str action_filter: - :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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentQueue]', response) - - def get_agent_queues_by_names(self, queue_names, project=None, action_filter=None): - """GetAgentQueuesByNames. - [Preview API] - :param [str] queue_names: - :param str project: Project ID or project name - :param str action_filter: - :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='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskAgentQueue]', response) - - def get_task_group_history(self, project, task_group_id): - """GetTaskGroupHistory. - [Preview API] - :param str project: Project ID or project name - :param str task_group_id: - :rtype: [TaskGroupRevision] - """ - 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') - response = self._send(http_method='GET', - location_id='100cc92a-b255-47fa-9ab3-e44a2985a3ac', - version='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[TaskGroupRevision]', response) - - def delete_secure_file(self, project, secure_file_id): - """DeleteSecureFile. - [Preview API] Delete a secure file - :param str project: Project ID or project name - :param str secure_file_id: The unique secure file Id - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if secure_file_id is not None: - route_values['secureFileId'] = self._serialize.url('secure_file_id', secure_file_id, 'str') - self._send(http_method='DELETE', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values) - - def download_secure_file(self, project, secure_file_id, ticket, download=None): - """DownloadSecureFile. - [Preview API] Download a secure file by Id - :param str project: Project ID or project name - :param str secure_file_id: The unique secure file Id - :param str ticket: A valid download ticket - :param bool download: If download is true, the file is sent as attachement in the response body. If download is false, the response body contains the file stream. - :rtype: object - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if secure_file_id is not None: - route_values['secureFileId'] = self._serialize.url('secure_file_id', secure_file_id, 'str') - query_parameters = {} - if ticket is not None: - query_parameters['ticket'] = self._serialize.query('ticket', ticket, 'str') - if download is not None: - query_parameters['download'] = self._serialize.query('download', download, 'bool') - response = self._send(http_method='GET', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_secure_file(self, project, secure_file_id, include_download_ticket=None, action_filter=None): - """GetSecureFile. - [Preview API] Get a secure file - :param str project: Project ID or project name - :param str secure_file_id: The unique secure file Id - :param bool include_download_ticket: If includeDownloadTicket is true and the caller has permissions, a download ticket is included in the response. - :param str action_filter: - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if secure_file_id is not None: - route_values['secureFileId'] = self._serialize.url('secure_file_id', secure_file_id, 'str') - query_parameters = {} - if include_download_ticket is not None: - query_parameters['includeDownloadTicket'] = self._serialize.query('include_download_ticket', include_download_ticket, 'bool') - 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='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('SecureFile', response) - - def get_secure_files(self, project, name_pattern=None, include_download_tickets=None, action_filter=None): - """GetSecureFiles. - [Preview API] Get secure files - :param str project: Project ID or project name - :param str name_pattern: Name of the secure file to match. Can include wildcards to match multiple files. - :param bool include_download_tickets: If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - :param str action_filter: Filter by secure file permissions for View, Manage or Use action. Defaults to View. - :rtype: [SecureFile] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if name_pattern is not None: - query_parameters['namePattern'] = self._serialize.query('name_pattern', name_pattern, 'str') - if include_download_tickets is not None: - query_parameters['includeDownloadTickets'] = self._serialize.query('include_download_tickets', include_download_tickets, 'bool') - 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='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[SecureFile]', response) - - def get_secure_files_by_ids(self, project, secure_file_ids, include_download_tickets=None, action_filter=None): - """GetSecureFilesByIds. - [Preview API] Get secure files - :param str project: Project ID or project name - :param [str] secure_file_ids: A list of secure file Ids - :param bool include_download_tickets: If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - :param str action_filter: - :rtype: [SecureFile] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if secure_file_ids is not None: - secure_file_ids = ",".join(secure_file_ids) - query_parameters['secureFileIds'] = self._serialize.query('secure_file_ids', secure_file_ids, 'str') - if include_download_tickets is not None: - query_parameters['includeDownloadTickets'] = self._serialize.query('include_download_tickets', include_download_tickets, 'bool') - 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='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[SecureFile]', response) - - def get_secure_files_by_names(self, project, secure_file_names, include_download_tickets=None, action_filter=None): - """GetSecureFilesByNames. - [Preview API] Get secure files - :param str project: Project ID or project name - :param [str] secure_file_names: A list of secure file Ids - :param bool include_download_tickets: If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - :param str action_filter: - :rtype: [SecureFile] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if secure_file_names is not None: - secure_file_names = ",".join(secure_file_names) - query_parameters['secureFileNames'] = self._serialize.query('secure_file_names', secure_file_names, 'str') - if include_download_tickets is not None: - query_parameters['includeDownloadTickets'] = self._serialize.query('include_download_tickets', include_download_tickets, 'bool') - 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='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[SecureFile]', response) - - def query_secure_files_by_properties(self, condition, project, name_pattern=None): - """QuerySecureFilesByProperties. - [Preview API] Query secure files using a name pattern and a condition on file properties. - :param str condition: The main condition syntax is described [here](https://go.microsoft.com/fwlink/?linkid=842996). Use the *property('property-name')* function to access the value of the specified property of a secure file. It returns null if the property is not set. E.g. ``` and( eq( property('devices'), '2' ), in( property('provisioning profile type'), 'ad hoc', 'development' ) ) ``` - :param str project: Project ID or project name - :param str name_pattern: Name of the secure file to match. Can include wildcards to match multiple files. - :rtype: [SecureFile] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - query_parameters = {} - if name_pattern is not None: - query_parameters['namePattern'] = self._serialize.query('name_pattern', name_pattern, 'str') - content = self._serialize.body(condition, 'str') - response = self._send(http_method='POST', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content, - returns_collection=True) - return self._deserialize('[SecureFile]', response) - - def update_secure_file(self, secure_file, project, secure_file_id): - """UpdateSecureFile. - [Preview API] Update the name or properties of an existing secure file - :param :class:` ` secure_file: The secure file with updated name and/or properties - :param str project: Project ID or project name - :param str secure_file_id: The unique secure file Id - :rtype: :class:` ` - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - if secure_file_id is not None: - route_values['secureFileId'] = self._serialize.url('secure_file_id', secure_file_id, 'str') - content = self._serialize.body(secure_file, 'SecureFile') - response = self._send(http_method='PATCH', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('SecureFile', response) - - def update_secure_files(self, secure_files, project): - """UpdateSecureFiles. - [Preview API] Update properties and/or names of a set of secure files. Files are identified by their IDs. Properties provided override the existing one entirely, i.e. do not merge. - :param [SecureFile] secure_files: A list of secure file objects. Only three field must be populated Id, Name, and Properties. The rest of fields in the object are ignored. - :param str project: Project ID or project name - :rtype: [SecureFile] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(secure_files, '[SecureFile]') - response = self._send(http_method='PATCH', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', - version='4.1-preview.1', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[SecureFile]', response) - - def upload_secure_file(self, upload_stream, project, name): - """UploadSecureFile. - [Preview API] Upload a secure file, include the file stream in the request body - :param object upload_stream: Stream to upload + def add_deployment_group(self, deployment_group, project): + """AddDeploymentGroup. + [Preview API] Create a deployment group. + :param :class:` ` deployment_group: Deployment group to create. :param str project: Project ID or project name - :param str name: Name of the file to upload - :rtype: :class:` ` + :rtype: :class:` ` """ 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') - content = self._serialize.body(upload_stream, 'object') + content = self._serialize.body(deployment_group, 'DeploymentGroupCreateParameter') response = self._send(http_method='POST', - location_id='adcfd8bc-b184-43ba-bd84-7c8c6a2ff421', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='4.1-preview.1', route_values=route_values, - query_parameters=query_parameters, - content=content, - media_type='application/octet-stream') - return self._deserialize('SecureFile', response) - - def execute_service_endpoint_request(self, service_endpoint_request, project, endpoint_id): - """ExecuteServiceEndpointRequest. - [Preview API] - :param :class:` ` service_endpoint_request: - :param str project: Project ID or project name - :param str endpoint_id: - :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='f956a7de-d766-43af-81b1-e9e349245634', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('ServiceEndpointRequestResult', response) - - def create_service_endpoint(self, endpoint, project): - """CreateServiceEndpoint. - [Preview API] - :param :class:` ` endpoint: - :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(endpoint, 'ServiceEndpoint') - response = self._send(http_method='POST', - location_id='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', - route_values=route_values, content=content) - return self._deserialize('ServiceEndpoint', response) + return self._deserialize('DeploymentGroup', response) - def delete_service_endpoint(self, project, endpoint_id): - """DeleteServiceEndpoint. - [Preview API] + def delete_deployment_group(self, project, deployment_group_id): + """DeleteDeploymentGroup. + [Preview API] Delete a deployment group. :param str project: Project ID or project name - :param str endpoint_id: + :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 endpoint_id is not None: - route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, '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='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='4.1-preview.1', route_values=route_values) - def get_service_endpoint_details(self, project, endpoint_id): - """GetServiceEndpointDetails. - [Preview API] - :param str project: Project ID or project name - :param str endpoint_id: - :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') - response = self._send(http_method='GET', - location_id='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', - route_values=route_values) - return self._deserialize('ServiceEndpoint', response) - - def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, include_failed=None): - """GetServiceEndpoints. - [Preview API] - :param str project: Project ID or project name - :param str type: - :param [str] auth_schemes: - :param [str] endpoint_ids: - :param bool include_failed: - :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 include_failed is not None: - query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') - response = self._send(http_method='GET', - location_id='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ServiceEndpoint]', response) - - def get_service_endpoints_by_names(self, project, endpoint_names, type=None, auth_schemes=None, include_failed=None): - """GetServiceEndpointsByNames. - [Preview API] + def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): + """GetDeploymentGroup. + [Preview API] Get a deployment group by its ID. :param str project: Project ID or project name - :param [str] endpoint_names: - :param str type: - :param [str] auth_schemes: - :param bool include_failed: - :rtype: [ServiceEndpoint] + :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 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 include_failed is not None: - query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') + 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='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[ServiceEndpoint]', response) - - def update_service_endpoint(self, endpoint, project, endpoint_id, operation=None): - """UpdateServiceEndpoint. - [Preview API] - :param :class:` ` endpoint: - :param str project: Project ID or project name - :param str endpoint_id: - :param str operation: - :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 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='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', + version='4.1-preview.1', route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('ServiceEndpoint', response) + query_parameters=query_parameters) + return self._deserialize('DeploymentGroup', response) - def update_service_endpoints(self, endpoints, project): - """UpdateServiceEndpoints. - [Preview API] - :param [ServiceEndpoint] endpoints: - :param str project: Project ID or project name - :rtype: [ServiceEndpoint] + def get_deployment_groups(self, project, name=None, action_filter=None, expand=None, continuation_token=None, top=None, ids=None): + """GetDeploymentGroups. + [Preview API] 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: [DeploymentGroup] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') - content = self._serialize.body(endpoints, '[ServiceEndpoint]') - response = self._send(http_method='PUT', - location_id='dca61d2f-3444-410a-b5ec-db2fc4efb4c5', - version='4.1-preview.2', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[ServiceEndpoint]', response) - - def get_service_endpoint_types(self, type=None, scheme=None): - """GetServiceEndpointTypes. - [Preview API] - :param str type: - :param str scheme: - :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') + 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='7c74af83-8605-45c1-a30b-7a05d5d7f8c1', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='4.1-preview.1', + route_values=route_values, query_parameters=query_parameters, returns_collection=True) - return self._deserialize('[ServiceEndpointType]', response) + return self._deserialize('[DeploymentGroup]', response) - def add_deployment_target(self, machine, project, deployment_group_id): - """AddDeploymentTarget. - [Preview API] - :param :class:` ` machine: + def update_deployment_group(self, deployment_group, project, deployment_group_id): + """UpdateDeploymentGroup. + [Preview API] 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: - :rtype: :class:` ` + :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(machine, 'DeploymentMachine') - response = self._send(http_method='POST', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', + content = self._serialize.body(deployment_group, 'DeploymentGroupUpdateParameter') + response = self._send(http_method='PATCH', + location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='4.1-preview.1', route_values=route_values, content=content) - return self._deserialize('DeploymentMachine', response) + return self._deserialize('DeploymentGroup', response) def delete_deployment_target(self, project, deployment_group_id, target_id): """DeleteDeploymentTarget. - [Preview API] + [Preview API] 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: - :param int target_id: + :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: @@ -1892,11 +164,11 @@ def delete_deployment_target(self, project, deployment_group_id, target_id): def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): """GetDeploymentTarget. - [Preview API] + [Preview API] Get a deployment target by its ID in a deployment group :param str project: Project ID or project name - :param int deployment_group_id: - :param int target_id: - :param str expand: + :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 = {} @@ -1918,17 +190,17 @@ def get_deployment_target(self, project, deployment_group_id, target_id, expand= 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): """GetDeploymentTargets. - [Preview API] - :param str project: Project ID or project name - :param int deployment_group_id: - :param [str] tags: - :param str name: - :param bool partial_name_match: - :param str expand: - :param str agent_status: - :param str agent_job_result: - :param str continuation_token: - :param int top: + [Preview API] 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**. :rtype: [DeploymentMachine] """ route_values = {} @@ -1962,60 +234,12 @@ def get_deployment_targets(self, project, deployment_group_id, tags=None, name=N returns_collection=True) return self._deserialize('[DeploymentMachine]', response) - def replace_deployment_target(self, machine, project, deployment_group_id, target_id): - """ReplaceDeploymentTarget. - [Preview API] - :param :class:` ` machine: - :param str project: Project ID or project name - :param int deployment_group_id: - :param int target_id: - :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') - content = self._serialize.body(machine, 'DeploymentMachine') - response = self._send(http_method='PUT', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachine', response) - - def update_deployment_target(self, machine, project, deployment_group_id, target_id): - """UpdateDeploymentTarget. - [Preview API] - :param :class:` ` machine: - :param str project: Project ID or project name - :param int deployment_group_id: - :param int target_id: - :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') - content = self._serialize.body(machine, 'DeploymentMachine') - response = self._send(http_method='PATCH', - location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('DeploymentMachine', response) - def update_deployment_targets(self, machines, project, deployment_group_id): """UpdateDeploymentTargets. - [Preview API] - :param [DeploymentMachine] machines: + [Preview API] 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: + :param int deployment_group_id: ID of the deployment group in which deployment targets are updated. :rtype: [DeploymentMachine] """ route_values = {} @@ -2023,7 +247,7 @@ def update_deployment_targets(self, machines, project, deployment_group_id): 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, '[DeploymentMachine]') + content = self._serialize.body(machines, '[DeploymentTargetUpdateParameter]') response = self._send(http_method='PATCH', location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', version='4.1-preview.1', @@ -2071,14 +295,17 @@ def delete_task_group(self, project, task_group_id, comment=None): 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): + 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. - [Preview API] Get a list of task groups. + [Preview API] 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 = {} @@ -2093,6 +320,12 @@ def get_task_groups(self, project, task_group_id=None, expanded=None, task_id_fi 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='4.1-preview.1', @@ -2122,150 +355,17 @@ def update_task_group(self, task_group, project, task_group_id=None): content=content) return self._deserialize('TaskGroup', response) - def delete_task_definition(self, task_id): - """DeleteTaskDefinition. - [Preview API] - :param str task_id: - """ - route_values = {} - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'str') - self._send(http_method='DELETE', - location_id='60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd', - version='4.1-preview.1', - route_values=route_values) - - def get_task_content_zip(self, task_id, version_string, visibility=None, scope_local=None): - """GetTaskContentZip. - [Preview API] - :param str task_id: - :param str version_string: - :param [str] visibility: - :param bool scope_local: - :rtype: object - """ - route_values = {} - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'str') - if version_string is not None: - route_values['versionString'] = self._serialize.url('version_string', version_string, 'str') - query_parameters = {} - if visibility is not None: - query_parameters['visibility'] = self._serialize.query('visibility', visibility, '[str]') - if scope_local is not None: - query_parameters['scopeLocal'] = self._serialize.query('scope_local', scope_local, 'bool') - response = self._send(http_method='GET', - location_id='60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('object', response) - - def get_task_definition(self, task_id, version_string, visibility=None, scope_local=None): - """GetTaskDefinition. - [Preview API] - :param str task_id: - :param str version_string: - :param [str] visibility: - :param bool scope_local: - :rtype: :class:` ` - """ - route_values = {} - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'str') - if version_string is not None: - route_values['versionString'] = self._serialize.url('version_string', version_string, 'str') - query_parameters = {} - if visibility is not None: - query_parameters['visibility'] = self._serialize.query('visibility', visibility, '[str]') - if scope_local is not None: - query_parameters['scopeLocal'] = self._serialize.query('scope_local', scope_local, 'bool') - response = self._send(http_method='GET', - location_id='60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TaskDefinition', response) - - def get_task_definitions(self, task_id=None, visibility=None, scope_local=None): - """GetTaskDefinitions. - [Preview API] - :param str task_id: - :param [str] visibility: - :param bool scope_local: - :rtype: [TaskDefinition] - """ - route_values = {} - if task_id is not None: - route_values['taskId'] = self._serialize.url('task_id', task_id, 'str') - query_parameters = {} - if visibility is not None: - query_parameters['visibility'] = self._serialize.query('visibility', visibility, '[str]') - if scope_local is not None: - query_parameters['scopeLocal'] = self._serialize.query('scope_local', scope_local, 'bool') - response = self._send(http_method='GET', - location_id='60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - returns_collection=True) - return self._deserialize('[TaskDefinition]', response) - - def update_agent_update_state(self, pool_id, agent_id, current_state): - """UpdateAgentUpdateState. - [Preview API] - :param int pool_id: - :param int agent_id: - :param str current_state: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - query_parameters = {} - if current_state is not None: - query_parameters['currentState'] = self._serialize.query('current_state', current_state, 'str') - response = self._send(http_method='PUT', - location_id='8cc1b02b-ae49-4516-b5ad-4f9b29967c30', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('TaskAgent', response) - - def update_agent_user_capabilities(self, user_capabilities, pool_id, agent_id): - """UpdateAgentUserCapabilities. - [Preview API] - :param {str} user_capabilities: - :param int pool_id: - :param int agent_id: - :rtype: :class:` ` - """ - route_values = {} - if pool_id is not None: - route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') - if agent_id is not None: - route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') - content = self._serialize.body(user_capabilities, '{str}') - response = self._send(http_method='PUT', - location_id='30ba3ada-fedf-4da8-bbb5-dacf2f82e176', - version='4.1-preview.1', - route_values=route_values, - content=content) - return self._deserialize('TaskAgent', response) - def add_variable_group(self, group, project): """AddVariableGroup. - [Preview API] - :param :class:` ` group: + [Preview API] Add a variable group. + :param :class:` ` group: Variable group to add. :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(group, 'VariableGroup') + content = self._serialize.body(group, 'VariableGroupParameters') response = self._send(http_method='POST', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='4.1-preview.1', @@ -2275,9 +375,9 @@ def add_variable_group(self, group, project): def delete_variable_group(self, project, group_id): """DeleteVariableGroup. - [Preview API] + [Preview API] Delete a variable group :param str project: Project ID or project name - :param int group_id: + :param int group_id: Id of the variable group. """ route_values = {} if project is not None: @@ -2291,9 +391,9 @@ def delete_variable_group(self, project, group_id): def get_variable_group(self, project, group_id): """GetVariableGroup. - [Preview API] + [Preview API] Get a variable group. :param str project: Project ID or project name - :param int group_id: + :param int group_id: Id of the variable group. :rtype: :class:` ` """ route_values = {} @@ -2307,12 +407,15 @@ def get_variable_group(self, project, group_id): route_values=route_values) return self._deserialize('VariableGroup', response) - def get_variable_groups(self, project, group_name=None, action_filter=None): + def get_variable_groups(self, project, group_name=None, action_filter=None, top=None, continuation_token=None, query_order=None): """GetVariableGroups. - [Preview API] + [Preview API] Get variable groups. :param str project: Project ID or project name - :param str group_name: - :param str action_filter: + :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 = {} @@ -2323,6 +426,12 @@ def get_variable_groups(self, project, group_name=None, action_filter=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='4.1-preview.1', @@ -2333,9 +442,9 @@ def get_variable_groups(self, project, group_name=None, action_filter=None): def get_variable_groups_by_id(self, project, group_ids): """GetVariableGroupsById. - [Preview API] + [Preview API] Get variable groups by ids. :param str project: Project ID or project name - :param [int] group_ids: + :param [int] group_ids: Comma separated list of Ids of variable groups. :rtype: [VariableGroup] """ route_values = {} @@ -2355,10 +464,10 @@ def get_variable_groups_by_id(self, project, group_ids): def update_variable_group(self, group, project, group_id): """UpdateVariableGroup. - [Preview API] - :param :class:` ` group: + [Preview API] Update a variable group. + :param :class:` ` group: Variable group to update. :param str project: Project ID or project name - :param int group_id: + :param int group_id: Id of the variable group to update. :rtype: :class:` ` """ route_values = {} @@ -2366,7 +475,7 @@ def update_variable_group(self, group, project, group_id): 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') - content = self._serialize.body(group, 'VariableGroup') + content = self._serialize.body(group, 'VariableGroupParameters') response = self._send(http_method='PUT', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='4.1-preview.1', @@ -2374,50 +483,3 @@ def update_variable_group(self, group, project, group_id): content=content) return self._deserialize('VariableGroup', response) - def acquire_access_token(self, authentication_request): - """AcquireAccessToken. - [Preview API] - :param :class:` ` authentication_request: - :rtype: :class:` ` - """ - content = self._serialize.body(authentication_request, 'AadOauthTokenRequest') - response = self._send(http_method='POST', - location_id='9c63205e-3a0f-42a0-ad88-095200f13607', - version='4.1-preview.1', - content=content) - return self._deserialize('AadOauthTokenResult', response) - - def create_aad_oAuth_request(self, tenant_id, redirect_uri, prompt_option=None, complete_callback_payload=None): - """CreateAadOAuthRequest. - [Preview API] - :param str tenant_id: - :param str redirect_uri: - :param str prompt_option: - :param str complete_callback_payload: - :rtype: str - """ - query_parameters = {} - if tenant_id is not None: - query_parameters['tenantId'] = self._serialize.query('tenant_id', tenant_id, 'str') - if redirect_uri is not None: - query_parameters['redirectUri'] = self._serialize.query('redirect_uri', redirect_uri, 'str') - if prompt_option is not None: - query_parameters['promptOption'] = self._serialize.query('prompt_option', prompt_option, 'str') - if complete_callback_payload is not None: - query_parameters['completeCallbackPayload'] = self._serialize.query('complete_callback_payload', complete_callback_payload, 'str') - response = self._send(http_method='POST', - location_id='9c63205e-3a0f-42a0-ad88-095200f13607', - version='4.1-preview.1', - query_parameters=query_parameters) - return self._deserialize('str', response) - - def get_vsts_aad_tenant_id(self): - """GetVstsAadTenantId. - [Preview API] - :rtype: str - """ - response = self._send(http_method='GET', - location_id='9c63205e-3a0f-42a0-ad88-095200f13607', - version='4.1-preview.1') - return self._deserialize('str', response) - diff --git a/vsts/vsts/test/v4_0/test_client.py b/vsts/vsts/test/v4_0/test_client.py index 38f1783d..bb1a27bf 100644 --- a/vsts/vsts/test/v4_0/test_client.py +++ b/vsts/vsts/test/v4_0/test_client.py @@ -1557,11 +1557,11 @@ def create_test_session(self, test_session, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1593,11 +1593,11 @@ def get_test_sessions(self, team_context, period=None, all_sessions=None, includ team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1636,11 +1636,11 @@ def update_test_session(self, test_session, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team diff --git a/vsts/vsts/test/v4_1/models/__init__.py b/vsts/vsts/test/v4_1/models/__init__.py index 36dcb63f..edc3f32d 100644 --- a/vsts/vsts/test/v4_1/models/__init__.py +++ b/vsts/vsts/test/v4_1/models/__init__.py @@ -10,6 +10,7 @@ from .aggregated_results_analysis import AggregatedResultsAnalysis from .aggregated_results_by_outcome import AggregatedResultsByOutcome from .aggregated_results_difference import AggregatedResultsDifference +from .aggregated_runs_by_state import AggregatedRunsByState from .build_configuration import BuildConfiguration from .build_coverage import BuildCoverage from .build_reference import BuildReference @@ -26,6 +27,7 @@ from .failing_since import FailingSince from .field_details_for_test_results import FieldDetailsForTestResults from .function_coverage import FunctionCoverage +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .last_result_details import LastResultDetails from .linked_work_items_query import LinkedWorkItemsQuery @@ -38,6 +40,7 @@ from .point_update_model import PointUpdateModel from .property_bag import PropertyBag from .query_model import QueryModel +from .reference_links import ReferenceLinks from .release_environment_definition_reference import ReleaseEnvironmentDefinitionReference from .release_reference import ReleaseReference from .result_retention_settings import ResultRetentionSettings @@ -47,6 +50,7 @@ from .run_statistic import RunStatistic from .run_update_model import RunUpdateModel from .shallow_reference import ShallowReference +from .shallow_test_case_result import ShallowTestCaseResult from .shared_step_model import SharedStepModel from .suite_create_model import SuiteCreateModel from .suite_entry import SuiteEntry @@ -109,6 +113,7 @@ 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', + 'AggregatedRunsByState', 'BuildConfiguration', 'BuildCoverage', 'BuildReference', @@ -125,6 +130,7 @@ 'FailingSince', 'FieldDetailsForTestResults', 'FunctionCoverage', + 'GraphSubjectBase', 'IdentityRef', 'LastResultDetails', 'LinkedWorkItemsQuery', @@ -137,6 +143,7 @@ 'PointUpdateModel', 'PropertyBag', 'QueryModel', + 'ReferenceLinks', 'ReleaseEnvironmentDefinitionReference', 'ReleaseReference', 'ResultRetentionSettings', @@ -146,6 +153,7 @@ 'RunStatistic', 'RunUpdateModel', 'ShallowReference', + 'ShallowTestCaseResult', 'SharedStepModel', 'SuiteCreateModel', 'SuiteEntry', diff --git a/vsts/vsts/test/v4_1/models/aggregated_data_for_result_trend.py b/vsts/vsts/test/v4_1/models/aggregated_data_for_result_trend.py index fc5b6be0..2328b2ae 100644 --- a/vsts/vsts/test/v4_1/models/aggregated_data_for_result_trend.py +++ b/vsts/vsts/test/v4_1/models/aggregated_data_for_result_trend.py @@ -16,6 +16,8 @@ class AggregatedDataForResultTrend(Model): :type duration: object :param results_by_outcome: :type results_by_outcome: dict + :param run_summary_by_state: + :type run_summary_by_state: dict :param test_results_context: :type test_results_context: :class:`TestResultsContext ` :param total_tests: @@ -25,13 +27,15 @@ class AggregatedDataForResultTrend(Model): _attribute_map = { 'duration': {'key': 'duration', 'type': 'object'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, + 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } - def __init__(self, duration=None, results_by_outcome=None, test_results_context=None, total_tests=None): + def __init__(self, duration=None, results_by_outcome=None, run_summary_by_state=None, test_results_context=None, total_tests=None): super(AggregatedDataForResultTrend, self).__init__() self.duration = duration self.results_by_outcome = results_by_outcome + self.run_summary_by_state = run_summary_by_state self.test_results_context = test_results_context self.total_tests = total_tests diff --git a/vsts/vsts/test/v4_1/models/aggregated_results_analysis.py b/vsts/vsts/test/v4_1/models/aggregated_results_analysis.py index ec00e302..d0e2fb82 100644 --- a/vsts/vsts/test/v4_1/models/aggregated_results_analysis.py +++ b/vsts/vsts/test/v4_1/models/aggregated_results_analysis.py @@ -22,6 +22,8 @@ class AggregatedResultsAnalysis(Model): :type results_by_outcome: dict :param results_difference: :type results_difference: :class:`AggregatedResultsDifference ` + :param run_summary_by_state: + :type run_summary_by_state: dict :param total_tests: :type total_tests: int """ @@ -32,14 +34,16 @@ class AggregatedResultsAnalysis(Model): 'previous_context': {'key': 'previousContext', 'type': 'TestResultsContext'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, + 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } - def __init__(self, duration=None, not_reported_results_by_outcome=None, previous_context=None, results_by_outcome=None, results_difference=None, total_tests=None): + def __init__(self, duration=None, not_reported_results_by_outcome=None, previous_context=None, results_by_outcome=None, results_difference=None, run_summary_by_state=None, total_tests=None): super(AggregatedResultsAnalysis, self).__init__() self.duration = duration self.not_reported_results_by_outcome = not_reported_results_by_outcome self.previous_context = previous_context self.results_by_outcome = results_by_outcome self.results_difference = results_difference + self.run_summary_by_state = run_summary_by_state self.total_tests = total_tests diff --git a/vsts/vsts/test/v4_1/models/identity_ref.py b/vsts/vsts/test/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/test/v4_1/models/identity_ref.py +++ b/vsts/vsts/test/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/test/v4_1/models/test_attachment.py b/vsts/vsts/test/v4_1/models/test_attachment.py index fa2cc043..908c2d12 100644 --- a/vsts/vsts/test/v4_1/models/test_attachment.py +++ b/vsts/vsts/test/v4_1/models/test_attachment.py @@ -22,6 +22,8 @@ class TestAttachment(Model): :type file_name: str :param id: :type id: int + :param size: + :type size: long :param url: :type url: str """ @@ -32,14 +34,16 @@ class TestAttachment(Model): 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, + 'size': {'key': 'size', 'type': 'long'}, 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, attachment_type=None, comment=None, created_date=None, file_name=None, id=None, url=None): + def __init__(self, attachment_type=None, comment=None, created_date=None, file_name=None, id=None, size=None, url=None): super(TestAttachment, self).__init__() self.attachment_type = attachment_type self.comment = comment self.created_date = created_date self.file_name = file_name self.id = id + self.size = size self.url = url diff --git a/vsts/vsts/test/v4_1/test_client.py b/vsts/vsts/test/v4_1/test_client.py index d70d5b28..f44c59b3 100644 --- a/vsts/vsts/test/v4_1/test_client.py +++ b/vsts/vsts/test/v4_1/test_client.py @@ -962,7 +962,7 @@ def get_points_by_query(self, query, project, skip=None, top=None): content=content) return self._deserialize('TestPointsQuery', response) - def get_test_result_details_for_build(self, project, build_id, publish_context=None, group_by=None, filter=None, orderby=None): + 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 @@ -971,6 +971,8 @@ def get_test_result_details_for_build(self, project, build_id, publish_context=N :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 = {} @@ -987,6 +989,10 @@ def get_test_result_details_for_build(self, project, build_id, publish_context=N 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='efb387b0-10d5-42e7-be40-95e06ee9430f', version='4.1-preview.1', @@ -994,7 +1000,7 @@ def get_test_result_details_for_build(self, project, build_id, publish_context=N 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): + 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 @@ -1004,6 +1010,8 @@ def get_test_result_details_for_release(self, project, release_id, release_env_i :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 = {} @@ -1022,6 +1030,10 @@ def get_test_result_details_for_release(self, project, release_id, release_env_i 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='b834ec7e-35bb-450f-a3c8-802e70ca40dd', version='4.1-preview.1', @@ -1648,11 +1660,11 @@ def create_test_session(self, test_session, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1684,11 +1696,11 @@ def get_test_sessions(self, team_context, period=None, all_sessions=None, includ team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1727,11 +1739,11 @@ def update_test_session(self, test_session, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1841,7 +1853,7 @@ def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') response = self._send(http_method='POST', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, returns_collection=True) return self._deserialize('[SuiteTestCase]', response) @@ -1866,7 +1878,7 @@ def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids): route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'int') response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values) return self._deserialize('SuiteTestCase', response) @@ -1887,7 +1899,7 @@ def get_test_cases(self, project, plan_id, suite_id): route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, returns_collection=True) return self._deserialize('[SuiteTestCase]', response) @@ -1911,7 +1923,7 @@ def remove_test_cases_from_suite_url(self, project, plan_id, suite_id, test_case route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') self._send(http_method='DELETE', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values) def create_test_suite(self, test_suite, project, plan_id, suite_id): @@ -1933,7 +1945,7 @@ def create_test_suite(self, test_suite, project, plan_id, suite_id): content = self._serialize.body(test_suite, 'SuiteCreateModel') response = self._send(http_method='POST', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, content=content, returns_collection=True) @@ -1955,16 +1967,16 @@ def delete_test_suite(self, project, plan_id, suite_id): route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') self._send(http_method='DELETE', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values) - def get_test_suite_by_id(self, project, plan_id, suite_id, include_child_suites=None): + def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None): """GetTestSuiteById. [Preview API] :param str project: Project ID or project name :param int plan_id: :param int suite_id: - :param bool include_child_suites: + :param int expand: :rtype: :class:` ` """ route_values = {} @@ -1975,21 +1987,21 @@ def get_test_suite_by_id(self, project, plan_id, suite_id, include_child_suites= if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') query_parameters = {} - if include_child_suites is not None: - query_parameters['includeChildSuites'] = self._serialize.query('include_child_suites', include_child_suites, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'int') response = self._send(http_method='GET', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestSuite', response) - def get_test_suites_for_plan(self, project, plan_id, include_suites=None, skip=None, top=None, as_tree_view=None): + def get_test_suites_for_plan(self, project, plan_id, expand=None, skip=None, top=None, as_tree_view=None): """GetTestSuitesForPlan. [Preview API] :param str project: Project ID or project name :param int plan_id: - :param bool include_suites: + :param int expand: :param int skip: :param int top: :param bool as_tree_view: @@ -2001,8 +2013,8 @@ def get_test_suites_for_plan(self, project, plan_id, include_suites=None, skip=N if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') query_parameters = {} - if include_suites is not None: - query_parameters['includeSuites'] = self._serialize.query('include_suites', include_suites, 'bool') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: @@ -2011,7 +2023,7 @@ def get_test_suites_for_plan(self, project, plan_id, include_suites=None, skip=N query_parameters['$asTreeView'] = self._serialize.query('as_tree_view', as_tree_view, 'bool') response = self._send(http_method='GET', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters, returns_collection=True) @@ -2036,7 +2048,7 @@ def update_test_suite(self, suite_update_model, project, plan_id, suite_id): content = self._serialize.body(suite_update_model, 'SuiteUpdateModel') response = self._send(http_method='PATCH', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, content=content) return self._deserialize('TestSuite', response) @@ -2052,7 +2064,7 @@ 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='09a6167b-e969-4775-9247-b94cf3819caf', - version='4.1-preview.1', + version='4.1-preview.3', query_parameters=query_parameters, returns_collection=True) return self._deserialize('[TestSuite]', response) diff --git a/vsts/vsts/tfvc/v4_1/models/__init__.py b/vsts/vsts/tfvc/v4_1/models/__init__.py index d49eca21..54666a57 100644 --- a/vsts/vsts/tfvc/v4_1/models/__init__.py +++ b/vsts/vsts/tfvc/v4_1/models/__init__.py @@ -12,6 +12,7 @@ from .file_content_metadata import FileContentMetadata from .git_repository import GitRepository from .git_repository_ref import GitRepositoryRef +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .item_content import ItemContent from .item_model import ItemModel @@ -50,6 +51,7 @@ 'FileContentMetadata', 'GitRepository', 'GitRepositoryRef', + 'GraphSubjectBase', 'IdentityRef', 'ItemContent', 'ItemModel', diff --git a/vsts/vsts/tfvc/v4_1/models/identity_ref.py b/vsts/vsts/tfvc/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/tfvc/v4_1/models/identity_ref.py +++ b/vsts/vsts/tfvc/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/tfvc/v4_1/models/item_model.py b/vsts/vsts/tfvc/v4_1/models/item_model.py index 362fed29..e346b148 100644 --- a/vsts/vsts/tfvc/v4_1/models/item_model.py +++ b/vsts/vsts/tfvc/v4_1/models/item_model.py @@ -14,6 +14,8 @@ class ItemModel(Model): :param _links: :type _links: :class:`ReferenceLinks ` + :param content: + :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: @@ -28,6 +30,7 @@ class ItemModel(Model): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, @@ -35,9 +38,10 @@ class ItemModel(Model): 'url': {'key': 'url', 'type': 'str'} } - def __init__(self, _links=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): + def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): super(ItemModel, self).__init__() self._links = _links + self.content = content self.content_metadata = content_metadata self.is_folder = is_folder self.is_sym_link = is_sym_link diff --git a/vsts/vsts/tfvc/v4_1/models/tfvc_item.py b/vsts/vsts/tfvc/v4_1/models/tfvc_item.py index fd0ceaf9..7d30e4fd 100644 --- a/vsts/vsts/tfvc/v4_1/models/tfvc_item.py +++ b/vsts/vsts/tfvc/v4_1/models/tfvc_item.py @@ -14,6 +14,8 @@ class TfvcItem(ItemModel): :param _links: :type _links: :class:`ReferenceLinks ` + :param content: + :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: @@ -42,6 +44,7 @@ class TfvcItem(ItemModel): _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, @@ -56,8 +59,8 @@ class TfvcItem(ItemModel): 'version': {'key': 'version', 'type': 'int'} } - def __init__(self, _links=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, change_date=None, deletion_id=None, hash_value=None, is_branch=None, is_pending_change=None, size=None, version=None): - super(TfvcItem, self).__init__(_links=_links, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) + def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, change_date=None, deletion_id=None, hash_value=None, is_branch=None, is_pending_change=None, size=None, version=None): + super(TfvcItem, self).__init__(_links=_links, content=content, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) self.change_date = change_date self.deletion_id = deletion_id self.hash_value = hash_value diff --git a/vsts/vsts/tfvc/v4_1/tfvc_client.py b/vsts/vsts/tfvc/v4_1/tfvc_client.py index c29ad5df..3a6e87f5 100644 --- a/vsts/vsts/tfvc/v4_1/tfvc_client.py +++ b/vsts/vsts/tfvc/v4_1/tfvc_client.py @@ -327,7 +327,7 @@ def get_items_batch_zip(self, item_request_data, project=None): content=content) return self._deserialize('object', response) - def get_item(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None): + def get_item(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItem. [Preview API] 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 path: Version control path of an individual item to return. @@ -336,7 +336,8 @@ 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: + :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:` ` """ route_values = {} @@ -360,6 +361,8 @@ def get_item(self, path, project=None, file_name=None, download=None, scope_path query_parameters['versionDescriptor.VersionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.Version'] = version_descriptor.version + 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='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='4.1-preview.1', @@ -367,7 +370,7 @@ def get_item(self, path, project=None, file_name=None, download=None, scope_path query_parameters=query_parameters) return self._deserialize('TfvcItem', response) - def get_item_content(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None): + def get_item_content(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItemContent. [Preview API] 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 path: Version control path of an individual item to return. @@ -376,7 +379,8 @@ 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: + :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 """ route_values = {} @@ -400,6 +404,8 @@ def get_item_content(self, path, project=None, file_name=None, download=None, sc query_parameters['versionDescriptor.VersionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.Version'] = version_descriptor.version + 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='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='4.1-preview.1', @@ -442,7 +448,7 @@ def get_items(self, project=None, scope_path=None, recursion_level=None, include returns_collection=True) return self._deserialize('[TfvcItem]', response) - def get_item_text(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None): + def get_item_text(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItemText. [Preview API] 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 path: Version control path of an individual item to return. @@ -451,7 +457,8 @@ 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: + :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 """ route_values = {} @@ -475,6 +482,8 @@ def get_item_text(self, path, project=None, file_name=None, download=None, scope query_parameters['versionDescriptor.VersionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.Version'] = version_descriptor.version + 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='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='4.1-preview.1', @@ -482,7 +491,7 @@ def get_item_text(self, path, project=None, file_name=None, download=None, scope query_parameters=query_parameters) return self._deserialize('object', response) - def get_item_zip(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None): + def get_item_zip(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItemZip. [Preview API] 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 path: Version control path of an individual item to return. @@ -491,7 +500,8 @@ 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: + :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 """ route_values = {} @@ -515,6 +525,8 @@ def get_item_zip(self, path, project=None, file_name=None, download=None, scope_ query_parameters['versionDescriptor.VersionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.Version'] = version_descriptor.version + 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='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='4.1-preview.1', diff --git a/vsts/vsts/work/v4_0/work_client.py b/vsts/vsts/work/v4_0/work_client.py index 8364608d..ea88bda2 100644 --- a/vsts/vsts/work/v4_0/work_client.py +++ b/vsts/vsts/work/v4_0/work_client.py @@ -35,11 +35,11 @@ def get_backlog_configurations(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -81,11 +81,11 @@ def get_board_mapping_parent_items(self, team_context, child_backlog_context_cat team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -134,11 +134,11 @@ def get_board(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -165,11 +165,11 @@ def get_boards(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -197,11 +197,11 @@ def set_board_options(self, options, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -232,11 +232,11 @@ def get_board_user_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -265,11 +265,11 @@ def update_board_user_settings(self, board_user_settings, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -298,11 +298,11 @@ def get_capacities(self, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -331,11 +331,11 @@ def get_capacity(self, team_context, iteration_id, team_member_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -365,11 +365,11 @@ def replace_capacities(self, capacities, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -401,11 +401,11 @@ def update_capacity(self, patch, team_context, iteration_id, team_member_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -437,11 +437,11 @@ def get_board_card_rule_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -470,11 +470,11 @@ def update_board_card_rule_settings(self, board_card_rule_settings, team_context team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -504,11 +504,11 @@ def get_board_card_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -537,11 +537,11 @@ def update_board_card_settings(self, board_card_settings_to_save, team_context, team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -572,11 +572,11 @@ def get_board_chart(self, team_context, board, name): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -606,11 +606,11 @@ def get_board_charts(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -641,11 +641,11 @@ def update_board_chart(self, chart, team_context, board, name): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -676,11 +676,11 @@ def get_board_columns(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -709,11 +709,11 @@ def update_board_columns(self, board_columns, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -771,11 +771,11 @@ def delete_team_iteration(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -801,11 +801,11 @@ def get_team_iteration(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -832,11 +832,11 @@ def get_team_iterations(self, team_context, timeframe=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -866,11 +866,11 @@ def post_team_iteration(self, iteration, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1001,11 +1001,11 @@ def get_board_rows(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1034,11 +1034,11 @@ def update_board_rows(self, board_rows, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1068,11 +1068,11 @@ def get_team_days_off(self, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1100,11 +1100,11 @@ def update_team_days_off(self, days_off_patch, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1132,11 +1132,11 @@ def get_team_field_values(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1161,11 +1161,11 @@ def update_team_field_values(self, patch, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1191,11 +1191,11 @@ def get_team_settings(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1220,11 +1220,11 @@ def update_team_settings(self, team_settings_patch, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team diff --git a/vsts/vsts/work/v4_1/models/__init__.py b/vsts/vsts/work/v4_1/models/__init__.py index 964adda3..9414a1cb 100644 --- a/vsts/vsts/work/v4_1/models/__init__.py +++ b/vsts/vsts/work/v4_1/models/__init__.py @@ -13,6 +13,7 @@ from .backlog_fields import BacklogFields from .backlog_level import BacklogLevel from .backlog_level_configuration import BacklogLevelConfiguration +from .backlog_level_work_items import BacklogLevelWorkItems from .board import Board from .board_card_rule_settings import BoardCardRuleSettings from .board_card_settings import BoardCardSettings @@ -32,7 +33,9 @@ from .field_reference import FieldReference from .field_setting import FieldSetting from .filter_clause import FilterClause +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef +from .iteration_work_items import IterationWorkItems from .member import Member from .parent_child_wIMap import ParentChildWIMap from .plan import Plan @@ -60,6 +63,8 @@ from .update_plan import UpdatePlan from .work_item_color import WorkItemColor from .work_item_field_reference import WorkItemFieldReference +from .work_item_link import WorkItemLink +from .work_item_reference import WorkItemReference from .work_item_tracking_resource_reference import WorkItemTrackingResourceReference from .work_item_type_reference import WorkItemTypeReference from .work_item_type_state_info import WorkItemTypeStateInfo @@ -72,6 +77,7 @@ 'BacklogFields', 'BacklogLevel', 'BacklogLevelConfiguration', + 'BacklogLevelWorkItems', 'Board', 'BoardCardRuleSettings', 'BoardCardSettings', @@ -91,7 +97,9 @@ 'FieldReference', 'FieldSetting', 'FilterClause', + 'GraphSubjectBase', 'IdentityRef', + 'IterationWorkItems', 'Member', 'ParentChildWIMap', 'Plan', @@ -119,6 +127,8 @@ 'UpdatePlan', 'WorkItemColor', 'WorkItemFieldReference', + 'WorkItemLink', + 'WorkItemReference', 'WorkItemTrackingResourceReference', 'WorkItemTypeReference', 'WorkItemTypeStateInfo', diff --git a/vsts/vsts/work/v4_1/models/backlog_level_configuration.py b/vsts/vsts/work/v4_1/models/backlog_level_configuration.py index 74de2696..970bf259 100644 --- a/vsts/vsts/work/v4_1/models/backlog_level_configuration.py +++ b/vsts/vsts/work/v4_1/models/backlog_level_configuration.py @@ -22,10 +22,14 @@ class BacklogLevelConfiguration(Model): :type default_work_item_type: :class:`WorkItemTypeReference ` :param id: Backlog Id (for Legacy Backlog Level from process config it can be categoryref name) :type id: str + :param is_hidden: Indicates whether the backlog level is hidden + :type is_hidden: bool :param name: Backlog Name :type name: str :param rank: Backlog Rank (Taskbacklog is 0) :type rank: int + :param type: The type of this backlog level + :type type: object :param work_item_count_limit: Max number of work items to show in the given backlog :type work_item_count_limit: int :param work_item_types: Work Item types participating in this backlog as known by the project/Process, can be overridden by team settings for bugs @@ -38,20 +42,24 @@ class BacklogLevelConfiguration(Model): 'column_fields': {'key': 'columnFields', 'type': '[BacklogColumn]'}, 'default_work_item_type': {'key': 'defaultWorkItemType', 'type': 'WorkItemTypeReference'}, 'id': {'key': 'id', 'type': 'str'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'rank': {'key': 'rank', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'object'}, 'work_item_count_limit': {'key': 'workItemCountLimit', 'type': 'int'}, 'work_item_types': {'key': 'workItemTypes', 'type': '[WorkItemTypeReference]'} } - def __init__(self, add_panel_fields=None, color=None, column_fields=None, default_work_item_type=None, id=None, name=None, rank=None, work_item_count_limit=None, work_item_types=None): + def __init__(self, add_panel_fields=None, color=None, column_fields=None, default_work_item_type=None, id=None, is_hidden=None, name=None, rank=None, type=None, work_item_count_limit=None, work_item_types=None): super(BacklogLevelConfiguration, self).__init__() self.add_panel_fields = add_panel_fields self.color = color self.column_fields = column_fields self.default_work_item_type = default_work_item_type self.id = id + self.is_hidden = is_hidden self.name = name self.rank = rank + self.type = type self.work_item_count_limit = work_item_count_limit self.work_item_types = work_item_types diff --git a/vsts/vsts/work/v4_1/models/identity_ref.py b/vsts/vsts/work/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/work/v4_1/models/identity_ref.py +++ b/vsts/vsts/work/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/work/v4_1/models/work_item_field_reference.py b/vsts/vsts/work/v4_1/models/work_item_field_reference.py index 29ebbbf2..943b036d 100644 --- a/vsts/vsts/work/v4_1/models/work_item_field_reference.py +++ b/vsts/vsts/work/v4_1/models/work_item_field_reference.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class WorkItemFieldReference(Model): +class WorkItemFieldReference(BaseSecuredObject): """WorkItemFieldReference. :param name: The name of the field. diff --git a/vsts/vsts/work/v4_1/models/work_item_tracking_resource_reference.py b/vsts/vsts/work/v4_1/models/work_item_tracking_resource_reference.py index de9a728b..75c0959e 100644 --- a/vsts/vsts/work/v4_1/models/work_item_tracking_resource_reference.py +++ b/vsts/vsts/work/v4_1/models/work_item_tracking_resource_reference.py @@ -6,10 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model -class WorkItemTrackingResourceReference(Model): +class WorkItemTrackingResourceReference(BaseSecuredObject): """WorkItemTrackingResourceReference. :param url: diff --git a/vsts/vsts/work/v4_1/work_client.py b/vsts/vsts/work/v4_1/work_client.py index e982dbbc..1b560078 100644 --- a/vsts/vsts/work/v4_1/work_client.py +++ b/vsts/vsts/work/v4_1/work_client.py @@ -35,11 +35,11 @@ def get_backlog_configurations(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -54,6 +54,100 @@ def get_backlog_configurations(self, team_context): route_values=route_values) return self._deserialize('BacklogConfiguration', response) + def get_backlog_level_work_items(self, team_context, backlog_id): + """GetBacklogLevelWorkItems. + [Preview API] 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.projectId: + project = team_context.project_id + else: + project = team_context.project + if team_context.teamId: + 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='4.1-preview.1', + route_values=route_values) + return self._deserialize('BacklogLevelWorkItems', response) + + def get_backlog(self, team_context, id): + """GetBacklog. + [Preview API] 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.projectId: + project = team_context.project_id + else: + project = team_context.project + if team_context.teamId: + 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='4.1-preview.1', + route_values=route_values) + return self._deserialize('BacklogLevelConfiguration', response) + + def get_backlogs(self, team_context): + """GetBacklogs. + [Preview API] 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.projectId: + project = team_context.project_id + else: + project = team_context.project + if team_context.teamId: + 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='4.1-preview.1', + route_values=route_values, + returns_collection=True) + return self._deserialize('[BacklogLevelConfiguration]', response) + def get_column_suggested_values(self, project=None): """GetColumnSuggestedValues. [Preview API] Get available board columns in a project @@ -82,11 +176,11 @@ def get_board_mapping_parent_items(self, team_context, child_backlog_context_cat team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -136,11 +230,11 @@ def get_board(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -167,11 +261,11 @@ def get_boards(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -199,11 +293,11 @@ def set_board_options(self, options, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -234,11 +328,11 @@ def get_board_user_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -267,11 +361,11 @@ def update_board_user_settings(self, board_user_settings, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -301,11 +395,11 @@ def get_capacities(self, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -335,11 +429,11 @@ def get_capacity(self, team_context, iteration_id, team_member_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -370,11 +464,11 @@ def replace_capacities(self, capacities, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -407,11 +501,11 @@ def update_capacity(self, patch, team_context, iteration_id, team_member_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -443,11 +537,11 @@ def get_board_card_rule_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -476,11 +570,11 @@ def update_board_card_rule_settings(self, board_card_rule_settings, team_context team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -510,11 +604,11 @@ def get_board_card_settings(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -543,11 +637,11 @@ def update_board_card_settings(self, board_card_settings_to_save, team_context, team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -578,11 +672,11 @@ def get_board_chart(self, team_context, board, name): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -612,11 +706,11 @@ def get_board_charts(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -647,11 +741,11 @@ def update_board_chart(self, chart, team_context, board, name): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -683,11 +777,11 @@ def get_board_columns(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -717,11 +811,11 @@ def update_board_columns(self, board_columns, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -780,11 +874,11 @@ def delete_team_iteration(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -811,11 +905,11 @@ def get_team_iteration(self, team_context, id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -843,11 +937,11 @@ def get_team_iterations(self, team_context, timeframe=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -878,11 +972,11 @@ def post_team_iteration(self, iteration, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1014,11 +1108,11 @@ def get_board_rows(self, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1048,11 +1142,11 @@ def update_board_rows(self, board_rows, team_context, board): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1083,11 +1177,11 @@ def get_team_days_off(self, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1116,11 +1210,11 @@ def update_team_days_off(self, days_off_patch, team_context, iteration_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1149,11 +1243,11 @@ def get_team_field_values(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1179,11 +1273,11 @@ def update_team_field_values(self, patch, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1210,11 +1304,11 @@ def get_team_settings(self, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1240,11 +1334,11 @@ def update_team_settings(self, team_settings_patch, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1261,3 +1355,35 @@ def update_team_settings(self, team_settings_patch, team_context): content=content) return self._deserialize('TeamSetting', response) + def get_iteration_work_items(self, team_context, iteration_id): + """GetIterationWorkItems. + [Preview API] 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.projectId: + project = team_context.project_id + else: + project = team_context.project + if team_context.teamId: + 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='4.1-preview.1', + route_values=route_values) + return self._deserialize('IterationWorkItems', response) + diff --git a/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py b/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py index 19b512b2..45aef248 100644 --- a/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py +++ b/vsts/vsts/work_item_tracking/v4_0/work_item_tracking_client.py @@ -655,11 +655,11 @@ def create_template(self, template, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -687,11 +687,11 @@ def get_templates(self, team_context, workitemtypename=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -721,11 +721,11 @@ def delete_template(self, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -752,11 +752,11 @@ def get_template(self, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -785,11 +785,11 @@ def replace_template(self, template_content, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -863,11 +863,11 @@ def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -902,11 +902,11 @@ def get_query_result_count(self, id, team_context=None, time_precision=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -939,11 +939,11 @@ def query_by_id(self, id, team_context=None, time_precision=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team diff --git a/vsts/vsts/work_item_tracking/v4_1/models/__init__.py b/vsts/vsts/work_item_tracking/v4_1/models/__init__.py index 996ebf8d..6e41be02 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/__init__.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/__init__.py @@ -15,6 +15,7 @@ from .attachment_reference import AttachmentReference from .field_dependent_rule import FieldDependentRule from .fields_to_evaluate import FieldsToEvaluate +from .graph_subject_base import GraphSubjectBase from .identity_ref import IdentityRef from .identity_reference import IdentityReference from .json_patch_operation import JsonPatchOperation @@ -38,6 +39,7 @@ from .work_item_comments import WorkItemComments from .work_item_delete import WorkItemDelete from .work_item_delete_reference import WorkItemDeleteReference +from .work_item_delete_shallow_reference import WorkItemDeleteShallowReference from .work_item_delete_update import WorkItemDeleteUpdate from .work_item_field import WorkItemField from .work_item_field_operation import WorkItemFieldOperation @@ -66,6 +68,8 @@ from .work_item_type_color import WorkItemTypeColor from .work_item_type_color_and_icon import WorkItemTypeColorAndIcon from .work_item_type_field_instance import WorkItemTypeFieldInstance +from .work_item_type_field_instance_base import WorkItemTypeFieldInstanceBase +from .work_item_type_field_with_references import WorkItemTypeFieldWithReferences from .work_item_type_reference import WorkItemTypeReference from .work_item_type_state_colors import WorkItemTypeStateColors from .work_item_type_template import WorkItemTypeTemplate @@ -82,6 +86,7 @@ 'AttachmentReference', 'FieldDependentRule', 'FieldsToEvaluate', + 'GraphSubjectBase', 'IdentityRef', 'IdentityReference', 'JsonPatchOperation', @@ -105,6 +110,7 @@ 'WorkItemComments', 'WorkItemDelete', 'WorkItemDeleteReference', + 'WorkItemDeleteShallowReference', 'WorkItemDeleteUpdate', 'WorkItemField', 'WorkItemFieldOperation', @@ -133,6 +139,8 @@ 'WorkItemTypeColor', 'WorkItemTypeColorAndIcon', 'WorkItemTypeFieldInstance', + 'WorkItemTypeFieldInstanceBase', + 'WorkItemTypeFieldWithReferences', 'WorkItemTypeReference', 'WorkItemTypeStateColors', 'WorkItemTypeTemplate', diff --git a/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py b/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py index 40c776c5..c4c35ad5 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/identity_ref.py @@ -6,16 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .graph_subject_base import GraphSubjectBase -class IdentityRef(Model): +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: :type directory_alias: str - :param display_name: - :type display_name: str :param id: :type id: str :param image_url: @@ -30,27 +36,26 @@ class IdentityRef(Model): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'} + 'unique_name': {'key': 'uniqueName', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None): - super(IdentityRef, self).__init__() + 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, 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.display_name = display_name self.id = id self.image_url = image_url self.inactive = inactive @@ -58,4 +63,3 @@ def __init__(self, directory_alias=None, display_name=None, id=None, image_url=N self.is_container = is_container self.profile_url = profile_url self.unique_name = unique_name - self.url = url diff --git a/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py b/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py index 29c2e6ee..35d909ef 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/identity_reference.py @@ -12,10 +12,16 @@ class IdentityReference(IdentityRef): """IdentityReference. + :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: :type directory_alias: str - :param display_name: - :type display_name: str :param image_url: :type image_url: str :param inactive: @@ -28,8 +34,6 @@ class IdentityReference(IdentityRef): :type profile_url: str :param unique_name: :type unique_name: str - :param url: - :type url: str :param id: :type id: str :param name: Legacy back-compat property. This has been the WIT specific value from Constants. Will be hidden (but exists) on the client unless they are targeting the newest version @@ -37,20 +41,22 @@ class IdentityReference(IdentityRef): """ _attribute_map = { - 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, + '_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'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } - def __init__(self, directory_alias=None, display_name=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, url=None, id=None, name=None): - super(IdentityReference, self).__init__(directory_alias=directory_alias, display_name=display_name, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name, url=url) + def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, profile_url=None, unique_name=None, id=None, name=None): + super(IdentityReference, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, directory_alias=directory_alias, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, profile_url=profile_url, unique_name=unique_name) self.id = id self.name = name diff --git a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py b/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py index 7774563f..d6bc200b 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/query_hierarchy_item.py @@ -32,7 +32,7 @@ class QueryHierarchyItem(WorkItemTrackingResource): :type has_children: bool :param id: The id of the query item. :type id: str - :param is_deleted: Indicates if this query item is deleted. + :param is_deleted: Indicates if this query item is deleted. Setting this to false on a deleted query item will undelete it. Undeleting a query or folder will not bring back the permission changes that were previously applied to it. :type is_deleted: bool :param is_folder: Indicates if this is a query folder or a query. :type is_folder: bool diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py index 3298de29..662c9838 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comment.py @@ -16,13 +16,13 @@ class WorkItemComment(WorkItemTrackingResource): :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` - :param revised_by: + :param revised_by: Identity of user who added the comment. :type revised_by: :class:`IdentityReference ` - :param revised_date: + :param revised_date: The date of comment. :type revised_date: datetime - :param revision: + :param revision: The work item revision number. :type revision: int - :param text: + :param text: The text of the comment. :type text: str """ diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py index 549ad7bf..6463b857 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/work_item_comments.py @@ -6,12 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from msrest.serialization import Model +from .work_item_tracking_resource import WorkItemTrackingResource -class WorkItemComments(Model): +class WorkItemComments(WorkItemTrackingResource): """WorkItemComments. + :param url: + :type url: str + :param _links: Link references to related REST resources. + :type _links: :class:`ReferenceLinks ` :param comments: Comments collection. :type comments: list of :class:`WorkItemComment ` :param count: The count of comments. @@ -23,14 +27,16 @@ class WorkItemComments(Model): """ _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comments': {'key': 'comments', 'type': '[WorkItemComment]'}, 'count': {'key': 'count', 'type': 'int'}, 'from_revision_count': {'key': 'fromRevisionCount', 'type': 'int'}, 'total_count': {'key': 'totalCount', 'type': 'int'} } - def __init__(self, comments=None, count=None, from_revision_count=None, total_count=None): - super(WorkItemComments, self).__init__() + def __init__(self, url=None, _links=None, comments=None, count=None, from_revision_count=None, total_count=None): + super(WorkItemComments, self).__init__(url=url, _links=_links) self.comments = comments self.count = count self.from_revision_count = from_revision_count diff --git a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py index 20f833b7..f7547d21 100644 --- a/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py +++ b/vsts/vsts/work_item_tracking/v4_1/models/work_item_type_field_instance.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- -from .work_item_field_reference import WorkItemFieldReference +from .work_item_type_field_instance_base import WorkItemTypeFieldInstanceBase -class WorkItemTypeFieldInstance(WorkItemFieldReference): +class WorkItemTypeFieldInstance(WorkItemTypeFieldInstanceBase): """WorkItemTypeFieldInstance. :param name: The name of the field. @@ -20,8 +20,14 @@ class WorkItemTypeFieldInstance(WorkItemFieldReference): :type url: str :param always_required: Indicates whether field value is always required. :type always_required: bool + :param dependent_fields: The list of dependent fields. + :type dependent_fields: list of :class:`WorkItemFieldReference ` :param help_text: Gets the help text for the field. :type help_text: str + :param allowed_values: The list of field allowed values. + :type allowed_values: list of str + :param default_value: Represents the default value of the field. + :type default_value: str """ _attribute_map = { @@ -29,10 +35,13 @@ class WorkItemTypeFieldInstance(WorkItemFieldReference): 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'always_required': {'key': 'alwaysRequired', 'type': 'bool'}, - 'help_text': {'key': 'helpText', 'type': 'str'} + 'dependent_fields': {'key': 'dependentFields', 'type': '[WorkItemFieldReference]'}, + 'help_text': {'key': 'helpText', 'type': 'str'}, + 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'} } - def __init__(self, name=None, reference_name=None, url=None, always_required=None, help_text=None): - super(WorkItemTypeFieldInstance, self).__init__(name=name, reference_name=reference_name, url=url) - self.always_required = always_required - self.help_text = help_text + def __init__(self, name=None, reference_name=None, url=None, always_required=None, dependent_fields=None, help_text=None, allowed_values=None, default_value=None): + super(WorkItemTypeFieldInstance, self).__init__(name=name, reference_name=reference_name, url=url, always_required=always_required, dependent_fields=dependent_fields, help_text=help_text) + self.allowed_values = allowed_values + self.default_value = default_value diff --git a/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py b/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py index e96ffe4f..05e720d1 100644 --- a/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py +++ b/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py @@ -36,28 +36,37 @@ def get_work_artifact_link_types(self): returns_collection=True) return self._deserialize('[WorkArtifactLink]', response) - def query_work_items_for_artifact_uris(self, artifact_uri_query): + def query_work_items_for_artifact_uris(self, artifact_uri_query, project=None): """QueryWorkItemsForArtifactUris. [Preview API] 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='4.1-preview.1', + route_values=route_values, content=content) return self._deserialize('ArtifactUriQueryResult', response) - def create_attachment(self, upload_stream, file_name=None, upload_type=None, area_path=None): + def create_attachment(self, upload_stream, project=None, file_name=None, upload_type=None, area_path=None): """CreateAttachment. [Preview API] Uploads an attachment. :param object upload_stream: Stream to upload + :param str project: Project ID or project name :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:` ` """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') @@ -68,52 +77,93 @@ def create_attachment(self, upload_stream, file_name=None, upload_type=None, are content = self._serialize.body(upload_stream, 'object') response = self._send(http_method='POST', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', + version='4.1-preview.3', + route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') return self._deserialize('AttachmentReference', response) - def get_attachment_content(self, id, file_name=None): + def get_attachment_content(self, id, project=None, file_name=None, download=None): """GetAttachmentContent. [Preview API] Downloads an attachment. :param str id: Attachment ID + :param str project: Project ID or project name :param str file_name: Name of the file + :param bool download: If set to true always download attachment :rtype: object """ 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 file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') + if download is not None: + query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) - def get_attachment_zip(self, id, file_name=None): + def get_attachment_zip(self, id, project=None, file_name=None, download=None): """GetAttachmentZip. [Preview API] Downloads an attachment. :param str id: Attachment ID + :param str project: Project ID or project name :param str file_name: Name of the file + :param bool download: If set to true always download attachment :rtype: object """ 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 file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') + if download is not None: + query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) + def get_classification_nodes(self, project, ids, depth=None, error_policy=None): + """GetClassificationNodes. + [Preview API] Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project. + :param str project: Project ID or project name + :param [int] ids: Comma seperated integer classification nodes ids. It's not required, if you want root nodes. + :param int depth: Depth of children to fetch. + :param str error_policy: Flag to handle errors in getting some nodes. Possible options are Fail and Omit. + :rtype: [WorkItemClassificationNode] + """ + 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') + if depth is not None: + query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') + if error_policy is not 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='4.1-preview.2', + route_values=route_values, + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[WorkItemClassificationNode]', response) + def get_root_nodes(self, project, depth=None): """GetRootNodes. [Preview API] Gets root classification nodes under the project. @@ -233,34 +283,40 @@ def update_classification_node(self, posted_node, project, structure_group, path content=content) return self._deserialize('WorkItemClassificationNode', response) - def get_comment(self, id, revision): + def get_comment(self, id, revision, project=None): """GetComment. [Preview API] Gets a comment for a work item at the specified revision. :param int id: Work item id :param int revision: Revision for which the comment need to be fetched + :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 id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if revision is not None: route_values['revision'] = self._serialize.url('revision', revision, 'int') response = self._send(http_method='GET', location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', - version='4.1-preview.1', + version='4.1-preview.2', route_values=route_values) return self._deserialize('WorkItemComment', response) - def get_comments(self, id, from_revision=None, top=None, order=None): + def get_comments(self, id, project=None, from_revision=None, top=None, order=None): """GetComments. [Preview API] Gets the specified number of comments for a work item from the specified revision. :param int id: Work item id - :param int from_revision: Revision from which comments are to be fetched - :param int top: The number of comments to return - :param str order: Ascending or descending by revision id + :param str project: Project ID or project name + :param int from_revision: Revision from which comments are to be fetched (default is 1) + :param int top: The number of comments to return (default is 200) + :param str order: Ascending or descending by revision id (default is ascending) :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, 'int') query_parameters = {} @@ -272,7 +328,7 @@ def get_comments(self, id, from_revision=None, top=None, order=None): query_parameters['order'] = self._serialize.query('order', order, 'str') response = self._send(http_method='GET', location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', - version='4.1-preview.1', + version='4.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemComments', response) @@ -374,7 +430,7 @@ def create_query(self, posted_query, project, query): def delete_query(self, project, query): """DeleteQuery. - [Preview API] Delete a query or a folder + [Preview API] Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder. :param str project: Project ID or project name :param str query: ID or path of the query or folder to delete. """ @@ -479,7 +535,7 @@ def update_query(self, query_update, project, query, undelete_descendants=None): :param :class:` ` query_update: The query to update. :param str project: Project ID or project name :param str query: The path for the query to update. - :param bool undelete_descendants: Undelete the children of this folder. + :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:` ` """ route_values = {} @@ -512,7 +568,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='4.1-preview.1', + version='4.1-preview.2', route_values=route_values) def get_deleted_work_item(self, id, project=None): @@ -529,26 +585,10 @@ 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='4.1-preview.1', + version='4.1-preview.2', route_values=route_values) return self._deserialize('WorkItemDelete', response) - def get_deleted_work_item_references(self, project=None): - """GetDeletedWorkItemReferences. - [Preview API] Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. - :param str project: Project ID or project name - :rtype: [WorkItemReference] - """ - route_values = {} - if project is not None: - route_values['project'] = self._serialize.url('project', project, 'str') - response = self._send(http_method='GET', - location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', - version='4.1-preview.1', - route_values=route_values, - returns_collection=True) - return self._deserialize('[WorkItemReference]', response) - def get_deleted_work_items(self, ids, project=None): """GetDeletedWorkItems. [Preview API] Gets the work items from the recycle bin, whose IDs have been specified in the parameters @@ -565,12 +605,28 @@ 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='4.1-preview.1', + version='4.1-preview.2', route_values=route_values, query_parameters=query_parameters, returns_collection=True) return self._deserialize('[WorkItemDeleteReference]', response) + def get_deleted_work_item_shallow_references(self, project=None): + """GetDeletedWorkItemShallowReferences. + [Preview API] Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. + :param str project: Project ID or project name + :rtype: [WorkItemDeleteShallowReference] + """ + route_values = {} + if project is not None: + route_values['project'] = self._serialize.url('project', project, 'str') + response = self._send(http_method='GET', + location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', + version='4.1-preview.2', + route_values=route_values, + returns_collection=True) + return self._deserialize('[WorkItemDeleteShallowReference]', response) + def restore_work_item(self, payload, id, project=None): """RestoreWorkItem. [Preview API] Restores the deleted work item from Recycle Bin. @@ -587,7 +643,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='4.1-preview.1', + version='4.1-preview.2', route_values=route_values, content=content) return self._deserialize('WorkItemDelete', response) @@ -610,7 +666,7 @@ def get_revision(self, id, revision_number, 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) @@ -636,7 +692,7 @@ def get_revisions(self, id, 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters, returns_collection=True) @@ -653,11 +709,11 @@ def create_template(self, template, team_context): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -685,11 +741,11 @@ def get_templates(self, team_context, workitemtypename=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -719,11 +775,11 @@ def delete_template(self, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -750,11 +806,11 @@ def get_template(self, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -783,11 +839,11 @@ def replace_template(self, template_content, team_context, template_id): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -820,7 +876,7 @@ def get_update(self, id, update_number): 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values) return self._deserialize('WorkItemUpdate', response) @@ -842,7 +898,7 @@ def get_updates(self, id, 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters, returns_collection=True) @@ -861,11 +917,11 @@ def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -900,11 +956,11 @@ def get_query_result_count(self, id, team_context=None, time_precision=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -937,11 +993,11 @@ def query_by_id(self, id, team_context=None, time_precision=None): team = None if team_context is not None: if team_context.projectId: - project = team_context.projectId + project = team_context.project_id else: project = team_context.project if team_context.teamId: - team = team_context.teamId + team = team_context.team_id else: team = team_context.team @@ -1019,10 +1075,11 @@ def get_work_item_icon_svg(self, icon, color=None, v=None): query_parameters=query_parameters) return self._deserialize('object', response) - def get_reporting_links(self, project=None, types=None, continuation_token=None, start_date_time=None): - """GetReportingLinks. + def get_reporting_links_by_link_type(self, project=None, link_types=None, types=None, continuation_token=None, start_date_time=None): + """GetReportingLinksByLinkType. [Preview API] Get a batch of work item links :param str project: Project ID or project name + :param [str] link_types: A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link 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. @@ -1032,6 +1089,9 @@ def get_reporting_links(self, project=None, types=None, continuation_token=None, if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} + if link_types is not None: + link_types = ",".join(link_types) + query_parameters['linkTypes'] = self._serialize.query('link_types', link_types, 'str') if types is not None: types = ",".join(types) query_parameters['types'] = self._serialize.query('types', types, 'str') @@ -1153,14 +1213,79 @@ def read_reporting_revisions_post(self, filter, project=None, continuation_token content=content) return self._deserialize('ReportingWorkItemRevisionsBatch', response) - def delete_work_item(self, id, destroy=None): + def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None): + """CreateWorkItem. + [Preview API] Creates a single 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 + :rtype: :class:` ` + """ + 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') + query_parameters = {} + if validate_only is not None: + query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') + if bypass_rules is not None: + query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') + if suppress_notifications is not None: + query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='POST', + location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', + version='4.1-preview.3', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('WorkItem', response) + + def get_work_item_template(self, project, type, fields=None, as_of=None, expand=None): + """GetWorkItemTemplate. + [Preview API] Returns a single work item from a template. + :param str project: Project ID or project name + :param str type: The work item type name + :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:` ` + """ + 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') + query_parameters = {} + if fields is not None: + query_parameters['fields'] = self._serialize.query('fields', fields, 'str') + if as_of is not None: + query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', + version='4.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WorkItem', response) + + def delete_work_item(self, id, project=None, destroy=None): """DeleteWorkItem. [Preview API] Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. :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 :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, 'int') query_parameters = {} @@ -1168,21 +1293,24 @@ def delete_work_item(self, id, 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemDelete', response) - def get_work_item(self, id, fields=None, as_of=None, expand=None): + def get_work_item(self, id, project=None, fields=None, as_of=None, expand=None): """GetWorkItem. [Preview API] Returns a single work item. :param int id: The work item id + :param str project: Project ID or project name :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 + :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :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, 'int') query_parameters = {} @@ -1195,21 +1323,25 @@ def get_work_item(self, id, 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='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) - def get_work_items(self, ids, fields=None, as_of=None, expand=None, error_policy=None): + def get_work_items(self, ids, project=None, fields=None, as_of=None, expand=None, error_policy=None): """GetWorkItems. [Preview API] Returns a list of work items. :param [int] ids: The comma-separated list of requested work item ids + :param str project: Project ID or project name :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 - :param str error_policy: The flag to control error policy in a bulk get work items request + :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + :param str error_policy: The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. :rtype: [WorkItem] """ + 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)) @@ -1225,22 +1357,26 @@ def get_work_items(self, ids, fields=None, as_of=None, expand=None, error_policy 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='4.1-preview.2', + version='4.1-preview.3', + route_values=route_values, query_parameters=query_parameters, returns_collection=True) return self._deserialize('[WorkItem]', response) - def update_work_item(self, document, id, validate_only=None, bypass_rules=None, suppress_notifications=None): + def update_work_item(self, document, id, project=None, validate_only=None, bypass_rules=None, suppress_notifications=None): """UpdateWorkItem. [Preview API] Updates a single work item. :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 :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, 'int') query_parameters = {} @@ -1253,75 +1389,13 @@ def update_work_item(self, document, id, validate_only=None, bypass_rules=None, content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', - version='4.1-preview.2', + version='4.1-preview.3', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('WorkItem', response) - def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None): - """CreateWorkItem. - [Preview API] Creates a single 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 - :rtype: :class:` ` - """ - 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') - query_parameters = {} - if validate_only is not None: - query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') - if bypass_rules is not None: - query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') - if suppress_notifications is not None: - query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') - content = self._serialize.body(document, '[JsonPatchOperation]') - response = self._send(http_method='POST', - location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters, - content=content, - media_type='application/json-patch+json') - return self._deserialize('WorkItem', response) - - def get_work_item_template(self, project, type, fields=None, as_of=None, expand=None): - """GetWorkItemTemplate. - [Preview API] Returns a single work item from a template. - :param str project: Project ID or project name - :param str type: The work item type name - :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 - :rtype: :class:` ` - """ - 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') - query_parameters = {} - if fields is not None: - query_parameters['fields'] = self._serialize.query('fields', fields, 'str') - if as_of is not None: - query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') - if expand is not None: - query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') - response = self._send(http_method='GET', - location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('WorkItem', response) - def get_work_item_next_states_on_checkin_action(self, ids, action=None): """GetWorkItemNextStatesOnCheckinAction. [Preview API] Returns the next state on the given work item IDs. @@ -1344,7 +1418,7 @@ def get_work_item_next_states_on_checkin_action(self, ids, action=None): def get_work_item_type_categories(self, project): """GetWorkItemTypeCategories. - [Preview API] Returns a the deltas between work item revisions. + [Preview API] Get all work item type categories. :param str project: Project ID or project name :rtype: [WorkItemTypeCategory] """ @@ -1360,7 +1434,7 @@ def get_work_item_type_categories(self, project): def get_work_item_type_category(self, project, category): """GetWorkItemTypeCategory. - [Preview API] Returns a the deltas between work item revisions. + [Preview API] Get specific work item type category by name. :param str project: Project ID or project name :param str category: The category name :rtype: :class:` ` @@ -1410,13 +1484,38 @@ def get_work_item_types(self, project): returns_collection=True) return self._deserialize('[WorkItemType]', response) - def get_dependent_fields(self, project, type, field): - """GetDependentFields. - [Preview API] Returns the dependent fields for the corresponding workitem type and fieldname. + def get_work_item_type_fields_with_references(self, project, type, expand=None): + """GetWorkItemTypeFieldsWithReferences. + [Preview API] Get a list of fields for a work item type with detailed references. :param str project: Project ID or project name - :param str type: The work item type name + :param str type: Work item type. + :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: [WorkItemTypeFieldWithReferences] + """ + 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') + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') + response = self._send(http_method='GET', + location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', + version='4.1-preview.3', + route_values=route_values, + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[WorkItemTypeFieldWithReferences]', response) + + def get_work_item_type_field_with_references(self, project, type, field, expand=None): + """GetWorkItemTypeFieldWithReferences. + [Preview API] Get a field for a work item type with detailed references. + :param str project: Project ID or project name + :param str type: Work item type. :param str field: - :rtype: :class:` ` + :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:` ` """ route_values = {} if project is not None: @@ -1425,11 +1524,15 @@ def get_dependent_fields(self, project, type, field): route_values['type'] = self._serialize.url('type', type, 'str') if field is not None: route_values['field'] = self._serialize.url('field', field, '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='bd293ce5-3d25-4192-8e67-e8092e879efb', - version='4.1-preview.2', - route_values=route_values) - return self._deserialize('FieldDependentRule', response) + version='4.1-preview.3', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('WorkItemTypeFieldWithReferences', response) def get_work_item_type_states(self, project, type): """GetWorkItemTypeStates.