From 6ae5d08ede70015ede1bb76940243a2c38fee730 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 10 Oct 2018 17:26:33 +0000 Subject: [PATCH] Generated from 3854ef67da587db1215bfdd4cba1d34bcd2ebc79 Update graphrbac.json --- .../graphrbac/graph_rbac_management_client.py | 18 +- .../azure/graphrbac/models/__init__.py | 21 +- .../azure/graphrbac/models/aad_object.py | 120 ++++++++++ .../graphrbac/models/aad_object_paged.py | 27 +++ .../azure/graphrbac/models/aad_object_py3.py | 120 ++++++++++ .../azure/graphrbac/models/ad_group.py | 10 - .../azure/graphrbac/models/ad_group_py3.py | 12 +- .../azure/graphrbac/models/app_role.py | 57 ----- .../azure/graphrbac/models/app_role_py3.py | 57 ----- .../azure/graphrbac/models/application.py | 6 - ...py => application_add_owner_parameters.py} | 4 +- ...> application_add_owner_parameters_py3.py} | 4 +- .../models/application_create_parameters.py | 6 - .../application_create_parameters_py3.py | 8 +- .../azure/graphrbac/models/application_py3.py | 8 +- .../models/application_update_parameters.py | 6 - .../application_update_parameters_py3.py | 8 +- .../models/directory_object_paged.py | 2 +- .../models/get_objects_parameters.py | 10 +- .../models/get_objects_parameters_py3.py | 12 +- .../graphrbac/models/service_principal.py | 6 - .../service_principal_create_parameters.py | 48 +--- ...service_principal_create_parameters_py3.py | 50 +--- .../graphrbac/models/service_principal_py3.py | 8 +- .../service_principal_update_parameters.py | 85 ------- ...service_principal_update_parameters_py3.py | 85 ------- .../azure/graphrbac/operations/__init__.py | 8 +- .../operations/applications_operations.py | 4 +- .../deleted_applications_operations.py | 217 ------------------ .../graphrbac/operations/groups_operations.py | 142 +----------- .../operations/objects_operations.py | 67 +++++- .../service_principals_operations.py | 56 ----- .../operations/signed_in_user_operations.py | 161 ------------- azure-graphrbac/azure/graphrbac/version.py | 2 +- 34 files changed, 388 insertions(+), 1067 deletions(-) create mode 100644 azure-graphrbac/azure/graphrbac/models/aad_object.py create mode 100644 azure-graphrbac/azure/graphrbac/models/aad_object_paged.py create mode 100644 azure-graphrbac/azure/graphrbac/models/aad_object_py3.py delete mode 100644 azure-graphrbac/azure/graphrbac/models/app_role.py delete mode 100644 azure-graphrbac/azure/graphrbac/models/app_role_py3.py rename azure-graphrbac/azure/graphrbac/models/{add_owner_parameters.py => application_add_owner_parameters.py} (93%) rename azure-graphrbac/azure/graphrbac/models/{add_owner_parameters_py3.py => application_add_owner_parameters_py3.py} (93%) delete mode 100644 azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters.py delete mode 100644 azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters_py3.py delete mode 100644 azure-graphrbac/azure/graphrbac/operations/deleted_applications_operations.py delete mode 100644 azure-graphrbac/azure/graphrbac/operations/signed_in_user_operations.py diff --git a/azure-graphrbac/azure/graphrbac/graph_rbac_management_client.py b/azure-graphrbac/azure/graphrbac/graph_rbac_management_client.py index f117db210db6..2acc3afb88fc 100644 --- a/azure-graphrbac/azure/graphrbac/graph_rbac_management_client.py +++ b/azure-graphrbac/azure/graphrbac/graph_rbac_management_client.py @@ -13,13 +13,11 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from .operations.signed_in_user_operations import SignedInUserOperations +from .operations.objects_operations import ObjectsOperations from .operations.applications_operations import ApplicationsOperations -from .operations.deleted_applications_operations import DeletedApplicationsOperations from .operations.groups_operations import GroupsOperations from .operations.service_principals_operations import ServicePrincipalsOperations from .operations.users_operations import UsersOperations -from .operations.objects_operations import ObjectsOperations from .operations.domains_operations import DomainsOperations from .operations.oauth2_operations import OAuth2Operations from . import models @@ -63,20 +61,16 @@ class GraphRbacManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: GraphRbacManagementClientConfiguration - :ivar signed_in_user: SignedInUser operations - :vartype signed_in_user: azure.graphrbac.operations.SignedInUserOperations + :ivar objects: Objects operations + :vartype objects: azure.graphrbac.operations.ObjectsOperations :ivar applications: Applications operations :vartype applications: azure.graphrbac.operations.ApplicationsOperations - :ivar deleted_applications: DeletedApplications operations - :vartype deleted_applications: azure.graphrbac.operations.DeletedApplicationsOperations :ivar groups: Groups operations :vartype groups: azure.graphrbac.operations.GroupsOperations :ivar service_principals: ServicePrincipals operations :vartype service_principals: azure.graphrbac.operations.ServicePrincipalsOperations :ivar users: Users operations :vartype users: azure.graphrbac.operations.UsersOperations - :ivar objects: Objects operations - :vartype objects: azure.graphrbac.operations.ObjectsOperations :ivar domains: Domains operations :vartype domains: azure.graphrbac.operations.DomainsOperations :ivar oauth2: OAuth2 operations @@ -101,20 +95,16 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.signed_in_user = SignedInUserOperations( + self.objects = ObjectsOperations( self._client, self.config, self._serialize, self._deserialize) self.applications = ApplicationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.deleted_applications = DeletedApplicationsOperations( - self._client, self.config, self._serialize, self._deserialize) self.groups = GroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.service_principals = ServicePrincipalsOperations( self._client, self.config, self._serialize, self._deserialize) self.users = UsersOperations( self._client, self.config, self._serialize, self._deserialize) - self.objects = ObjectsOperations( - self._client, self.config, self._serialize, self._deserialize) self.domains = DomainsOperations( self._client, self.config, self._serialize, self._deserialize) self.oauth2 = OAuth2Operations( diff --git a/azure-graphrbac/azure/graphrbac/models/__init__.py b/azure-graphrbac/azure/graphrbac/models/__init__.py index 0708935493f8..36fb5b018482 100644 --- a/azure-graphrbac/azure/graphrbac/models/__init__.py +++ b/azure-graphrbac/azure/graphrbac/models/__init__.py @@ -16,13 +16,13 @@ from .password_credential_py3 import PasswordCredential from .resource_access_py3 import ResourceAccess from .required_resource_access_py3 import RequiredResourceAccess - from .app_role_py3 import AppRole from .application_create_parameters_py3 import ApplicationCreateParameters from .application_update_parameters_py3 import ApplicationUpdateParameters from .application_py3 import Application - from .add_owner_parameters_py3 import AddOwnerParameters + from .application_add_owner_parameters_py3 import ApplicationAddOwnerParameters from .key_credentials_update_parameters_py3 import KeyCredentialsUpdateParameters from .password_credentials_update_parameters_py3 import PasswordCredentialsUpdateParameters + from .aad_object_py3 import AADObject from .group_add_member_parameters_py3 import GroupAddMemberParameters from .group_create_parameters_py3 import GroupCreateParameters from .ad_group_py3 import ADGroup @@ -30,7 +30,6 @@ from .check_group_membership_parameters_py3 import CheckGroupMembershipParameters from .check_group_membership_result_py3 import CheckGroupMembershipResult from .service_principal_create_parameters_py3 import ServicePrincipalCreateParameters - from .service_principal_update_parameters_py3 import ServicePrincipalUpdateParameters from .service_principal_py3 import ServicePrincipal from .password_profile_py3 import PasswordProfile from .user_base_py3 import UserBase @@ -49,13 +48,13 @@ from .password_credential import PasswordCredential from .resource_access import ResourceAccess from .required_resource_access import RequiredResourceAccess - from .app_role import AppRole from .application_create_parameters import ApplicationCreateParameters from .application_update_parameters import ApplicationUpdateParameters from .application import Application - from .add_owner_parameters import AddOwnerParameters + from .application_add_owner_parameters import ApplicationAddOwnerParameters from .key_credentials_update_parameters import KeyCredentialsUpdateParameters from .password_credentials_update_parameters import PasswordCredentialsUpdateParameters + from .aad_object import AADObject from .group_add_member_parameters import GroupAddMemberParameters from .group_create_parameters import GroupCreateParameters from .ad_group import ADGroup @@ -63,7 +62,6 @@ from .check_group_membership_parameters import CheckGroupMembershipParameters from .check_group_membership_result import CheckGroupMembershipResult from .service_principal_create_parameters import ServicePrincipalCreateParameters - from .service_principal_update_parameters import ServicePrincipalUpdateParameters from .service_principal import ServicePrincipal from .password_profile import PasswordProfile from .user_base import UserBase @@ -75,8 +73,9 @@ from .get_objects_parameters import GetObjectsParameters from .domain import Domain from .permissions import Permissions -from .directory_object_paged import DirectoryObjectPaged +from .aad_object_paged import AADObjectPaged from .application_paged import ApplicationPaged +from .directory_object_paged import DirectoryObjectPaged from .key_credential_paged import KeyCredentialPaged from .password_credential_paged import PasswordCredentialPaged from .ad_group_paged import ADGroupPaged @@ -95,13 +94,13 @@ 'PasswordCredential', 'ResourceAccess', 'RequiredResourceAccess', - 'AppRole', 'ApplicationCreateParameters', 'ApplicationUpdateParameters', 'Application', - 'AddOwnerParameters', + 'ApplicationAddOwnerParameters', 'KeyCredentialsUpdateParameters', 'PasswordCredentialsUpdateParameters', + 'AADObject', 'GroupAddMemberParameters', 'GroupCreateParameters', 'ADGroup', @@ -109,7 +108,6 @@ 'CheckGroupMembershipParameters', 'CheckGroupMembershipResult', 'ServicePrincipalCreateParameters', - 'ServicePrincipalUpdateParameters', 'ServicePrincipal', 'PasswordProfile', 'UserBase', @@ -121,8 +119,9 @@ 'GetObjectsParameters', 'Domain', 'Permissions', - 'DirectoryObjectPaged', + 'AADObjectPaged', 'ApplicationPaged', + 'DirectoryObjectPaged', 'KeyCredentialPaged', 'PasswordCredentialPaged', 'ADGroupPaged', diff --git a/azure-graphrbac/azure/graphrbac/models/aad_object.py b/azure-graphrbac/azure/graphrbac/models/aad_object.py new file mode 100644 index 000000000000..373601b2bf80 --- /dev/null +++ b/azure-graphrbac/azure/graphrbac/models/aad_object.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AADObject(Model): + """The properties of an Active Directory object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param object_id: The ID of the object. + :type object_id: str + :param object_type: The type of AAD object. + :type object_type: str + :param display_name: The display name of the object. + :type display_name: str + :param user_principal_name: The principal name of the object. + :type user_principal_name: str + :param mail: The primary email address of the object. + :type mail: str + :param mail_enabled: Whether the AAD object is mail-enabled. + :type mail_enabled: bool + :ivar mail_nickname: The mail alias for the user. + :vartype mail_nickname: str + :param security_enabled: Whether the AAD object is security-enabled. + :type security_enabled: bool + :param sign_in_name: The sign-in name of the object. + :type sign_in_name: str + :param service_principal_names: A collection of service principal names + associated with the object. + :type service_principal_names: list[str] + :param user_type: The user type of the object. + :type user_type: str + :ivar usage_location: A two letter country code (ISO standard 3166). + Required for users that will be assigned licenses due to legal requirement + to check for availability of services in countries. Examples include: + "US", "JP", and "GB". + :vartype usage_location: str + :ivar app_id: The application ID. + :vartype app_id: str + :ivar app_permissions: The application permissions. + :vartype app_permissions: list[str] + :ivar available_to_other_tenants: Whether the application is be available + to other tenants. + :vartype available_to_other_tenants: bool + :ivar identifier_uris: A collection of URIs for the application. + :vartype identifier_uris: list[str] + :ivar reply_urls: A collection of reply URLs for the application. + :vartype reply_urls: list[str] + :ivar homepage: The home page of the application. + :vartype homepage: str + """ + + _validation = { + 'mail_nickname': {'readonly': True}, + 'usage_location': {'readonly': True}, + 'app_id': {'readonly': True}, + 'app_permissions': {'readonly': True}, + 'available_to_other_tenants': {'readonly': True}, + 'identifier_uris': {'readonly': True}, + 'reply_urls': {'readonly': True}, + 'homepage': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + 'mail': {'key': 'mail', 'type': 'str'}, + 'mail_enabled': {'key': 'mailEnabled', 'type': 'bool'}, + 'mail_nickname': {'key': 'mailNickname', 'type': 'str'}, + 'security_enabled': {'key': 'securityEnabled', 'type': 'bool'}, + 'sign_in_name': {'key': 'signInName', 'type': 'str'}, + 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, + 'user_type': {'key': 'userType', 'type': 'str'}, + 'usage_location': {'key': 'usageLocation', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_permissions': {'key': 'appPermissions', 'type': '[str]'}, + 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, + 'identifier_uris': {'key': 'identifierUris', 'type': '[str]'}, + 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, + 'homepage': {'key': 'homepage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AADObject, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.object_id = kwargs.get('object_id', None) + self.object_type = kwargs.get('object_type', None) + self.display_name = kwargs.get('display_name', None) + self.user_principal_name = kwargs.get('user_principal_name', None) + self.mail = kwargs.get('mail', None) + self.mail_enabled = kwargs.get('mail_enabled', None) + self.mail_nickname = None + self.security_enabled = kwargs.get('security_enabled', None) + self.sign_in_name = kwargs.get('sign_in_name', None) + self.service_principal_names = kwargs.get('service_principal_names', None) + self.user_type = kwargs.get('user_type', None) + self.usage_location = None + self.app_id = None + self.app_permissions = None + self.available_to_other_tenants = None + self.identifier_uris = None + self.reply_urls = None + self.homepage = None diff --git a/azure-graphrbac/azure/graphrbac/models/aad_object_paged.py b/azure-graphrbac/azure/graphrbac/models/aad_object_paged.py new file mode 100644 index 000000000000..2e67f8f64fac --- /dev/null +++ b/azure-graphrbac/azure/graphrbac/models/aad_object_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AADObjectPaged(Paged): + """ + A paging container for iterating over a list of :class:`AADObject ` object + """ + + _attribute_map = { + 'next_link': {'key': 'odata\\.nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AADObject]'} + } + + def __init__(self, *args, **kwargs): + + super(AADObjectPaged, self).__init__(*args, **kwargs) diff --git a/azure-graphrbac/azure/graphrbac/models/aad_object_py3.py b/azure-graphrbac/azure/graphrbac/models/aad_object_py3.py new file mode 100644 index 000000000000..d758e0057745 --- /dev/null +++ b/azure-graphrbac/azure/graphrbac/models/aad_object_py3.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AADObject(Model): + """The properties of an Active Directory object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param object_id: The ID of the object. + :type object_id: str + :param object_type: The type of AAD object. + :type object_type: str + :param display_name: The display name of the object. + :type display_name: str + :param user_principal_name: The principal name of the object. + :type user_principal_name: str + :param mail: The primary email address of the object. + :type mail: str + :param mail_enabled: Whether the AAD object is mail-enabled. + :type mail_enabled: bool + :ivar mail_nickname: The mail alias for the user. + :vartype mail_nickname: str + :param security_enabled: Whether the AAD object is security-enabled. + :type security_enabled: bool + :param sign_in_name: The sign-in name of the object. + :type sign_in_name: str + :param service_principal_names: A collection of service principal names + associated with the object. + :type service_principal_names: list[str] + :param user_type: The user type of the object. + :type user_type: str + :ivar usage_location: A two letter country code (ISO standard 3166). + Required for users that will be assigned licenses due to legal requirement + to check for availability of services in countries. Examples include: + "US", "JP", and "GB". + :vartype usage_location: str + :ivar app_id: The application ID. + :vartype app_id: str + :ivar app_permissions: The application permissions. + :vartype app_permissions: list[str] + :ivar available_to_other_tenants: Whether the application is be available + to other tenants. + :vartype available_to_other_tenants: bool + :ivar identifier_uris: A collection of URIs for the application. + :vartype identifier_uris: list[str] + :ivar reply_urls: A collection of reply URLs for the application. + :vartype reply_urls: list[str] + :ivar homepage: The home page of the application. + :vartype homepage: str + """ + + _validation = { + 'mail_nickname': {'readonly': True}, + 'usage_location': {'readonly': True}, + 'app_id': {'readonly': True}, + 'app_permissions': {'readonly': True}, + 'available_to_other_tenants': {'readonly': True}, + 'identifier_uris': {'readonly': True}, + 'reply_urls': {'readonly': True}, + 'homepage': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + 'mail': {'key': 'mail', 'type': 'str'}, + 'mail_enabled': {'key': 'mailEnabled', 'type': 'bool'}, + 'mail_nickname': {'key': 'mailNickname', 'type': 'str'}, + 'security_enabled': {'key': 'securityEnabled', 'type': 'bool'}, + 'sign_in_name': {'key': 'signInName', 'type': 'str'}, + 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, + 'user_type': {'key': 'userType', 'type': 'str'}, + 'usage_location': {'key': 'usageLocation', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_permissions': {'key': 'appPermissions', 'type': '[str]'}, + 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, + 'identifier_uris': {'key': 'identifierUris', 'type': '[str]'}, + 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, + 'homepage': {'key': 'homepage', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, object_id: str=None, object_type: str=None, display_name: str=None, user_principal_name: str=None, mail: str=None, mail_enabled: bool=None, security_enabled: bool=None, sign_in_name: str=None, service_principal_names=None, user_type: str=None, **kwargs) -> None: + super(AADObject, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.object_id = object_id + self.object_type = object_type + self.display_name = display_name + self.user_principal_name = user_principal_name + self.mail = mail + self.mail_enabled = mail_enabled + self.mail_nickname = None + self.security_enabled = security_enabled + self.sign_in_name = sign_in_name + self.service_principal_names = service_principal_names + self.user_type = user_type + self.usage_location = None + self.app_id = None + self.app_permissions = None + self.available_to_other_tenants = None + self.identifier_uris = None + self.reply_urls = None + self.homepage = None diff --git a/azure-graphrbac/azure/graphrbac/models/ad_group.py b/azure-graphrbac/azure/graphrbac/models/ad_group.py index b5eca7ec4089..b282e8e10c03 100644 --- a/azure-graphrbac/azure/graphrbac/models/ad_group.py +++ b/azure-graphrbac/azure/graphrbac/models/ad_group.py @@ -32,12 +32,6 @@ class ADGroup(DirectoryObject): :type object_type: str :param display_name: The display name of the group. :type display_name: str - :param mail_enabled: Whether the group is mail-enabled. Must be false. - This is because only pure security groups can be created using the Graph - API. - :type mail_enabled: bool - :param mail_nickname: The mail alias for the group. - :type mail_nickname: str :param security_enabled: Whether the group is security-enable. :type security_enabled: bool :param mail: The primary email address of the group. @@ -56,8 +50,6 @@ class ADGroup(DirectoryObject): 'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'}, 'object_type': {'key': 'objectType', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'mail_enabled': {'key': 'mailEnabled', 'type': 'bool'}, - 'mail_nickname': {'key': 'mailNickname', 'type': 'str'}, 'security_enabled': {'key': 'securityEnabled', 'type': 'bool'}, 'mail': {'key': 'mail', 'type': 'str'}, } @@ -65,8 +57,6 @@ class ADGroup(DirectoryObject): def __init__(self, **kwargs): super(ADGroup, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) - self.mail_enabled = kwargs.get('mail_enabled', None) - self.mail_nickname = kwargs.get('mail_nickname', None) self.security_enabled = kwargs.get('security_enabled', None) self.mail = kwargs.get('mail', None) self.object_type = 'Group' diff --git a/azure-graphrbac/azure/graphrbac/models/ad_group_py3.py b/azure-graphrbac/azure/graphrbac/models/ad_group_py3.py index 212d69cb1fc2..36f230513ff8 100644 --- a/azure-graphrbac/azure/graphrbac/models/ad_group_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/ad_group_py3.py @@ -32,12 +32,6 @@ class ADGroup(DirectoryObject): :type object_type: str :param display_name: The display name of the group. :type display_name: str - :param mail_enabled: Whether the group is mail-enabled. Must be false. - This is because only pure security groups can be created using the Graph - API. - :type mail_enabled: bool - :param mail_nickname: The mail alias for the group. - :type mail_nickname: str :param security_enabled: Whether the group is security-enable. :type security_enabled: bool :param mail: The primary email address of the group. @@ -56,17 +50,13 @@ class ADGroup(DirectoryObject): 'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'}, 'object_type': {'key': 'objectType', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'mail_enabled': {'key': 'mailEnabled', 'type': 'bool'}, - 'mail_nickname': {'key': 'mailNickname', 'type': 'str'}, 'security_enabled': {'key': 'securityEnabled', 'type': 'bool'}, 'mail': {'key': 'mail', 'type': 'str'}, } - def __init__(self, *, additional_properties=None, display_name: str=None, mail_enabled: bool=None, mail_nickname: str=None, security_enabled: bool=None, mail: str=None, **kwargs) -> None: + def __init__(self, *, additional_properties=None, display_name: str=None, security_enabled: bool=None, mail: str=None, **kwargs) -> None: super(ADGroup, self).__init__(additional_properties=additional_properties, **kwargs) self.display_name = display_name - self.mail_enabled = mail_enabled - self.mail_nickname = mail_nickname self.security_enabled = security_enabled self.mail = mail self.object_type = 'Group' diff --git a/azure-graphrbac/azure/graphrbac/models/app_role.py b/azure-graphrbac/azure/graphrbac/models/app_role.py deleted file mode 100644 index 174984015873..000000000000 --- a/azure-graphrbac/azure/graphrbac/models/app_role.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppRole(Model): - """AppRole. - - :param id: Unique role identifier inside the appRoles collection. - :type id: str - :param allowed_member_types: Specifies whether this app role definition - can be assigned to users and groups by setting to 'User', or to other - applications (that are accessing this application in daemon service - scenarios) by setting to 'Application', or to both. - :type allowed_member_types: list[str] - :param description: Permission help text that appears in the admin app - assignment and consent experiences. - :type description: str - :param display_name: Display name for the permission that appears in the - admin consent and app assignment experiences. - :type display_name: str - :param is_enabled: When creating or updating a role definition, this must - be set to true (which is the default). To delete a role, this must first - be set to false. At that point, in a subsequent call, this role may be - removed. - :type is_enabled: bool - :param value: Specifies the value of the roles claim that the application - should expect in the authentication and access tokens. - :type value: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'allowed_member_types': {'key': 'allowedMemberTypes', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AppRole, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.allowed_member_types = kwargs.get('allowed_member_types', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', None) - self.value = kwargs.get('value', None) diff --git a/azure-graphrbac/azure/graphrbac/models/app_role_py3.py b/azure-graphrbac/azure/graphrbac/models/app_role_py3.py deleted file mode 100644 index 0292e877b7f5..000000000000 --- a/azure-graphrbac/azure/graphrbac/models/app_role_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppRole(Model): - """AppRole. - - :param id: Unique role identifier inside the appRoles collection. - :type id: str - :param allowed_member_types: Specifies whether this app role definition - can be assigned to users and groups by setting to 'User', or to other - applications (that are accessing this application in daemon service - scenarios) by setting to 'Application', or to both. - :type allowed_member_types: list[str] - :param description: Permission help text that appears in the admin app - assignment and consent experiences. - :type description: str - :param display_name: Display name for the permission that appears in the - admin consent and app assignment experiences. - :type display_name: str - :param is_enabled: When creating or updating a role definition, this must - be set to true (which is the default). To delete a role, this must first - be set to false. At that point, in a subsequent call, this role may be - removed. - :type is_enabled: bool - :param value: Specifies the value of the roles claim that the application - should expect in the authentication and access tokens. - :type value: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'allowed_member_types': {'key': 'allowedMemberTypes', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, allowed_member_types=None, description: str=None, display_name: str=None, is_enabled: bool=None, value: str=None, **kwargs) -> None: - super(AppRole, self).__init__(**kwargs) - self.id = id - self.allowed_member_types = allowed_member_types - self.description = description - self.display_name = display_name - self.is_enabled = is_enabled - self.value = value diff --git a/azure-graphrbac/azure/graphrbac/models/application.py b/azure-graphrbac/azure/graphrbac/models/application.py index c6330273a1f7..7bff3d81f834 100644 --- a/azure-graphrbac/azure/graphrbac/models/application.py +++ b/azure-graphrbac/azure/graphrbac/models/application.py @@ -32,10 +32,6 @@ class Application(DirectoryObject): :type object_type: str :param app_id: The application ID. :type app_id: str - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param app_permissions: The application permissions. :type app_permissions: list[str] :param available_to_other_tenants: Whether the application is be available @@ -66,7 +62,6 @@ class Application(DirectoryObject): 'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'}, 'object_type': {'key': 'objectType', 'type': 'str'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'app_permissions': {'key': 'appPermissions', 'type': '[str]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, @@ -79,7 +74,6 @@ class Application(DirectoryObject): def __init__(self, **kwargs): super(Application, self).__init__(**kwargs) self.app_id = kwargs.get('app_id', None) - self.app_roles = kwargs.get('app_roles', None) self.app_permissions = kwargs.get('app_permissions', None) self.available_to_other_tenants = kwargs.get('available_to_other_tenants', None) self.display_name = kwargs.get('display_name', None) diff --git a/azure-graphrbac/azure/graphrbac/models/add_owner_parameters.py b/azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters.py similarity index 93% rename from azure-graphrbac/azure/graphrbac/models/add_owner_parameters.py rename to azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters.py index c7dfa3a68db9..b40d3e6cdb75 100644 --- a/azure-graphrbac/azure/graphrbac/models/add_owner_parameters.py +++ b/azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class AddOwnerParameters(Model): +class ApplicationAddOwnerParameters(Model): """Request parameters for adding a owner to an application. All required parameters must be populated in order to send to Azure. @@ -38,6 +38,6 @@ class AddOwnerParameters(Model): } def __init__(self, **kwargs): - super(AddOwnerParameters, self).__init__(**kwargs) + super(ApplicationAddOwnerParameters, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) self.url = kwargs.get('url', None) diff --git a/azure-graphrbac/azure/graphrbac/models/add_owner_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters_py3.py similarity index 93% rename from azure-graphrbac/azure/graphrbac/models/add_owner_parameters_py3.py rename to azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters_py3.py index 1d2f474d42bb..1f45c62a58ef 100644 --- a/azure-graphrbac/azure/graphrbac/models/add_owner_parameters_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/application_add_owner_parameters_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class AddOwnerParameters(Model): +class ApplicationAddOwnerParameters(Model): """Request parameters for adding a owner to an application. All required parameters must be populated in order to send to Azure. @@ -38,6 +38,6 @@ class AddOwnerParameters(Model): } def __init__(self, *, url: str, additional_properties=None, **kwargs) -> None: - super(AddOwnerParameters, self).__init__(**kwargs) + super(ApplicationAddOwnerParameters, self).__init__(**kwargs) self.additional_properties = additional_properties self.url = url diff --git a/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py b/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py index 9c2b0e9c83e4..e3482bf86341 100644 --- a/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py +++ b/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py @@ -20,10 +20,6 @@ class ApplicationCreateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param available_to_other_tenants: Required. Whether the application is available to other tenants. :type available_to_other_tenants: bool @@ -60,7 +56,6 @@ class ApplicationCreateParameters(Model): _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'homepage': {'key': 'homepage', 'type': 'str'}, @@ -75,7 +70,6 @@ class ApplicationCreateParameters(Model): def __init__(self, **kwargs): super(ApplicationCreateParameters, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) - self.app_roles = kwargs.get('app_roles', None) self.available_to_other_tenants = kwargs.get('available_to_other_tenants', None) self.display_name = kwargs.get('display_name', None) self.homepage = kwargs.get('homepage', None) diff --git a/azure-graphrbac/azure/graphrbac/models/application_create_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/application_create_parameters_py3.py index a64daff94ed2..87082c205078 100644 --- a/azure-graphrbac/azure/graphrbac/models/application_create_parameters_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/application_create_parameters_py3.py @@ -20,10 +20,6 @@ class ApplicationCreateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param available_to_other_tenants: Required. Whether the application is available to other tenants. :type available_to_other_tenants: bool @@ -60,7 +56,6 @@ class ApplicationCreateParameters(Model): _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'homepage': {'key': 'homepage', 'type': 'str'}, @@ -72,10 +67,9 @@ class ApplicationCreateParameters(Model): 'required_resource_access': {'key': 'requiredResourceAccess', 'type': '[RequiredResourceAccess]'}, } - def __init__(self, *, available_to_other_tenants: bool, display_name: str, identifier_uris, additional_properties=None, app_roles=None, homepage: str=None, reply_urls=None, key_credentials=None, password_credentials=None, oauth2_allow_implicit_flow: bool=None, required_resource_access=None, **kwargs) -> None: + def __init__(self, *, available_to_other_tenants: bool, display_name: str, identifier_uris, additional_properties=None, homepage: str=None, reply_urls=None, key_credentials=None, password_credentials=None, oauth2_allow_implicit_flow: bool=None, required_resource_access=None, **kwargs) -> None: super(ApplicationCreateParameters, self).__init__(**kwargs) self.additional_properties = additional_properties - self.app_roles = app_roles self.available_to_other_tenants = available_to_other_tenants self.display_name = display_name self.homepage = homepage diff --git a/azure-graphrbac/azure/graphrbac/models/application_py3.py b/azure-graphrbac/azure/graphrbac/models/application_py3.py index be0ea5d714c5..d069287e16e6 100644 --- a/azure-graphrbac/azure/graphrbac/models/application_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/application_py3.py @@ -32,10 +32,6 @@ class Application(DirectoryObject): :type object_type: str :param app_id: The application ID. :type app_id: str - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param app_permissions: The application permissions. :type app_permissions: list[str] :param available_to_other_tenants: Whether the application is be available @@ -66,7 +62,6 @@ class Application(DirectoryObject): 'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'}, 'object_type': {'key': 'objectType', 'type': 'str'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'app_permissions': {'key': 'appPermissions', 'type': '[str]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, @@ -76,10 +71,9 @@ class Application(DirectoryObject): 'oauth2_allow_implicit_flow': {'key': 'oauth2AllowImplicitFlow', 'type': 'bool'}, } - def __init__(self, *, additional_properties=None, app_id: str=None, app_roles=None, app_permissions=None, available_to_other_tenants: bool=None, display_name: str=None, identifier_uris=None, reply_urls=None, homepage: str=None, oauth2_allow_implicit_flow: bool=None, **kwargs) -> None: + def __init__(self, *, additional_properties=None, app_id: str=None, app_permissions=None, available_to_other_tenants: bool=None, display_name: str=None, identifier_uris=None, reply_urls=None, homepage: str=None, oauth2_allow_implicit_flow: bool=None, **kwargs) -> None: super(Application, self).__init__(additional_properties=additional_properties, **kwargs) self.app_id = app_id - self.app_roles = app_roles self.app_permissions = app_permissions self.available_to_other_tenants = available_to_other_tenants self.display_name = display_name diff --git a/azure-graphrbac/azure/graphrbac/models/application_update_parameters.py b/azure-graphrbac/azure/graphrbac/models/application_update_parameters.py index ecb1068d31c7..f1ebe6a01eca 100644 --- a/azure-graphrbac/azure/graphrbac/models/application_update_parameters.py +++ b/azure-graphrbac/azure/graphrbac/models/application_update_parameters.py @@ -18,10 +18,6 @@ class ApplicationUpdateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param available_to_other_tenants: Whether the application is available to other tenants :type available_to_other_tenants: bool @@ -51,7 +47,6 @@ class ApplicationUpdateParameters(Model): _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'homepage': {'key': 'homepage', 'type': 'str'}, @@ -66,7 +61,6 @@ class ApplicationUpdateParameters(Model): def __init__(self, **kwargs): super(ApplicationUpdateParameters, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) - self.app_roles = kwargs.get('app_roles', None) self.available_to_other_tenants = kwargs.get('available_to_other_tenants', None) self.display_name = kwargs.get('display_name', None) self.homepage = kwargs.get('homepage', None) diff --git a/azure-graphrbac/azure/graphrbac/models/application_update_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/application_update_parameters_py3.py index c8efcf211d61..d0c1be0e15bf 100644 --- a/azure-graphrbac/azure/graphrbac/models/application_update_parameters_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/application_update_parameters_py3.py @@ -18,10 +18,6 @@ class ApplicationUpdateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param available_to_other_tenants: Whether the application is available to other tenants :type available_to_other_tenants: bool @@ -51,7 +47,6 @@ class ApplicationUpdateParameters(Model): _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'available_to_other_tenants': {'key': 'availableToOtherTenants', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'homepage': {'key': 'homepage', 'type': 'str'}, @@ -63,10 +58,9 @@ class ApplicationUpdateParameters(Model): 'required_resource_access': {'key': 'requiredResourceAccess', 'type': '[RequiredResourceAccess]'}, } - def __init__(self, *, additional_properties=None, app_roles=None, available_to_other_tenants: bool=None, display_name: str=None, homepage: str=None, identifier_uris=None, reply_urls=None, key_credentials=None, password_credentials=None, oauth2_allow_implicit_flow: bool=None, required_resource_access=None, **kwargs) -> None: + def __init__(self, *, additional_properties=None, available_to_other_tenants: bool=None, display_name: str=None, homepage: str=None, identifier_uris=None, reply_urls=None, key_credentials=None, password_credentials=None, oauth2_allow_implicit_flow: bool=None, required_resource_access=None, **kwargs) -> None: super(ApplicationUpdateParameters, self).__init__(**kwargs) self.additional_properties = additional_properties - self.app_roles = app_roles self.available_to_other_tenants = available_to_other_tenants self.display_name = display_name self.homepage = homepage diff --git a/azure-graphrbac/azure/graphrbac/models/directory_object_paged.py b/azure-graphrbac/azure/graphrbac/models/directory_object_paged.py index 2873512be9c0..9afb9de28259 100644 --- a/azure-graphrbac/azure/graphrbac/models/directory_object_paged.py +++ b/azure-graphrbac/azure/graphrbac/models/directory_object_paged.py @@ -18,7 +18,7 @@ class DirectoryObjectPaged(Paged): """ _attribute_map = { - 'next_link': {'key': 'odata\\.nextLink', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[DirectoryObject]'} } diff --git a/azure-graphrbac/azure/graphrbac/models/get_objects_parameters.py b/azure-graphrbac/azure/graphrbac/models/get_objects_parameters.py index 598445e6fc15..cfc3b3c93c40 100644 --- a/azure-graphrbac/azure/graphrbac/models/get_objects_parameters.py +++ b/azure-graphrbac/azure/graphrbac/models/get_objects_parameters.py @@ -15,6 +15,8 @@ class GetObjectsParameters(Model): """Request parameters for the GetObjectsByObjectIds API. + All required parameters must be populated in order to send to Azure. + :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] @@ -22,11 +24,15 @@ class GetObjectsParameters(Model): :type object_ids: list[str] :param types: The requested object types. :type types: list[str] - :param include_directory_object_references: If true, also searches for - object IDs in the partner tenant. + :param include_directory_object_references: Required. If true, also + searches for object IDs in the partner tenant. :type include_directory_object_references: bool """ + _validation = { + 'include_directory_object_references': {'required': True}, + } + _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'object_ids': {'key': 'objectIds', 'type': '[str]'}, diff --git a/azure-graphrbac/azure/graphrbac/models/get_objects_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/get_objects_parameters_py3.py index c618f6e93cea..1c7620f14b78 100644 --- a/azure-graphrbac/azure/graphrbac/models/get_objects_parameters_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/get_objects_parameters_py3.py @@ -15,6 +15,8 @@ class GetObjectsParameters(Model): """Request parameters for the GetObjectsByObjectIds API. + All required parameters must be populated in order to send to Azure. + :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] @@ -22,11 +24,15 @@ class GetObjectsParameters(Model): :type object_ids: list[str] :param types: The requested object types. :type types: list[str] - :param include_directory_object_references: If true, also searches for - object IDs in the partner tenant. + :param include_directory_object_references: Required. If true, also + searches for object IDs in the partner tenant. :type include_directory_object_references: bool """ + _validation = { + 'include_directory_object_references': {'required': True}, + } + _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'object_ids': {'key': 'objectIds', 'type': '[str]'}, @@ -34,7 +40,7 @@ class GetObjectsParameters(Model): 'include_directory_object_references': {'key': 'includeDirectoryObjectReferences', 'type': 'bool'}, } - def __init__(self, *, additional_properties=None, object_ids=None, types=None, include_directory_object_references: bool=None, **kwargs) -> None: + def __init__(self, *, include_directory_object_references: bool, additional_properties=None, object_ids=None, types=None, **kwargs) -> None: super(GetObjectsParameters, self).__init__(**kwargs) self.additional_properties = additional_properties self.object_ids = object_ids diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal.py b/azure-graphrbac/azure/graphrbac/models/service_principal.py index d68f9140ce40..761fe161b257 100644 --- a/azure-graphrbac/azure/graphrbac/models/service_principal.py +++ b/azure-graphrbac/azure/graphrbac/models/service_principal.py @@ -34,10 +34,6 @@ class ServicePrincipal(DirectoryObject): :type display_name: str :param app_id: The application ID. :type app_id: str - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param service_principal_names: A collection of service principal names. :type service_principal_names: list[str] """ @@ -55,7 +51,6 @@ class ServicePrincipal(DirectoryObject): 'object_type': {'key': 'objectType', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, } @@ -63,6 +58,5 @@ def __init__(self, **kwargs): super(ServicePrincipal, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.app_id = kwargs.get('app_id', None) - self.app_roles = kwargs.get('app_roles', None) self.service_principal_names = kwargs.get('service_principal_names', None) self.object_type = 'ServicePrincipal' diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters.py b/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters.py index 40661faa8b45..a788a73032e7 100644 --- a/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters.py +++ b/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters.py @@ -20,72 +20,34 @@ class ServicePrincipalCreateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param account_enabled: Whether the account is enabled - :type account_enabled: bool :param app_id: Required. application Id :type app_id: str - :param app_role_assignment_required: Specifies whether an - AppRoleAssignment to a user or group is required before Azure AD will - issue a user or access token to the application. - :type app_role_assignment_required: bool - :param display_name: The display name for the service principal. - :type display_name: str - :param error_url: - :type error_url: str - :param homepage: The URL to the homepage of the associated application. - :type homepage: str + :param account_enabled: Required. Whether the account is enabled + :type account_enabled: bool :param key_credentials: A collection of KeyCredential objects. :type key_credentials: list[~azure.graphrbac.models.KeyCredential] :param password_credentials: A collection of PasswordCredential objects :type password_credentials: list[~azure.graphrbac.models.PasswordCredential] - :param publisher_name: The display name of the tenant in which the - associated application is specified. - :type publisher_name: str - :param reply_urls: A collection of reply URLs for the service principal. - :type reply_urls: list[str] - :param saml_metadata_url: - :type saml_metadata_url: str - :param service_principal_names: A collection of service principal names. - :type service_principal_names: list[str] - :param tags: - :type tags: list[str] """ _validation = { 'app_id': {'required': True}, + 'account_enabled': {'required': True}, } _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_role_assignment_required': {'key': 'appRoleAssignmentRequired', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'error_url': {'key': 'errorUrl', 'type': 'str'}, - 'homepage': {'key': 'homepage', 'type': 'str'}, + 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, 'key_credentials': {'key': 'keyCredentials', 'type': '[KeyCredential]'}, 'password_credentials': {'key': 'passwordCredentials', 'type': '[PasswordCredential]'}, - 'publisher_name': {'key': 'publisherName', 'type': 'str'}, - 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, - 'saml_metadata_url': {'key': 'samlMetadataUrl', 'type': 'str'}, - 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '[str]'}, } def __init__(self, **kwargs): super(ServicePrincipalCreateParameters, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) - self.account_enabled = kwargs.get('account_enabled', None) self.app_id = kwargs.get('app_id', None) - self.app_role_assignment_required = kwargs.get('app_role_assignment_required', None) - self.display_name = kwargs.get('display_name', None) - self.error_url = kwargs.get('error_url', None) - self.homepage = kwargs.get('homepage', None) + self.account_enabled = kwargs.get('account_enabled', None) self.key_credentials = kwargs.get('key_credentials', None) self.password_credentials = kwargs.get('password_credentials', None) - self.publisher_name = kwargs.get('publisher_name', None) - self.reply_urls = kwargs.get('reply_urls', None) - self.saml_metadata_url = kwargs.get('saml_metadata_url', None) - self.service_principal_names = kwargs.get('service_principal_names', None) - self.tags = kwargs.get('tags', None) diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters_py3.py index ee22eac837f2..b5a5b4e29c46 100644 --- a/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/service_principal_create_parameters_py3.py @@ -20,72 +20,34 @@ class ServicePrincipalCreateParameters(Model): :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] - :param account_enabled: Whether the account is enabled - :type account_enabled: bool :param app_id: Required. application Id :type app_id: str - :param app_role_assignment_required: Specifies whether an - AppRoleAssignment to a user or group is required before Azure AD will - issue a user or access token to the application. - :type app_role_assignment_required: bool - :param display_name: The display name for the service principal. - :type display_name: str - :param error_url: - :type error_url: str - :param homepage: The URL to the homepage of the associated application. - :type homepage: str + :param account_enabled: Required. Whether the account is enabled + :type account_enabled: bool :param key_credentials: A collection of KeyCredential objects. :type key_credentials: list[~azure.graphrbac.models.KeyCredential] :param password_credentials: A collection of PasswordCredential objects :type password_credentials: list[~azure.graphrbac.models.PasswordCredential] - :param publisher_name: The display name of the tenant in which the - associated application is specified. - :type publisher_name: str - :param reply_urls: A collection of reply URLs for the service principal. - :type reply_urls: list[str] - :param saml_metadata_url: - :type saml_metadata_url: str - :param service_principal_names: A collection of service principal names. - :type service_principal_names: list[str] - :param tags: - :type tags: list[str] """ _validation = { 'app_id': {'required': True}, + 'account_enabled': {'required': True}, } _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, - 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_role_assignment_required': {'key': 'appRoleAssignmentRequired', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'error_url': {'key': 'errorUrl', 'type': 'str'}, - 'homepage': {'key': 'homepage', 'type': 'str'}, + 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, 'key_credentials': {'key': 'keyCredentials', 'type': '[KeyCredential]'}, 'password_credentials': {'key': 'passwordCredentials', 'type': '[PasswordCredential]'}, - 'publisher_name': {'key': 'publisherName', 'type': 'str'}, - 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, - 'saml_metadata_url': {'key': 'samlMetadataUrl', 'type': 'str'}, - 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '[str]'}, } - def __init__(self, *, app_id: str, additional_properties=None, account_enabled: bool=None, app_role_assignment_required: bool=None, display_name: str=None, error_url: str=None, homepage: str=None, key_credentials=None, password_credentials=None, publisher_name: str=None, reply_urls=None, saml_metadata_url: str=None, service_principal_names=None, tags=None, **kwargs) -> None: + def __init__(self, *, app_id: str, account_enabled: bool, additional_properties=None, key_credentials=None, password_credentials=None, **kwargs) -> None: super(ServicePrincipalCreateParameters, self).__init__(**kwargs) self.additional_properties = additional_properties - self.account_enabled = account_enabled self.app_id = app_id - self.app_role_assignment_required = app_role_assignment_required - self.display_name = display_name - self.error_url = error_url - self.homepage = homepage + self.account_enabled = account_enabled self.key_credentials = key_credentials self.password_credentials = password_credentials - self.publisher_name = publisher_name - self.reply_urls = reply_urls - self.saml_metadata_url = saml_metadata_url - self.service_principal_names = service_principal_names - self.tags = tags diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal_py3.py b/azure-graphrbac/azure/graphrbac/models/service_principal_py3.py index d9dce61da9b8..bd0b154487ff 100644 --- a/azure-graphrbac/azure/graphrbac/models/service_principal_py3.py +++ b/azure-graphrbac/azure/graphrbac/models/service_principal_py3.py @@ -34,10 +34,6 @@ class ServicePrincipal(DirectoryObject): :type display_name: str :param app_id: The application ID. :type app_id: str - :param app_roles: The collection of application roles that an application - may declare. These roles can be assigned to users, groups or service - principals. - :type app_roles: list[~azure.graphrbac.models.AppRole] :param service_principal_names: A collection of service principal names. :type service_principal_names: list[str] """ @@ -55,14 +51,12 @@ class ServicePrincipal(DirectoryObject): 'object_type': {'key': 'objectType', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_roles': {'key': 'appRoles', 'type': '[AppRole]'}, 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, } - def __init__(self, *, additional_properties=None, display_name: str=None, app_id: str=None, app_roles=None, service_principal_names=None, **kwargs) -> None: + def __init__(self, *, additional_properties=None, display_name: str=None, app_id: str=None, service_principal_names=None, **kwargs) -> None: super(ServicePrincipal, self).__init__(additional_properties=additional_properties, **kwargs) self.display_name = display_name self.app_id = app_id - self.app_roles = app_roles self.service_principal_names = service_principal_names self.object_type = 'ServicePrincipal' diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters.py b/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters.py deleted file mode 100644 index 80b66ea3e4a1..000000000000 --- a/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServicePrincipalUpdateParameters(Model): - """Request parameters for creating a new service principal. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param account_enabled: Whether the account is enabled - :type account_enabled: bool - :param app_id: application Id - :type app_id: str - :param app_role_assignment_required: Specifies whether an - AppRoleAssignment to a user or group is required before Azure AD will - issue a user or access token to the application. - :type app_role_assignment_required: bool - :param display_name: The display name for the service principal. - :type display_name: str - :param error_url: - :type error_url: str - :param homepage: The URL to the homepage of the associated application. - :type homepage: str - :param key_credentials: A collection of KeyCredential objects. - :type key_credentials: list[~azure.graphrbac.models.KeyCredential] - :param password_credentials: A collection of PasswordCredential objects - :type password_credentials: - list[~azure.graphrbac.models.PasswordCredential] - :param publisher_name: The display name of the tenant in which the - associated application is specified. - :type publisher_name: str - :param reply_urls: A collection of reply URLs for the service principal. - :type reply_urls: list[str] - :param saml_metadata_url: - :type saml_metadata_url: str - :param service_principal_names: A collection of service principal names. - :type service_principal_names: list[str] - :param tags: - :type tags: list[str] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_role_assignment_required': {'key': 'appRoleAssignmentRequired', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'error_url': {'key': 'errorUrl', 'type': 'str'}, - 'homepage': {'key': 'homepage', 'type': 'str'}, - 'key_credentials': {'key': 'keyCredentials', 'type': '[KeyCredential]'}, - 'password_credentials': {'key': 'passwordCredentials', 'type': '[PasswordCredential]'}, - 'publisher_name': {'key': 'publisherName', 'type': 'str'}, - 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, - 'saml_metadata_url': {'key': 'samlMetadataUrl', 'type': 'str'}, - 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ServicePrincipalUpdateParameters, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.account_enabled = kwargs.get('account_enabled', None) - self.app_id = kwargs.get('app_id', None) - self.app_role_assignment_required = kwargs.get('app_role_assignment_required', None) - self.display_name = kwargs.get('display_name', None) - self.error_url = kwargs.get('error_url', None) - self.homepage = kwargs.get('homepage', None) - self.key_credentials = kwargs.get('key_credentials', None) - self.password_credentials = kwargs.get('password_credentials', None) - self.publisher_name = kwargs.get('publisher_name', None) - self.reply_urls = kwargs.get('reply_urls', None) - self.saml_metadata_url = kwargs.get('saml_metadata_url', None) - self.service_principal_names = kwargs.get('service_principal_names', None) - self.tags = kwargs.get('tags', None) diff --git a/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters_py3.py b/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters_py3.py deleted file mode 100644 index 65312edc9dab..000000000000 --- a/azure-graphrbac/azure/graphrbac/models/service_principal_update_parameters_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServicePrincipalUpdateParameters(Model): - """Request parameters for creating a new service principal. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param account_enabled: Whether the account is enabled - :type account_enabled: bool - :param app_id: application Id - :type app_id: str - :param app_role_assignment_required: Specifies whether an - AppRoleAssignment to a user or group is required before Azure AD will - issue a user or access token to the application. - :type app_role_assignment_required: bool - :param display_name: The display name for the service principal. - :type display_name: str - :param error_url: - :type error_url: str - :param homepage: The URL to the homepage of the associated application. - :type homepage: str - :param key_credentials: A collection of KeyCredential objects. - :type key_credentials: list[~azure.graphrbac.models.KeyCredential] - :param password_credentials: A collection of PasswordCredential objects - :type password_credentials: - list[~azure.graphrbac.models.PasswordCredential] - :param publisher_name: The display name of the tenant in which the - associated application is specified. - :type publisher_name: str - :param reply_urls: A collection of reply URLs for the service principal. - :type reply_urls: list[str] - :param saml_metadata_url: - :type saml_metadata_url: str - :param service_principal_names: A collection of service principal names. - :type service_principal_names: list[str] - :param tags: - :type tags: list[str] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'account_enabled': {'key': 'accountEnabled', 'type': 'bool'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_role_assignment_required': {'key': 'appRoleAssignmentRequired', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'error_url': {'key': 'errorUrl', 'type': 'str'}, - 'homepage': {'key': 'homepage', 'type': 'str'}, - 'key_credentials': {'key': 'keyCredentials', 'type': '[KeyCredential]'}, - 'password_credentials': {'key': 'passwordCredentials', 'type': '[PasswordCredential]'}, - 'publisher_name': {'key': 'publisherName', 'type': 'str'}, - 'reply_urls': {'key': 'replyUrls', 'type': '[str]'}, - 'saml_metadata_url': {'key': 'samlMetadataUrl', 'type': 'str'}, - 'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, additional_properties=None, account_enabled: bool=None, app_id: str=None, app_role_assignment_required: bool=None, display_name: str=None, error_url: str=None, homepage: str=None, key_credentials=None, password_credentials=None, publisher_name: str=None, reply_urls=None, saml_metadata_url: str=None, service_principal_names=None, tags=None, **kwargs) -> None: - super(ServicePrincipalUpdateParameters, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.account_enabled = account_enabled - self.app_id = app_id - self.app_role_assignment_required = app_role_assignment_required - self.display_name = display_name - self.error_url = error_url - self.homepage = homepage - self.key_credentials = key_credentials - self.password_credentials = password_credentials - self.publisher_name = publisher_name - self.reply_urls = reply_urls - self.saml_metadata_url = saml_metadata_url - self.service_principal_names = service_principal_names - self.tags = tags diff --git a/azure-graphrbac/azure/graphrbac/operations/__init__.py b/azure-graphrbac/azure/graphrbac/operations/__init__.py index 8ca6c17b5fa2..409d3c3c8680 100644 --- a/azure-graphrbac/azure/graphrbac/operations/__init__.py +++ b/azure-graphrbac/azure/graphrbac/operations/__init__.py @@ -9,24 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from .signed_in_user_operations import SignedInUserOperations +from .objects_operations import ObjectsOperations from .applications_operations import ApplicationsOperations -from .deleted_applications_operations import DeletedApplicationsOperations from .groups_operations import GroupsOperations from .service_principals_operations import ServicePrincipalsOperations from .users_operations import UsersOperations -from .objects_operations import ObjectsOperations from .domains_operations import DomainsOperations from .oauth2_operations import OAuth2Operations __all__ = [ - 'SignedInUserOperations', + 'ObjectsOperations', 'ApplicationsOperations', - 'DeletedApplicationsOperations', 'GroupsOperations', 'ServicePrincipalsOperations', 'UsersOperations', - 'ObjectsOperations', 'DomainsOperations', 'OAuth2Operations', ] diff --git a/azure-graphrbac/azure/graphrbac/operations/applications_operations.py b/azure-graphrbac/azure/graphrbac/operations/applications_operations.py index 25750b9a580e..6fafd11d9eac 100644 --- a/azure-graphrbac/azure/graphrbac/operations/applications_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/applications_operations.py @@ -428,7 +428,7 @@ def add_owner( :raises: :class:`GraphErrorException` """ - parameters = models.AddOwnerParameters(additional_properties=additional_properties, url=url) + parameters = models.ApplicationAddOwnerParameters(additional_properties=additional_properties, url=url) # Construct URL url = self.add_owner.metadata['url'] @@ -453,7 +453,7 @@ def add_owner( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'AddOwnerParameters') + body_content = self._serialize.body(parameters, 'ApplicationAddOwnerParameters') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) diff --git a/azure-graphrbac/azure/graphrbac/operations/deleted_applications_operations.py b/azure-graphrbac/azure/graphrbac/operations/deleted_applications_operations.py deleted file mode 100644 index 132c5f3e9915..000000000000 --- a/azure-graphrbac/azure/graphrbac/operations/deleted_applications_operations.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class DeletedApplicationsOperations(object): - """DeletedApplicationsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "1.6". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "1.6" - - self.config = config - - def restore( - self, object_id, custom_headers=None, raw=False, **operation_config): - """Restores the deleted application in the directory. - - :param object_id: Application object ID. - :type object_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Application or ClientRawResponse if raw=true - :rtype: ~azure.graphrbac.models.Application or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`GraphErrorException` - """ - # Construct URL - url = self.restore.metadata['url'] - path_format_arguments = { - 'objectId': self._serialize.url("object_id", object_id, 'str'), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.GraphErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Application', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - restore.metadata = {'url': '/{tenantID}/deletedApplications/{objectId}/restore'} - - def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets a list of deleted applications in the directory. - - :param filter: The filter to apply to the operation. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Application - :rtype: - ~azure.graphrbac.models.ApplicationPaged[~azure.graphrbac.models.Application] - :raises: - :class:`GraphErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = '/{tenantID}/{nextLink}' - path_format_arguments = { - 'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.GraphErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ApplicationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ApplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{tenantID}/deletedApplications'} - - def hard_delete( - self, application_object_id, custom_headers=None, raw=False, **operation_config): - """Hard-delete an application. - - :param application_object_id: Application object ID. - :type application_object_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`GraphErrorException` - """ - # Construct URL - url = self.hard_delete.metadata['url'] - path_format_arguments = { - 'applicationObjectId': self._serialize.url("application_object_id", application_object_id, 'str'), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.GraphErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - hard_delete.metadata = {'url': '/{tenantID}/deletedApplications/{applicationObjectId}'} diff --git a/azure-graphrbac/azure/graphrbac/operations/groups_operations.py b/azure-graphrbac/azure/graphrbac/operations/groups_operations.py index 52e7f22d8378..c5dcd2625761 100644 --- a/azure-graphrbac/azure/graphrbac/operations/groups_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/groups_operations.py @@ -363,9 +363,9 @@ def get_group_members( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of DirectoryObject + :return: An iterator like instance of AADObject :rtype: - ~azure.graphrbac.models.DirectoryObjectPaged[~azure.graphrbac.models.DirectoryObject] + ~azure.graphrbac.models.AADObjectPaged[~azure.graphrbac.models.AADObject] :raises: :class:`GraphErrorException` """ @@ -414,11 +414,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.AADObjectPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.AADObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -611,137 +611,3 @@ def internal_paging(next_link=None, raw=False): return deserialized get_member_groups.metadata = {'url': '/{tenantID}/groups/{objectId}/getMemberGroups'} - - def list_owners( - self, object_id, custom_headers=None, raw=False, **operation_config): - """Directory objects that are owners of the group. - - The owners are a set of non-admin users who are allowed to modify this - object. - - :param object_id: The object ID of the group for which to get owners. - :type object_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of DirectoryObject - :rtype: - ~azure.graphrbac.models.DirectoryObjectPaged[~azure.graphrbac.models.DirectoryObject] - :raises: - :class:`GraphErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_owners.metadata['url'] - path_format_arguments = { - 'objectId': self._serialize.url("object_id", object_id, 'str'), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.GraphErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_owners.metadata = {'url': '/{tenantID}/groups/{objectId}/owners'} - - def add_owner( - self, object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config): - """Add an owner to a group. - - :param object_id: The object ID of the application to which to add the - owner. - :type object_id: str - :param url: A owner object URL, such as - "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", - where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and - "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner - (user, application, servicePrincipal, group) to be added. - :type url: str - :param additional_properties: Unmatched properties from the message - are deserialized this collection - :type additional_properties: dict[str, object] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`GraphErrorException` - """ - parameters = models.AddOwnerParameters(additional_properties=additional_properties, url=url) - - # Construct URL - url = self.add_owner.metadata['url'] - path_format_arguments = { - 'objectId': self._serialize.url("object_id", object_id, 'str'), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AddOwnerParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.GraphErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - add_owner.metadata = {'url': '/{tenantID}/groups/{objectId}/$links/owners'} diff --git a/azure-graphrbac/azure/graphrbac/operations/objects_operations.py b/azure-graphrbac/azure/graphrbac/operations/objects_operations.py index 56d5aa0e4261..8aa9a61d6d34 100644 --- a/azure-graphrbac/azure/graphrbac/operations/objects_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/objects_operations.py @@ -37,11 +37,64 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def get_current_user( + self, custom_headers=None, raw=False, **operation_config): + """Gets the details for the currently logged-in user. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AADObject or ClientRawResponse if raw=true + :rtype: ~azure.graphrbac.models.AADObject or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`GraphErrorException` + """ + # Construct URL + url = self.get_current_user.metadata['url'] + path_format_arguments = { + 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.GraphErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AADObject', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_current_user.metadata = {'url': '/{tenantID}/me'} + def get_objects_by_object_ids( self, parameters, custom_headers=None, raw=False, **operation_config): - """Gets the directory objects specified in a list of object IDs. You can - also specify which resource collections (users, groups, etc.) should be - searched by specifying the optional types parameter. + """Gets AD group membership for the specified AD object IDs. :param parameters: Objects filtering parameters. :type parameters: ~azure.graphrbac.models.GetObjectsParameters @@ -50,9 +103,9 @@ def get_objects_by_object_ids( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of DirectoryObject + :return: An iterator like instance of AADObject :rtype: - ~azure.graphrbac.models.DirectoryObjectPaged[~azure.graphrbac.models.DirectoryObject] + ~azure.graphrbac.models.AADObjectPaged[~azure.graphrbac.models.AADObject] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -105,11 +158,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.AADObjectPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.AADObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-graphrbac/azure/graphrbac/operations/service_principals_operations.py b/azure-graphrbac/azure/graphrbac/operations/service_principals_operations.py index e24bd11b7020..ac353899cdad 100644 --- a/azure-graphrbac/azure/graphrbac/operations/service_principals_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/service_principals_operations.py @@ -171,62 +171,6 @@ def internal_paging(next_link=None, raw=False): return deserialized list.metadata = {'url': '/{tenantID}/servicePrincipals'} - def update( - self, object_id, parameters, custom_headers=None, raw=False, **operation_config): - """Updates a service principal in the directory. - - :param object_id: The object ID of the service principal to delete. - :type object_id: str - :param parameters: Parameters to update a service principal. - :type parameters: - ~azure.graphrbac.models.ServicePrincipalUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`GraphErrorException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'objectId': self._serialize.url("object_id", object_id, 'str'), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ServicePrincipalUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.GraphErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - update.metadata = {'url': '/{tenantID}/servicePrincipals/{objectId}'} - def delete( self, object_id, custom_headers=None, raw=False, **operation_config): """Deletes a service principal from the directory. diff --git a/azure-graphrbac/azure/graphrbac/operations/signed_in_user_operations.py b/azure-graphrbac/azure/graphrbac/operations/signed_in_user_operations.py deleted file mode 100644 index 4be3b48f540e..000000000000 --- a/azure-graphrbac/azure/graphrbac/operations/signed_in_user_operations.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class SignedInUserOperations(object): - """SignedInUserOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "1.6". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "1.6" - - self.config = config - - def get( - self, custom_headers=None, raw=False, **operation_config): - """Gets the details for the currently logged-in user. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: User or ClientRawResponse if raw=true - :rtype: ~azure.graphrbac.models.User or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`GraphErrorException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.GraphErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('User', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{tenantID}/me'} - - def list_owned_objects( - self, custom_headers=None, raw=False, **operation_config): - """Get the list of directory objects that are owned by the user. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of DirectoryObject - :rtype: - ~azure.graphrbac.models.DirectoryObjectPaged[~azure.graphrbac.models.DirectoryObject] - :raises: - :class:`GraphErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_owned_objects.metadata['url'] - path_format_arguments = { - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = '/{tenantID}/{nextLink}' - path_format_arguments = { - 'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True), - 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.GraphErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DirectoryObjectPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_owned_objects.metadata = {'url': '/{tenantID}/me/ownedObjects'} diff --git a/azure-graphrbac/azure/graphrbac/version.py b/azure-graphrbac/azure/graphrbac/version.py index 1002e003856c..60bd31944182 100644 --- a/azure-graphrbac/azure/graphrbac/version.py +++ b/azure-graphrbac/azure/graphrbac/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.50.0" +VERSION = "1.6"