Skip to content

Commit

Permalink
Generated from 5e122049229875c775c412be46ee2548b94cceef
Browse files Browse the repository at this point in the history
Authorization py 0.40.0
  • Loading branch information
AutorestCI authored and lmazuel committed Mar 13, 2018
1 parent dc6ea95 commit 4dbe837
Show file tree
Hide file tree
Showing 23 changed files with 307 additions and 389 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.classic_administrators_operations import ClassicAdministratorsOperations
from .operations.permissions_operations import PermissionsOperations
from .operations.provider_operations_metadata_operations import ProviderOperationsMetadataOperations
from .operations.permissions_operations import PermissionsOperations
from .operations.role_assignments_operations import RoleAssignmentsOperations
from .operations.role_definitions_operations import RoleDefinitionsOperations
from . import models
Expand All @@ -31,26 +31,37 @@ class AuthorizationManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource
provider.
:type resource_provider_namespace: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if resource_group_name is None:
raise ValueError("Parameter 'resource_group_name' must not be None.")
if resource_provider_namespace is None:
raise ValueError("Parameter 'resource_provider_namespace' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(AuthorizationManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('authorizationmanagementclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-authorization/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
self.resource_group_name = resource_group_name
self.resource_provider_namespace = resource_provider_namespace


class AuthorizationManagementClient(object):
Expand All @@ -61,10 +72,10 @@ class AuthorizationManagementClient(object):
:ivar classic_administrators: ClassicAdministrators operations
:vartype classic_administrators: azure.mgmt.authorization.operations.ClassicAdministratorsOperations
:ivar permissions: Permissions operations
:vartype permissions: azure.mgmt.authorization.operations.PermissionsOperations
:ivar provider_operations_metadata: ProviderOperationsMetadata operations
:vartype provider_operations_metadata: azure.mgmt.authorization.operations.ProviderOperationsMetadataOperations
:ivar permissions: Permissions operations
:vartype permissions: azure.mgmt.authorization.operations.PermissionsOperations
:ivar role_assignments: RoleAssignments operations
:vartype role_assignments: azure.mgmt.authorization.operations.RoleAssignmentsOperations
:ivar role_definitions: RoleDefinitions operations
Expand All @@ -75,26 +86,30 @@ class AuthorizationManagementClient(object):
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource
provider.
:type resource_provider_namespace: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url=None):

self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, base_url)
self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2015-07-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.classic_administrators = ClassicAdministratorsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.permissions = PermissionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.provider_operations_metadata = ProviderOperationsMetadataOperations(
self._client, self.config, self._serialize, self._deserialize)
self.permissions = PermissionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.role_assignments = RoleAssignmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.role_definitions = RoleDefinitionsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,36 @@
# regenerated.
# --------------------------------------------------------------------------

from .role_assignment_filter import RoleAssignmentFilter
from .role_definition_filter import RoleDefinitionFilter
from .classic_administrator_properties import ClassicAdministratorProperties
from .classic_administrator import ClassicAdministrator
from .permission import Permission
from .provider_operation import ProviderOperation
from .resource_type import ResourceType
from .provider_operations_metadata import ProviderOperationsMetadata
from .role_assignment_properties_with_scope import RoleAssignmentPropertiesWithScope
from .permission import Permission
from .role_definition_filter import RoleDefinitionFilter
from .role_definition import RoleDefinition
from .role_assignment_filter import RoleAssignmentFilter
from .role_assignment import RoleAssignment
from .role_assignment_properties import RoleAssignmentProperties
from .role_assignment_create_parameters import RoleAssignmentCreateParameters
from .role_definition_properties import RoleDefinitionProperties
from .role_definition import RoleDefinition
from .classic_administrator_paged import ClassicAdministratorPaged
from .permission_paged import PermissionPaged
from .provider_operations_metadata_paged import ProviderOperationsMetadataPaged
from .permission_paged import PermissionPaged
from .role_assignment_paged import RoleAssignmentPaged
from .role_definition_paged import RoleDefinitionPaged

