Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions azure-graphrbac/azure/graphrbac/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
# --------------------------------------------------------------------------

from .graph_error import GraphError, GraphErrorException
from .directory_object import DirectoryObject
from .key_credential import KeyCredential
from .password_credential import PasswordCredential
from .resource_access import ResourceAccess
from .required_resource_access import RequiredResourceAccess
from .application_create_parameters import ApplicationCreateParameters
from .application_update_parameters import ApplicationUpdateParameters
from .application import Application
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
Expand All @@ -39,6 +41,7 @@
from .domain import Domain
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
Expand All @@ -52,13 +55,15 @@

__all__ = [
'GraphError', 'GraphErrorException',
'DirectoryObject',
'KeyCredential',
'PasswordCredential',
'ResourceAccess',
'RequiredResourceAccess',
'ApplicationCreateParameters',
'ApplicationUpdateParameters',
'Application',
'ApplicationAddOwnerParameters',
'KeyCredentialsUpdateParameters',
'PasswordCredentialsUpdateParameters',
'AADObject',
Expand All @@ -81,6 +86,7 @@
'Domain',
'AADObjectPaged',
'ApplicationPaged',
'DirectoryObjectPaged',
'KeyCredentialPaged',
'PasswordCredentialPaged',
'ADGroupPaged',
Expand Down
29 changes: 21 additions & 8 deletions azure-graphrbac/azure/graphrbac/models/ad_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .directory_object import DirectoryObject


class ADGroup(Model):
class ADGroup(DirectoryObject):
"""Active Directory group information.

:param object_id: The object ID.
:type object_id: str
:param object_type: The object type.
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar object_id: The object ID.
:vartype object_id: str
:ivar deletion_timestamp: The time at which the directory object was
deleted.
:vartype deletion_timestamp: datetime
:param object_type: Constant filled by server.
:type object_type: str
:param display_name: The display name of the group.
:type display_name: str
Expand All @@ -27,17 +33,24 @@ class ADGroup(Model):
:type mail: str
"""

_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'},
'object_type': {'key': 'objectType', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'security_enabled': {'key': 'securityEnabled', 'type': 'bool'},
'mail': {'key': 'mail', 'type': 'str'},
}

def __init__(self, object_id=None, object_type=None, display_name=None, security_enabled=None, mail=None):
self.object_id = object_id
self.object_type = object_type
def __init__(self, display_name=None, security_enabled=None, mail=None):
super(ADGroup, self).__init__()
self.display_name = display_name
self.security_enabled = security_enabled
self.mail = mail
self.object_type = 'Group'
29 changes: 21 additions & 8 deletions azure-graphrbac/azure/graphrbac/models/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .directory_object import DirectoryObject


class Application(Model):
class Application(DirectoryObject):
"""Active Directory application information.

:param object_id: The object ID.
:type object_id: str
:param object_type: The object type.
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar object_id: The object ID.
:vartype object_id: str
:ivar deletion_timestamp: The time at which the directory object was
deleted.
:vartype deletion_timestamp: datetime
:param object_type: Constant filled by server.
:type object_type: str
:param app_id: The application ID.
:type app_id: str
Expand All @@ -39,8 +45,15 @@ class Application(Model):
:type oauth2_allow_implicit_flow: bool
"""

_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'},
'object_type': {'key': 'objectType', 'type': 'str'},
'app_id': {'key': 'appId', 'type': 'str'},
'app_permissions': {'key': 'appPermissions', 'type': '[str]'},
Expand All @@ -52,9 +65,8 @@ class Application(Model):
'oauth2_allow_implicit_flow': {'key': 'oauth2AllowImplicitFlow', 'type': 'bool'},
}

def __init__(self, object_id=None, object_type=None, app_id=None, app_permissions=None, available_to_other_tenants=None, display_name=None, identifier_uris=None, reply_urls=None, homepage=None, oauth2_allow_implicit_flow=None):
self.object_id = object_id
self.object_type = object_type
def __init__(self, app_id=None, app_permissions=None, available_to_other_tenants=None, display_name=None, identifier_uris=None, reply_urls=None, homepage=None, oauth2_allow_implicit_flow=None):
super(Application, self).__init__()
self.app_id = app_id
self.app_permissions = app_permissions
self.available_to_other_tenants = available_to_other_tenants
Expand All @@ -63,3 +75,4 @@ def __init__(self, object_id=None, object_type=None, app_id=None, app_permission
self.reply_urls = reply_urls
self.homepage = homepage
self.oauth2_allow_implicit_flow = oauth2_allow_implicit_flow
self.object_type = 'Application'
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 ApplicationAddOwnerParameters(Model):
"""Request parameters for adding a owner to an application.

: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
"""

_validation = {
'url': {'required': True},
}

_attribute_map = {
'url': {'key': 'url', 'type': 'str'},
}

def __init__(self, url):
self.url = url
52 changes: 52 additions & 0 deletions azure-graphrbac/azure/graphrbac/models/directory_object.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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 DirectoryObject(Model):
"""Represents an Azure Active Directory object.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: Application, ADGroup, ServicePrincipal, User

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar object_id: The object ID.
:vartype object_id: str
:ivar deletion_timestamp: The time at which the directory object was
deleted.
:vartype deletion_timestamp: datetime
:param object_type: Constant filled by server.
:type object_type: str
"""

_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'},
'object_type': {'key': 'objectType', 'type': 'str'},
}

_subtype_map = {
'object_type': {'Application': 'Application', 'Group': 'ADGroup', 'ServicePrincipal': 'ServicePrincipal', 'User': 'User'}
}

def __init__(self):
self.object_id = None
self.deletion_timestamp = None
self.object_type = None
27 changes: 27 additions & 0 deletions azure-graphrbac/azure/graphrbac/models/directory_object_paged.py
Original file line number Diff line number Diff line change
@@ -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 DirectoryObjectPaged(Paged):
"""
A paging container for iterating over a list of :class:`DirectoryObject <azure.graphrbac.models.DirectoryObject>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[DirectoryObject]'}
}

def __init__(self, *args, **kwargs):

super(DirectoryObjectPaged, self).__init__(*args, **kwargs)
29 changes: 21 additions & 8 deletions azure-graphrbac/azure/graphrbac/models/service_principal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .directory_object import DirectoryObject


class ServicePrincipal(Model):
class ServicePrincipal(DirectoryObject):
"""Active Directory service principal information.

:param object_id: The object ID.
:type object_id: str
:param object_type: The object type.
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar object_id: The object ID.
:vartype object_id: str
:ivar deletion_timestamp: The time at which the directory object was
deleted.
:vartype deletion_timestamp: datetime
:param object_type: Constant filled by server.
:type object_type: str
:param display_name: The display name of the service principal.
:type display_name: str
Expand All @@ -27,17 +33,24 @@ class ServicePrincipal(Model):
:type service_principal_names: list[str]
"""

_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
'deletion_timestamp': {'key': 'deletionTimestamp', 'type': 'iso-8601'},
'object_type': {'key': 'objectType', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'app_id': {'key': 'appId', 'type': 'str'},
'service_principal_names': {'key': 'servicePrincipalNames', 'type': '[str]'},
}

def __init__(self, object_id=None, object_type=None, display_name=None, app_id=None, service_principal_names=None):
self.object_id = object_id
self.object_type = object_type
def __init__(self, display_name=None, app_id=None, service_principal_names=None):
super(ServicePrincipal, self).__init__()
self.display_name = display_name
self.app_id = app_id
self.service_principal_names = service_principal_names
self.object_type = 'ServicePrincipal'
Loading