Merge pull request #353 from microsoft/users/tedchamb/5.1pp
add pipelines_permissions_client and pipelines_checks_client
This commit is contained in:
Коммит
f74935e358
|
@ -204,6 +204,13 @@ class ClientFactoryV5_1(object):
|
|||
"""
|
||||
return self._connection.get_client('azure.devops.v5_1.operations.operations_client.OperationsClient')
|
||||
|
||||
def get_pipeline_permissions_client(self):
|
||||
"""get_pipeline_permissions_client.
|
||||
Gets the 5.1 version of the PipelinePermissionsClient
|
||||
:rtype: :class:`<PipelinePermissionsClient> <azure.devops.v5_1.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient>`
|
||||
"""
|
||||
return self._connection.get_client('azure.devops.v5_1.pipeline_permissions.pipeline_permissions_client.PipelinePermissionsClient')
|
||||
|
||||
def get_pipelines_client(self):
|
||||
"""get_pipelines_client.
|
||||
Gets the 5.1 version of the PipelinesClient
|
||||
|
@ -211,6 +218,13 @@ class ClientFactoryV5_1(object):
|
|||
"""
|
||||
return self._connection.get_client('azure.devops.v5_1.pipelines.pipelines_client.PipelinesClient')
|
||||
|
||||
def get_pipelines_checks_client(self):
|
||||
"""get_pipelines_checks_client.
|
||||
Gets the 5.1 version of the PipelinesChecksClient
|
||||
:rtype: :class:`<PipelinesChecksClient> <azure.devops.v5_1.pipelines_checks.pipelines_checks_client.PipelinesChecksClient>`
|
||||
"""
|
||||
return self._connection.get_client('azure.devops.v5_1.pipelines_checks.pipelines_checks_client.PipelinesChecksClient')
|
||||
|
||||
def get_policy_client(self):
|
||||
"""get_policy_client.
|
||||
Gets the 5.1 version of the PolicyClient
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Generated file, DO NOT EDIT
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
from .models import *
|
||||
from .pipeline_permissions_client import PipelinePermissionsClient
|
||||
|
||||
__all__ = [
|
||||
'GraphSubjectBase',
|
||||
'IdentityRef',
|
||||
'Permission',
|
||||
'PipelinePermission',
|
||||
'ReferenceLinks',
|
||||
'Resource',
|
||||
'ResourcePipelinePermissions',
|
||||
'PipelinePermissionsClient'
|
||||
]
|
|
@ -0,0 +1,212 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# 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 GraphSubjectBase(Model):
|
||||
"""
|
||||
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
|
||||
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
||||
:type descriptor: str
|
||||
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
|
||||
:type display_name: str
|
||||
:param url: This url is the full route to the source resource of this graph subject.
|
||||
:type url: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'descriptor': {'key': 'descriptor', 'type': 'str'},
|
||||
'display_name': {'key': 'displayName', 'type': 'str'},
|
||||
'url': {'key': 'url', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, _links=None, descriptor=None, display_name=None, url=None):
|
||||
super(GraphSubjectBase, self).__init__()
|
||||
self._links = _links
|
||||
self.descriptor = descriptor
|
||||
self.display_name = display_name
|
||||
self.url = url
|
||||
|
||||
|
||||
class IdentityRef(GraphSubjectBase):
|
||||
"""
|
||||
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
|
||||
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
||||
:type descriptor: str
|
||||
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
|
||||
:type display_name: str
|
||||
:param url: This url is the full route to the source resource of this graph subject.
|
||||
:type url: str
|
||||
:param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary
|
||||
:type directory_alias: str
|
||||
:param id:
|
||||
:type id: str
|
||||
:param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary
|
||||
:type image_url: str
|
||||
:param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary
|
||||
:type inactive: bool
|
||||
:param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)
|
||||
:type is_aad_identity: bool
|
||||
:param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)
|
||||
:type is_container: bool
|
||||
:param is_deleted_in_origin:
|
||||
:type is_deleted_in_origin: bool
|
||||
:param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef
|
||||
:type profile_url: str
|
||||
:param unique_name: Deprecated - use Domain+PrincipalName instead
|
||||
:type unique_name: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'descriptor': {'key': 'descriptor', 'type': 'str'},
|
||||
'display_name': {'key': 'displayName', 'type': 'str'},
|
||||
'url': {'key': 'url', 'type': 'str'},
|
||||
'directory_alias': {'key': 'directoryAlias', 'type': 'str'},
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'image_url': {'key': 'imageUrl', 'type': 'str'},
|
||||
'inactive': {'key': 'inactive', 'type': 'bool'},
|
||||
'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'},
|
||||
'is_container': {'key': 'isContainer', 'type': 'bool'},
|
||||
'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'},
|
||||
'profile_url': {'key': 'profileUrl', 'type': 'str'},
|
||||
'unique_name': {'key': 'uniqueName', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None):
|
||||
super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url)
|
||||
self.directory_alias = directory_alias
|
||||
self.id = id
|
||||
self.image_url = image_url
|
||||
self.inactive = inactive
|
||||
self.is_aad_identity = is_aad_identity
|
||||
self.is_container = is_container
|
||||
self.is_deleted_in_origin = is_deleted_in_origin
|
||||
self.profile_url = profile_url
|
||||
self.unique_name = unique_name
|
||||
|
||||
|
||||
class Permission(Model):
|
||||
"""
|
||||
:param authorized:
|
||||
:type authorized: bool
|
||||
:param authorized_by:
|
||||
:type authorized_by: :class:`IdentityRef <azure.devops.v5_1.pipeline_permissions.models.IdentityRef>`
|
||||
:param authorized_on:
|
||||
:type authorized_on: datetime
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'authorized': {'key': 'authorized', 'type': 'bool'},
|
||||
'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'},
|
||||
'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'}
|
||||
}
|
||||
|
||||
def __init__(self, authorized=None, authorized_by=None, authorized_on=None):
|
||||
super(Permission, self).__init__()
|
||||
self.authorized = authorized
|
||||
self.authorized_by = authorized_by
|
||||
self.authorized_on = authorized_on
|
||||
|
||||
|
||||
class PipelinePermission(Permission):
|
||||
"""
|
||||
:param authorized:
|
||||
:type authorized: bool
|
||||
:param authorized_by:
|
||||
:type authorized_by: :class:`IdentityRef <azure.devops.v5_1.pipeline_permissions.models.IdentityRef>`
|
||||
:param authorized_on:
|
||||
:type authorized_on: datetime
|
||||
:param id:
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'authorized': {'key': 'authorized', 'type': 'bool'},
|
||||
'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'},
|
||||
'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'},
|
||||
'id': {'key': 'id', 'type': 'int'}
|
||||
}
|
||||
|
||||
def __init__(self, authorized=None, authorized_by=None, authorized_on=None, id=None):
|
||||
super(PipelinePermission, self).__init__(authorized=authorized, authorized_by=authorized_by, authorized_on=authorized_on)
|
||||
self.id = id
|
||||
|
||||
|
||||
class ReferenceLinks(Model):
|
||||
"""
|
||||
The class to represent a collection of REST reference links.
|
||||
|
||||
:param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.
|
||||
:type links: dict
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'links': {'key': 'links', 'type': '{object}'}
|
||||
}
|
||||
|
||||
def __init__(self, links=None):
|
||||
super(ReferenceLinks, self).__init__()
|
||||
self.links = links
|
||||
|
||||
|
||||
class Resource(Model):
|
||||
"""
|
||||
:param id: Id of the resource.
|
||||
:type id: str
|
||||
:param type: Type of the resource.
|
||||
:type type: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'type': {'key': 'type', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, id=None, type=None):
|
||||
super(Resource, self).__init__()
|
||||
self.id = id
|
||||
self.type = type
|
||||
|
||||
|
||||
class ResourcePipelinePermissions(Model):
|
||||
"""
|
||||
:param all_pipelines:
|
||||
:type all_pipelines: :class:`Permission <azure.devops.v5_1.pipeline_permissions.models.Permission>`
|
||||
:param pipelines:
|
||||
:type pipelines: list of :class:`PipelinePermission <azure.devops.v5_1.pipeline_permissions.models.PipelinePermission>`
|
||||
:param resource:
|
||||
:type resource: :class:`Resource <azure.devops.v5_1.pipeline_permissions.models.Resource>`
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'all_pipelines': {'key': 'allPipelines', 'type': 'Permission'},
|
||||
'pipelines': {'key': 'pipelines', 'type': '[PipelinePermission]'},
|
||||
'resource': {'key': 'resource', 'type': 'Resource'}
|
||||
}
|
||||
|
||||
def __init__(self, all_pipelines=None, pipelines=None, resource=None):
|
||||
super(ResourcePipelinePermissions, self).__init__()
|
||||
self.all_pipelines = all_pipelines
|
||||
self.pipelines = pipelines
|
||||
self.resource = resource
|
||||
|
||||
|
||||
__all__ = [
|
||||
'GraphSubjectBase',
|
||||
'IdentityRef',
|
||||
'Permission',
|
||||
'PipelinePermission',
|
||||
'ReferenceLinks',
|
||||
'Resource',
|
||||
'ResourcePipelinePermissions',
|
||||
]
|
|
@ -0,0 +1,90 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Generated file, DO NOT EDIT
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
from msrest import Serializer, Deserializer
|
||||
from ...client import Client
|
||||
from . import models
|
||||
|
||||
|
||||
class PipelinePermissionsClient(Client):
|
||||
"""PipelinePermissions
|
||||
:param str base_url: Service URL
|
||||
:param Authentication creds: Authenticated credentials.
|
||||
"""
|
||||
|
||||
def __init__(self, base_url=None, creds=None):
|
||||
super(PipelinePermissionsClient, self).__init__(base_url, creds)
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
|
||||
resource_area_identifier = 'a81a0441-de52-4000-aa15-ff0e07bfbbaa'
|
||||
|
||||
def get_pipeline_permissions_for_resource(self, project, resource_type, resource_id):
|
||||
"""GetPipelinePermissionsForResource.
|
||||
[Preview API] Given a ResourceType and ResourceId, returns authorized definitions for that resource.
|
||||
:param str project: Project ID or project name
|
||||
:param str resource_type:
|
||||
:param str resource_id:
|
||||
:rtype: :class:`<ResourcePipelinePermissions> <azure.devops.v5_1.pipeline_permissions.models.ResourcePipelinePermissions>`
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
if resource_type is not None:
|
||||
route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str')
|
||||
if resource_id is not None:
|
||||
route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str')
|
||||
response = self._send(http_method='GET',
|
||||
location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values)
|
||||
return self._deserialize('ResourcePipelinePermissions', response)
|
||||
|
||||
def update_pipeline_permisions_for_resource(self, resource_authorization, project, resource_type, resource_id):
|
||||
"""UpdatePipelinePermisionsForResource.
|
||||
[Preview API] Authorizes/Unauthorizes a list of definitions for a given resource.
|
||||
:param :class:`<ResourcePipelinePermissions> <azure.devops.v5_1.pipeline_permissions.models.ResourcePipelinePermissions>` resource_authorization:
|
||||
:param str project: Project ID or project name
|
||||
:param str resource_type:
|
||||
:param str resource_id:
|
||||
:rtype: :class:`<ResourcePipelinePermissions> <azure.devops.v5_1.pipeline_permissions.models.ResourcePipelinePermissions>`
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
if resource_type is not None:
|
||||
route_values['resourceType'] = self._serialize.url('resource_type', resource_type, 'str')
|
||||
if resource_id is not None:
|
||||
route_values['resourceId'] = self._serialize.url('resource_id', resource_id, 'str')
|
||||
content = self._serialize.body(resource_authorization, 'ResourcePipelinePermissions')
|
||||
response = self._send(http_method='PATCH',
|
||||
location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
content=content)
|
||||
return self._deserialize('ResourcePipelinePermissions', response)
|
||||
|
||||
def update_pipeline_permisions_for_resources(self, resource_authorizations, project):
|
||||
"""UpdatePipelinePermisionsForResources.
|
||||
[Preview API] Batch API to authorize/unauthorize a list of definitions for a multiple resources.
|
||||
:param [ResourcePipelinePermissions] resource_authorizations:
|
||||
:param str project: Project ID or project name
|
||||
:rtype: [ResourcePipelinePermissions]
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
content = self._serialize.body(resource_authorizations, '[ResourcePipelinePermissions]')
|
||||
response = self._send(http_method='PATCH',
|
||||
location_id='b5b9a4a4-e6cd-4096-853c-ab7d8b0c4eb2',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
content=content)
|
||||
return self._deserialize('[ResourcePipelinePermissions]', self._unwrap_collection(response))
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Generated file, DO NOT EDIT
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
from .models import *
|
||||
from .pipelines_checks_client import PipelinesChecksClient
|
||||
|
||||
__all__ = [
|
||||
'CheckConfiguration',
|
||||
'CheckConfigurationRef',
|
||||
'CheckRun',
|
||||
'CheckRunResult',
|
||||
'CheckSuite',
|
||||
'CheckSuiteRequest',
|
||||
'CheckType',
|
||||
'GraphSubjectBase',
|
||||
'IdentityRef',
|
||||
'ReferenceLinks',
|
||||
'Resource',
|
||||
'PipelinesChecksClient'
|
||||
]
|
|
@ -0,0 +1,353 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# 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 CheckConfigurationRef(Model):
|
||||
"""
|
||||
:param id: Check configuration id.
|
||||
:type id: int
|
||||
:param resource: Resource on which check get configured.
|
||||
:type resource: :class:`Resource <azure.devops.v5_1.pipelines_checks.models.Resource>`
|
||||
:param type: Check configuration type
|
||||
:type type: :class:`CheckType <azure.devops.v5_1.pipelines_checks.models.CheckType>`
|
||||
:param url: The URL from which one can fetch the configured check.
|
||||
:type url: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'int'},
|
||||
'resource': {'key': 'resource', 'type': 'Resource'},
|
||||
'type': {'key': 'type', 'type': 'CheckType'},
|
||||
'url': {'key': 'url', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, id=None, resource=None, type=None, url=None):
|
||||
super(CheckConfigurationRef, self).__init__()
|
||||
self.id = id
|
||||
self.resource = resource
|
||||
self.type = type
|
||||
self.url = url
|
||||
|
||||
|
||||
class CheckRunResult(Model):
|
||||
"""
|
||||
:param result_message:
|
||||
:type result_message: str
|
||||
:param status:
|
||||
:type status: object
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'result_message': {'key': 'resultMessage', 'type': 'str'},
|
||||
'status': {'key': 'status', 'type': 'object'}
|
||||
}
|
||||
|
||||
def __init__(self, result_message=None, status=None):
|
||||
super(CheckRunResult, self).__init__()
|
||||
self.result_message = result_message
|
||||
self.status = status
|
||||
|
||||
|
||||
class CheckSuite(Model):
|
||||
"""
|
||||
:param _links: Reference links.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.pipelines_checks.models.ReferenceLinks>`
|
||||
:param check_runs: List of check runs associated with the given check suite request.
|
||||
:type check_runs: list of :class:`CheckRun <azure.devops.v5_1.pipelines_checks.models.CheckRun>`
|
||||
:param completed_date: Completed date of the given check suite request
|
||||
:type completed_date: datetime
|
||||
:param context: Evaluation context for the check suite request
|
||||
:type context: :class:`object <azure.devops.v5_1.pipelines_checks.models.object>`
|
||||
:param id: Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage
|
||||
:type id: str
|
||||
:param message: Optional message for the given check suite request
|
||||
:type message: str
|
||||
:param status: Overall check runs status for the given suite request. This is check suite status
|
||||
:type status: object
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'check_runs': {'key': 'checkRuns', 'type': '[CheckRun]'},
|
||||
'completed_date': {'key': 'completedDate', 'type': 'iso-8601'},
|
||||
'context': {'key': 'context', 'type': 'object'},
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'message': {'key': 'message', 'type': 'str'},
|
||||
'status': {'key': 'status', 'type': 'object'}
|
||||
}
|
||||
|
||||
def __init__(self, _links=None, check_runs=None, completed_date=None, context=None, id=None, message=None, status=None):
|
||||
super(CheckSuite, self).__init__()
|
||||
self._links = _links
|
||||
self.check_runs = check_runs
|
||||
self.completed_date = completed_date
|
||||
self.context = context
|
||||
self.id = id
|
||||
self.message = message
|
||||
self.status = status
|
||||
|
||||
|
||||
class CheckSuiteRequest(Model):
|
||||
"""
|
||||
:param context:
|
||||
:type context: :class:`object <azure.devops.v5_1.pipelines_checks.models.object>`
|
||||
:param id:
|
||||
:type id: str
|
||||
:param resources:
|
||||
:type resources: list of :class:`Resource <azure.devops.v5_1.pipelines_checks.models.Resource>`
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'context': {'key': 'context', 'type': 'object'},
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'resources': {'key': 'resources', 'type': '[Resource]'}
|
||||
}
|
||||
|
||||
def __init__(self, context=None, id=None, resources=None):
|
||||
super(CheckSuiteRequest, self).__init__()
|
||||
self.context = context
|
||||
self.id = id
|
||||
self.resources = resources
|
||||
|
||||
|
||||
class CheckType(Model):
|
||||
"""
|
||||
:param id: Gets or sets check type id.
|
||||
:type id: str
|
||||
:param name: Name of the check type.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'name': {'key': 'name', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, id=None, name=None):
|
||||
super(CheckType, self).__init__()
|
||||
self.id = id
|
||||
self.name = name
|
||||
|
||||
|
||||
class GraphSubjectBase(Model):
|
||||
"""
|
||||
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
|
||||
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
||||
:type descriptor: str
|
||||
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
|
||||
:type display_name: str
|
||||
:param url: This url is the full route to the source resource of this graph subject.
|
||||
:type url: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'descriptor': {'key': 'descriptor', 'type': 'str'},
|
||||
'display_name': {'key': 'displayName', 'type': 'str'},
|
||||
'url': {'key': 'url', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, _links=None, descriptor=None, display_name=None, url=None):
|
||||
super(GraphSubjectBase, self).__init__()
|
||||
self._links = _links
|
||||
self.descriptor = descriptor
|
||||
self.display_name = display_name
|
||||
self.url = url
|
||||
|
||||
|
||||
class IdentityRef(GraphSubjectBase):
|
||||
"""
|
||||
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
|
||||
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
||||
:type descriptor: str
|
||||
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
|
||||
:type display_name: str
|
||||
:param url: This url is the full route to the source resource of this graph subject.
|
||||
:type url: str
|
||||
:param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary
|
||||
:type directory_alias: str
|
||||
:param id:
|
||||
:type id: str
|
||||
:param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary
|
||||
:type image_url: str
|
||||
:param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary
|
||||
:type inactive: bool
|
||||
:param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)
|
||||
:type is_aad_identity: bool
|
||||
:param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)
|
||||
:type is_container: bool
|
||||
:param is_deleted_in_origin:
|
||||
:type is_deleted_in_origin: bool
|
||||
:param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef
|
||||
:type profile_url: str
|
||||
:param unique_name: Deprecated - use Domain+PrincipalName instead
|
||||
:type unique_name: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'descriptor': {'key': 'descriptor', 'type': 'str'},
|
||||
'display_name': {'key': 'displayName', 'type': 'str'},
|
||||
'url': {'key': 'url', 'type': 'str'},
|
||||
'directory_alias': {'key': 'directoryAlias', 'type': 'str'},
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'image_url': {'key': 'imageUrl', 'type': 'str'},
|
||||
'inactive': {'key': 'inactive', 'type': 'bool'},
|
||||
'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'},
|
||||
'is_container': {'key': 'isContainer', 'type': 'bool'},
|
||||
'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'},
|
||||
'profile_url': {'key': 'profileUrl', 'type': 'str'},
|
||||
'unique_name': {'key': 'uniqueName', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None):
|
||||
super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url)
|
||||
self.directory_alias = directory_alias
|
||||
self.id = id
|
||||
self.image_url = image_url
|
||||
self.inactive = inactive
|
||||
self.is_aad_identity = is_aad_identity
|
||||
self.is_container = is_container
|
||||
self.is_deleted_in_origin = is_deleted_in_origin
|
||||
self.profile_url = profile_url
|
||||
self.unique_name = unique_name
|
||||
|
||||
|
||||
class ReferenceLinks(Model):
|
||||
"""
|
||||
The class to represent a collection of REST reference links.
|
||||
|
||||
:param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.
|
||||
:type links: dict
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'links': {'key': 'links', 'type': '{object}'}
|
||||
}
|
||||
|
||||
def __init__(self, links=None):
|
||||
super(ReferenceLinks, self).__init__()
|
||||
self.links = links
|
||||
|
||||
|
||||
class Resource(Model):
|
||||
"""
|
||||
:param id: Id of the resource.
|
||||
:type id: str
|
||||
:param type: Type of the resource.
|
||||
:type type: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'type': {'key': 'type', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, id=None, type=None):
|
||||
super(Resource, self).__init__()
|
||||
self.id = id
|
||||
self.type = type
|
||||
|
||||
|
||||
class CheckConfiguration(CheckConfigurationRef):
|
||||
"""
|
||||
:param id: Check configuration id.
|
||||
:type id: int
|
||||
:param resource: Resource on which check get configured.
|
||||
:type resource: :class:`Resource <azure.devops.v5_1.pipelines_checks.models.Resource>`
|
||||
:param type: Check configuration type
|
||||
:type type: :class:`CheckType <azure.devops.v5_1.pipelines_checks.models.CheckType>`
|
||||
:param url: The URL from which one can fetch the configured check.
|
||||
:type url: str
|
||||
:param _links: Reference links.
|
||||
:type _links: :class:`ReferenceLinks <azure.devops.v5_1.pipelines_checks.models.ReferenceLinks>`
|
||||
:param created_by: Identity of person who configured check.
|
||||
:type created_by: :class:`IdentityRef <azure.devops.v5_1.pipelines_checks.models.IdentityRef>`
|
||||
:param created_on: Time when check got configured.
|
||||
:type created_on: datetime
|
||||
:param modified_by: Identity of person who modified the configured check.
|
||||
:type modified_by: :class:`IdentityRef <azure.devops.v5_1.pipelines_checks.models.IdentityRef>`
|
||||
:param modified_on: Time when configured check was modified.
|
||||
:type modified_on: datetime
|
||||
:param settings: Settings for the check configuration.
|
||||
:type settings: :class:`object <azure.devops.v5_1.pipelines_checks.models.object>`
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'int'},
|
||||
'resource': {'key': 'resource', 'type': 'Resource'},
|
||||
'type': {'key': 'type', 'type': 'CheckType'},
|
||||
'url': {'key': 'url', 'type': 'str'},
|
||||
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
|
||||
'created_by': {'key': 'createdBy', 'type': 'IdentityRef'},
|
||||
'created_on': {'key': 'createdOn', 'type': 'iso-8601'},
|
||||
'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'},
|
||||
'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'},
|
||||
'settings': {'key': 'settings', 'type': 'object'}
|
||||
}
|
||||
|
||||
def __init__(self, id=None, resource=None, type=None, url=None, _links=None, created_by=None, created_on=None, modified_by=None, modified_on=None, settings=None):
|
||||
super(CheckConfiguration, self).__init__(id=id, resource=resource, type=type, url=url)
|
||||
self._links = _links
|
||||
self.created_by = created_by
|
||||
self.created_on = created_on
|
||||
self.modified_by = modified_by
|
||||
self.modified_on = modified_on
|
||||
self.settings = settings
|
||||
|
||||
|
||||
class CheckRun(CheckRunResult):
|
||||
"""
|
||||
:param result_message:
|
||||
:type result_message: str
|
||||
:param status:
|
||||
:type status: object
|
||||
:param check_configuration_ref:
|
||||
:type check_configuration_ref: :class:`CheckConfigurationRef <azure.devops.v5_1.pipelines_checks.models.CheckConfigurationRef>`
|
||||
:param completed_date:
|
||||
:type completed_date: datetime
|
||||
:param created_date:
|
||||
:type created_date: datetime
|
||||
:param id:
|
||||
:type id: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'result_message': {'key': 'resultMessage', 'type': 'str'},
|
||||
'status': {'key': 'status', 'type': 'object'},
|
||||
'check_configuration_ref': {'key': 'checkConfigurationRef', 'type': 'CheckConfigurationRef'},
|
||||
'completed_date': {'key': 'completedDate', 'type': 'iso-8601'},
|
||||
'created_date': {'key': 'createdDate', 'type': 'iso-8601'},
|
||||
'id': {'key': 'id', 'type': 'str'}
|
||||
}
|
||||
|
||||
def __init__(self, result_message=None, status=None, check_configuration_ref=None, completed_date=None, created_date=None, id=None):
|
||||
super(CheckRun, self).__init__(result_message=result_message, status=status)
|
||||
self.check_configuration_ref = check_configuration_ref
|
||||
self.completed_date = completed_date
|
||||
self.created_date = created_date
|
||||
self.id = id
|
||||
|
||||
|
||||
__all__ = [
|
||||
'CheckConfigurationRef',
|
||||
'CheckRunResult',
|
||||
'CheckSuite',
|
||||
'CheckSuiteRequest',
|
||||
'CheckType',
|
||||
'GraphSubjectBase',
|
||||
'IdentityRef',
|
||||
'ReferenceLinks',
|
||||
'Resource',
|
||||
'CheckConfiguration',
|
||||
'CheckRun',
|
||||
]
|
|
@ -0,0 +1,159 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Generated file, DO NOT EDIT
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
from msrest import Serializer, Deserializer
|
||||
from ...client import Client
|
||||
from . import models
|
||||
|
||||
|
||||
class PipelinesChecksClient(Client):
|
||||
"""PipelinesChecks
|
||||
:param str base_url: Service URL
|
||||
:param Authentication creds: Authenticated credentials.
|
||||
"""
|
||||
|
||||
def __init__(self, base_url=None, creds=None):
|
||||
super(PipelinesChecksClient, self).__init__(base_url, creds)
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
|
||||
resource_area_identifier = '4a933897-0488-45af-bd82-6fd3ad33f46a'
|
||||
|
||||
def add_check_configuration(self, configuration, project):
|
||||
"""AddCheckConfiguration.
|
||||
[Preview API] Add a check configuration
|
||||
:param :class:`<CheckConfiguration> <azure.devops.v5_1.pipelines_checks.models.CheckConfiguration>` configuration:
|
||||
:param str project: Project ID or project name
|
||||
:rtype: :class:`<CheckConfiguration> <azure.devops.v5_1.pipelines_checks.models.CheckConfiguration>`
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
content = self._serialize.body(configuration, 'CheckConfiguration')
|
||||
response = self._send(http_method='POST',
|
||||
location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
content=content)
|
||||
return self._deserialize('CheckConfiguration', response)
|
||||
|
||||
def delete_check_configuration(self, project, id):
|
||||
"""DeleteCheckConfiguration.
|
||||
[Preview API]
|
||||
:param str project: Project ID or project name
|
||||
:param int id:
|
||||
"""
|
||||
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')
|
||||
self._send(http_method='DELETE',
|
||||
location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values)
|
||||
|
||||
def get_check_configuration(self, project, id):
|
||||
"""GetCheckConfiguration.
|
||||
[Preview API] Get Check configuration by Id
|
||||
:param str project: Project ID or project name
|
||||
:param int id:
|
||||
:rtype: :class:`<CheckConfiguration> <azure.devops.v5_1.pipelines_checks.models.CheckConfiguration>`
|
||||
"""
|
||||
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')
|
||||
response = self._send(http_method='GET',
|
||||
location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values)
|
||||
return self._deserialize('CheckConfiguration', response)
|
||||
|
||||
def get_check_configurations_on_resource(self, project, resource_type, resource_id):
|
||||
"""GetCheckConfigurationsOnResource.
|
||||
[Preview API] Get Check configuration by resource type and id
|
||||
:param str project: Project ID or project name
|
||||
:param str resource_type: resource type
|
||||
:param str resource_id: resource id
|
||||
:rtype: [CheckConfiguration]
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
query_parameters = {}
|
||||
if resource_type is not None:
|
||||
query_parameters['resourceType'] = self._serialize.query('resource_type', resource_type, 'str')
|
||||
if resource_id is not None:
|
||||
query_parameters['resourceId'] = self._serialize.query('resource_id', resource_id, 'str')
|
||||
response = self._send(http_method='GET',
|
||||
location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
query_parameters=query_parameters)
|
||||
return self._deserialize('[CheckConfiguration]', self._unwrap_collection(response))
|
||||
|
||||
def update_check_configuration(self, configuration, project, id):
|
||||
"""UpdateCheckConfiguration.
|
||||
[Preview API] Update check configuration
|
||||
:param :class:`<CheckConfiguration> <azure.devops.v5_1.pipelines_checks.models.CheckConfiguration>` configuration: check configuration
|
||||
:param str project: Project ID or project name
|
||||
:param int id: check configuration id
|
||||
:rtype: :class:`<CheckConfiguration> <azure.devops.v5_1.pipelines_checks.models.CheckConfiguration>`
|
||||
"""
|
||||
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')
|
||||
content = self._serialize.body(configuration, 'CheckConfiguration')
|
||||
response = self._send(http_method='PATCH',
|
||||
location_id='86c8381e-5aee-4cde-8ae4-25c0c7f5eaea',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
content=content)
|
||||
return self._deserialize('CheckConfiguration', response)
|
||||
|
||||
def evaluate_check_suite(self, request, project):
|
||||
"""EvaluateCheckSuite.
|
||||
[Preview API]
|
||||
:param :class:`<CheckSuiteRequest> <azure.devops.v5_1.pipelines_checks.models.CheckSuiteRequest>` request:
|
||||
:param str project: Project ID or project name
|
||||
:rtype: :class:`<CheckSuite> <azure.devops.v5_1.pipelines_checks.models.CheckSuite>`
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
content = self._serialize.body(request, 'CheckSuiteRequest')
|
||||
response = self._send(http_method='POST',
|
||||
location_id='91282c1d-c183-444f-9554-1485bfb3879d',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values,
|
||||
content=content)
|
||||
return self._deserialize('CheckSuite', response)
|
||||
|
||||
def get_check_suite(self, project, check_suite_id):
|
||||
"""GetCheckSuite.
|
||||
[Preview API]
|
||||
:param str project: Project ID or project name
|
||||
:param str check_suite_id:
|
||||
:rtype: :class:`<CheckSuite> <azure.devops.v5_1.pipelines_checks.models.CheckSuite>`
|
||||
"""
|
||||
route_values = {}
|
||||
if project is not None:
|
||||
route_values['project'] = self._serialize.url('project', project, 'str')
|
||||
if check_suite_id is not None:
|
||||
route_values['checkSuiteId'] = self._serialize.url('check_suite_id', check_suite_id, 'str')
|
||||
response = self._send(http_method='GET',
|
||||
location_id='91282c1d-c183-444f-9554-1485bfb3879d',
|
||||
version='5.1-preview.1',
|
||||
route_values=route_values)
|
||||
return self._deserialize('CheckSuite', response)
|
||||
|
|
@ -3,4 +3,4 @@
|
|||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
VERSION = "5.1.0b7"
|
||||
VERSION = "5.1.0b8"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
NAME = "azure-devops"
|
||||
VERSION = "5.1.0b7"
|
||||
VERSION = "5.1.0b8"
|
||||
|
||||
# To install the library, run the following
|
||||
#
|
||||
|
|
Загрузка…
Ссылка в новой задаче