# 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 typing import Any, Optional, TYPE_CHECKING

from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import IdentityDirectoryManagementConfiguration
from .operations import ContactsOrgContactOperations
from .operations import ContactsOperations
from .operations import ContractsContractOperations
from .operations import ContractsOperations
from .operations import DevicesDeviceOperations
from .operations import DevicesOperations
from .operations import DirectoryDirectoryOperations
from .operations import DirectoryOperations
from .operations import DirectoryAdministrativeUnitsOperations
from .operations import DirectoryRolesDirectoryRoleOperations
from .operations import DirectoryRolesOperations
from .operations import DirectoryRoleTemplatesDirectoryRoleTemplateOperations
from .operations import DirectoryRoleTemplatesOperations
from .operations import DomainsDomainOperations
from .operations import DomainsOperations
from .operations import OrganizationOrganizationOperations
from .operations import OrganizationOperations
from .operations import SubscribedSkusSubscribedSkuOperations
from .operations import UsersOperations
from .. import models


class IdentityDirectoryManagement(object):
    """IdentityDirectoryManagement.

    :ivar contacts_org_contact: ContactsOrgContactOperations operations
    :vartype contacts_org_contact: identity_directory_management.aio.operations.ContactsOrgContactOperations
    :ivar contacts: ContactsOperations operations
    :vartype contacts: identity_directory_management.aio.operations.ContactsOperations
    :ivar contracts_contract: ContractsContractOperations operations
    :vartype contracts_contract: identity_directory_management.aio.operations.ContractsContractOperations
    :ivar contracts: ContractsOperations operations
    :vartype contracts: identity_directory_management.aio.operations.ContractsOperations
    :ivar devices_device: DevicesDeviceOperations operations
    :vartype devices_device: identity_directory_management.aio.operations.DevicesDeviceOperations
    :ivar devices: DevicesOperations operations
    :vartype devices: identity_directory_management.aio.operations.DevicesOperations
    :ivar directory_directory: DirectoryDirectoryOperations operations
    :vartype directory_directory: identity_directory_management.aio.operations.DirectoryDirectoryOperations
    :ivar directory: DirectoryOperations operations
    :vartype directory: identity_directory_management.aio.operations.DirectoryOperations
    :ivar directory_administrative_units: DirectoryAdministrativeUnitsOperations operations
    :vartype directory_administrative_units: identity_directory_management.aio.operations.DirectoryAdministrativeUnitsOperations
    :ivar directory_roles_directory_role: DirectoryRolesDirectoryRoleOperations operations
    :vartype directory_roles_directory_role: identity_directory_management.aio.operations.DirectoryRolesDirectoryRoleOperations
    :ivar directory_roles: DirectoryRolesOperations operations
    :vartype directory_roles: identity_directory_management.aio.operations.DirectoryRolesOperations
    :ivar directory_role_templates_directory_role_template: DirectoryRoleTemplatesDirectoryRoleTemplateOperations operations
    :vartype directory_role_templates_directory_role_template: identity_directory_management.aio.operations.DirectoryRoleTemplatesDirectoryRoleTemplateOperations
    :ivar directory_role_templates: DirectoryRoleTemplatesOperations operations
    :vartype directory_role_templates: identity_directory_management.aio.operations.DirectoryRoleTemplatesOperations
    :ivar domains_domain: DomainsDomainOperations operations
    :vartype domains_domain: identity_directory_management.aio.operations.DomainsDomainOperations
    :ivar domains: DomainsOperations operations
    :vartype domains: identity_directory_management.aio.operations.DomainsOperations
    :ivar organization_organization: OrganizationOrganizationOperations operations
    :vartype organization_organization: identity_directory_management.aio.operations.OrganizationOrganizationOperations
    :ivar organization: OrganizationOperations operations
    :vartype organization: identity_directory_management.aio.operations.OrganizationOperations
    :ivar subscribed_skus_subscribed_sku: SubscribedSkusSubscribedSkuOperations operations
    :vartype subscribed_skus_subscribed_sku: identity_directory_management.aio.operations.SubscribedSkusSubscribedSkuOperations
    :ivar users: UsersOperations operations
    :vartype users: identity_directory_management.aio.operations.UsersOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param top: Show only the first n items.
    :type top: int
    :param skip: Skip the first n items.
    :type skip: int
    :param search: Search items by search phrases.
    :type search: str
    :param filter: Filter items by property values.
    :type filter: str
    :param count: Include count of items.
    :type count: bool
    :param str base_url: Service URL
    """

    def __init__(
        self,
        credential: "AsyncTokenCredential",
        top: Optional[int] = None,
        skip: Optional[int] = None,
        search: Optional[str] = None,
        filter: Optional[str] = None,
        count: Optional[bool] = None,
        base_url: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        if not base_url:
            base_url = 'https://graph.microsoft.com/v1.0'
        self._config = IdentityDirectoryManagementConfiguration(credential, top, skip, search, filter, count, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.contacts_org_contact = ContactsOrgContactOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contacts = ContactsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contracts_contract = ContractsContractOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contracts = ContractsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.devices_device = DevicesDeviceOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.devices = DevicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_directory = DirectoryDirectoryOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory = DirectoryOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_administrative_units = DirectoryAdministrativeUnitsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_roles_directory_role = DirectoryRolesDirectoryRoleOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_roles = DirectoryRolesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_role_templates_directory_role_template = DirectoryRoleTemplatesDirectoryRoleTemplateOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_role_templates = DirectoryRoleTemplatesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.domains_domain = DomainsDomainOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.domains = DomainsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.organization_organization = OrganizationOrganizationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.organization = OrganizationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.subscribed_skus_subscribed_sku = SubscribedSkusSubscribedSkuOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.users = UsersOperations(
            self._client, self._config, self._serialize, self._deserialize)

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "IdentityDirectoryManagement":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)

# 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 typing import Any, Optional, TYPE_CHECKING

from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import IdentityDirectoryManagementConfiguration
from .operations import ContactsOrgContactOperations
from .operations import ContactsOperations
from .operations import ContractsContractOperations
from .operations import ContractsOperations
from .operations import DevicesDeviceOperations
from .operations import DevicesOperations
from .operations import DirectoryDirectoryOperations
from .operations import DirectoryOperations
from .operations import DirectoryAdministrativeUnitsOperations
from .operations import DirectoryRolesDirectoryRoleOperations
from .operations import DirectoryRolesOperations
from .operations import DirectoryRoleTemplatesDirectoryRoleTemplateOperations
from .operations import DirectoryRoleTemplatesOperations
from .operations import DomainsDomainOperations
from .operations import DomainsOperations
from .operations import OrganizationOrganizationOperations
from .operations import OrganizationOperations
from .operations import SubscribedSkusSubscribedSkuOperations
from .operations import UsersOperations
from .. import models


class IdentityDirectoryManagement(object):
    """IdentityDirectoryManagement.

    :ivar contacts_org_contact: ContactsOrgContactOperations operations
    :vartype contacts_org_contact: identity_directory_management.aio.operations.ContactsOrgContactOperations
    :ivar contacts: ContactsOperations operations
    :vartype contacts: identity_directory_management.aio.operations.ContactsOperations
    :ivar contracts_contract: ContractsContractOperations operations
    :vartype contracts_contract: identity_directory_management.aio.operations.ContractsContractOperations
    :ivar contracts: ContractsOperations operations
    :vartype contracts: identity_directory_management.aio.operations.ContractsOperations
    :ivar devices_device: DevicesDeviceOperations operations
    :vartype devices_device: identity_directory_management.aio.operations.DevicesDeviceOperations
    :ivar devices: DevicesOperations operations
    :vartype devices: identity_directory_management.aio.operations.DevicesOperations
    :ivar directory_directory: DirectoryDirectoryOperations operations
    :vartype directory_directory: identity_directory_management.aio.operations.DirectoryDirectoryOperations
    :ivar directory: DirectoryOperations operations
    :vartype directory: identity_directory_management.aio.operations.DirectoryOperations
    :ivar directory_administrative_units: DirectoryAdministrativeUnitsOperations operations
    :vartype directory_administrative_units: identity_directory_management.aio.operations.DirectoryAdministrativeUnitsOperations
    :ivar directory_roles_directory_role: DirectoryRolesDirectoryRoleOperations operations
    :vartype directory_roles_directory_role: identity_directory_management.aio.operations.DirectoryRolesDirectoryRoleOperations
    :ivar directory_roles: DirectoryRolesOperations operations
    :vartype directory_roles: identity_directory_management.aio.operations.DirectoryRolesOperations
    :ivar directory_role_templates_directory_role_template: DirectoryRoleTemplatesDirectoryRoleTemplateOperations operations
    :vartype directory_role_templates_directory_role_template: identity_directory_management.aio.operations.DirectoryRoleTemplatesDirectoryRoleTemplateOperations
    :ivar directory_role_templates: DirectoryRoleTemplatesOperations operations
    :vartype directory_role_templates: identity_directory_management.aio.operations.DirectoryRoleTemplatesOperations
    :ivar domains_domain: DomainsDomainOperations operations
    :vartype domains_domain: identity_directory_management.aio.operations.DomainsDomainOperations
    :ivar domains: DomainsOperations operations
    :vartype domains: identity_directory_management.aio.operations.DomainsOperations
    :ivar organization_organization: OrganizationOrganizationOperations operations
    :vartype organization_organization: identity_directory_management.aio.operations.OrganizationOrganizationOperations
    :ivar organization: OrganizationOperations operations
    :vartype organization: identity_directory_management.aio.operations.OrganizationOperations
    :ivar subscribed_skus_subscribed_sku: SubscribedSkusSubscribedSkuOperations operations
    :vartype subscribed_skus_subscribed_sku: identity_directory_management.aio.operations.SubscribedSkusSubscribedSkuOperations
    :ivar users: UsersOperations operations
    :vartype users: identity_directory_management.aio.operations.UsersOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param top: Show only the first n items.
    :type top: int
    :param skip: Skip the first n items.
    :type skip: int
    :param search: Search items by search phrases.
    :type search: str
    :param filter: Filter items by property values.
    :type filter: str
    :param count: Include count of items.
    :type count: bool
    :param str base_url: Service URL
    """

    def __init__(
        self,
        credential: "AsyncTokenCredential",
        top: Optional[int] = None,
        skip: Optional[int] = None,
        search: Optional[str] = None,
        filter: Optional[str] = None,
        count: Optional[bool] = None,
        base_url: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        if not base_url:
            base_url = 'https://graph.microsoft.com/v1.0'
        self._config = IdentityDirectoryManagementConfiguration(credential, top, skip, search, filter, count, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.contacts_org_contact = ContactsOrgContactOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contacts = ContactsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contracts_contract = ContractsContractOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.contracts = ContractsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.devices_device = DevicesDeviceOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.devices = DevicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_directory = DirectoryDirectoryOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory = DirectoryOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_administrative_units = DirectoryAdministrativeUnitsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_roles_directory_role = DirectoryRolesDirectoryRoleOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_roles = DirectoryRolesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_role_templates_directory_role_template = DirectoryRoleTemplatesDirectoryRoleTemplateOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.directory_role_templates = DirectoryRoleTemplatesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.domains_domain = DomainsDomainOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.domains = DomainsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.organization_organization = OrganizationOrganizationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.organization = OrganizationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.subscribed_skus_subscribed_sku = SubscribedSkusSubscribedSkuOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.users = UsersOperations(
            self._client, self._config, self._serialize, self._deserialize)

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "IdentityDirectoryManagement":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)

# 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. # -------------------------------------------------------------------------- # pylint: disable=unused-import,ungrouped-imports IdentityDirectoryManagement.      :ivar contacts_org_contact: ContactsOrgContactOperations operations     :vartype contacts_org_contact: identity_directory_management.aio.operations.ContactsOrgContactOperations     :ivar contacts: ContactsOperations operations     :vartype contacts: identity_directory_management.aio.operations.ContactsOperations     :ivar contracts_contract: ContractsContractOperations operations     :vartype contracts_contract: identity_directory_management.aio.operations.ContractsContractOperations     :ivar contracts: ContractsOperations operations     :vartype contracts: identity_directory_management.aio.operations.ContractsOperations     :ivar devices_device: DevicesDeviceOperations operations     :vartype devices_device: identity_directory_management.aio.operations.DevicesDeviceOperations     :ivar devices: DevicesOperations operations     :vartype devices: identity_directory_management.aio.operations.DevicesOperations     :ivar directory_directory: DirectoryDirectoryOperations operations     :vartype directory_directory: identity_directory_management.aio.operations.DirectoryDirectoryOperations     :ivar directory: DirectoryOperations operations     :vartype directory: identity_directory_management.aio.operations.DirectoryOperations     :ivar directory_administrative_units: DirectoryAdministrativeUnitsOperations operations     :vartype directory_administrative_units: identity_directory_management.aio.operations.DirectoryAdministrativeUnitsOperations     :ivar directory_roles_directory_role: DirectoryRolesDirectoryRoleOperations operations     :vartype directory_roles_directory_role: identity_directory_management.aio.operations.DirectoryRolesDirectoryRoleOperations     :ivar directory_roles: DirectoryRolesOperations operations     :vartype directory_roles: identity_directory_management.aio.operations.DirectoryRolesOperations     :ivar directory_role_templates_directory_role_template: DirectoryRoleTemplatesDirectoryRoleTemplateOperations operations     :vartype directory_role_templates_directory_role_template: identity_directory_management.aio.operations.DirectoryRoleTemplatesDirectoryRoleTemplateOperations     :ivar directory_role_templates: DirectoryRoleTemplatesOperations operations     :vartype directory_role_templates: identity_directory_management.aio.operations.DirectoryRoleTemplatesOperations     :ivar domains_domain: DomainsDomainOperations operations     :vartype domains_domain: identity_directory_management.aio.operations.DomainsDomainOperations     :ivar domains: DomainsOperations operations     :vartype domains: identity_directory_management.aio.operations.DomainsOperations     :ivar organization_organization: OrganizationOrganizationOperations operations     :vartype organization_organization: identity_directory_management.aio.operations.OrganizationOrganizationOperations     :ivar organization: OrganizationOperations operations     :vartype organization: identity_directory_management.aio.operations.OrganizationOperations     :ivar subscribed_skus_subscribed_sku: SubscribedSkusSubscribedSkuOperations operations     :vartype subscribed_skus_subscribed_sku: identity_directory_management.aio.operations.SubscribedSkusSubscribedSkuOperations     :ivar users: UsersOperations operations     :vartype users: identity_directory_management.aio.operations.UsersOperations     :param credential: Credential needed for the client to connect to Azure.     :type credential: ~azure.core.credentials_async.AsyncTokenCredential     :param top: Show only the first n items.     :type top: int     :param skip: Skip the first n items.     :type skip: int     :param search: Search items by search phrases.     :type search: str     :param filter: Filter items by property values.     :type filter: str     :param count: Include count of items.     :type count: bool     :param str base_url: Service URL