diff --git a/vsts/vsts/user/__init__.py b/vsts/vsts/member_entitlement_management/__init__.py similarity index 100% rename from vsts/vsts/user/__init__.py rename to vsts/vsts/member_entitlement_management/__init__.py diff --git a/vsts/vsts/user/v4_1/__init__.py b/vsts/vsts/member_entitlement_management/v4_0/__init__.py similarity index 100% rename from vsts/vsts/user/v4_1/__init__.py rename to vsts/vsts/member_entitlement_management/v4_0/__init__.py diff --git a/vsts/vsts/member_entitlement_management/v4_0/member_entitlement_management_client.py b/vsts/vsts/member_entitlement_management/v4_0/member_entitlement_management_client.py new file mode 100644 index 00000000..7ec671d1 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/member_entitlement_management_client.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...vss_client import VssClient +from . import models + + +class MemberEntitlementManagementClient(VssClient): + """MemberEntitlementManagement + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(MemberEntitlementManagementClient, self).__init__(base_url, creds) + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + resource_area_identifier = None + + def add_group_entitlement(self, group_entitlement, rule_option=None): + """AddGroupEntitlement. + [Preview API] Used to add members to a project in an account. It adds them to groups, assigns licenses, and assigns extensions. + :param :class:` ` group_entitlement: Member model for where to add the member and what licenses and extensions they should receive. + :param str rule_option: + :rtype: :class:` ` + """ + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + content = self._serialize.body(group_entitlement, 'GroupEntitlement') + response = self._send(http_method='POST', + location_id='ec7fb08f-5dcc-481c-9bf6-122001b1caa6', + version='4.0-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('GroupEntitlementOperationReference', response) + + def delete_group_entitlement(self, group_id, rule_option=None): + """DeleteGroupEntitlement. + [Preview API] Deletes members from an account + :param str group_id: memberId of the member to be removed. + :param str rule_option: + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + response = self._send(http_method='DELETE', + location_id='ec7fb08f-5dcc-481c-9bf6-122001b1caa6', + version='4.0-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlement(self, group_id): + """GetGroupEntitlement. + [Preview API] Used to get a group entitlement and its current rules + :param str group_id: + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + response = self._send(http_method='GET', + location_id='ec7fb08f-5dcc-481c-9bf6-122001b1caa6', + version='4.0-preview.1', + route_values=route_values) + return self._deserialize('GroupEntitlement', response) + + def get_group_entitlements(self): + """GetGroupEntitlements. + [Preview API] Used to get group entitlement information in an account + :rtype: [GroupEntitlement] + """ + response = self._send(http_method='GET', + location_id='ec7fb08f-5dcc-481c-9bf6-122001b1caa6', + version='4.0-preview.1', + returns_collection=True) + return self._deserialize('[GroupEntitlement]', response) + + def update_group_entitlement(self, document, group_id, rule_option=None): + """UpdateGroupEntitlement. + [Preview API] Used to edit a member in an account. Edits groups, licenses, and extensions. + :param :class:`<[JsonPatchOperation]> ` document: document of operations to be used + :param str group_id: member Id of the member to be edit + :param str rule_option: + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='ec7fb08f-5dcc-481c-9bf6-122001b1caa6', + version='4.0-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('GroupEntitlementOperationReference', response) + + def add_member_entitlement(self, member_entitlement): + """AddMemberEntitlement. + [Preview API] Used to add members to a project in an account. It adds them to project groups, assigns licenses, and assigns extensions. + :param :class:` ` member_entitlement: Member model for where to add the member and what licenses and extensions they should receive. + :rtype: :class:` ` + """ + content = self._serialize.body(member_entitlement, 'MemberEntitlement') + response = self._send(http_method='POST', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + content=content) + return self._deserialize('MemberEntitlementsPostResponse', response) + + def delete_member_entitlement(self, member_id): + """DeleteMemberEntitlement. + [Preview API] Deletes members from an account + :param str member_id: memberId of the member to be removed. + """ + route_values = {} + if member_id is not None: + route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') + self._send(http_method='DELETE', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + route_values=route_values) + + def get_member_entitlement(self, member_id): + """GetMemberEntitlement. + [Preview API] Used to get member entitlement information in an account + :param str member_id: + :rtype: :class:` ` + """ + route_values = {} + if member_id is not None: + route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') + response = self._send(http_method='GET', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + route_values=route_values) + return self._deserialize('MemberEntitlement', response) + + def get_member_entitlements(self, top, skip, filter=None, select=None): + """GetMemberEntitlements. + [Preview API] Used to get member entitlement information in an account + :param int top: + :param int skip: + :param str filter: + :param str select: + :rtype: [MemberEntitlement] + """ + query_parameters = {} + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + if filter is not None: + query_parameters['filter'] = self._serialize.query('filter', filter, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + response = self._send(http_method='GET', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[MemberEntitlement]', response) + + def update_member_entitlement(self, document, member_id): + """UpdateMemberEntitlement. + [Preview API] Used to edit a member in an account. Edits groups, licenses, and extensions. + :param :class:`<[JsonPatchOperation]> ` document: document of operations to be used + :param str member_id: member Id of the member to be edit + :rtype: :class:` ` + """ + route_values = {} + if member_id is not None: + route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('MemberEntitlementsPatchResponse', response) + + def update_member_entitlements(self, document): + """UpdateMemberEntitlements. + [Preview API] Used to edit multiple members in an account. Edits groups, licenses, and extensions. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatch document + :rtype: :class:` ` + """ + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='1e8cabfb-1fda-461e-860f-eeeae54d06bb', + version='4.0-preview.1', + content=content, + media_type='application/json-patch+json') + return self._deserialize('MemberEntitlementOperationReference', response) + diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/__init__.py b/vsts/vsts/member_entitlement_management/v4_0/models/__init__.py new file mode 100644 index 00000000..1499c62b --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/__init__.py @@ -0,0 +1,55 @@ +# -------------------------------------------------------------------------------------------- +# 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 .access_level import AccessLevel +from .base_operation_result import BaseOperationResult +from .extension import Extension +from .graph_group import GraphGroup +from .graph_member import GraphMember +from .graph_subject import GraphSubject +from .group import Group +from .group_entitlement import GroupEntitlement +from .group_entitlement_operation_reference import GroupEntitlementOperationReference +from .group_operation_result import GroupOperationResult +from .json_patch_operation import JsonPatchOperation +from .member_entitlement import MemberEntitlement +from .member_entitlement_operation_reference import MemberEntitlementOperationReference +from .member_entitlements_patch_response import MemberEntitlementsPatchResponse +from .member_entitlements_post_response import MemberEntitlementsPostResponse +from .member_entitlements_response_base import MemberEntitlementsResponseBase +from .operation_reference import OperationReference +from .operation_result import OperationResult +from .project_entitlement import ProjectEntitlement +from .project_ref import ProjectRef +from .reference_links import ReferenceLinks +from .team_ref import TeamRef + +__all__ = [ + 'AccessLevel', + 'BaseOperationResult', + 'Extension', + 'GraphGroup', + 'GraphMember', + 'GraphSubject', + 'Group', + 'GroupEntitlement', + 'GroupEntitlementOperationReference', + 'GroupOperationResult', + 'JsonPatchOperation', + 'MemberEntitlement', + 'MemberEntitlementOperationReference', + 'MemberEntitlementsPatchResponse', + 'MemberEntitlementsPostResponse', + 'MemberEntitlementsResponseBase', + 'OperationReference', + 'OperationResult', + 'ProjectEntitlement', + 'ProjectRef', + 'ReferenceLinks', + 'TeamRef', +] diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/access_level.py b/vsts/vsts/member_entitlement_management/v4_0/models/access_level.py new file mode 100644 index 00000000..90488c17 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/access_level.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 AccessLevel(Model): + """AccessLevel. + + :param account_license_type: + :type account_license_type: object + :param assignment_source: + :type assignment_source: object + :param license_display_name: + :type license_display_name: str + :param licensing_source: + :type licensing_source: object + :param msdn_license_type: + :type msdn_license_type: object + :param status: + :type status: object + :param status_message: + :type status_message: str + """ + + _attribute_map = { + 'account_license_type': {'key': 'accountLicenseType', 'type': 'object'}, + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'license_display_name': {'key': 'licenseDisplayName', 'type': 'str'}, + 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, + 'msdn_license_type': {'key': 'msdnLicenseType', 'type': 'object'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'} + } + + def __init__(self, account_license_type=None, assignment_source=None, license_display_name=None, licensing_source=None, msdn_license_type=None, status=None, status_message=None): + super(AccessLevel, self).__init__() + self.account_license_type = account_license_type + self.assignment_source = assignment_source + self.license_display_name = license_display_name + self.licensing_source = licensing_source + self.msdn_license_type = msdn_license_type + self.status = status + self.status_message = status_message diff --git a/vsts/vsts/user/v4_1/models/mail_confirmation_parameters.py b/vsts/vsts/member_entitlement_management/v4_0/models/base_operation_result.py similarity index 50% rename from vsts/vsts/user/v4_1/models/mail_confirmation_parameters.py rename to vsts/vsts/member_entitlement_management/v4_0/models/base_operation_result.py index a8c07359..843f13fc 100644 --- a/vsts/vsts/user/v4_1/models/mail_confirmation_parameters.py +++ b/vsts/vsts/member_entitlement_management/v4_0/models/base_operation_result.py @@ -9,21 +9,21 @@ from msrest.serialization import Model -class MailConfirmationParameters(Model): - """MailConfirmationParameters. +class BaseOperationResult(Model): + """BaseOperationResult. - :param challenge_code: The unique code that proves ownership of the email address. - :type challenge_code: str - :param mail_address: The email address to be confirmed. - :type mail_address: str + :param errors: List of error codes paired with their corresponding error messages + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation + :type is_success: bool """ _attribute_map = { - 'challenge_code': {'key': 'challengeCode', 'type': 'str'}, - 'mail_address': {'key': 'mailAddress', 'type': 'str'} + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'} } - def __init__(self, challenge_code=None, mail_address=None): - super(MailConfirmationParameters, self).__init__() - self.challenge_code = challenge_code - self.mail_address = mail_address + def __init__(self, errors=None, is_success=None): + super(BaseOperationResult, self).__init__() + self.errors = errors + self.is_success = is_success diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/extension.py b/vsts/vsts/member_entitlement_management/v4_0/models/extension.py new file mode 100644 index 00000000..8d037ee6 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/extension.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 Extension(Model): + """Extension. + + :param assignment_source: Assignment source for this extension. I.e. explicitly assigned or from a group rule + :type assignment_source: object + :param id: Gallery Id of the Extension + :type id: str + :param name: Friendly name of this extension + :type name: str + :param source: Source of this extension assignment. Ex: msdn, account, none, ect. + :type source: object + """ + + _attribute_map = { + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'object'} + } + + def __init__(self, assignment_source=None, id=None, name=None, source=None): + super(Extension, self).__init__() + self.assignment_source = assignment_source + self.id = id + self.name = name + self.source = source diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/graph_group.py b/vsts/vsts/member_entitlement_management/v4_0/models/graph_group.py new file mode 100644 index 00000000..babb06a7 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/graph_group.py @@ -0,0 +1,55 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_member import GraphMember + + +class GraphGroup(GraphMember): + """GraphGroup. + + :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 origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + :param url: This url is the full route to the source resource of this graph subject. + :type url: str + :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the name of the directory, for Vsts groups the ScopeId, etc) + :type domain: str + :param mail_address: The email address of record for a given graph member. This may be different than the principal name. + :type mail_address: str + :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by Vsts. + :type principal_name: str + :param description: A short phrase to help human readers disambiguate groups with similar names + :type description: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'mail_address': {'key': 'mailAddress', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, origin=None, origin_id=None, subject_kind=None, url=None, domain=None, mail_address=None, principal_name=None, description=None): + super(GraphGroup, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, origin=origin, origin_id=origin_id, subject_kind=subject_kind, url=url, domain=domain, mail_address=mail_address, principal_name=principal_name) + self.description = description diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/graph_member.py b/vsts/vsts/member_entitlement_management/v4_0/models/graph_member.py new file mode 100644 index 00000000..fb9dc497 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/graph_member.py @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_subject import GraphSubject + + +class GraphMember(GraphSubject): + """GraphMember. + + :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 origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + :param url: This url is the full route to the source resource of this graph subject. + :type url: str + :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the name of the directory, for Vsts groups the ScopeId, etc) + :type domain: str + :param mail_address: The email address of record for a given graph member. This may be different than the principal name. + :type mail_address: str + :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by Vsts. + :type principal_name: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'mail_address': {'key': 'mailAddress', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, origin=None, origin_id=None, subject_kind=None, url=None, domain=None, mail_address=None, principal_name=None): + super(GraphMember, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, origin=origin, origin_id=origin_id, subject_kind=subject_kind, url=url) + self.domain = domain + self.mail_address = mail_address + self.principal_name = principal_name diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/graph_subject.py b/vsts/vsts/member_entitlement_management/v4_0/models/graph_subject.py new file mode 100644 index 00000000..f970efd0 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/graph_subject.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 GraphSubject(Model): + """GraphSubject. + + :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 origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: 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'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, origin=None, origin_id=None, subject_kind=None, url=None): + super(GraphSubject, self).__init__() + self._links = _links + self.descriptor = descriptor + self.display_name = display_name + self.origin = origin + self.origin_id = origin_id + self.subject_kind = subject_kind + self.url = url diff --git a/vsts/vsts/user/v4_1/models/user_notification.py b/vsts/vsts/member_entitlement_management/v4_0/models/group.py similarity index 53% rename from vsts/vsts/user/v4_1/models/user_notification.py rename to vsts/vsts/member_entitlement_management/v4_0/models/group.py index aeddef33..a8f1a156 100644 --- a/vsts/vsts/user/v4_1/models/user_notification.py +++ b/vsts/vsts/member_entitlement_management/v4_0/models/group.py @@ -9,21 +9,21 @@ from msrest.serialization import Model -class UserNotification(Model): - """UserNotification. +class Group(Model): + """Group. - :param event_id: Unique notification id (must be idempotent) - :type event_id: str - :param time_stamp: Time at which notification was posted (must be idempotent) - :type time_stamp: datetime + :param display_name: + :type display_name: str + :param group_type: + :type group_type: object """ _attribute_map = { - 'event_id': {'key': 'eventId', 'type': 'str'}, - 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'} + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'group_type': {'key': 'groupType', 'type': 'object'} } - def __init__(self, event_id=None, time_stamp=None): - super(UserNotification, self).__init__() - self.event_id = event_id - self.time_stamp = time_stamp + def __init__(self, display_name=None, group_type=None): + super(Group, self).__init__() + self.display_name = display_name + self.group_type = group_type diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement.py b/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement.py new file mode 100644 index 00000000..8d663451 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement.py @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------------------------- +# 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 GroupEntitlement(Model): + """GroupEntitlement. + + :param extension_rules: Extension Rules + :type extension_rules: list of :class:`Extension ` + :param group: Member reference + :type group: :class:`GraphGroup ` + :param id: The unique identifier which matches the Id of the GraphMember + :type id: str + :param license_rule: License Rule + :type license_rule: :class:`AccessLevel ` + :param project_entitlements: Relation between a project and the member's effective permissions in that project + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param status: + :type status: object + """ + + _attribute_map = { + 'extension_rules': {'key': 'extensionRules', 'type': '[Extension]'}, + 'group': {'key': 'group', 'type': 'GraphGroup'}, + 'id': {'key': 'id', 'type': 'str'}, + 'license_rule': {'key': 'licenseRule', 'type': 'AccessLevel'}, + 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, extension_rules=None, group=None, id=None, license_rule=None, project_entitlements=None, status=None): + super(GroupEntitlement, self).__init__() + self.extension_rules = extension_rules + self.group = group + self.id = id + self.license_rule = license_rule + self.project_entitlements = project_entitlements + self.status = status diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement_operation_reference.py b/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement_operation_reference.py new file mode 100644 index 00000000..6a348095 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/group_entitlement_operation_reference.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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 .operation_reference import OperationReference + + +class GroupEntitlementOperationReference(OperationReference): + """GroupEntitlementOperationReference. + + :param id: The identifier for this operation. + :type id: str + :param status: The current status of the operation. + :type status: object + :param url: Url to get the full object. + :type url: str + :param completed: Operation completed with success or failure + :type completed: bool + :param have_results_succeeded: True if all operations were successful + :type have_results_succeeded: bool + :param results: List of results for each operation + :type results: list of :class:`GroupOperationResult ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[GroupOperationResult]'} + } + + def __init__(self, id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(GroupEntitlementOperationReference, self).__init__(id=id, status=status, url=url) + self.completed = completed + self.have_results_succeeded = have_results_succeeded + self.results = results diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/group_operation_result.py b/vsts/vsts/member_entitlement_management/v4_0/models/group_operation_result.py new file mode 100644 index 00000000..b3e2adab --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/group_operation_result.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# 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 .base_operation_result import BaseOperationResult + + +class GroupOperationResult(BaseOperationResult): + """GroupOperationResult. + + :param errors: List of error codes paired with their corresponding error messages + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation + :type is_success: bool + :param group_id: Identifier of the Group being acted upon + :type group_id: str + :param result: Result of the Groupentitlement after the operation + :type result: :class:`GroupEntitlement ` + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'GroupEntitlement'} + } + + def __init__(self, errors=None, is_success=None, group_id=None, result=None): + super(GroupOperationResult, self).__init__(errors=errors, is_success=is_success) + self.group_id = group_id + self.result = result diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/json_patch_operation.py b/vsts/vsts/member_entitlement_management/v4_0/models/json_patch_operation.py new file mode 100644 index 00000000..7d45b0f6 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/json_patch_operation.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 JsonPatchOperation(Model): + """JsonPatchOperation. + + :param from_: The path to copy from for the Move/Copy operation. + :type from_: str + :param op: The patch operation + :type op: object + :param path: The path for the operation + :type path: str + :param value: The value for the operation. This is either a primitive or a JToken. + :type value: object + """ + + _attribute_map = { + 'from_': {'key': 'from', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'object'}, + 'path': {'key': 'path', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'} + } + + def __init__(self, from_=None, op=None, path=None, value=None): + super(JsonPatchOperation, self).__init__() + self.from_ = from_ + self.op = op + self.path = path + self.value = value diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement.py b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement.py new file mode 100644 index 00000000..7a1ec3c7 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 MemberEntitlement(Model): + """MemberEntitlement. + + :param access_level: Member's access level denoted by a license + :type access_level: :class:`AccessLevel ` + :param extensions: Member's extensions + :type extensions: list of :class:`Extension ` + :param group_assignments: GroupEntitlements that this member belongs to + :type group_assignments: list of :class:`GroupEntitlement ` + :param id: The unique identifier which matches the Id of the GraphMember + :type id: str + :param last_accessed_date: Date the Member last access the collection + :type last_accessed_date: datetime + :param member: Member reference + :type member: :class:`GraphMember ` + :param project_entitlements: Relation between a project and the member's effective permissions in that project + :type project_entitlements: list of :class:`ProjectEntitlement ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'extensions': {'key': 'extensions', 'type': '[Extension]'}, + 'group_assignments': {'key': 'groupAssignments', 'type': '[GroupEntitlement]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'member': {'key': 'member', 'type': 'GraphMember'}, + 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'} + } + + def __init__(self, access_level=None, extensions=None, group_assignments=None, id=None, last_accessed_date=None, member=None, project_entitlements=None): + super(MemberEntitlement, self).__init__() + self.access_level = access_level + self.extensions = extensions + self.group_assignments = group_assignments + self.id = id + self.last_accessed_date = last_accessed_date + self.member = member + self.project_entitlements = project_entitlements diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement_operation_reference.py b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement_operation_reference.py new file mode 100644 index 00000000..50ba8021 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlement_operation_reference.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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 .operation_reference import OperationReference + + +class MemberEntitlementOperationReference(OperationReference): + """MemberEntitlementOperationReference. + + :param id: The identifier for this operation. + :type id: str + :param status: The current status of the operation. + :type status: object + :param url: Url to get the full object. + :type url: str + :param completed: Operation completed with success or failure + :type completed: bool + :param have_results_succeeded: True if all operations were successful + :type have_results_succeeded: bool + :param results: List of results for each operation + :type results: list of :class:`OperationResult ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[OperationResult]'} + } + + def __init__(self, id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(MemberEntitlementOperationReference, self).__init__(id=id, status=status, url=url) + self.completed = completed + self.have_results_succeeded = have_results_succeeded + self.results = results diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_patch_response.py b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_patch_response.py new file mode 100644 index 00000000..d95b35cc --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_patch_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .member_entitlements_response_base import MemberEntitlementsResponseBase + + +class MemberEntitlementsPatchResponse(MemberEntitlementsResponseBase): + """MemberEntitlementsPatchResponse. + + :param is_success: True if all operations were successful + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations have been applied + :type member_entitlement: :class:`MemberEntitlement ` + :param operation_results: List of results for each operation + :type operation_results: list of :class:`OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, + 'operation_results': {'key': 'operationResults', 'type': '[OperationResult]'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_results=None): + super(MemberEntitlementsPatchResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_results = operation_results diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_post_response.py b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_post_response.py new file mode 100644 index 00000000..c4c1f122 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_post_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .member_entitlements_response_base import MemberEntitlementsResponseBase + + +class MemberEntitlementsPostResponse(MemberEntitlementsResponseBase): + """MemberEntitlementsPostResponse. + + :param is_success: True if all operations were successful + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations have been applied + :type member_entitlement: :class:`MemberEntitlement ` + :param operation_result: Operation result + :type operation_result: :class:`OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, + 'operation_result': {'key': 'operationResult', 'type': 'OperationResult'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_result=None): + super(MemberEntitlementsPostResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_result = operation_result diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_response_base.py b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_response_base.py new file mode 100644 index 00000000..ba588156 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/member_entitlements_response_base.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 MemberEntitlementsResponseBase(Model): + """MemberEntitlementsResponseBase. + + :param is_success: True if all operations were successful + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations have been applied + :type member_entitlement: :class:`MemberEntitlement ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'} + } + + def __init__(self, is_success=None, member_entitlement=None): + super(MemberEntitlementsResponseBase, self).__init__() + self.is_success = is_success + self.member_entitlement = member_entitlement diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/operation_reference.py b/vsts/vsts/member_entitlement_management/v4_0/models/operation_reference.py new file mode 100644 index 00000000..fb73a6c6 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/operation_reference.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# 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 OperationReference(Model): + """OperationReference. + + :param id: The identifier for this operation. + :type id: str + :param status: The current status of the operation. + :type status: object + :param url: Url to get the full object. + :type url: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, id=None, status=None, url=None): + super(OperationReference, self).__init__() + self.id = id + self.status = status + self.url = url diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/operation_result.py b/vsts/vsts/member_entitlement_management/v4_0/models/operation_result.py new file mode 100644 index 00000000..59f1744f --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/operation_result.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 OperationResult(Model): + """OperationResult. + + :param errors: List of error codes paired with their corresponding error messages + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation + :type is_success: bool + :param member_id: Identifier of the Member being acted upon + :type member_id: str + :param result: Result of the MemberEntitlement after the operation + :type result: :class:`MemberEntitlement ` + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_id': {'key': 'memberId', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'MemberEntitlement'} + } + + def __init__(self, errors=None, is_success=None, member_id=None, result=None): + super(OperationResult, self).__init__() + self.errors = errors + self.is_success = is_success + self.member_id = member_id + self.result = result diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/project_entitlement.py b/vsts/vsts/member_entitlement_management/v4_0/models/project_entitlement.py new file mode 100644 index 00000000..ceb1ae33 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/project_entitlement.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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 ProjectEntitlement(Model): + """ProjectEntitlement. + + :param assignment_source: + :type assignment_source: object + :param group: + :type group: :class:`Group ` + :param is_project_permission_inherited: + :type is_project_permission_inherited: bool + :param project_ref: + :type project_ref: :class:`ProjectRef ` + :param team_refs: + :type team_refs: list of :class:`TeamRef ` + """ + + _attribute_map = { + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'group': {'key': 'group', 'type': 'Group'}, + 'is_project_permission_inherited': {'key': 'isProjectPermissionInherited', 'type': 'bool'}, + 'project_ref': {'key': 'projectRef', 'type': 'ProjectRef'}, + 'team_refs': {'key': 'teamRefs', 'type': '[TeamRef]'} + } + + def __init__(self, assignment_source=None, group=None, is_project_permission_inherited=None, project_ref=None, team_refs=None): + super(ProjectEntitlement, self).__init__() + self.assignment_source = assignment_source + self.group = group + self.is_project_permission_inherited = is_project_permission_inherited + self.project_ref = project_ref + self.team_refs = team_refs diff --git a/vsts/vsts/user/v4_1/models/update_user_parameters.py b/vsts/vsts/member_entitlement_management/v4_0/models/project_ref.py similarity index 60% rename from vsts/vsts/user/v4_1/models/update_user_parameters.py rename to vsts/vsts/member_entitlement_management/v4_0/models/project_ref.py index 5726e001..847ba331 100644 --- a/vsts/vsts/user/v4_1/models/update_user_parameters.py +++ b/vsts/vsts/member_entitlement_management/v4_0/models/project_ref.py @@ -9,17 +9,21 @@ from msrest.serialization import Model -class UpdateUserParameters(Model): - """UpdateUserParameters. +class ProjectRef(Model): + """ProjectRef. - :param properties: The collection of properties to set. See "User" for valid fields. - :type properties: :class:`object ` + :param id: + :type id: str + :param name: + :type name: str """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'object'} + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} } - def __init__(self, properties=None): - super(UpdateUserParameters, self).__init__() - self.properties = properties + def __init__(self, id=None, name=None): + super(ProjectRef, self).__init__() + self.id = id + self.name = name diff --git a/vsts/vsts/user/v4_1/models/reference_links.py b/vsts/vsts/member_entitlement_management/v4_0/models/reference_links.py similarity index 100% rename from vsts/vsts/user/v4_1/models/reference_links.py rename to vsts/vsts/member_entitlement_management/v4_0/models/reference_links.py diff --git a/vsts/vsts/member_entitlement_management/v4_0/models/team_ref.py b/vsts/vsts/member_entitlement_management/v4_0/models/team_ref.py new file mode 100644 index 00000000..2e6a6e36 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_0/models/team_ref.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 TeamRef(Model): + """TeamRef. + + :param id: + :type id: str + :param name: + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TeamRef, self).__init__() + self.id = id + self.name = name diff --git a/vsts/vsts/member_entitlement_management/v4_1/__init__.py b/vsts/vsts/member_entitlement_management/v4_1/__init__.py new file mode 100644 index 00000000..b19525a6 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------------------------- diff --git a/vsts/vsts/member_entitlement_management/v4_1/member_entitlement_management_client.py b/vsts/vsts/member_entitlement_management/v4_1/member_entitlement_management_client.py new file mode 100644 index 00000000..4cb97035 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/member_entitlement_management_client.py @@ -0,0 +1,292 @@ +# -------------------------------------------------------------------------------------------- +# 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 ...vss_client import VssClient +from . import models + + +class MemberEntitlementManagementClient(VssClient): + """MemberEntitlementManagement + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(MemberEntitlementManagementClient, self).__init__(base_url, creds) + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + resource_area_identifier = None + + def add_group_entitlement(self, group_entitlement, rule_option=None): + """AddGroupEntitlement. + [Preview API] Create a group entitlement with license rule, extension rule. + :param :class:` ` group_entitlement: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups + :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be created and applied to it’s members (default option) or just be tested + :rtype: :class:` ` + """ + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + content = self._serialize.body(group_entitlement, 'GroupEntitlement') + response = self._send(http_method='POST', + location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', + version='4.1-preview.1', + query_parameters=query_parameters, + content=content) + return self._deserialize('GroupEntitlementOperationReference', response) + + def delete_group_entitlement(self, group_id, rule_option=None, remove_group_membership=None): + """DeleteGroupEntitlement. + [Preview API] Delete a group entitlement. + :param str group_id: ID of the group to delete. + :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be deleted and the changes are applied to it’s members (default option) or just be tested + :param bool remove_group_membership: Optional parameter that specifies whether the group with the given ID should be removed from all other groups + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + if remove_group_membership is not None: + query_parameters['removeGroupMembership'] = self._serialize.query('remove_group_membership', remove_group_membership, 'bool') + response = self._send(http_method='DELETE', + location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('GroupEntitlementOperationReference', response) + + def get_group_entitlement(self, group_id): + """GetGroupEntitlement. + [Preview API] Get a group entitlement. + :param str group_id: ID of the group. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + response = self._send(http_method='GET', + location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', + version='4.1-preview.1', + route_values=route_values) + return self._deserialize('GroupEntitlement', response) + + def get_group_entitlements(self): + """GetGroupEntitlements. + [Preview API] Get the group entitlements for an account. + :rtype: [GroupEntitlement] + """ + response = self._send(http_method='GET', + location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', + version='4.1-preview.1', + returns_collection=True) + return self._deserialize('[GroupEntitlement]', response) + + def update_group_entitlement(self, document, group_id, rule_option=None): + """UpdateGroupEntitlement. + [Preview API] Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the group. + :param str group_id: ID of the group. + :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be updated and the changes are applied to it’s members (default option) or just be tested + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if rule_option is not None: + query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('GroupEntitlementOperationReference', response) + + def add_member_to_group(self, group_id, member_id): + """AddMemberToGroup. + [Preview API] Add a member to a Group. + :param str group_id: Id of the Group. + :param str member_id: Id of the member to add. + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + if member_id is not None: + route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') + self._send(http_method='PUT', + location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', + version='4.1-preview.1', + route_values=route_values) + + def get_group_members(self, group_id, max_results=None, paging_token=None): + """GetGroupMembers. + [Preview API] Get direct members of a Group. + :param str group_id: Id of the Group. + :param int max_results: Maximum number of results to retrieve. + :param str paging_token: Paging Token from the previous page fetched. If the 'pagingToken' is null, the results would be fetched from the begining of the Members List. + :rtype: :class:` ` + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + query_parameters = {} + if max_results is not None: + query_parameters['maxResults'] = self._serialize.query('max_results', max_results, 'int') + if paging_token is not None: + query_parameters['pagingToken'] = self._serialize.query('paging_token', paging_token, 'str') + response = self._send(http_method='GET', + location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', + version='4.1-preview.1', + route_values=route_values, + query_parameters=query_parameters) + return self._deserialize('PagedGraphMemberList', response) + + def remove_member_from_group(self, group_id, member_id): + """RemoveMemberFromGroup. + [Preview API] Remove a member from a Group. + :param str group_id: Id of the group. + :param str member_id: Id of the member to remove. + """ + route_values = {} + if group_id is not None: + route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') + if member_id is not None: + route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') + self._send(http_method='DELETE', + location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', + version='4.1-preview.1', + route_values=route_values) + + def add_user_entitlement(self, user_entitlement): + """AddUserEntitlement. + [Preview API] Add a user, assign license and extensions and make them a member of a project group in an account. + :param :class:` ` user_entitlement: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to. + :rtype: :class:` ` + """ + content = self._serialize.body(user_entitlement, 'UserEntitlement') + response = self._send(http_method='POST', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='4.1-preview.1', + content=content) + return self._deserialize('UserEntitlementsPostResponse', response) + + def get_user_entitlements(self, top=None, skip=None, filter=None, select=None): + """GetUserEntitlements. + [Preview API] Get a paged set of user entitlements matching the filter criteria. If no filter is is passed, a page from all the account users is returned. + :param int top: Maximum number of the user entitlements to return. Max value is 10000. Default value is 100 + :param int skip: Offset: Number of records to skip. Default value is 0 + :param str filter: Comma (",") separated list of properties and their values to filter on. Currently, the API only supports filtering by ExtensionId. An example parameter would be filter=extensionId eq search. + :param str select: Comma (",") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'. + :rtype: [UserEntitlement] + """ + query_parameters = {} + if top is not None: + query_parameters['top'] = self._serialize.query('top', top, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query('skip', skip, 'int') + if filter is not None: + query_parameters['filter'] = self._serialize.query('filter', filter, 'str') + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + response = self._send(http_method='GET', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='4.1-preview.1', + query_parameters=query_parameters, + returns_collection=True) + return self._deserialize('[UserEntitlement]', response) + + def update_user_entitlements(self, document, do_not_send_invite_for_new_users=None): + """UpdateUserEntitlements. + [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more users. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform. + :param bool do_not_send_invite_for_new_users: Whether to send email invites to new users or not + :rtype: :class:` ` + """ + query_parameters = {} + if do_not_send_invite_for_new_users is not None: + query_parameters['doNotSendInviteForNewUsers'] = self._serialize.query('do_not_send_invite_for_new_users', do_not_send_invite_for_new_users, 'bool') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', + version='4.1-preview.1', + query_parameters=query_parameters, + content=content, + media_type='application/json-patch+json') + return self._deserialize('UserEntitlementOperationReference', response) + + def delete_user_entitlement(self, user_id): + """DeleteUserEntitlement. + [Preview API] Delete a user from the account. + :param str user_id: ID of the user. + """ + route_values = {} + if user_id is not None: + route_values['userId'] = self._serialize.url('user_id', user_id, 'str') + self._send(http_method='DELETE', + location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', + version='4.1-preview.1', + route_values=route_values) + + def get_user_entitlement(self, user_id): + """GetUserEntitlement. + [Preview API] Get User Entitlement for a user. + :param str user_id: ID of the user. + :rtype: :class:` ` + """ + route_values = {} + if user_id is not None: + route_values['userId'] = self._serialize.url('user_id', user_id, 'str') + response = self._send(http_method='GET', + location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', + version='4.1-preview.1', + route_values=route_values) + return self._deserialize('UserEntitlement', response) + + def update_user_entitlement(self, document, user_id): + """UpdateUserEntitlement. + [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. + :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the user. + :param str user_id: ID of the user. + :rtype: :class:` ` + """ + route_values = {} + if user_id is not None: + route_values['userId'] = self._serialize.url('user_id', user_id, 'str') + content = self._serialize.body(document, '[JsonPatchOperation]') + response = self._send(http_method='PATCH', + location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', + version='4.1-preview.1', + route_values=route_values, + content=content, + media_type='application/json-patch+json') + return self._deserialize('UserEntitlementsPatchResponse', response) + + def get_users_summary(self, select=None): + """GetUsersSummary. + [Preview API] Get summary of Licenses, Extension, Projects, Groups and their assignments in the collection. + :param str select: Comma (",") separated list of properties to select. Supported property names are {AccessLevels, Licenses, Extensions, Projects, Groups}. + :rtype: :class:` ` + """ + query_parameters = {} + if select is not None: + query_parameters['select'] = self._serialize.query('select', select, 'str') + response = self._send(http_method='GET', + location_id='5ae55b13-c9dd-49d1-957e-6e76c152e3d9', + version='4.1-preview.1', + query_parameters=query_parameters) + return self._deserialize('UsersSummary', response) + diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/__init__.py b/vsts/vsts/member_entitlement_management/v4_1/models/__init__.py new file mode 100644 index 00000000..97f1a285 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/__init__.py @@ -0,0 +1,83 @@ +# -------------------------------------------------------------------------------------------- +# 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 .access_level import AccessLevel +from .base_operation_result import BaseOperationResult +from .extension import Extension +from .extension_summary_data import ExtensionSummaryData +from .graph_group import GraphGroup +from .graph_member import GraphMember +from .graph_subject import GraphSubject +from .graph_subject_base import GraphSubjectBase +from .graph_user import GraphUser +from .group import Group +from .group_entitlement import GroupEntitlement +from .group_entitlement_operation_reference import GroupEntitlementOperationReference +from .group_operation_result import GroupOperationResult +from .group_option import GroupOption +from .json_patch_operation import JsonPatchOperation +from .license_summary_data import LicenseSummaryData +from .member_entitlement import MemberEntitlement +from .member_entitlement_operation_reference import MemberEntitlementOperationReference +from .member_entitlements_patch_response import MemberEntitlementsPatchResponse +from .member_entitlements_post_response import MemberEntitlementsPostResponse +from .member_entitlements_response_base import MemberEntitlementsResponseBase +from .operation_reference import OperationReference +from .operation_result import OperationResult +from .paged_graph_member_list import PagedGraphMemberList +from .project_entitlement import ProjectEntitlement +from .project_ref import ProjectRef +from .reference_links import ReferenceLinks +from .summary_data import SummaryData +from .team_ref import TeamRef +from .user_entitlement import UserEntitlement +from .user_entitlement_operation_reference import UserEntitlementOperationReference +from .user_entitlement_operation_result import UserEntitlementOperationResult +from .user_entitlements_patch_response import UserEntitlementsPatchResponse +from .user_entitlements_post_response import UserEntitlementsPostResponse +from .user_entitlements_response_base import UserEntitlementsResponseBase +from .users_summary import UsersSummary + +__all__ = [ + 'AccessLevel', + 'BaseOperationResult', + 'Extension', + 'ExtensionSummaryData', + 'GraphGroup', + 'GraphMember', + 'GraphSubject', + 'GraphSubjectBase', + 'GraphUser', + 'Group', + 'GroupEntitlement', + 'GroupEntitlementOperationReference', + 'GroupOperationResult', + 'GroupOption', + 'JsonPatchOperation', + 'LicenseSummaryData', + 'MemberEntitlement', + 'MemberEntitlementOperationReference', + 'MemberEntitlementsPatchResponse', + 'MemberEntitlementsPostResponse', + 'MemberEntitlementsResponseBase', + 'OperationReference', + 'OperationResult', + 'PagedGraphMemberList', + 'ProjectEntitlement', + 'ProjectRef', + 'ReferenceLinks', + 'SummaryData', + 'TeamRef', + 'UserEntitlement', + 'UserEntitlementOperationReference', + 'UserEntitlementOperationResult', + 'UserEntitlementsPatchResponse', + 'UserEntitlementsPostResponse', + 'UserEntitlementsResponseBase', + 'UsersSummary', +] diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/access_level.py b/vsts/vsts/member_entitlement_management/v4_1/models/access_level.py new file mode 100644 index 00000000..827a40c0 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/access_level.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 AccessLevel(Model): + """AccessLevel. + + :param account_license_type: Type of Account License (e.g. Express, Stakeholder etc.) + :type account_license_type: object + :param assignment_source: Assignment Source of the License (e.g. Group, Unknown etc. + :type assignment_source: object + :param license_display_name: Display name of the License + :type license_display_name: str + :param licensing_source: Licensing Source (e.g. Account. MSDN etc.) + :type licensing_source: object + :param msdn_license_type: Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.) + :type msdn_license_type: object + :param status: User status in the account + :type status: object + :param status_message: Status message. + :type status_message: str + """ + + _attribute_map = { + 'account_license_type': {'key': 'accountLicenseType', 'type': 'object'}, + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'license_display_name': {'key': 'licenseDisplayName', 'type': 'str'}, + 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, + 'msdn_license_type': {'key': 'msdnLicenseType', 'type': 'object'}, + 'status': {'key': 'status', 'type': 'object'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'} + } + + def __init__(self, account_license_type=None, assignment_source=None, license_display_name=None, licensing_source=None, msdn_license_type=None, status=None, status_message=None): + super(AccessLevel, self).__init__() + self.account_license_type = account_license_type + self.assignment_source = assignment_source + self.license_display_name = license_display_name + self.licensing_source = licensing_source + self.msdn_license_type = msdn_license_type + self.status = status + self.status_message = status_message diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/base_operation_result.py b/vsts/vsts/member_entitlement_management/v4_1/models/base_operation_result.py new file mode 100644 index 00000000..843f13fc --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/base_operation_result.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 BaseOperationResult(Model): + """BaseOperationResult. + + :param errors: List of error codes paired with their corresponding error messages + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation + :type is_success: bool + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'} + } + + def __init__(self, errors=None, is_success=None): + super(BaseOperationResult, self).__init__() + self.errors = errors + self.is_success = is_success diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/extension.py b/vsts/vsts/member_entitlement_management/v4_1/models/extension.py new file mode 100644 index 00000000..6d1963cf --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/extension.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 Extension(Model): + """Extension. + + :param assignment_source: Assignment source for this extension. I.e. explicitly assigned or from a group rule. + :type assignment_source: object + :param id: Gallery Id of the Extension. + :type id: str + :param name: Friendly name of this extension. + :type name: str + :param source: Source of this extension assignment. Ex: msdn, account, none, etc. + :type source: object + """ + + _attribute_map = { + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'object'} + } + + def __init__(self, assignment_source=None, id=None, name=None, source=None): + super(Extension, self).__init__() + self.assignment_source = assignment_source + self.id = id + self.name = name + self.source = source diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/extension_summary_data.py b/vsts/vsts/member_entitlement_management/v4_1/models/extension_summary_data.py new file mode 100644 index 00000000..ec0de188 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/extension_summary_data.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# 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 .summary_data import SummaryData + + +class ExtensionSummaryData(SummaryData): + """ExtensionSummaryData. + + :param assigned: Count of Licenses already assigned. + :type assigned: int + :param available: Available Count. + :type available: int + :param included_quantity: Quantity + :type included_quantity: int + :param total: Total Count. + :type total: int + :param assigned_through_subscription: Count of Extension Licenses assigned to users through msdn. + :type assigned_through_subscription: int + :param extension_id: Gallery Id of the Extension + :type extension_id: str + :param extension_name: Friendly name of this extension + :type extension_name: str + :param is_trial_version: Whether its a Trial Version. + :type is_trial_version: bool + :param minimum_license_required: Minimum License Required for the Extension. + :type minimum_license_required: object + :param remaining_trial_days: Days remaining for the Trial to expire. + :type remaining_trial_days: int + :param trial_expiry_date: Date on which the Trial expires. + :type trial_expiry_date: datetime + """ + + _attribute_map = { + 'assigned': {'key': 'assigned', 'type': 'int'}, + 'available': {'key': 'available', 'type': 'int'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, + 'total': {'key': 'total', 'type': 'int'}, + 'assigned_through_subscription': {'key': 'assignedThroughSubscription', 'type': 'int'}, + 'extension_id': {'key': 'extensionId', 'type': 'str'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'is_trial_version': {'key': 'isTrialVersion', 'type': 'bool'}, + 'minimum_license_required': {'key': 'minimumLicenseRequired', 'type': 'object'}, + 'remaining_trial_days': {'key': 'remainingTrialDays', 'type': 'int'}, + 'trial_expiry_date': {'key': 'trialExpiryDate', 'type': 'iso-8601'} + } + + def __init__(self, assigned=None, available=None, included_quantity=None, total=None, assigned_through_subscription=None, extension_id=None, extension_name=None, is_trial_version=None, minimum_license_required=None, remaining_trial_days=None, trial_expiry_date=None): + super(ExtensionSummaryData, self).__init__(assigned=assigned, available=available, included_quantity=included_quantity, total=total) + self.assigned_through_subscription = assigned_through_subscription + self.extension_id = extension_id + self.extension_name = extension_name + self.is_trial_version = is_trial_version + self.minimum_license_required = minimum_license_required + self.remaining_trial_days = remaining_trial_days + self.trial_expiry_date = trial_expiry_date diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/graph_group.py b/vsts/vsts/member_entitlement_management/v4_1/models/graph_group.py new file mode 100644 index 00000000..c28da383 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/graph_group.py @@ -0,0 +1,101 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_member import GraphMember + + +class GraphGroup(GraphMember): + """GraphGroup. + + :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 legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. + :type legacy_descriptor: str + :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + :param cuid: The Consistently Unique Identifier of the subject + :type cuid: str + :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) + :type domain: str + :param mail_address: The email address of record for a given graph member. This may be different than the principal name. + :type mail_address: str + :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. + :type principal_name: str + :param description: A short phrase to help human readers disambiguate groups with similar names + :type description: str + :param is_cross_project: + :type is_cross_project: bool + :param is_deleted: + :type is_deleted: bool + :param is_global_scope: + :type is_global_scope: bool + :param is_restricted_visible: + :type is_restricted_visible: bool + :param local_scope_id: + :type local_scope_id: str + :param scope_id: + :type scope_id: str + :param scope_name: + :type scope_name: str + :param scope_type: + :type scope_type: str + :param securing_host_id: + :type securing_host_id: str + :param special_type: + :type special_type: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'cuid': {'key': 'cuid', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'mail_address': {'key': 'mailAddress', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_cross_project': {'key': 'isCrossProject', 'type': 'bool'}, + 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, + 'is_global_scope': {'key': 'isGlobalScope', 'type': 'bool'}, + 'is_restricted_visible': {'key': 'isRestrictedVisible', 'type': 'bool'}, + 'local_scope_id': {'key': 'localScopeId', 'type': 'str'}, + 'scope_id': {'key': 'scopeId', 'type': 'str'}, + 'scope_name': {'key': 'scopeName', 'type': 'str'}, + 'scope_type': {'key': 'scopeType', 'type': 'str'}, + 'securing_host_id': {'key': 'securingHostId', 'type': 'str'}, + 'special_type': {'key': 'specialType', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, cuid=None, domain=None, mail_address=None, principal_name=None, description=None, is_cross_project=None, is_deleted=None, is_global_scope=None, is_restricted_visible=None, local_scope_id=None, scope_id=None, scope_name=None, scope_type=None, securing_host_id=None, special_type=None): + super(GraphGroup, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, cuid=cuid, domain=domain, mail_address=mail_address, principal_name=principal_name) + self.description = description + self.is_cross_project = is_cross_project + self.is_deleted = is_deleted + self.is_global_scope = is_global_scope + self.is_restricted_visible = is_restricted_visible + self.local_scope_id = local_scope_id + self.scope_id = scope_id + self.scope_name = scope_name + self.scope_type = scope_type + self.securing_host_id = securing_host_id + self.special_type = special_type diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/graph_member.py b/vsts/vsts/member_entitlement_management/v4_1/models/graph_member.py new file mode 100644 index 00000000..7f518143 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/graph_member.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_subject import GraphSubject + + +class GraphMember(GraphSubject): + """GraphMember. + + :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 legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. + :type legacy_descriptor: str + :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + :param cuid: The Consistently Unique Identifier of the subject + :type cuid: str + :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) + :type domain: str + :param mail_address: The email address of record for a given graph member. This may be different than the principal name. + :type mail_address: str + :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. + :type principal_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'}, + 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'cuid': {'key': 'cuid', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'mail_address': {'key': 'mailAddress', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, cuid=None, domain=None, mail_address=None, principal_name=None): + super(GraphMember, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind) + self.cuid = cuid + self.domain = domain + self.mail_address = mail_address + self.principal_name = principal_name diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject.py b/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject.py new file mode 100644 index 00000000..3d92d54c --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_subject_base import GraphSubjectBase + + +class GraphSubject(GraphSubjectBase): + """GraphSubject. + + :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 legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. + :type legacy_descriptor: str + :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None): + super(GraphSubject, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) + self.legacy_descriptor = legacy_descriptor + self.origin = origin + self.origin_id = origin_id + self.subject_kind = subject_kind diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject_base.py b/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject_base.py new file mode 100644 index 00000000..f8b8d21a --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/graph_subject_base.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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): + """GraphSubjectBase. + + :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + :type _links: :class:`ReferenceLinks ` + :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + :type descriptor: str + :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. + :type display_name: str + :param url: This url is the full route to the source resource of this graph subject. + :type url: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, url=None): + super(GraphSubjectBase, self).__init__() + self._links = _links + self.descriptor = descriptor + self.display_name = display_name + self.url = url diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/graph_user.py b/vsts/vsts/member_entitlement_management/v4_1/models/graph_user.py new file mode 100644 index 00000000..e04a89ed --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/graph_user.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# 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 .graph_member import GraphMember + + +class GraphUser(GraphMember): + """GraphUser. + + :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 legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. + :type legacy_descriptor: str + :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) + :type origin: str + :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. + :type origin_id: str + :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). + :type subject_kind: str + :param cuid: The Consistently Unique Identifier of the subject + :type cuid: str + :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) + :type domain: str + :param mail_address: The email address of record for a given graph member. This may be different than the principal name. + :type mail_address: str + :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. + :type principal_name: str + :param meta_type: The meta type of the user in the origin, such as "member", "guest", etc. See UserMetaType for the set of possible values. + :type meta_type: str + """ + + _attribute_map = { + '_links': {'key': '_links', 'type': 'ReferenceLinks'}, + 'descriptor': {'key': 'descriptor', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'origin_id': {'key': 'originId', 'type': 'str'}, + 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, + 'cuid': {'key': 'cuid', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'mail_address': {'key': 'mailAddress', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'meta_type': {'key': 'metaType', 'type': 'str'} + } + + def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, cuid=None, domain=None, mail_address=None, principal_name=None, meta_type=None): + super(GraphUser, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, cuid=cuid, domain=domain, mail_address=mail_address, principal_name=principal_name) + self.meta_type = meta_type diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/group.py b/vsts/vsts/member_entitlement_management/v4_1/models/group.py new file mode 100644 index 00000000..8bb6729e --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/group.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 Group(Model): + """Group. + + :param display_name: Display Name of the Group + :type display_name: str + :param group_type: Group Type + :type group_type: object + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'group_type': {'key': 'groupType', 'type': 'object'} + } + + def __init__(self, display_name=None, group_type=None): + super(Group, self).__init__() + self.display_name = display_name + self.group_type = group_type diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement.py b/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement.py new file mode 100644 index 00000000..3a3d6c94 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# 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 GroupEntitlement(Model): + """GroupEntitlement. + + :param extension_rules: Extension Rules. + :type extension_rules: list of :class:`Extension ` + :param group: Member reference. + :type group: :class:`GraphGroup ` + :param id: The unique identifier which matches the Id of the GraphMember. + :type id: str + :param last_executed: [Readonly] The last time the group licensing rule was executed (regardless of whether any changes were made). + :type last_executed: datetime + :param license_rule: License Rule. + :type license_rule: :class:`AccessLevel ` + :param members: Group members. Only used when creating a new group. + :type members: list of :class:`UserEntitlement ` + :param project_entitlements: Relation between a project and the member's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param status: The status of the group rule. + :type status: object + """ + + _attribute_map = { + 'extension_rules': {'key': 'extensionRules', 'type': '[Extension]'}, + 'group': {'key': 'group', 'type': 'GraphGroup'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_executed': {'key': 'lastExecuted', 'type': 'iso-8601'}, + 'license_rule': {'key': 'licenseRule', 'type': 'AccessLevel'}, + 'members': {'key': 'members', 'type': '[UserEntitlement]'}, + 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, + 'status': {'key': 'status', 'type': 'object'} + } + + def __init__(self, extension_rules=None, group=None, id=None, last_executed=None, license_rule=None, members=None, project_entitlements=None, status=None): + super(GroupEntitlement, self).__init__() + self.extension_rules = extension_rules + self.group = group + self.id = id + self.last_executed = last_executed + self.license_rule = license_rule + self.members = members + self.project_entitlements = project_entitlements + self.status = status diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement_operation_reference.py b/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement_operation_reference.py new file mode 100644 index 00000000..1ce5575e --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/group_entitlement_operation_reference.py @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------------------------- +# 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 .operation_reference import OperationReference + + +class GroupEntitlementOperationReference(OperationReference): + """GroupEntitlementOperationReference. + + :param id: Unique identifier for the operation. + :type id: str + :param plugin_id: Unique identifier for the plugin. + :type plugin_id: str + :param status: The current status of the operation. + :type status: object + :param url: URL to get the full operation object. + :type url: str + :param completed: Operation completed with success or failure. + :type completed: bool + :param have_results_succeeded: True if all operations were successful. + :type have_results_succeeded: bool + :param results: List of results for each operation. + :type results: list of :class:`GroupOperationResult ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'plugin_id': {'key': 'pluginId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[GroupOperationResult]'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(GroupEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) + self.completed = completed + self.have_results_succeeded = have_results_succeeded + self.results = results diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/group_operation_result.py b/vsts/vsts/member_entitlement_management/v4_1/models/group_operation_result.py new file mode 100644 index 00000000..67bb685d --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/group_operation_result.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# 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 .base_operation_result import BaseOperationResult + + +class GroupOperationResult(BaseOperationResult): + """GroupOperationResult. + + :param errors: List of error codes paired with their corresponding error messages + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation + :type is_success: bool + :param group_id: Identifier of the Group being acted upon + :type group_id: str + :param result: Result of the Groupentitlement after the operation + :type result: :class:`GroupEntitlement ` + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'GroupEntitlement'} + } + + def __init__(self, errors=None, is_success=None, group_id=None, result=None): + super(GroupOperationResult, self).__init__(errors=errors, is_success=is_success) + self.group_id = group_id + self.result = result diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/group_option.py b/vsts/vsts/member_entitlement_management/v4_1/models/group_option.py new file mode 100644 index 00000000..6d56eebc --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/group_option.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 GroupOption(Model): + """GroupOption. + + :param access_level: Access Level + :type access_level: :class:`AccessLevel ` + :param group: Group + :type group: :class:`Group ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'group': {'key': 'group', 'type': 'Group'} + } + + def __init__(self, access_level=None, group=None): + super(GroupOption, self).__init__() + self.access_level = access_level + self.group = group diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/json_patch_operation.py b/vsts/vsts/member_entitlement_management/v4_1/models/json_patch_operation.py new file mode 100644 index 00000000..7d45b0f6 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/json_patch_operation.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 JsonPatchOperation(Model): + """JsonPatchOperation. + + :param from_: The path to copy from for the Move/Copy operation. + :type from_: str + :param op: The patch operation + :type op: object + :param path: The path for the operation + :type path: str + :param value: The value for the operation. This is either a primitive or a JToken. + :type value: object + """ + + _attribute_map = { + 'from_': {'key': 'from', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'object'}, + 'path': {'key': 'path', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'} + } + + def __init__(self, from_=None, op=None, path=None, value=None): + super(JsonPatchOperation, self).__init__() + self.from_ = from_ + self.op = op + self.path = path + self.value = value diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/license_summary_data.py b/vsts/vsts/member_entitlement_management/v4_1/models/license_summary_data.py new file mode 100644 index 00000000..acd6d6eb --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/license_summary_data.py @@ -0,0 +1,65 @@ +# -------------------------------------------------------------------------------------------- +# 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 .summary_data import SummaryData + + +class LicenseSummaryData(SummaryData): + """LicenseSummaryData. + + :param assigned: Count of Licenses already assigned. + :type assigned: int + :param available: Available Count. + :type available: int + :param included_quantity: Quantity + :type included_quantity: int + :param total: Total Count. + :type total: int + :param account_license_type: Type of Account License. + :type account_license_type: object + :param disabled: Count of Disabled Licenses. + :type disabled: int + :param is_purchasable: Designates if this license quantity can be changed through purchase + :type is_purchasable: bool + :param license_name: Name of the License. + :type license_name: str + :param msdn_license_type: Type of MSDN License. + :type msdn_license_type: object + :param next_billing_date: Specifies the date when billing will charge for paid licenses + :type next_billing_date: datetime + :param source: Source of the License. + :type source: object + :param total_after_next_billing_date: Total license count after next billing cycle + :type total_after_next_billing_date: int + """ + + _attribute_map = { + 'assigned': {'key': 'assigned', 'type': 'int'}, + 'available': {'key': 'available', 'type': 'int'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, + 'total': {'key': 'total', 'type': 'int'}, + 'account_license_type': {'key': 'accountLicenseType', 'type': 'object'}, + 'disabled': {'key': 'disabled', 'type': 'int'}, + 'is_purchasable': {'key': 'isPurchasable', 'type': 'bool'}, + 'license_name': {'key': 'licenseName', 'type': 'str'}, + 'msdn_license_type': {'key': 'msdnLicenseType', 'type': 'object'}, + 'next_billing_date': {'key': 'nextBillingDate', 'type': 'iso-8601'}, + 'source': {'key': 'source', 'type': 'object'}, + 'total_after_next_billing_date': {'key': 'totalAfterNextBillingDate', 'type': 'int'} + } + + def __init__(self, assigned=None, available=None, included_quantity=None, total=None, account_license_type=None, disabled=None, is_purchasable=None, license_name=None, msdn_license_type=None, next_billing_date=None, source=None, total_after_next_billing_date=None): + super(LicenseSummaryData, self).__init__(assigned=assigned, available=available, included_quantity=included_quantity, total=total) + self.account_license_type = account_license_type + self.disabled = disabled + self.is_purchasable = is_purchasable + self.license_name = license_name + self.msdn_license_type = msdn_license_type + self.next_billing_date = next_billing_date + self.source = source + self.total_after_next_billing_date = total_after_next_billing_date diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement.py b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement.py new file mode 100644 index 00000000..897d3ad3 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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 .user_entitlement import UserEntitlement + + +class MemberEntitlement(UserEntitlement): + """MemberEntitlement. + + :param access_level: User's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param extensions: User's extensions. + :type extensions: list of :class:`Extension ` + :param group_assignments: [Readonly] GroupEntitlements that this user belongs to. + :type group_assignments: list of :class:`GroupEntitlement ` + :param id: The unique identifier which matches the Id of the Identity associated with the GraphMember. + :type id: str + :param last_accessed_date: [Readonly] Date the user last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the user's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param user: User reference. + :type user: :class:`GraphUser ` + :param member: Member reference + :type member: :class:`GraphMember ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'extensions': {'key': 'extensions', 'type': '[Extension]'}, + 'group_assignments': {'key': 'groupAssignments', 'type': '[GroupEntitlement]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, + 'user': {'key': 'user', 'type': 'GraphUser'}, + 'member': {'key': 'member', 'type': 'GraphMember'} + } + + def __init__(self, access_level=None, extensions=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, user=None, member=None): + super(MemberEntitlement, self).__init__(access_level=access_level, extensions=extensions, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements, user=user) + self.member = member diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement_operation_reference.py b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement_operation_reference.py new file mode 100644 index 00000000..a07854bd --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlement_operation_reference.py @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------------------------- +# 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 .operation_reference import OperationReference + + +class MemberEntitlementOperationReference(OperationReference): + """MemberEntitlementOperationReference. + + :param id: Unique identifier for the operation. + :type id: str + :param plugin_id: Unique identifier for the plugin. + :type plugin_id: str + :param status: The current status of the operation. + :type status: object + :param url: URL to get the full operation object. + :type url: str + :param completed: Operation completed with success or failure + :type completed: bool + :param have_results_succeeded: True if all operations were successful + :type have_results_succeeded: bool + :param results: List of results for each operation + :type results: list of :class:`OperationResult ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'plugin_id': {'key': 'pluginId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[OperationResult]'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(MemberEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) + self.completed = completed + self.have_results_succeeded = have_results_succeeded + self.results = results diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_patch_response.py b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_patch_response.py new file mode 100644 index 00000000..c5f20a5e --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_patch_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .member_entitlements_response_base import MemberEntitlementsResponseBase + + +class MemberEntitlementsPatchResponse(MemberEntitlementsResponseBase): + """MemberEntitlementsPatchResponse. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations. have been applied + :type member_entitlement: :class:`MemberEntitlement ` + :param operation_results: List of results for each operation + :type operation_results: list of :class:`OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, + 'operation_results': {'key': 'operationResults', 'type': '[OperationResult]'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_results=None): + super(MemberEntitlementsPatchResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_results = operation_results diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_post_response.py b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_post_response.py new file mode 100644 index 00000000..ab88e7fd --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_post_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .member_entitlements_response_base import MemberEntitlementsResponseBase + + +class MemberEntitlementsPostResponse(MemberEntitlementsResponseBase): + """MemberEntitlementsPostResponse. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations. have been applied + :type member_entitlement: :class:`MemberEntitlement ` + :param operation_result: Operation result + :type operation_result: :class:`OperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, + 'operation_result': {'key': 'operationResult', 'type': 'OperationResult'} + } + + def __init__(self, is_success=None, member_entitlement=None, operation_result=None): + super(MemberEntitlementsPostResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) + self.operation_result = operation_result diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_response_base.py b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_response_base.py new file mode 100644 index 00000000..241ca3f0 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/member_entitlements_response_base.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 MemberEntitlementsResponseBase(Model): + """MemberEntitlementsResponseBase. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param member_entitlement: Result of the member entitlement after the operations. have been applied + :type member_entitlement: :class:`MemberEntitlement ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'} + } + + def __init__(self, is_success=None, member_entitlement=None): + super(MemberEntitlementsResponseBase, self).__init__() + self.is_success = is_success + self.member_entitlement = member_entitlement diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/operation_reference.py b/vsts/vsts/member_entitlement_management/v4_1/models/operation_reference.py new file mode 100644 index 00000000..cdbef013 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/operation_reference.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 OperationReference(Model): + """OperationReference. + + :param id: Unique identifier for the operation. + :type id: str + :param plugin_id: Unique identifier for the plugin. + :type plugin_id: str + :param status: The current status of the operation. + :type status: object + :param url: URL to get the full operation object. + :type url: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'plugin_id': {'key': 'pluginId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None): + super(OperationReference, self).__init__() + self.id = id + self.plugin_id = plugin_id + self.status = status + self.url = url diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/operation_result.py b/vsts/vsts/member_entitlement_management/v4_1/models/operation_result.py new file mode 100644 index 00000000..7624a6f9 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/operation_result.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 OperationResult(Model): + """OperationResult. + + :param errors: List of error codes paired with their corresponding error messages. + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation. + :type is_success: bool + :param member_id: Identifier of the Member being acted upon. + :type member_id: str + :param result: Result of the MemberEntitlement after the operation. + :type result: :class:`MemberEntitlement ` + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'member_id': {'key': 'memberId', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'MemberEntitlement'} + } + + def __init__(self, errors=None, is_success=None, member_id=None, result=None): + super(OperationResult, self).__init__() + self.errors = errors + self.is_success = is_success + self.member_id = member_id + self.result = result diff --git a/vsts/vsts/user/v4_1/models/user_notifications.py b/vsts/vsts/member_entitlement_management/v4_1/models/paged_graph_member_list.py similarity index 60% rename from vsts/vsts/user/v4_1/models/user_notifications.py rename to vsts/vsts/member_entitlement_management/v4_1/models/paged_graph_member_list.py index b3528bcc..99ca90c5 100644 --- a/vsts/vsts/user/v4_1/models/user_notifications.py +++ b/vsts/vsts/member_entitlement_management/v4_1/models/paged_graph_member_list.py @@ -9,21 +9,21 @@ from msrest.serialization import Model -class UserNotifications(Model): - """UserNotifications. +class PagedGraphMemberList(Model): + """PagedGraphMemberList. - :param continuation_token: Continuation token to query the next segment + :param continuation_token: :type continuation_token: str - :param notifications: Collection of notifications - :type notifications: list of :class:`UserNotification ` + :param members: + :type members: list of :class:`UserEntitlement ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'notifications': {'key': 'notifications', 'type': '[UserNotification]'} + 'members': {'key': 'members', 'type': '[UserEntitlement]'} } - def __init__(self, continuation_token=None, notifications=None): - super(UserNotifications, self).__init__() + def __init__(self, continuation_token=None, members=None): + super(PagedGraphMemberList, self).__init__() self.continuation_token = continuation_token - self.notifications = notifications + self.members = members diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/project_entitlement.py b/vsts/vsts/member_entitlement_management/v4_1/models/project_entitlement.py new file mode 100644 index 00000000..e443fcc4 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/project_entitlement.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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 ProjectEntitlement(Model): + """ProjectEntitlement. + + :param assignment_source: Assignment Source (e.g. Group or Unknown). + :type assignment_source: object + :param group: Project Group (e.g. Contributor, Reader etc.) + :type group: :class:`Group ` + :param is_project_permission_inherited: Whether the user is inheriting permissions to a project through a VSTS or AAD group membership. + :type is_project_permission_inherited: bool + :param project_ref: Project Ref + :type project_ref: :class:`ProjectRef ` + :param team_refs: Team Ref. + :type team_refs: list of :class:`TeamRef ` + """ + + _attribute_map = { + 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, + 'group': {'key': 'group', 'type': 'Group'}, + 'is_project_permission_inherited': {'key': 'isProjectPermissionInherited', 'type': 'bool'}, + 'project_ref': {'key': 'projectRef', 'type': 'ProjectRef'}, + 'team_refs': {'key': 'teamRefs', 'type': '[TeamRef]'} + } + + def __init__(self, assignment_source=None, group=None, is_project_permission_inherited=None, project_ref=None, team_refs=None): + super(ProjectEntitlement, self).__init__() + self.assignment_source = assignment_source + self.group = group + self.is_project_permission_inherited = is_project_permission_inherited + self.project_ref = project_ref + self.team_refs = team_refs diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/project_ref.py b/vsts/vsts/member_entitlement_management/v4_1/models/project_ref.py new file mode 100644 index 00000000..f25727c4 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/project_ref.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 ProjectRef(Model): + """ProjectRef. + + :param id: Project ID. + :type id: str + :param name: Project Name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(ProjectRef, self).__init__() + self.id = id + self.name = name diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/reference_links.py b/vsts/vsts/member_entitlement_management/v4_1/models/reference_links.py new file mode 100644 index 00000000..54f03acd --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/reference_links.py @@ -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 msrest.serialization import Model + + +class ReferenceLinks(Model): + """ReferenceLinks. + + :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. + :type links: dict + """ + + _attribute_map = { + 'links': {'key': 'links', 'type': '{object}'} + } + + def __init__(self, links=None): + super(ReferenceLinks, self).__init__() + self.links = links diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/summary_data.py b/vsts/vsts/member_entitlement_management/v4_1/models/summary_data.py new file mode 100644 index 00000000..8bb32cea --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/summary_data.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 SummaryData(Model): + """SummaryData. + + :param assigned: Count of Licenses already assigned. + :type assigned: int + :param available: Available Count. + :type available: int + :param included_quantity: Quantity + :type included_quantity: int + :param total: Total Count. + :type total: int + """ + + _attribute_map = { + 'assigned': {'key': 'assigned', 'type': 'int'}, + 'available': {'key': 'available', 'type': 'int'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, + 'total': {'key': 'total', 'type': 'int'} + } + + def __init__(self, assigned=None, available=None, included_quantity=None, total=None): + super(SummaryData, self).__init__() + self.assigned = assigned + self.available = available + self.included_quantity = included_quantity + self.total = total diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/team_ref.py b/vsts/vsts/member_entitlement_management/v4_1/models/team_ref.py new file mode 100644 index 00000000..56471504 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/team_ref.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 TeamRef(Model): + """TeamRef. + + :param id: Team ID + :type id: str + :param name: Team Name + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'} + } + + def __init__(self, id=None, name=None): + super(TeamRef, self).__init__() + self.id = id + self.name = name diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement.py new file mode 100644 index 00000000..e1b27dfa --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 UserEntitlement(Model): + """UserEntitlement. + + :param access_level: User's access level denoted by a license. + :type access_level: :class:`AccessLevel ` + :param extensions: User's extensions. + :type extensions: list of :class:`Extension ` + :param group_assignments: [Readonly] GroupEntitlements that this user belongs to. + :type group_assignments: list of :class:`GroupEntitlement ` + :param id: The unique identifier which matches the Id of the Identity associated with the GraphMember. + :type id: str + :param last_accessed_date: [Readonly] Date the user last accessed the collection. + :type last_accessed_date: datetime + :param project_entitlements: Relation between a project and the user's effective permissions in that project. + :type project_entitlements: list of :class:`ProjectEntitlement ` + :param user: User reference. + :type user: :class:`GraphUser ` + """ + + _attribute_map = { + 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, + 'extensions': {'key': 'extensions', 'type': '[Extension]'}, + 'group_assignments': {'key': 'groupAssignments', 'type': '[GroupEntitlement]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, + 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, + 'user': {'key': 'user', 'type': 'GraphUser'} + } + + def __init__(self, access_level=None, extensions=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, user=None): + super(UserEntitlement, self).__init__() + self.access_level = access_level + self.extensions = extensions + self.group_assignments = group_assignments + self.id = id + self.last_accessed_date = last_accessed_date + self.project_entitlements = project_entitlements + self.user = user diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_reference.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_reference.py new file mode 100644 index 00000000..96ef406e --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_reference.py @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------------------------- +# 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 .operation_reference import OperationReference + + +class UserEntitlementOperationReference(OperationReference): + """UserEntitlementOperationReference. + + :param id: Unique identifier for the operation. + :type id: str + :param plugin_id: Unique identifier for the plugin. + :type plugin_id: str + :param status: The current status of the operation. + :type status: object + :param url: URL to get the full operation object. + :type url: str + :param completed: Operation completed with success or failure. + :type completed: bool + :param have_results_succeeded: True if all operations were successful. + :type have_results_succeeded: bool + :param results: List of results for each operation. + :type results: list of :class:`UserEntitlementOperationResult ` + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'plugin_id': {'key': 'pluginId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'url': {'key': 'url', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[UserEntitlementOperationResult]'} + } + + def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): + super(UserEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) + self.completed = completed + self.have_results_succeeded = have_results_succeeded + self.results = results diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_result.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_result.py new file mode 100644 index 00000000..0edad338 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlement_operation_result.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 UserEntitlementOperationResult(Model): + """UserEntitlementOperationResult. + + :param errors: List of error codes paired with their corresponding error messages. + :type errors: list of { key: int; value: str } + :param is_success: Success status of the operation. + :type is_success: bool + :param result: Result of the MemberEntitlement after the operation. + :type result: :class:`UserEntitlement ` + :param user_id: Identifier of the Member being acted upon. + :type user_id: str + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'result': {'key': 'result', 'type': 'UserEntitlement'}, + 'user_id': {'key': 'userId', 'type': 'str'} + } + + def __init__(self, errors=None, is_success=None, result=None, user_id=None): + super(UserEntitlementOperationResult, self).__init__() + self.errors = errors + self.is_success = is_success + self.result = result + self.user_id = user_id diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_patch_response.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_patch_response.py new file mode 100644 index 00000000..c4e5ff12 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_patch_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .user_entitlements_response_base import UserEntitlementsResponseBase + + +class UserEntitlementsPatchResponse(UserEntitlementsResponseBase): + """UserEntitlementsPatchResponse. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param user_entitlement: Result of the user entitlement after the operations have been applied. + :type user_entitlement: :class:`UserEntitlement ` + :param operation_results: List of results for each operation. + :type operation_results: list of :class:`UserEntitlementOperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'}, + 'operation_results': {'key': 'operationResults', 'type': '[UserEntitlementOperationResult]'} + } + + def __init__(self, is_success=None, user_entitlement=None, operation_results=None): + super(UserEntitlementsPatchResponse, self).__init__(is_success=is_success, user_entitlement=user_entitlement) + self.operation_results = operation_results diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_post_response.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_post_response.py new file mode 100644 index 00000000..7977340b --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_post_response.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .user_entitlements_response_base import UserEntitlementsResponseBase + + +class UserEntitlementsPostResponse(UserEntitlementsResponseBase): + """UserEntitlementsPostResponse. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param user_entitlement: Result of the user entitlement after the operations have been applied. + :type user_entitlement: :class:`UserEntitlement ` + :param operation_result: Operation result. + :type operation_result: :class:`UserEntitlementOperationResult ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'}, + 'operation_result': {'key': 'operationResult', 'type': 'UserEntitlementOperationResult'} + } + + def __init__(self, is_success=None, user_entitlement=None, operation_result=None): + super(UserEntitlementsPostResponse, self).__init__(is_success=is_success, user_entitlement=user_entitlement) + self.operation_result = operation_result diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_response_base.py b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_response_base.py new file mode 100644 index 00000000..8e02e53f --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/user_entitlements_response_base.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# 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 UserEntitlementsResponseBase(Model): + """UserEntitlementsResponseBase. + + :param is_success: True if all operations were successful. + :type is_success: bool + :param user_entitlement: Result of the user entitlement after the operations have been applied. + :type user_entitlement: :class:`UserEntitlement ` + """ + + _attribute_map = { + 'is_success': {'key': 'isSuccess', 'type': 'bool'}, + 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'} + } + + def __init__(self, is_success=None, user_entitlement=None): + super(UserEntitlementsResponseBase, self).__init__() + self.is_success = is_success + self.user_entitlement = user_entitlement diff --git a/vsts/vsts/member_entitlement_management/v4_1/models/users_summary.py b/vsts/vsts/member_entitlement_management/v4_1/models/users_summary.py new file mode 100644 index 00000000..2105e094 --- /dev/null +++ b/vsts/vsts/member_entitlement_management/v4_1/models/users_summary.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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 UsersSummary(Model): + """UsersSummary. + + :param available_access_levels: Available Access Levels. + :type available_access_levels: list of :class:`AccessLevel ` + :param extensions: Summary of Extensions in the account. + :type extensions: list of :class:`ExtensionSummaryData ` + :param group_options: Group Options. + :type group_options: list of :class:`GroupOption ` + :param licenses: Summary of Licenses in the Account. + :type licenses: list of :class:`LicenseSummaryData ` + :param project_refs: Summary of Projects in the Account. + :type project_refs: list of :class:`ProjectRef ` + """ + + _attribute_map = { + 'available_access_levels': {'key': 'availableAccessLevels', 'type': '[AccessLevel]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionSummaryData]'}, + 'group_options': {'key': 'groupOptions', 'type': '[GroupOption]'}, + 'licenses': {'key': 'licenses', 'type': '[LicenseSummaryData]'}, + 'project_refs': {'key': 'projectRefs', 'type': '[ProjectRef]'} + } + + def __init__(self, available_access_levels=None, extensions=None, group_options=None, licenses=None, project_refs=None): + super(UsersSummary, self).__init__() + self.available_access_levels = available_access_levels + self.extensions = extensions + self.group_options = group_options + self.licenses = licenses + self.project_refs = project_refs diff --git a/vsts/vsts/user/v4_1/models/__init__.py b/vsts/vsts/user/v4_1/models/__init__.py deleted file mode 100644 index deed4a68..00000000 --- a/vsts/vsts/user/v4_1/models/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from .avatar import Avatar -from .create_user_parameters import CreateUserParameters -from .mail_confirmation_parameters import MailConfirmationParameters -from .reference_links import ReferenceLinks -from .send_user_notification_parameters import SendUserNotificationParameters -from .set_user_attribute_parameters import SetUserAttributeParameters -from .update_user_parameters import UpdateUserParameters -from .user import User -from .user_attribute import UserAttribute -from .user_attributes import UserAttributes -from .user_notification import UserNotification -from .user_notifications import UserNotifications - -__all__ = [ - 'Avatar', - 'CreateUserParameters', - 'MailConfirmationParameters', - 'ReferenceLinks', - 'SendUserNotificationParameters', - 'SetUserAttributeParameters', - 'UpdateUserParameters', - 'User', - 'UserAttribute', - 'UserAttributes', - 'UserNotification', - 'UserNotifications', -] diff --git a/vsts/vsts/user/v4_1/models/avatar.py b/vsts/vsts/user/v4_1/models/avatar.py deleted file mode 100644 index cd4f5f01..00000000 --- a/vsts/vsts/user/v4_1/models/avatar.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 Avatar(Model): - """Avatar. - - :param image: The raw avatar image data, in either jpg or png format. - :type image: str - :param is_auto_generated: True if the avatar is dynamically generated, false if user-provided. - :type is_auto_generated: bool - :param last_modified: The date/time at which the avatar was last modified. - :type last_modified: datetime - :param size: The size of the avatar, e.g. small, medium, or large. - :type size: object - """ - - _attribute_map = { - 'image': {'key': 'image', 'type': 'str'}, - 'is_auto_generated': {'key': 'isAutoGenerated', 'type': 'bool'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'size': {'key': 'size', 'type': 'object'} - } - - def __init__(self, image=None, is_auto_generated=None, last_modified=None, size=None): - super(Avatar, self).__init__() - self.image = image - self.is_auto_generated = is_auto_generated - self.last_modified = last_modified - self.size = size diff --git a/vsts/vsts/user/v4_1/models/create_user_parameters.py b/vsts/vsts/user/v4_1/models/create_user_parameters.py deleted file mode 100644 index 03801e6c..00000000 --- a/vsts/vsts/user/v4_1/models/create_user_parameters.py +++ /dev/null @@ -1,45 +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 CreateUserParameters(Model): - """CreateUserParameters. - - :param country: The user's country of residence or association. - :type country: str - :param data: - :type data: dict - :param descriptor: The user's unique identifier, and the primary means by which the user is referenced. - :type descriptor: :class:`str ` - :param display_name: The user's name, as displayed throughout the product. - :type display_name: str - :param mail: The user's preferred email address. - :type mail: str - :param region: The region in which the user resides or is associated. - :type region: str - """ - - _attribute_map = { - 'country': {'key': 'country', 'type': 'str'}, - 'data': {'key': 'data', 'type': '{object}'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'mail': {'key': 'mail', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'} - } - - def __init__(self, country=None, data=None, descriptor=None, display_name=None, mail=None, region=None): - super(CreateUserParameters, self).__init__() - self.country = country - self.data = data - self.descriptor = descriptor - self.display_name = display_name - self.mail = mail - self.region = region diff --git a/vsts/vsts/user/v4_1/models/send_user_notification_parameters.py b/vsts/vsts/user/v4_1/models/send_user_notification_parameters.py deleted file mode 100644 index c5936eba..00000000 --- a/vsts/vsts/user/v4_1/models/send_user_notification_parameters.py +++ /dev/null @@ -1,29 +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 SendUserNotificationParameters(Model): - """SendUserNotificationParameters. - - :param notification: Notification to be delivered - :type notification: :class:`UserNotification ` - :param recipients: Users whom this notification is addressed to - :type recipients: list of :class:`str ` - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'UserNotification'}, - 'recipients': {'key': 'recipients', 'type': '[str]'} - } - - def __init__(self, notification=None, recipients=None): - super(SendUserNotificationParameters, self).__init__() - self.notification = notification - self.recipients = recipients diff --git a/vsts/vsts/user/v4_1/models/set_user_attribute_parameters.py b/vsts/vsts/user/v4_1/models/set_user_attribute_parameters.py deleted file mode 100644 index bdfd9cfb..00000000 --- a/vsts/vsts/user/v4_1/models/set_user_attribute_parameters.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 SetUserAttributeParameters(Model): - """SetUserAttributeParameters. - - :param last_modified: The date/time at which the attribute was last modified. - :type last_modified: datetime - :param name: The unique group-prefixed name of the attribute, e.g. "TFS.TimeZone". - :type name: str - :param revision: The attribute's revision, for change tracking. - :type revision: int - :param value: The value of the attribute. - :type value: str - """ - - _attribute_map = { - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, last_modified=None, name=None, revision=None, value=None): - super(SetUserAttributeParameters, self).__init__() - self.last_modified = last_modified - self.name = name - self.revision = revision - self.value = value diff --git a/vsts/vsts/user/v4_1/models/user.py b/vsts/vsts/user/v4_1/models/user.py deleted file mode 100644 index 98b3c9c4..00000000 --- a/vsts/vsts/user/v4_1/models/user.py +++ /dev/null @@ -1,73 +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 User(Model): - """User. - - :param bio: A short blurb of "about me"-style text. - :type bio: str - :param blog: A link to an external blog. - :type blog: str - :param company: The company at which the user is employed. - :type company: str - :param country: The user's country of residence or association. - :type country: str - :param date_created: The date the user was created in the system - :type date_created: datetime - :param descriptor: The user's unique identifier, and the primary means by which the user is referenced. - :type descriptor: :class:`str ` - :param display_name: The user's name, as displayed throughout the product. - :type display_name: str - :param last_modified: The date/time at which the user data was last modified. - :type last_modified: datetime - :param links: A set of readonly links for obtaining more info about the user. - :type links: :class:`ReferenceLinks ` - :param mail: The user's preferred email address. - :type mail: str - :param revision: The attribute's revision, for change tracking. - :type revision: int - :param unconfirmed_mail: The user's preferred email address which has not yet been confirmed. - :type unconfirmed_mail: str - :param user_name: The unique name of the user. - :type user_name: str - """ - - _attribute_map = { - 'bio': {'key': 'bio', 'type': 'str'}, - 'blog': {'key': 'blog', 'type': 'str'}, - 'company': {'key': 'company', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, - 'descriptor': {'key': 'descriptor', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'links': {'key': 'links', 'type': 'ReferenceLinks'}, - 'mail': {'key': 'mail', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'unconfirmed_mail': {'key': 'unconfirmedMail', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'} - } - - def __init__(self, bio=None, blog=None, company=None, country=None, date_created=None, descriptor=None, display_name=None, last_modified=None, links=None, mail=None, revision=None, unconfirmed_mail=None, user_name=None): - super(User, self).__init__() - self.bio = bio - self.blog = blog - self.company = company - self.country = country - self.date_created = date_created - self.descriptor = descriptor - self.display_name = display_name - self.last_modified = last_modified - self.links = links - self.mail = mail - self.revision = revision - self.unconfirmed_mail = unconfirmed_mail - self.user_name = user_name diff --git a/vsts/vsts/user/v4_1/models/user_attribute.py b/vsts/vsts/user/v4_1/models/user_attribute.py deleted file mode 100644 index 6e0da83c..00000000 --- a/vsts/vsts/user/v4_1/models/user_attribute.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 UserAttribute(Model): - """UserAttribute. - - :param last_modified: The date/time at which the attribute was last modified. - :type last_modified: datetime - :param name: The unique group-prefixed name of the attribute, e.g. "TFS.TimeZone". - :type name: str - :param revision: The attribute's revision, for change tracking. - :type revision: int - :param value: The value of the attribute. - :type value: str - """ - - _attribute_map = { - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'}, - 'value': {'key': 'value', 'type': 'str'} - } - - def __init__(self, last_modified=None, name=None, revision=None, value=None): - super(UserAttribute, self).__init__() - self.last_modified = last_modified - self.name = name - self.revision = revision - self.value = value diff --git a/vsts/vsts/user/v4_1/models/user_attributes.py b/vsts/vsts/user/v4_1/models/user_attributes.py deleted file mode 100644 index d06fb34f..00000000 --- a/vsts/vsts/user/v4_1/models/user_attributes.py +++ /dev/null @@ -1,29 +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 UserAttributes(Model): - """UserAttributes. - - :param attributes: Collection of attributes - :type attributes: list of :class:`UserAttribute ` - :param continuation_token: Opaque string to get the next chunk of results Server would return non-null string here if there is more data Client will need then to pass it to the server to get more results - :type continuation_token: str - """ - - _attribute_map = { - 'attributes': {'key': 'attributes', 'type': '[UserAttribute]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'} - } - - def __init__(self, attributes=None, continuation_token=None): - super(UserAttributes, self).__init__() - self.attributes = attributes - self.continuation_token = continuation_token diff --git a/vsts/vsts/user/v4_1/user_client.py b/vsts/vsts/user/v4_1/user_client.py deleted file mode 100644 index ed83a567..00000000 --- a/vsts/vsts/user/v4_1/user_client.py +++ /dev/null @@ -1,326 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# Generated file, DO NOT EDIT -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------------------------- - -from msrest import Serializer, Deserializer -from ...vss_client import VssClient -from . import models - - -class UserClient(VssClient): - """User - :param str base_url: Service URL - :param Authentication creds: Authenticated credentials. - """ - - def __init__(self, base_url=None, creds=None): - super(UserClient, self).__init__(base_url, creds) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - resource_area_identifier = None - - def delete_attribute(self, descriptor, attribute_name): - """DeleteAttribute. - [Preview API] Deletes an attribute for the given user. - :param str descriptor: The identity of the user for the operation. - :param str attribute_name: The name of the attribute to delete. - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - if attribute_name is not None: - route_values['attributeName'] = self._serialize.url('attribute_name', attribute_name, 'str') - self._send(http_method='DELETE', - location_id='ac77b682-1ef8-4277-afde-30af9b546004', - version='4.1-preview.2', - route_values=route_values) - - def get_attribute(self, descriptor, attribute_name): - """GetAttribute. - [Preview API] Retrieves an attribute for a given user. - :param str descriptor: The identity of the user for the operation. - :param str attribute_name: The name of the attribute to retrieve. - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - if attribute_name is not None: - route_values['attributeName'] = self._serialize.url('attribute_name', attribute_name, 'str') - response = self._send(http_method='GET', - location_id='ac77b682-1ef8-4277-afde-30af9b546004', - version='4.1-preview.2', - route_values=route_values) - return self._deserialize('UserAttribute', response) - - def query_attributes(self, descriptor, continuation_token=None, query_pattern=None, modified_after=None): - """QueryAttributes. - [Preview API] Retrieves attributes for a given user. May return subset of attributes providing continuation token to retrieve the next batch - :param str descriptor: The identity of the user for the operation. - :param str continuation_token: The token telling server to return the next chunk of attributes from where it stopped last time. This must either be null or be a value returned from the previous call to this API - :param str query_pattern: The wildcardable pattern for the attribute names to be retrieved, e.g. queryPattern=visualstudio.14.* - :param str modified_after: The optional date/time of the minimum modification date for attributes to be retrieved, e.g. modifiedafter=2017-04-12T15:00:00.000Z - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - query_parameters = {} - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - if query_pattern is not None: - query_parameters['queryPattern'] = self._serialize.query('query_pattern', query_pattern, 'str') - if modified_after is not None: - query_parameters['modifiedAfter'] = self._serialize.query('modified_after', modified_after, 'str') - response = self._send(http_method='GET', - location_id='ac77b682-1ef8-4277-afde-30af9b546004', - version='4.1-preview.2', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('UserAttributes', response) - - def set_attributes(self, attribute_parameters_list, descriptor): - """SetAttributes. - [Preview API] Updates multiple attributes for a given user. - :param [SetUserAttributeParameters] attribute_parameters_list: The list of attribute data to update. Existing values will be overwritten. - :param str descriptor: The identity of the user for the operation. - :rtype: [UserAttribute] - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - content = self._serialize.body(attribute_parameters_list, '[SetUserAttributeParameters]') - response = self._send(http_method='PATCH', - location_id='ac77b682-1ef8-4277-afde-30af9b546004', - version='4.1-preview.2', - route_values=route_values, - content=content, - returns_collection=True) - return self._deserialize('[UserAttribute]', response) - - def delete_avatar(self, descriptor): - """DeleteAvatar. - [Preview API] Deletes a user's avatar. - :param str descriptor: The identity of the user for the operation. - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - self._send(http_method='DELETE', - location_id='1c34cdf0-dd20-4370-a316-56ba776d75ce', - version='4.1-preview.1', - route_values=route_values) - - def get_avatar(self, descriptor, size=None, format=None): - """GetAvatar. - [Preview API] Retrieves the user's avatar. - :param str descriptor: The identity of the user for the operation. - :param str size: The size to retrieve, e.g. small, medium (default), or large. - :param str format: The format for the response. Can be null. Accepted values: "png", "json" - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - query_parameters = {} - if size is not None: - query_parameters['size'] = self._serialize.query('size', size, 'str') - if format is not None: - query_parameters['format'] = self._serialize.query('format', format, 'str') - response = self._send(http_method='GET', - location_id='1c34cdf0-dd20-4370-a316-56ba776d75ce', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('Avatar', response) - - def set_avatar(self, avatar, descriptor): - """SetAvatar. - [Preview API] Creates or updates an avatar to be associated with a given user. - :param :class:` ` avatar: The avatar to set. The Image property must contain the binary representation of the image, in either jpg or png format. - :param str descriptor: The identity of the user for the operation. - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - content = self._serialize.body(avatar, 'Avatar') - self._send(http_method='PUT', - location_id='1c34cdf0-dd20-4370-a316-56ba776d75ce', - version='4.1-preview.1', - route_values=route_values, - content=content) - - def create_avatar_preview(self, avatar, descriptor, size=None, display_name=None): - """CreateAvatarPreview. - [Preview API] - :param :class:` ` avatar: - :param str descriptor: - :param str size: - :param str display_name: - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - query_parameters = {} - if size is not None: - query_parameters['size'] = self._serialize.query('size', size, 'str') - if display_name is not None: - query_parameters['displayName'] = self._serialize.query('display_name', display_name, 'str') - content = self._serialize.body(avatar, 'Avatar') - response = self._send(http_method='POST', - location_id='aad154d3-750f-47e6-9898-dc3a2e7a1708', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters, - content=content) - return self._deserialize('Avatar', response) - - def get_descriptor(self, descriptor): - """GetDescriptor. - [Preview API] - :param str descriptor: - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - response = self._send(http_method='GET', - location_id='e338ed36-f702-44d3-8d18-9cba811d013a', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) - - def confirm_mail(self, confirmation_parameters, descriptor): - """ConfirmMail. - [Preview API] Confirms preferred email for a given user. - :param :class:` ` confirmation_parameters: - :param str descriptor: The descriptor identifying the user for the operation. - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - content = self._serialize.body(confirmation_parameters, 'MailConfirmationParameters') - self._send(http_method='POST', - location_id='fc213dcd-3a4e-4951-a2e2-7e3fed15706d', - version='4.1-preview.1', - route_values=route_values, - content=content) - - def write_notifications(self, notifications): - """WriteNotifications. - [Preview API] Stores/forwards provided notifications Accepts batch of notifications and each of those may be targeting multiple users - :param [SendUserNotificationParameters] notifications: Collection of notifications to be persisted. - """ - content = self._serialize.body(notifications, '[SendUserNotificationParameters]') - self._send(http_method='POST', - location_id='63e9e5c8-09a5-4de6-9aa1-01a96219073c', - version='4.1-preview.1', - content=content) - - def query_notifications(self, descriptor, top=None, continuation_token=None): - """QueryNotifications. - [Preview API] Queries notifications for a given user - :param str descriptor: The identity of the user for the operation. - :param int top: Maximum amount of items to retrieve. - :param str continuation_token: Token representing the position to restart reading notifications from. - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - query_parameters = {} - if top is not None: - query_parameters['top'] = self._serialize.query('top', top, 'int') - if continuation_token is not None: - query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') - response = self._send(http_method='GET', - location_id='58ff9476-0a49-4a70-81d6-1ef63d4f92e8', - version='4.1-preview.1', - route_values=route_values, - query_parameters=query_parameters) - return self._deserialize('UserNotifications', response) - - def get_storage_key(self, descriptor): - """GetStorageKey. - [Preview API] - :param str descriptor: - :rtype: str - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - response = self._send(http_method='GET', - location_id='c1d0bf9e-3220-44d9-b048-222ae15fc3e4', - version='4.1-preview.1', - route_values=route_values) - return self._deserialize('str', response) - - def get_user_defaults(self): - """GetUserDefaults. - [Preview API] Retrieves the default data for the authenticated user. - :rtype: :class:` ` - """ - response = self._send(http_method='GET', - location_id='a9e65880-7489-4453-aa72-0f7896f0b434', - version='4.1-preview.1') - return self._deserialize('User', response) - - def create_user(self, user_parameters, create_local=None): - """CreateUser. - [Preview API] Creates a new user. - :param :class:` ` user_parameters: The parameters to be used for user creation. - :param bool create_local: - :rtype: :class:` ` - """ - query_parameters = {} - if create_local is not None: - query_parameters['createLocal'] = self._serialize.query('create_local', create_local, 'bool') - content = self._serialize.body(user_parameters, 'CreateUserParameters') - response = self._send(http_method='POST', - location_id='61117502-a055-422c-9122-b56e6643ed02', - version='4.1-preview.2', - query_parameters=query_parameters, - content=content) - return self._deserialize('User', response) - - def get_user(self, descriptor, create_if_not_exists=None): - """GetUser. - [Preview API] Retrieves the data for a given user. - :param str descriptor: The identity of the user for the operation. - :param Boolean create_if_not_exists: Whether to auto-provision the authenticated user - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - response = self._send(http_method='GET', - location_id='61117502-a055-422c-9122-b56e6643ed02', - version='4.1-preview.2', - route_values=route_values) - return self._deserialize('User', response) - - def update_user(self, user_parameters, descriptor): - """UpdateUser. - [Preview API] Updates an existing user. - :param :class:` ` user_parameters: The parameters to be used for user update. - :param str descriptor: The identity of the user for the operation. - :rtype: :class:` ` - """ - route_values = {} - if descriptor is not None: - route_values['descriptor'] = self._serialize.url('descriptor', descriptor, 'str') - content = self._serialize.body(user_parameters, 'UpdateUserParameters') - response = self._send(http_method='PATCH', - location_id='61117502-a055-422c-9122-b56e6643ed02', - version='4.1-preview.2', - route_values=route_values, - content=content) - return self._deserialize('User', response) -