__all__ = [
'RoleAssignmentFilter',
'RoleDefinitionFilter',
'ClassicAdministratorProperties',
'ClassicAdministrator',
'Permission',
'ProviderOperation',
'ResourceType',
'ProviderOperationsMetadata',
'RoleAssignmentPropertiesWithScope',
'Permission',
'RoleDefinitionFilter',
'RoleDefinition',
'RoleAssignmentFilter',
'RoleAssignment',
'RoleAssignmentProperties',
'RoleAssignmentCreateParameters',
'RoleDefinitionProperties',
'RoleDefinition',
'ClassicAdministratorPaged',
'PermissionPaged',
'ProviderOperationsMetadataPaged',
'PermissionPaged',
'RoleAssignmentPaged',
'RoleDefinitionPaged',
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@ class ClassicAdministrator(Model):
:type name: str
:param type: The type of the administrator.
:type type: str
:param properties: Properties for the classic administrator.
:type properties:
~azure.mgmt.authorization.models.ClassicAdministratorProperties
:param email_address: The email address of the administrator.
:type email_address: str
:param role: The role of the administrator.
:type role: str
"""

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ClassicAdministratorProperties'},
'email_address': {'key': 'properties.emailAddress', 'type': 'str'},
'role': {'key': 'properties.role', 'type': 'str'},
}

def __init__(self, id=None, name=None, type=None, properties=None):
def __init__(self, id=None, name=None, type=None, email_address=None, role=None):
super(ClassicAdministrator, self).__init__()
self.id = id
self.name = name
self.type = type
self.properties = properties
self.email_address = email_address
self.role = role

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ class Permission(Model):
:type actions: list[str]
:param not_actions: Denied actions.
:type not_actions: list[str]
:param data_actions: Allowed Data actions.
:type data_actions: list[str]
:param not_data_actions: Denied Data actions.
:type not_data_actions: list[str]
"""

_attribute_map = {
'actions': {'key': 'actions', 'type': '[str]'},
'not_actions': {'key': 'notActions', 'type': '[str]'},
'data_actions': {'key': 'dataActions', 'type': '[str]'},
'not_data_actions': {'key': 'notDataActions', 'type': '[str]'},
}

def __init__(self, actions=None, not_actions=None):
def __init__(self, actions=None, not_actions=None, data_actions=None, not_data_actions=None):
super(Permission, self).__init__()
self.actions = actions
self.not_actions = not_actions
self.data_actions = data_actions
self.not_data_actions = not_data_actions
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ProviderOperation(Model):
:type origin: str
:param properties: The operation properties.
:type properties: object
:param is_data_action: The dataAction flag to specify the operation type.
:type is_data_action: bool
"""

_attribute_map = {
Expand All @@ -33,11 +35,14 @@ class ProviderOperation(Model):
'description': {'key': 'description', 'type': 'str'},
'origin': {'key': 'origin', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'object'},
'is_data_action': {'key': 'isDataAction', 'type': 'bool'},
}

def __init__(self, name=None, display_name=None, description=None, origin=None, properties=None):
def __init__(self, name=None, display_name=None, description=None, origin=None, properties=None, is_data_action=None):
super(ProviderOperation, self).__init__()
self.name = name
self.display_name = display_name
self.description = description
self.origin = origin
self.properties = properties
self.is_data_action = is_data_action
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ProviderOperationsMetadata(Model):
}

def __init__(self, id=None, name=None, type=None, display_name=None, resource_types=None, operations=None):
super(ProviderOperationsMetadata, self).__init__()
self.id = id
self.name = name
self.type = type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ResourceType(Model):
}

def __init__(self, name=None, display_name=None, operations=None):
super(ResourceType, self).__init__()
self.name = name
self.display_name = display_name
self.operations = operations
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,47 @@
class RoleAssignment(Model):
"""Role Assignments.
:param id: The role assignment ID.
:type id: str
:param name: The role assignment name.
:type name: str
:param type: The role assignment type.
:type type: str
:param properties: Role assignment properties.
:type properties:
~azure.mgmt.authorization.models.RoleAssignmentPropertiesWithScope
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The role assignment ID.
:vartype id: str
:ivar name: The role assignment name.
:vartype name: str
:ivar type: The role assignment type.
:vartype type: str
:param scope: The role assignment scope.
:type scope: str
:param role_definition_id: The role definition ID.
:type role_definition_id: str
:param principal_id: The principal ID.
:type principal_id: str
:param can_delegate: The Delegation flag for the roleassignment
:type can_delegate: bool
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'RoleAssignmentPropertiesWithScope'},
'scope': {'key': 'properties.scope', 'type': 'str'},
'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'},
'principal_id': {'key': 'properties.principalId', 'type': 'str'},
'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'},
}

def __init__(self, id=None, name=None, type=None, properties=None):
self.id = id
self.name = name
self.type = type
self.properties = properties
def __init__(self, scope=None, role_definition_id=None, principal_id=None, can_delegate=None):
super(RoleAssignment, self).__init__()
self.id = None
self.name = None
self.type = None
self.scope = scope
self.role_definition_id = role_definition_id
self.principal_id = principal_id
self.can_delegate = can_delegate
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@
class RoleAssignmentCreateParameters(Model):
"""Role assignment create parameters.
:param properties: Role assignment properties.
:type properties:
~azure.mgmt.authorization.models.RoleAssignmentProperties
:param role_definition_id: The role definition ID used in the role
assignment.
:type role_definition_id: str
:param principal_id: The principal ID assigned to the role. This maps to
the ID inside the Active Directory. It can point to a user, service
principal, or security group.
:type principal_id: str
:param can_delegate: The delgation flag used for creating a role
assignment
:type can_delegate: bool
"""

_attribute_map = {
'properties': {'key': 'properties', 'type': 'RoleAssignmentProperties'},
'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'},
'principal_id': {'key': 'properties.principalId', 'type': 'str'},
'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'},
}

def __init__(self, properties=None):
self.properties = properties
def __init__(self, role_definition_id=None, principal_id=None, can_delegate=None):
super(RoleAssignmentCreateParameters, self).__init__()
self.role_definition_id = role_definition_id
self.principal_id = principal_id
self.can_delegate = can_delegate
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ class RoleAssignmentFilter(Model):
:param principal_id: Returns role assignment of the specific principal.
:type principal_id: str
:param can_delegate: The Delegation flag for the roleassignment
:type can_delegate: bool
"""

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'can_delegate': {'key': 'canDelegate', 'type': 'bool'},
}

def __init__(self, principal_id=None):
def __init__(self, principal_id=None, can_delegate=None):
super(RoleAssignmentFilter, self).__init__()
self.principal_id = principal_id
self.can_delegate = can_delegate
Loading

0 comments on commit 4dbe837

Please sign in to comment.