def setUp(self):
     super(MgmtComputeTestMultiVersion, self).setUp()
     self.mgmt_client = self.create_mgmt_client(
         azure.mgmt.compute.ComputeManagementClient)
     self.mgmt_client.profile = ProfileDefinition(
         {
             self.mgmt_client._PROFILE_TAG: {
                 None: "2019-07-01",
                 'availability_sets': '2019-07-01',
                 'dedicated_host_groups': '2019-07-01',
                 'dedicated_hosts': '2019-07-01',
                 'disk_encryption_sets': '2019-11-01',
                 'disks': '2019-03-01',  # test old version
                 'images': '2019-07-01',
                 'log_analytics': '2019-07-01',
                 'operations': '2019-07-01',
                 'proximity_placement_groups': '2019-07-01',
                 'resource_skus': '2019-04-01',
                 'snapshots': '2019-11-01',
                 'usage': '2019-07-01',
                 'virtual_machine_extension_images': '2019-07-01',
                 'virtual_machine_extensions': '2019-07-01',
                 'virtual_machine_images': '2019-07-01',
                 'virtual_machine_run_commands': '2019-07-01',
                 'virtual_machine_scale_set_extensions': '2019-07-01',
                 'virtual_machine_scale_set_rolling_upgrades': '2019-07-01',
                 'virtual_machine_scale_set_vm_extensions': '2019-07-01',
                 'virtual_machine_scale_set_vms': '2019-07-01',
                 'virtual_machine_scale_sets': '2019-07-01',
                 'virtual_machine_sizes': '2019-07-01',
                 'virtual_machines': '2019-07-01',
             }
         },
         self.mgmt_client._PROFILE_TAG + " test")
    class TestClient(MultiApiClientMixin):
        DEFAULT_API_VERSION = "2216-08-09"
        _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient"
        LATEST_PROFILE = ProfileDefinition(
            {_PROFILE_TAG: {
                None: DEFAULT_API_VERSION
            }}, _PROFILE_TAG + " latest")

        def __init__(self, api_version=None, profile=KnownProfiles.default):
            super(TestClient, self).__init__(api_version=api_version,
                                             profile=profile)

        def operations(self):
            return self._get_api_version("operations")
Exemple #3
0
    class TestClient(MultiApiClientMixin):
        DEFAULT_API_VERSION = "2216-08-09"
        _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient"
        LATEST_PROFILE = ProfileDefinition(
            {_PROFILE_TAG: {
                None: DEFAULT_API_VERSION
            }}, _PROFILE_TAG + " latest")

        def __init__(self,
                     creds="creds",
                     config="config",
                     api_version=None,
                     profile=KnownProfiles.default):
            super(TestClient, self).__init__(credentials="credentials",
                                             subscription_id="subscription_id",
                                             api_version=api_version,
                                             base_url="base_url",
                                             profile=profile)

        def operations(self):
            return self._get_api_version("operations")
 def setup_method(self, method):
     # self.re_replacer.register_pattern_pair(
     #   '\"accessSAS\": \"https://.*\"',
     #   '\"accessSAS\": \"FakeUrl\"'
     # )
     self.mgmt_client = self.create_mgmt_client(
         azure.mgmt.compute.ComputeManagementClient)
     self.mgmt_client.profile = ProfileDefinition(
         {
             self.mgmt_client._PROFILE_TAG: {
                 None: "2019-07-01",
                 'availability_sets': '2019-07-01',
                 'dedicated_host_groups': '2019-07-01',
                 'dedicated_hosts': '2019-07-01',
                 'disk_encryption_sets': '2019-11-01',
                 'disks': '2019-03-01',  # test old version
                 'images': '2019-07-01',
                 'log_analytics': '2019-07-01',
                 'operations': '2019-07-01',
                 'proximity_placement_groups': '2019-07-01',
                 'resource_skus': '2019-04-01',
                 'snapshots': '2019-11-01',
                 'usage': '2019-07-01',
                 'virtual_machine_extension_images': '2019-07-01',
                 'virtual_machine_extensions': '2019-07-01',
                 'virtual_machine_images': '2019-07-01',
                 'virtual_machine_run_commands': '2019-07-01',
                 'virtual_machine_scale_set_extensions': '2019-07-01',
                 'virtual_machine_scale_set_rolling_upgrades': '2019-07-01',
                 'virtual_machine_scale_set_vm_extensions': '2019-07-01',
                 'virtual_machine_scale_set_vms': '2019-07-01',
                 'virtual_machine_scale_sets': '2019-07-01',
                 'virtual_machine_sizes': '2019-07-01',
                 'virtual_machines': '2019-07-01',
             }
         },
         self.mgmt_client._PROFILE_TAG + " test")
Exemple #5
0
class PolicyClient(MultiApiClientMixin, _SDKClient):
    """To manage and control access to your resources, you can define customized policies and assign them at a scope.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2019-09-01'
    _PROFILE_TAG = "azure.mgmt.resource.PolicyClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_id,  # type: str
            api_version=None,
            base_url=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ):
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = PolicyClientConfiguration(credential, subscription_id,
                                                 **kwargs)
        self._client = ARMPipelineClient(base_url=base_url,
                                         config=self._config,
                                         **kwargs)
        super(PolicyClient, self).__init__(credential,
                                           self._config,
                                           api_version=api_version,
                                           profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-10-01-preview: :mod:`v2015_10_01_preview.models<azure.mgmt.resource.v2015_10_01_preview.models>`
           * 2016-04-01: :mod:`v2016_04_01.models<azure.mgmt.resource.v2016_04_01.models>`
           * 2016-12-01: :mod:`v2016_12_01.models<azure.mgmt.resource.v2016_12_01.models>`
           * 2017-06-01-preview: :mod:`v2017_06_01_preview.models<azure.mgmt.resource.v2017_06_01_preview.models>`
           * 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.v2018_03_01.models>`
           * 2018-05-01: :mod:`v2018_05_01.models<azure.mgmt.resource.v2018_05_01.models>`
           * 2019-01-01: :mod:`v2019_01_01.models<azure.mgmt.resource.v2019_01_01.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.resource.v2019_06_01.models>`
           * 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.resource.v2019_09_01.models>`
        """
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview import models
            return models
        elif api_version == '2016-04-01':
            from .v2016_04_01 import models
            return models
        elif api_version == '2016-12-01':
            from .v2016_12_01 import models
            return models
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview import models
            return models
        elif api_version == '2018-03-01':
            from .v2018_03_01 import models
            return models
        elif api_version == '2018-05-01':
            from .v2018_05_01 import models
            return models
        elif api_version == '2019-01-01':
            from .v2019_01_01 import models
            return models
        elif api_version == '2019-06-01':
            from .v2019_06_01 import models
            return models
        elif api_version == '2019-09-01':
            from .v2019_09_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def policy_assignments(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2015_10_01_preview.operations.PolicyAssignmentsOperations>`
           * 2016-04-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2016_04_01.operations.PolicyAssignmentsOperations>`
           * 2016-12-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2016_12_01.operations.PolicyAssignmentsOperations>`
           * 2017-06-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2017_06_01_preview.operations.PolicyAssignmentsOperations>`
           * 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2018_03_01.operations.PolicyAssignmentsOperations>`
           * 2018-05-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2018_05_01.operations.PolicyAssignmentsOperations>`
           * 2019-01-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2019_01_01.operations.PolicyAssignmentsOperations>`
           * 2019-06-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2019_06_01.operations.PolicyAssignmentsOperations>`
           * 2019-09-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.v2019_09_01.operations.PolicyAssignmentsOperations>`
        """
        api_version = self._get_api_version('policy_assignments')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicyAssignmentsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def policy_definitions(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2015_10_01_preview.operations.PolicyDefinitionsOperations>`
           * 2016-04-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2016_04_01.operations.PolicyDefinitionsOperations>`
           * 2016-12-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2016_12_01.operations.PolicyDefinitionsOperations>`
           * 2017-06-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2017_06_01_preview.operations.PolicyDefinitionsOperations>`
           * 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2018_03_01.operations.PolicyDefinitionsOperations>`
           * 2018-05-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2018_05_01.operations.PolicyDefinitionsOperations>`
           * 2019-01-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2019_01_01.operations.PolicyDefinitionsOperations>`
           * 2019-06-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2019_06_01.operations.PolicyDefinitionsOperations>`
           * 2019-09-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.v2019_09_01.operations.PolicyDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_definitions')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicyDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def policy_set_definitions(self):
        """Instance depends on the API version:

           * 2017-06-01-preview: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2017_06_01_preview.operations.PolicySetDefinitionsOperations>`
           * 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2018_03_01.operations.PolicySetDefinitionsOperations>`
           * 2018-05-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2018_05_01.operations.PolicySetDefinitionsOperations>`
           * 2019-01-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2019_01_01.operations.PolicySetDefinitionsOperations>`
           * 2019-06-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2019_06_01.operations.PolicySetDefinitionsOperations>`
           * 2019-09-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.v2019_09_01.operations.PolicySetDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_set_definitions')
        if api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicySetDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #6
0
class ManagementLinkClient(MultiApiClientMixin, _SDKClient):
    """Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner must clean up the remaining link.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2016-09-01'
    _PROFILE_TAG = "azure.mgmt.resource.links.ManagementLinkClient"
    LATEST_PROFILE = ProfileDefinition({
        _PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }},
        _PROFILE_TAG + " latest"
    )

    def __init__(
        self,
        credential,  # type: "TokenCredential"
        subscription_id,  # type: str
        api_version=None, # type: Optional[str]
        base_url="https://management.azure.com",  # type: str
        profile=KnownProfiles.default, # type: KnownProfiles
        **kwargs  # type: Any
    ):
        self._config = ManagementLinkClientConfiguration(credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
        super(ManagementLinkClient, self).__init__(
            api_version=api_version,
            profile=profile
        )

    @classmethod
    def _models_dict(cls, api_version):
        return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2016-09-01: :mod:`v2016_09_01.models<azure.mgmt.resource.links.v2016_09_01.models>`
        """
        if api_version == '2016-09-01':
            from .v2016_09_01 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2016-09-01: :class:`Operations<azure.mgmt.resource.links.v2016_09_01.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2016-09-01':
            from .v2016_09_01.operations import Operations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def resource_links(self):
        """Instance depends on the API version:

           * 2016-09-01: :class:`ResourceLinksOperations<azure.mgmt.resource.links.v2016_09_01.operations.ResourceLinksOperations>`
        """
        api_version = self._get_api_version('resource_links')
        if api_version == '2016-09-01':
            from .v2016_09_01.operations import ResourceLinksOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'resource_links'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()
    def __enter__(self):
        self._client.__enter__()
        return self
    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #7
0
class WebSiteManagementClient(WebSiteManagementClientOperationsMixin,
                              MultiApiClientMixin, _SDKClient):
    """WebSite Management Client.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2019-08-01'
    _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                None: DEFAULT_API_VERSION,
                'billing_meters': '2016-03-01',
                'validate_container_settings': '2018-02-01',
            }
        }, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "AsyncTokenCredential"
            subscription_id,  # type: str
            api_version=None,
            base_url=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = WebSiteManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(WebSiteManagementClient, self).__init__(api_version=api_version,
                                                      profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-04-01: :mod:`v2015_04_01.models<azure.mgmt.web.v2015_04_01.models>`
           * 2015-08-01: :mod:`v2015_08_01.models<azure.mgmt.web.v2015_08_01.models>`
           * 2016-03-01: :mod:`v2016_03_01.models<azure.mgmt.web.v2016_03_01.models>`
           * 2016-08-01: :mod:`v2016_08_01.models<azure.mgmt.web.v2016_08_01.models>`
           * 2016-09-01: :mod:`v2016_09_01.models<azure.mgmt.web.v2016_09_01.models>`
           * 2018-02-01: :mod:`v2018_02_01.models<azure.mgmt.web.v2018_02_01.models>`
           * 2018-11-01: :mod:`v2018_11_01.models<azure.mgmt.web.v2018_11_01.models>`
           * 2019-08-01: :mod:`v2019_08_01.models<azure.mgmt.web.v2019_08_01.models>`
        """
        if api_version == '2015-04-01':
            from ..v2015_04_01 import models
            return models
        elif api_version == '2015-08-01':
            from ..v2015_08_01 import models
            return models
        elif api_version == '2016-03-01':
            from ..v2016_03_01 import models
            return models
        elif api_version == '2016-08-01':
            from ..v2016_08_01 import models
            return models
        elif api_version == '2016-09-01':
            from ..v2016_09_01 import models
            return models
        elif api_version == '2018-02-01':
            from ..v2018_02_01 import models
            return models
        elif api_version == '2018-11-01':
            from ..v2018_11_01 import models
            return models
        elif api_version == '2019-08-01':
            from ..v2019_08_01 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def app_service_certificate_orders(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`AppServiceCertificateOrdersOperations<azure.mgmt.web.v2015_08_01.aio.operations.AppServiceCertificateOrdersOperations>`
           * 2018-02-01: :class:`AppServiceCertificateOrdersOperations<azure.mgmt.web.v2018_02_01.aio.operations.AppServiceCertificateOrdersOperations>`
           * 2019-08-01: :class:`AppServiceCertificateOrdersOperations<azure.mgmt.web.v2019_08_01.aio.operations.AppServiceCertificateOrdersOperations>`
        """
        api_version = self._get_api_version('app_service_certificate_orders')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'app_service_certificate_orders'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def app_service_environments(self):
        """Instance depends on the API version:

           * 2016-09-01: :class:`AppServiceEnvironmentsOperations<azure.mgmt.web.v2016_09_01.aio.operations.AppServiceEnvironmentsOperations>`
           * 2018-02-01: :class:`AppServiceEnvironmentsOperations<azure.mgmt.web.v2018_02_01.aio.operations.AppServiceEnvironmentsOperations>`
           * 2019-08-01: :class:`AppServiceEnvironmentsOperations<azure.mgmt.web.v2019_08_01.aio.operations.AppServiceEnvironmentsOperations>`
        """
        api_version = self._get_api_version('app_service_environments')
        if api_version == '2016-09-01':
            from ..v2016_09_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'app_service_environments'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def app_service_plans(self):
        """Instance depends on the API version:

           * 2016-09-01: :class:`AppServicePlansOperations<azure.mgmt.web.v2016_09_01.aio.operations.AppServicePlansOperations>`
           * 2018-02-01: :class:`AppServicePlansOperations<azure.mgmt.web.v2018_02_01.aio.operations.AppServicePlansOperations>`
           * 2019-08-01: :class:`AppServicePlansOperations<azure.mgmt.web.v2019_08_01.aio.operations.AppServicePlansOperations>`
        """
        api_version = self._get_api_version('app_service_plans')
        if api_version == '2016-09-01':
            from ..v2016_09_01.aio.operations import AppServicePlansOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import AppServicePlansOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import AppServicePlansOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'app_service_plans'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def billing_meters(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`BillingMetersOperations<azure.mgmt.web.v2016_03_01.aio.operations.BillingMetersOperations>`
        """
        api_version = self._get_api_version('billing_meters')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import BillingMetersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'billing_meters'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def certificate_registration_provider(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`CertificateRegistrationProviderOperations<azure.mgmt.web.v2015_08_01.aio.operations.CertificateRegistrationProviderOperations>`
           * 2018-02-01: :class:`CertificateRegistrationProviderOperations<azure.mgmt.web.v2018_02_01.aio.operations.CertificateRegistrationProviderOperations>`
           * 2019-08-01: :class:`CertificateRegistrationProviderOperations<azure.mgmt.web.v2019_08_01.aio.operations.CertificateRegistrationProviderOperations>`
        """
        api_version = self._get_api_version(
            'certificate_registration_provider')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'certificate_registration_provider'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def certificates(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`CertificatesOperations<azure.mgmt.web.v2016_03_01.aio.operations.CertificatesOperations>`
           * 2018-02-01: :class:`CertificatesOperations<azure.mgmt.web.v2018_02_01.aio.operations.CertificatesOperations>`
           * 2018-11-01: :class:`CertificatesOperations<azure.mgmt.web.v2018_11_01.aio.operations.CertificatesOperations>`
           * 2019-08-01: :class:`CertificatesOperations<azure.mgmt.web.v2019_08_01.aio.operations.CertificatesOperations>`
        """
        api_version = self._get_api_version('certificates')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import CertificatesOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import CertificatesOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import CertificatesOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import CertificatesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'certificates'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def deleted_web_apps(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`DeletedWebAppsOperations<azure.mgmt.web.v2016_03_01.aio.operations.DeletedWebAppsOperations>`
           * 2018-02-01: :class:`DeletedWebAppsOperations<azure.mgmt.web.v2018_02_01.aio.operations.DeletedWebAppsOperations>`
           * 2019-08-01: :class:`DeletedWebAppsOperations<azure.mgmt.web.v2019_08_01.aio.operations.DeletedWebAppsOperations>`
        """
        api_version = self._get_api_version('deleted_web_apps')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import DeletedWebAppsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import DeletedWebAppsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import DeletedWebAppsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'deleted_web_apps'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def diagnostics(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`DiagnosticsOperations<azure.mgmt.web.v2016_03_01.aio.operations.DiagnosticsOperations>`
           * 2018-02-01: :class:`DiagnosticsOperations<azure.mgmt.web.v2018_02_01.aio.operations.DiagnosticsOperations>`
           * 2019-08-01: :class:`DiagnosticsOperations<azure.mgmt.web.v2019_08_01.aio.operations.DiagnosticsOperations>`
        """
        api_version = self._get_api_version('diagnostics')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import DiagnosticsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import DiagnosticsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import DiagnosticsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'diagnostics'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def domain_registration_provider(self):
        """Instance depends on the API version:

           * 2015-04-01: :class:`DomainRegistrationProviderOperations<azure.mgmt.web.v2015_04_01.aio.operations.DomainRegistrationProviderOperations>`
           * 2018-02-01: :class:`DomainRegistrationProviderOperations<azure.mgmt.web.v2018_02_01.aio.operations.DomainRegistrationProviderOperations>`
           * 2019-08-01: :class:`DomainRegistrationProviderOperations<azure.mgmt.web.v2019_08_01.aio.operations.DomainRegistrationProviderOperations>`
        """
        api_version = self._get_api_version('domain_registration_provider')
        if api_version == '2015-04-01':
            from ..v2015_04_01.aio.operations import DomainRegistrationProviderOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import DomainRegistrationProviderOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import DomainRegistrationProviderOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'domain_registration_provider'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def domains(self):
        """Instance depends on the API version:

           * 2015-04-01: :class:`DomainsOperations<azure.mgmt.web.v2015_04_01.aio.operations.DomainsOperations>`
           * 2018-02-01: :class:`DomainsOperations<azure.mgmt.web.v2018_02_01.aio.operations.DomainsOperations>`
           * 2019-08-01: :class:`DomainsOperations<azure.mgmt.web.v2019_08_01.aio.operations.DomainsOperations>`
        """
        api_version = self._get_api_version('domains')
        if api_version == '2015-04-01':
            from ..v2015_04_01.aio.operations import DomainsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import DomainsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import DomainsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'domains'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def provider(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`ProviderOperations<azure.mgmt.web.v2016_03_01.aio.operations.ProviderOperations>`
           * 2018-02-01: :class:`ProviderOperations<azure.mgmt.web.v2018_02_01.aio.operations.ProviderOperations>`
           * 2019-08-01: :class:`ProviderOperations<azure.mgmt.web.v2019_08_01.aio.operations.ProviderOperations>`
        """
        api_version = self._get_api_version('provider')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import ProviderOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import ProviderOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import ProviderOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'provider'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def recommendations(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`RecommendationsOperations<azure.mgmt.web.v2016_03_01.aio.operations.RecommendationsOperations>`
           * 2018-02-01: :class:`RecommendationsOperations<azure.mgmt.web.v2018_02_01.aio.operations.RecommendationsOperations>`
           * 2019-08-01: :class:`RecommendationsOperations<azure.mgmt.web.v2019_08_01.aio.operations.RecommendationsOperations>`
        """
        api_version = self._get_api_version('recommendations')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import RecommendationsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import RecommendationsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import RecommendationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'recommendations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def resource_health_metadata(self):
        """Instance depends on the API version:

           * 2016-03-01: :class:`ResourceHealthMetadataOperations<azure.mgmt.web.v2016_03_01.aio.operations.ResourceHealthMetadataOperations>`
           * 2018-02-01: :class:`ResourceHealthMetadataOperations<azure.mgmt.web.v2018_02_01.aio.operations.ResourceHealthMetadataOperations>`
           * 2019-08-01: :class:`ResourceHealthMetadataOperations<azure.mgmt.web.v2019_08_01.aio.operations.ResourceHealthMetadataOperations>`
        """
        api_version = self._get_api_version('resource_health_metadata')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import ResourceHealthMetadataOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import ResourceHealthMetadataOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import ResourceHealthMetadataOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'resource_health_metadata'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def static_sites(self):
        """Instance depends on the API version:

           * 2019-08-01: :class:`StaticSitesOperations<azure.mgmt.web.v2019_08_01.aio.operations.StaticSitesOperations>`
        """
        api_version = self._get_api_version('static_sites')
        if api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import StaticSitesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'static_sites'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def top_level_domains(self):
        """Instance depends on the API version:

           * 2015-04-01: :class:`TopLevelDomainsOperations<azure.mgmt.web.v2015_04_01.aio.operations.TopLevelDomainsOperations>`
           * 2018-02-01: :class:`TopLevelDomainsOperations<azure.mgmt.web.v2018_02_01.aio.operations.TopLevelDomainsOperations>`
           * 2019-08-01: :class:`TopLevelDomainsOperations<azure.mgmt.web.v2019_08_01.aio.operations.TopLevelDomainsOperations>`
        """
        api_version = self._get_api_version('top_level_domains')
        if api_version == '2015-04-01':
            from ..v2015_04_01.aio.operations import TopLevelDomainsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import TopLevelDomainsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import TopLevelDomainsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'top_level_domains'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def web_apps(self):
        """Instance depends on the API version:

           * 2016-08-01: :class:`WebAppsOperations<azure.mgmt.web.v2016_08_01.aio.operations.WebAppsOperations>`
           * 2018-02-01: :class:`WebAppsOperations<azure.mgmt.web.v2018_02_01.aio.operations.WebAppsOperations>`
           * 2019-08-01: :class:`WebAppsOperations<azure.mgmt.web.v2019_08_01.aio.operations.WebAppsOperations>`
        """
        api_version = self._get_api_version('web_apps')
        if api_version == '2016-08-01':
            from ..v2016_08_01.aio.operations import WebAppsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebAppsOperations as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebAppsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'web_apps'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
Exemple #8
0
class EventHubManagementClient(MultiApiClientMixin, _SDKClient):
    """Azure Event Hubs client.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2017-04-01'
    _PROFILE_TAG = "azure.mgmt.eventhub.EventHubManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "AsyncTokenCredential"
            subscription_id,  # type: str
            api_version=None,
            base_url=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = EventHubManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(EventHubManagementClient, self).__init__(credential,
                                                       self._config,
                                                       api_version=api_version,
                                                       profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-08-01: :mod:`v2015_08_01.models<azure.mgmt.eventhub.v2015_08_01.models>`
           * 2017-04-01: :mod:`v2017_04_01.models<azure.mgmt.eventhub.v2017_04_01.models>`
           * 2018-01-01-preview: :mod:`v2018_01_01_preview.models<azure.mgmt.eventhub.v2018_01_01_preview.models>`
        """
        if api_version == '2015-08-01':
            from ..v2015_08_01 import models
            return models
        elif api_version == '2017-04-01':
            from ..v2017_04_01 import models
            return models
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def clusters(self):
        """Instance depends on the API version:

           * 2018-01-01-preview: :class:`ClustersOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ClustersOperations>`
        """
        api_version = self._get_api_version('clusters')
        if api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import ClustersOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def configuration(self):
        """Instance depends on the API version:

           * 2018-01-01-preview: :class:`ConfigurationOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ConfigurationOperations>`
        """
        api_version = self._get_api_version('configuration')
        if api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import ConfigurationOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def consumer_groups(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2015_08_01.aio.operations_async.ConsumerGroupsOperations>`
           * 2017-04-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.ConsumerGroupsOperations>`
           * 2018-01-01-preview: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ConsumerGroupsOperations>`
        """
        api_version = self._get_api_version('consumer_groups')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations_async import ConsumerGroupsOperations as OperationClass
        elif api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import ConsumerGroupsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import ConsumerGroupsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def disaster_recovery_configs(self):
        """Instance depends on the API version:

           * 2017-04-01: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.DisasterRecoveryConfigsOperations>`
           * 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.DisasterRecoveryConfigsOperations>`
        """
        api_version = self._get_api_version('disaster_recovery_configs')
        if api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import DisasterRecoveryConfigsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import DisasterRecoveryConfigsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def event_hubs(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2015_08_01.aio.operations_async.EventHubsOperations>`
           * 2017-04-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.EventHubsOperations>`
           * 2018-01-01-preview: :class:`EventHubsOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.EventHubsOperations>`
        """
        api_version = self._get_api_version('event_hubs')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations_async import EventHubsOperations as OperationClass
        elif api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import EventHubsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import EventHubsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def namespaces(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2015_08_01.aio.operations_async.NamespacesOperations>`
           * 2017-04-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.NamespacesOperations>`
           * 2018-01-01-preview: :class:`NamespacesOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.NamespacesOperations>`
        """
        api_version = self._get_api_version('namespaces')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations_async import NamespacesOperations as OperationClass
        elif api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import NamespacesOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import NamespacesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2015-08-01: :class:`Operations<azure.mgmt.eventhub.v2015_08_01.aio.operations_async.Operations>`
           * 2017-04-01: :class:`Operations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.Operations>`
           * 2018-01-01-preview: :class:`Operations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2015-08-01':
            from ..v2015_08_01.aio.operations_async import Operations as OperationClass
        elif api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import Operations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import Operations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def regions(self):
        """Instance depends on the API version:

           * 2017-04-01: :class:`RegionsOperations<azure.mgmt.eventhub.v2017_04_01.aio.operations_async.RegionsOperations>`
           * 2018-01-01-preview: :class:`RegionsOperations<azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.RegionsOperations>`
        """
        api_version = self._get_api_version('regions')
        if api_version == '2017-04-01':
            from ..v2017_04_01.aio.operations_async import RegionsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from ..v2018_01_01_preview.aio.operations_async import RegionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
class KeyVaultClient(MultiApiClientMixin):
    """The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
    Implementation depends on the API version:

         * 2016-10-01: :class:`v2016_10_01.KeyVaultClient<azure.keyvault._generated.v2016_10_01.KeyVaultClient>`
         * 7.0: :class:`v7_0.KeyVaultClient<azure.keyvault._generated.v7_0.KeyVaultClient>`

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`

    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = "7.0"
    _PROFILE_TAG = "azure.keyvault.KeyVaultClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION
        }}, _PROFILE_TAG + " latest")

    _init_complete = False

    def __init__(self,
                 credentials,
                 pipeline=None,
                 api_version=None,
                 aio=False,
                 profile=KnownProfiles.default):
        self._client_impls = {}
        self._pipeline = pipeline
        self._entered = False
        self._aio = aio
        super(KeyVaultClient, self).__init__(api_version=api_version,
                                             profile=profile)

        self._credentials = credentials
        self._init_complete = True

    @staticmethod
    def get_configuration_class(api_version, aio=False):
        """
        Get the versioned configuration implementation corresponding to the current profile.
        :return: The versioned configuration implementation.
        """
        if api_version == V7_0_VERSION:
            if aio:
                from .v7_0.aio import KeyVaultClientConfiguration as ImplConfig
            else:
                from .v7_0 import KeyVaultClientConfiguration as ImplConfig
        elif api_version == V2016_10_01_VERSION:
            if aio:
                from .v2016_10_01.aio import KeyVaultClientConfiguration as ImplConfig
            else:
                from .v2016_10_01 import KeyVaultClientConfiguration as ImplConfig
        else:
            raise NotImplementedError(
                "API version {} is not available".format(api_version))
        return ImplConfig

    @property
    def models(self):
        """Module depends on the API version:
            * 2016-10-01: :mod:`v2016_10_01.models<azure.keyvault._generated.v2016_10_01.models>`
            * 7.0: :mod:`v7_0.models<azure.keyvault._generated.v7_0.models>`
        """
        api_version = self._get_api_version(None)

        if api_version == V7_0_VERSION:
            from .v7_0 import models as impl_models
        elif api_version == V2016_10_01_VERSION:
            from .v2016_10_01 import models as impl_models
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return impl_models

    def _get_client_impl(self):
        """
        Get the versioned client implementation corresponding to the current profile.
        :return:  The versioned client implementation.
        """
        api_version = self._get_api_version(None)
        if api_version not in self._client_impls:
            self._create_client_impl(api_version)
        return self._client_impls[api_version]

    def _create_client_impl(self, api_version):
        """
        Creates the client implementation corresponding to the specified api_version.
        :param api_version:
        :return:
        """
        if api_version == V7_0_VERSION:
            if self._aio:
                from .v7_0.aio import KeyVaultClient as ImplClient
            else:
                from .v7_0 import KeyVaultClient as ImplClient
        elif api_version == V2016_10_01_VERSION:
            if self._aio:
                from .v2016_10_01.aio import KeyVaultClient as ImplClient
            else:
                from .v2016_10_01 import KeyVaultClient as ImplClient
        else:
            raise NotImplementedError(
                "API version {} is not available".format(api_version))

        impl = ImplClient(credentials=self._credentials,
                          pipeline=self._pipeline)

        # if __enter__ has previously been called and the impl client has __enter__ defined we need to call it
        if self._entered:
            if hasattr(impl, "__enter__"):
                impl.__enter__()
            elif hasattr(impl, "__aenter__"):
                impl.__aenter__()

        self._client_impls[api_version] = impl
        return impl

    def __aenter__(self, *args, **kwargs):
        """
        Calls __aenter__ on all client implementations which support it
        :param args: positional arguments to relay to client implementations of __aenter__
        :param kwargs: keyword arguments to relay to client implementations of __aenter__
        :return: returns the current KeyVaultClient instance
        """
        for _, impl in self._client_impls.items():
            if hasattr(impl, "__aenter__"):
                impl.__aenter__(*args, **kwargs)

        # mark the current KeyVaultClient as _entered so that client implementations instantiated
        # subsequently will also have __aenter__ called on them as appropriate
        self._entered = True
        return self

    def __enter__(self, *args, **kwargs):
        """
        Calls __enter__ on all client implementations which support it
        :param args: positional arguments to relay to client implementations of __enter__
        :param kwargs: keyword arguments to relay to client implementations of __enter__
        :return: returns the current KeyVaultClient instance
        """
        for _, impl in self._client_impls.items():
            if hasattr(impl, "__enter__"):
                impl.__enter__(*args, **kwargs)

        # mark the current KeyVaultClient as _entered so that client implementations instantiated
        # subsequently will also have __enter__ called on them as appropriate
        self._entered = True
        return self

    def __aexit__(self, *args, **kwargs):
        """
        Calls __aexit__ on all client implementations which support it
        :param args: positional arguments to relay to client implementations of __aexit__
        :param kwargs: keyword arguments to relay to client implementations of __aexit__
        :return: returns the current KeyVaultClient instance
        """
        for _, impl in self._client_impls.items():
            if hasattr(impl, "__aexit__"):
                impl.__aexit__(*args, **kwargs)
        return self

    def __exit__(self, *args, **kwargs):
        """
        Calls __exit__ on all client implementations which support it
        :param args: positional arguments to relay to client implementations of __enter__
        :param kwargs: keyword arguments to relay to client implementations of __enter__
        :return: returns the current KeyVaultClient instance
        """
        for _, impl in self._client_impls.items():
            if hasattr(impl, "__exit__"):
                impl.__exit__(*args, **kwargs)
        return self

    def __getattr__(self, name):
        """
        In the case that the attribute is not defined on the custom KeyVaultClient.  Attempt to get
        the attribute from the versioned client implementation corresponding to the current profile.
        :param name: Name of the attribute retrieve from the current versioned client implementation
        :return: The value of the specified attribute on the current client implementation.
        """
        impl = self._get_client_impl()
        return getattr(impl, name)

    def __setattr__(self, name, attr):
        """
        Sets the specified attribute either on the custom KeyVaultClient or the current underlying implementation.
        :param name: Name of the attribute to set
        :param attr: Value of the attribute to set
        :return: None
        """
        if self._init_complete and not hasattr(self, name):
            impl = self._get_client_impl()
            setattr(impl, name, attr)
        else:
            super(KeyVaultClient, self).__setattr__(name, attr)
class AppPlatformManagementClient(MultiApiClientMixin, _SDKClient):
    """REST API for Azure Spring Cloud.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2020-07-01'
    _PROFILE_TAG = "azure.mgmt.appplatform.AppPlatformManagementClient"
    LATEST_PROFILE = ProfileDefinition({
        _PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
            'sku': '2019-05-01-preview',
        }},
        _PROFILE_TAG + " latest"
    )

    def __init__(
        self,
        credential,  # type: "TokenCredential"
        subscription_id,  # type: str
        api_version=None, # type: Optional[str]
        base_url=None,  # type: Optional[str]
        profile=KnownProfiles.default, # type: KnownProfiles
        **kwargs  # type: Any
    ):
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = AppPlatformManagementClientConfiguration(credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
        super(AppPlatformManagementClient, self).__init__(
            api_version=api_version,
            profile=profile
        )

    @classmethod
    def _models_dict(cls, api_version):
        return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2019-05-01-preview: :mod:`v2019_05_01_preview.models<azure.mgmt.appplatform.v2019_05_01_preview.models>`
           * 2020-07-01: :mod:`v2020_07_01.models<azure.mgmt.appplatform.v2020_07_01.models>`
           * 2020-11-01-preview: :mod:`v2020_11_01_preview.models<azure.mgmt.appplatform.v2020_11_01_preview.models>`
           * 2021-06-01-preview: :mod:`v2021_06_01_preview.models<azure.mgmt.appplatform.v2021_06_01_preview.models>`
           * 2021-09-01-preview: :mod:`v2021_09_01_preview.models<azure.mgmt.appplatform.v2021_09_01_preview.models>`
           * 2022-01-01-preview: :mod:`v2022_01_01_preview.models<azure.mgmt.appplatform.v2022_01_01_preview.models>`
        """
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview import models
            return models
        elif api_version == '2020-07-01':
            from .v2020_07_01 import models
            return models
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview import models
            return models
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview import models
            return models
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview import models
            return models
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def api_portal_custom_domains(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`ApiPortalCustomDomainsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ApiPortalCustomDomainsOperations>`
        """
        api_version = self._get_api_version('api_portal_custom_domains')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ApiPortalCustomDomainsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'api_portal_custom_domains'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def api_portals(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`ApiPortalsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ApiPortalsOperations>`
        """
        api_version = self._get_api_version('api_portals')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ApiPortalsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'api_portals'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def apps(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.AppsOperations>`
           * 2020-07-01: :class:`AppsOperations<azure.mgmt.appplatform.v2020_07_01.operations.AppsOperations>`
           * 2020-11-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.AppsOperations>`
           * 2021-06-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.AppsOperations>`
           * 2021-09-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.AppsOperations>`
           * 2022-01-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.AppsOperations>`
        """
        api_version = self._get_api_version('apps')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import AppsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import AppsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import AppsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import AppsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import AppsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import AppsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'apps'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def bindings(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.BindingsOperations>`
           * 2020-07-01: :class:`BindingsOperations<azure.mgmt.appplatform.v2020_07_01.operations.BindingsOperations>`
           * 2020-11-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.BindingsOperations>`
           * 2021-06-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.BindingsOperations>`
           * 2021-09-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.BindingsOperations>`
           * 2022-01-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.BindingsOperations>`
        """
        api_version = self._get_api_version('bindings')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import BindingsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import BindingsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import BindingsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import BindingsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import BindingsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import BindingsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'bindings'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def build_service(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`BuildServiceOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.BuildServiceOperations>`
        """
        api_version = self._get_api_version('build_service')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import BuildServiceOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'build_service'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def build_service_agent_pool(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`BuildServiceAgentPoolOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.BuildServiceAgentPoolOperations>`
        """
        api_version = self._get_api_version('build_service_agent_pool')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import BuildServiceAgentPoolOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'build_service_agent_pool'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def build_service_builder(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`BuildServiceBuilderOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.BuildServiceBuilderOperations>`
        """
        api_version = self._get_api_version('build_service_builder')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import BuildServiceBuilderOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'build_service_builder'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def buildpack_binding(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`BuildpackBindingOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.BuildpackBindingOperations>`
        """
        api_version = self._get_api_version('buildpack_binding')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import BuildpackBindingOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'buildpack_binding'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def certificates(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.CertificatesOperations>`
           * 2020-07-01: :class:`CertificatesOperations<azure.mgmt.appplatform.v2020_07_01.operations.CertificatesOperations>`
           * 2020-11-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.CertificatesOperations>`
           * 2021-06-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.CertificatesOperations>`
           * 2021-09-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.CertificatesOperations>`
           * 2022-01-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.CertificatesOperations>`
        """
        api_version = self._get_api_version('certificates')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import CertificatesOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import CertificatesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import CertificatesOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import CertificatesOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import CertificatesOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import CertificatesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'certificates'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def config_servers(self):
        """Instance depends on the API version:

           * 2020-07-01: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2020_07_01.operations.ConfigServersOperations>`
           * 2020-11-01-preview: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.ConfigServersOperations>`
           * 2021-06-01-preview: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.ConfigServersOperations>`
           * 2021-09-01-preview: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.ConfigServersOperations>`
           * 2022-01-01-preview: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ConfigServersOperations>`
        """
        api_version = self._get_api_version('config_servers')
        if api_version == '2020-07-01':
            from .v2020_07_01.operations import ConfigServersOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import ConfigServersOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import ConfigServersOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import ConfigServersOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ConfigServersOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'config_servers'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def configuration_services(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`ConfigurationServicesOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ConfigurationServicesOperations>`
        """
        api_version = self._get_api_version('configuration_services')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ConfigurationServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'configuration_services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def custom_domains(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.CustomDomainsOperations>`
           * 2020-07-01: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2020_07_01.operations.CustomDomainsOperations>`
           * 2020-11-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.CustomDomainsOperations>`
           * 2021-06-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.CustomDomainsOperations>`
           * 2021-09-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.CustomDomainsOperations>`
           * 2022-01-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.CustomDomainsOperations>`
        """
        api_version = self._get_api_version('custom_domains')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import CustomDomainsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import CustomDomainsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import CustomDomainsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import CustomDomainsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import CustomDomainsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import CustomDomainsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'custom_domains'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def deployments(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.DeploymentsOperations>`
           * 2020-07-01: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2020_07_01.operations.DeploymentsOperations>`
           * 2020-11-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.DeploymentsOperations>`
           * 2021-06-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.DeploymentsOperations>`
           * 2021-09-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.DeploymentsOperations>`
           * 2022-01-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.DeploymentsOperations>`
        """
        api_version = self._get_api_version('deployments')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import DeploymentsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import DeploymentsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import DeploymentsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import DeploymentsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import DeploymentsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import DeploymentsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'deployments'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def gateway_custom_domains(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`GatewayCustomDomainsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.GatewayCustomDomainsOperations>`
        """
        api_version = self._get_api_version('gateway_custom_domains')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import GatewayCustomDomainsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'gateway_custom_domains'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def gateway_route_configs(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`GatewayRouteConfigsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.GatewayRouteConfigsOperations>`
        """
        api_version = self._get_api_version('gateway_route_configs')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import GatewayRouteConfigsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'gateway_route_configs'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def gateways(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`GatewaysOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.GatewaysOperations>`
        """
        api_version = self._get_api_version('gateways')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import GatewaysOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'gateways'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def monitoring_settings(self):
        """Instance depends on the API version:

           * 2020-07-01: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2020_07_01.operations.MonitoringSettingsOperations>`
           * 2020-11-01-preview: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.MonitoringSettingsOperations>`
           * 2021-06-01-preview: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.MonitoringSettingsOperations>`
           * 2021-09-01-preview: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.MonitoringSettingsOperations>`
           * 2022-01-01-preview: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.MonitoringSettingsOperations>`
        """
        api_version = self._get_api_version('monitoring_settings')
        if api_version == '2020-07-01':
            from .v2020_07_01.operations import MonitoringSettingsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import MonitoringSettingsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import MonitoringSettingsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import MonitoringSettingsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import MonitoringSettingsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'monitoring_settings'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`Operations<azure.mgmt.appplatform.v2019_05_01_preview.operations.Operations>`
           * 2020-07-01: :class:`Operations<azure.mgmt.appplatform.v2020_07_01.operations.Operations>`
           * 2020-11-01-preview: :class:`Operations<azure.mgmt.appplatform.v2020_11_01_preview.operations.Operations>`
           * 2021-06-01-preview: :class:`Operations<azure.mgmt.appplatform.v2021_06_01_preview.operations.Operations>`
           * 2021-09-01-preview: :class:`Operations<azure.mgmt.appplatform.v2021_09_01_preview.operations.Operations>`
           * 2022-01-01-preview: :class:`Operations<azure.mgmt.appplatform.v2022_01_01_preview.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import Operations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import Operations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import Operations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import Operations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import Operations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import Operations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def runtime_versions(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.RuntimeVersionsOperations>`
           * 2020-07-01: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2020_07_01.operations.RuntimeVersionsOperations>`
           * 2020-11-01-preview: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.RuntimeVersionsOperations>`
           * 2021-06-01-preview: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.RuntimeVersionsOperations>`
           * 2021-09-01-preview: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.RuntimeVersionsOperations>`
           * 2022-01-01-preview: :class:`RuntimeVersionsOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.RuntimeVersionsOperations>`
        """
        api_version = self._get_api_version('runtime_versions')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RuntimeVersionsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import RuntimeVersionsOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RuntimeVersionsOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import RuntimeVersionsOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import RuntimeVersionsOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import RuntimeVersionsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'runtime_versions'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def service_registries(self):
        """Instance depends on the API version:

           * 2022-01-01-preview: :class:`ServiceRegistriesOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ServiceRegistriesOperations>`
        """
        api_version = self._get_api_version('service_registries')
        if api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ServiceRegistriesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'service_registries'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def services(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.ServicesOperations>`
           * 2020-07-01: :class:`ServicesOperations<azure.mgmt.appplatform.v2020_07_01.operations.ServicesOperations>`
           * 2020-11-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.ServicesOperations>`
           * 2021-06-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.ServicesOperations>`
           * 2021-09-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.ServicesOperations>`
           * 2022-01-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.ServicesOperations>`
        """
        api_version = self._get_api_version('services')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import ServicesOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import ServicesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import ServicesOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import ServicesOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import ServicesOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import ServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def sku(self):
        """Instance depends on the API version:

           * 2019-05-01-preview: :class:`SkuOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.SkuOperations>`
        """
        api_version = self._get_api_version('sku')
        if api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import SkuOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'sku'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def skus(self):
        """Instance depends on the API version:

           * 2020-07-01: :class:`SkusOperations<azure.mgmt.appplatform.v2020_07_01.operations.SkusOperations>`
           * 2020-11-01-preview: :class:`SkusOperations<azure.mgmt.appplatform.v2020_11_01_preview.operations.SkusOperations>`
           * 2021-06-01-preview: :class:`SkusOperations<azure.mgmt.appplatform.v2021_06_01_preview.operations.SkusOperations>`
           * 2021-09-01-preview: :class:`SkusOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.SkusOperations>`
           * 2022-01-01-preview: :class:`SkusOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.SkusOperations>`
        """
        api_version = self._get_api_version('skus')
        if api_version == '2020-07-01':
            from .v2020_07_01.operations import SkusOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import SkusOperations as OperationClass
        elif api_version == '2021-06-01-preview':
            from .v2021_06_01_preview.operations import SkusOperations as OperationClass
        elif api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import SkusOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import SkusOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'skus'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def storages(self):
        """Instance depends on the API version:

           * 2021-09-01-preview: :class:`StoragesOperations<azure.mgmt.appplatform.v2021_09_01_preview.operations.StoragesOperations>`
           * 2022-01-01-preview: :class:`StoragesOperations<azure.mgmt.appplatform.v2022_01_01_preview.operations.StoragesOperations>`
        """
        api_version = self._get_api_version('storages')
        if api_version == '2021-09-01-preview':
            from .v2021_09_01_preview.operations import StoragesOperations as OperationClass
        elif api_version == '2022-01-01-preview':
            from .v2022_01_01_preview.operations import StoragesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'storages'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()
    def __enter__(self):
        self._client.__enter__()
        return self
    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #11
0
class KeyVaultManagementClient(MultiApiClientMixin, SDKClient):
    """The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.

    This ready contains multiple API versions, to help you deal with all Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, uses latest API version available on public Azure.
    For production, you should stick a particular api-version and/or profile.
    The profile sets a mapping between the operation group and an API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :ivar config: Configuration for client.
    :vartype config: KeyVaultManagementClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Subscription credentials which uniquely identify
     Microsoft Azure subscription. The subscription ID forms part of the URI
     for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2018-02-14'
    _PROFILE_TAG = "azure.mgmt.keyvault.KeyVaultManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        self.config = KeyVaultManagementClientConfiguration(
            credentials, subscription_id, base_url)
        super(KeyVaultManagementClient, self).__init__(credentials,
                                                       self.config,
                                                       api_version=api_version,
                                                       profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2016-10-01: :mod:`v2016_10_01.models<azure.mgmt.keyvault.v2016_10_01.models>`
           * 2018-02-14: :mod:`v2018_02_14.models<azure.mgmt.keyvault.v2018_02_14.models>`
        """
        if api_version == '2016-10-01':
            from .v2016_10_01 import models
            return models
        elif api_version == '2018-02-14':
            from .v2018_02_14 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.operations.Operations>`
           * 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2016-10-01':
            from .v2016_10_01.operations import Operations as OperationClass
        elif api_version == '2018-02-14':
            from .v2018_02_14.operations import Operations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def vaults(self):
        """Instance depends on the API version:

           * 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.operations.VaultsOperations>`
           * 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.operations.VaultsOperations>`
        """
        api_version = self._get_api_version('vaults')
        if api_version == '2016-10-01':
            from .v2016_10_01.operations import VaultsOperations as OperationClass
        elif api_version == '2018-02-14':
            from .v2018_02_14.operations import VaultsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
class StorageManagementClient(MultiApiClientMixin, SDKClient):
    """The Azure Storage Management API.

    This ready contains multiple API versions, to help you deal with all Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, uses latest API version available on public Azure.
    For production, you should stick a particular api-version and/or profile.
    The profile sets a mapping between the operation group and an API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :ivar config: Configuration for client.
    :vartype config: StorageManagementClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Subscription credentials which uniquely identify
     Microsoft Azure subscription. The subscription ID forms part of the URI
     for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2019-06-01'
    _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
            'usage': '2018-02-01',
        }}, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        self.config = StorageManagementClientConfiguration(
            credentials, subscription_id, base_url)
        super(StorageManagementClient, self).__init__(credentials,
                                                      self.config,
                                                      api_version=api_version,
                                                      profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-06-15: :mod:`v2015_06_15.models<azure.mgmt.storage.v2015_06_15.models>`
           * 2016-01-01: :mod:`v2016_01_01.models<azure.mgmt.storage.v2016_01_01.models>`
           * 2016-12-01: :mod:`v2016_12_01.models<azure.mgmt.storage.v2016_12_01.models>`
           * 2017-06-01: :mod:`v2017_06_01.models<azure.mgmt.storage.v2017_06_01.models>`
           * 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.storage.v2017_10_01.models>`
           * 2018-02-01: :mod:`v2018_02_01.models<azure.mgmt.storage.v2018_02_01.models>`
           * 2018-03-01-preview: :mod:`v2018_03_01_preview.models<azure.mgmt.storage.v2018_03_01_preview.models>`
           * 2018-07-01: :mod:`v2018_07_01.models<azure.mgmt.storage.v2018_07_01.models>`
           * 2018-11-01: :mod:`v2018_11_01.models<azure.mgmt.storage.v2018_11_01.models>`
           * 2019-04-01: :mod:`v2019_04_01.models<azure.mgmt.storage.v2019_04_01.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.storage.v2019_06_01.models>`
        """
        if api_version == '2015-06-15':
            from .v2015_06_15 import models
            return models
        elif api_version == '2016-01-01':
            from .v2016_01_01 import models
            return models
        elif api_version == '2016-12-01':
            from .v2016_12_01 import models
            return models
        elif api_version == '2017-06-01':
            from .v2017_06_01 import models
            return models
        elif api_version == '2017-10-01':
            from .v2017_10_01 import models
            return models
        elif api_version == '2018-02-01':
            from .v2018_02_01 import models
            return models
        elif api_version == '2018-03-01-preview':
            from .v2018_03_01_preview import models
            return models
        elif api_version == '2018-07-01':
            from .v2018_07_01 import models
            return models
        elif api_version == '2018-11-01':
            from .v2018_11_01 import models
            return models
        elif api_version == '2019-04-01':
            from .v2019_04_01 import models
            return models
        elif api_version == '2019-06-01':
            from .v2019_06_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def blob_containers(self):
        """Instance depends on the API version:

           * 2018-02-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_02_01.operations.BlobContainersOperations>`
           * 2018-03-01-preview: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_03_01_preview.operations.BlobContainersOperations>`
           * 2018-07-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_07_01.operations.BlobContainersOperations>`
           * 2018-11-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_11_01.operations.BlobContainersOperations>`
           * 2019-04-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2019_04_01.operations.BlobContainersOperations>`
           * 2019-06-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2019_06_01.operations.BlobContainersOperations>`
        """
        api_version = self._get_api_version('blob_containers')
        if api_version == '2018-02-01':
            from .v2018_02_01.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from .v2018_03_01_preview.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import BlobContainersOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import BlobContainersOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import BlobContainersOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def blob_services(self):
        """Instance depends on the API version:

           * 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>`
           * 2018-11-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_11_01.operations.BlobServicesOperations>`
           * 2019-04-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2019_04_01.operations.BlobServicesOperations>`
           * 2019-06-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2019_06_01.operations.BlobServicesOperations>`
        """
        api_version = self._get_api_version('blob_services')
        if api_version == '2018-07-01':
            from .v2018_07_01.operations import BlobServicesOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import BlobServicesOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import BlobServicesOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import BlobServicesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def encryption_scopes(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2019_06_01.operations.EncryptionScopesOperations>`
        """
        api_version = self._get_api_version('encryption_scopes')
        if api_version == '2019-06-01':
            from .v2019_06_01.operations import EncryptionScopesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def file_services(self):
        """Instance depends on the API version:

           * 2019-04-01: :class:`FileServicesOperations<azure.mgmt.storage.v2019_04_01.operations.FileServicesOperations>`
           * 2019-06-01: :class:`FileServicesOperations<azure.mgmt.storage.v2019_06_01.operations.FileServicesOperations>`
        """
        api_version = self._get_api_version('file_services')
        if api_version == '2019-04-01':
            from .v2019_04_01.operations import FileServicesOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import FileServicesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def file_shares(self):
        """Instance depends on the API version:

           * 2019-04-01: :class:`FileSharesOperations<azure.mgmt.storage.v2019_04_01.operations.FileSharesOperations>`
           * 2019-06-01: :class:`FileSharesOperations<azure.mgmt.storage.v2019_06_01.operations.FileSharesOperations>`
        """
        api_version = self._get_api_version('file_shares')
        if api_version == '2019-04-01':
            from .v2019_04_01.operations import FileSharesOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import FileSharesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def management_policies(self):
        """Instance depends on the API version:

           * 2018-07-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2018_07_01.operations.ManagementPoliciesOperations>`
           * 2018-11-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2018_11_01.operations.ManagementPoliciesOperations>`
           * 2019-04-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2019_04_01.operations.ManagementPoliciesOperations>`
           * 2019-06-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2019_06_01.operations.ManagementPoliciesOperations>`
        """
        api_version = self._get_api_version('management_policies')
        if api_version == '2018-07-01':
            from .v2018_07_01.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import ManagementPoliciesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2017-06-01: :class:`Operations<azure.mgmt.storage.v2017_06_01.operations.Operations>`
           * 2017-10-01: :class:`Operations<azure.mgmt.storage.v2017_10_01.operations.Operations>`
           * 2018-02-01: :class:`Operations<azure.mgmt.storage.v2018_02_01.operations.Operations>`
           * 2018-03-01-preview: :class:`Operations<azure.mgmt.storage.v2018_03_01_preview.operations.Operations>`
           * 2018-07-01: :class:`Operations<azure.mgmt.storage.v2018_07_01.operations.Operations>`
           * 2018-11-01: :class:`Operations<azure.mgmt.storage.v2018_11_01.operations.Operations>`
           * 2019-04-01: :class:`Operations<azure.mgmt.storage.v2019_04_01.operations.Operations>`
           * 2019-06-01: :class:`Operations<azure.mgmt.storage.v2019_06_01.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2017-06-01':
            from .v2017_06_01.operations import Operations as OperationClass
        elif api_version == '2017-10-01':
            from .v2017_10_01.operations import Operations as OperationClass
        elif api_version == '2018-02-01':
            from .v2018_02_01.operations import Operations as OperationClass
        elif api_version == '2018-03-01-preview':
            from .v2018_03_01_preview.operations import Operations as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import Operations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import Operations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import Operations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import Operations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2019_06_01.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2019-06-01':
            from .v2019_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2019_06_01.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2019-06-01':
            from .v2019_06_01.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def skus(self):
        """Instance depends on the API version:

           * 2017-06-01: :class:`SkusOperations<azure.mgmt.storage.v2017_06_01.operations.SkusOperations>`
           * 2017-10-01: :class:`SkusOperations<azure.mgmt.storage.v2017_10_01.operations.SkusOperations>`
           * 2018-02-01: :class:`SkusOperations<azure.mgmt.storage.v2018_02_01.operations.SkusOperations>`
           * 2018-03-01-preview: :class:`SkusOperations<azure.mgmt.storage.v2018_03_01_preview.operations.SkusOperations>`
           * 2018-07-01: :class:`SkusOperations<azure.mgmt.storage.v2018_07_01.operations.SkusOperations>`
           * 2018-11-01: :class:`SkusOperations<azure.mgmt.storage.v2018_11_01.operations.SkusOperations>`
           * 2019-04-01: :class:`SkusOperations<azure.mgmt.storage.v2019_04_01.operations.SkusOperations>`
           * 2019-06-01: :class:`SkusOperations<azure.mgmt.storage.v2019_06_01.operations.SkusOperations>`
        """
        api_version = self._get_api_version('skus')
        if api_version == '2017-06-01':
            from .v2017_06_01.operations import SkusOperations as OperationClass
        elif api_version == '2017-10-01':
            from .v2017_10_01.operations import SkusOperations as OperationClass
        elif api_version == '2018-02-01':
            from .v2018_02_01.operations import SkusOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from .v2018_03_01_preview.operations import SkusOperations as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import SkusOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import SkusOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import SkusOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import SkusOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def storage_accounts(self):
        """Instance depends on the API version:

           * 2015-06-15: :class:`StorageAccountsOperations<azure.mgmt.storage.v2015_06_15.operations.StorageAccountsOperations>`
           * 2016-01-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2016_01_01.operations.StorageAccountsOperations>`
           * 2016-12-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2016_12_01.operations.StorageAccountsOperations>`
           * 2017-06-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2017_06_01.operations.StorageAccountsOperations>`
           * 2017-10-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2017_10_01.operations.StorageAccountsOperations>`
           * 2018-02-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_02_01.operations.StorageAccountsOperations>`
           * 2018-03-01-preview: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_03_01_preview.operations.StorageAccountsOperations>`
           * 2018-07-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_07_01.operations.StorageAccountsOperations>`
           * 2018-11-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_11_01.operations.StorageAccountsOperations>`
           * 2019-04-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2019_04_01.operations.StorageAccountsOperations>`
           * 2019-06-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2019_06_01.operations.StorageAccountsOperations>`
        """
        api_version = self._get_api_version('storage_accounts')
        if api_version == '2015-06-15':
            from .v2015_06_15.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2016-01-01':
            from .v2016_01_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2017-06-01':
            from .v2017_06_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2017-10-01':
            from .v2017_10_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-02-01':
            from .v2018_02_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from .v2018_03_01_preview.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import StorageAccountsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def usage(self):
        """Instance depends on the API version:

           * 2015-06-15: :class:`UsageOperations<azure.mgmt.storage.v2015_06_15.operations.UsageOperations>`
           * 2016-01-01: :class:`UsageOperations<azure.mgmt.storage.v2016_01_01.operations.UsageOperations>`
           * 2016-12-01: :class:`UsageOperations<azure.mgmt.storage.v2016_12_01.operations.UsageOperations>`
           * 2017-06-01: :class:`UsageOperations<azure.mgmt.storage.v2017_06_01.operations.UsageOperations>`
           * 2017-10-01: :class:`UsageOperations<azure.mgmt.storage.v2017_10_01.operations.UsageOperations>`
           * 2018-02-01: :class:`UsageOperations<azure.mgmt.storage.v2018_02_01.operations.UsageOperations>`
        """
        api_version = self._get_api_version('usage')
        if api_version == '2015-06-15':
            from .v2015_06_15.operations import UsageOperations as OperationClass
        elif api_version == '2016-01-01':
            from .v2016_01_01.operations import UsageOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import UsageOperations as OperationClass
        elif api_version == '2017-06-01':
            from .v2017_06_01.operations import UsageOperations as OperationClass
        elif api_version == '2017-10-01':
            from .v2017_10_01.operations import UsageOperations as OperationClass
        elif api_version == '2018-02-01':
            from .v2018_02_01.operations import UsageOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def usages(self):
        """Instance depends on the API version:

           * 2018-03-01-preview: :class:`UsagesOperations<azure.mgmt.storage.v2018_03_01_preview.operations.UsagesOperations>`
           * 2018-07-01: :class:`UsagesOperations<azure.mgmt.storage.v2018_07_01.operations.UsagesOperations>`
           * 2018-11-01: :class:`UsagesOperations<azure.mgmt.storage.v2018_11_01.operations.UsagesOperations>`
           * 2019-04-01: :class:`UsagesOperations<azure.mgmt.storage.v2019_04_01.operations.UsagesOperations>`
           * 2019-06-01: :class:`UsagesOperations<azure.mgmt.storage.v2019_06_01.operations.UsagesOperations>`
        """
        api_version = self._get_api_version('usages')
        if api_version == '2018-03-01-preview':
            from .v2018_03_01_preview.operations import UsagesOperations as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import UsagesOperations as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import UsagesOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import UsagesOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import UsagesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
Exemple #13
0
class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
    """Composite Swagger for Application Insights Management Client.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2017-10-01'
    _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                None: DEFAULT_API_VERSION,
                'analytics_items': '2015-05-01',
                'annotations': '2015-05-01',
                'api_keys': '2015-05-01',
                'component_available_features': '2015-05-01',
                'component_current_billing_features': '2015-05-01',
                'component_feature_capabilities': '2015-05-01',
                'component_quota_status': '2015-05-01',
                'components': '2015-05-01',
                'export_configurations': '2015-05-01',
                'favorites': '2015-05-01',
                'my_workbooks': '2015-05-01',
                'operations': '2015-05-01',
                'proactive_detection_configurations': '2015-05-01',
                'web_test_locations': '2015-05-01',
                'web_tests': '2015-05-01',
                'work_item_configurations': '2015-05-01',
                'workbooks': '2015-05-01',
            }
        }, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential: "AsyncTokenCredential",
            subscription_id: str,
            api_version: Optional[str] = None,
            base_url: Optional[str] = None,
            profile: KnownProfiles = KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = ApplicationInsightsManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(ApplicationInsightsManagementClient,
              self).__init__(api_version=api_version, profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-05-01: :mod:`v2015_05_01.models<azure.mgmt.applicationinsights.v2015_05_01.models>`
           * 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.applicationinsights.v2017_10_01.models>`
           * 2018-05-01-preview: :mod:`v2018_05_01_preview.models<azure.mgmt.applicationinsights.v2018_05_01_preview.models>`
           * 2018-06-17-preview: :mod:`v2018_06_17_preview.models<azure.mgmt.applicationinsights.v2018_06_17_preview.models>`
           * 2019-10-17-preview: :mod:`v2019_10_17_preview.models<azure.mgmt.applicationinsights.v2019_10_17_preview.models>`
           * 2020-02-02-preview: :mod:`v2020_02_02_preview.models<azure.mgmt.applicationinsights.v2020_02_02_preview.models>`
           * 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.applicationinsights.v2020_03_01_preview.models>`
           * 2020-06-02-preview: :mod:`v2020_06_02_preview.models<azure.mgmt.applicationinsights.v2020_06_02_preview.models>`
        """
        if api_version == '2015-05-01':
            from ..v2015_05_01 import models
            return models
        elif api_version == '2017-10-01':
            from ..v2017_10_01 import models
            return models
        elif api_version == '2018-05-01-preview':
            from ..v2018_05_01_preview import models
            return models
        elif api_version == '2018-06-17-preview':
            from ..v2018_06_17_preview import models
            return models
        elif api_version == '2019-10-17-preview':
            from ..v2019_10_17_preview import models
            return models
        elif api_version == '2020-02-02-preview':
            from ..v2020_02_02_preview import models
            return models
        elif api_version == '2020-03-01-preview':
            from ..v2020_03_01_preview import models
            return models
        elif api_version == '2020-06-02-preview':
            from ..v2020_06_02_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def analytics_items(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`AnalyticsItemsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnalyticsItemsOperations>`
        """
        api_version = self._get_api_version('analytics_items')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import AnalyticsItemsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'analytics_items'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def annotations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`AnnotationsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnnotationsOperations>`
        """
        api_version = self._get_api_version('annotations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import AnnotationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'annotations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def api_keys(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`APIKeysOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.APIKeysOperations>`
        """
        api_version = self._get_api_version('api_keys')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import APIKeysOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'api_keys'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_available_features(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ComponentAvailableFeaturesOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentAvailableFeaturesOperations>`
        """
        api_version = self._get_api_version('component_available_features')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ComponentAvailableFeaturesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_available_features'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_current_billing_features(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ComponentCurrentBillingFeaturesOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentCurrentBillingFeaturesOperations>`
        """
        api_version = self._get_api_version(
            'component_current_billing_features')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ComponentCurrentBillingFeaturesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_current_billing_features'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_current_pricing_plan(self):
        """Instance depends on the API version:

           * 2017-10-01: :class:`ComponentCurrentPricingPlanOperations<azure.mgmt.applicationinsights.v2017_10_01.aio.operations.ComponentCurrentPricingPlanOperations>`
        """
        api_version = self._get_api_version('component_current_pricing_plan')
        if api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import ComponentCurrentPricingPlanOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_current_pricing_plan'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_feature_capabilities(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ComponentFeatureCapabilitiesOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentFeatureCapabilitiesOperations>`
        """
        api_version = self._get_api_version('component_feature_capabilities')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ComponentFeatureCapabilitiesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_feature_capabilities'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_linked_storage_accounts(self):
        """Instance depends on the API version:

           * 2020-03-01-preview: :class:`ComponentLinkedStorageAccountsOperations<azure.mgmt.applicationinsights.v2020_03_01_preview.aio.operations.ComponentLinkedStorageAccountsOperations>`
        """
        api_version = self._get_api_version(
            'component_linked_storage_accounts')
        if api_version == '2020-03-01-preview':
            from ..v2020_03_01_preview.aio.operations import ComponentLinkedStorageAccountsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_linked_storage_accounts'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def component_quota_status(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ComponentQuotaStatusOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentQuotaStatusOperations>`
        """
        api_version = self._get_api_version('component_quota_status')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ComponentQuotaStatusOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'component_quota_status'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def components(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentsOperations>`
           * 2018-05-01-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ComponentsOperations>`
           * 2020-02-02-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02_preview.aio.operations.ComponentsOperations>`
        """
        api_version = self._get_api_version('components')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ComponentsOperations as OperationClass
        elif api_version == '2018-05-01-preview':
            from ..v2018_05_01_preview.aio.operations import ComponentsOperations as OperationClass
        elif api_version == '2020-02-02-preview':
            from ..v2020_02_02_preview.aio.operations import ComponentsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'components'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def ea_subscription_list_migration_date(self):
        """Instance depends on the API version:

           * 2017-10-01: :class:`EASubscriptionListMigrationDateOperations<azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionListMigrationDateOperations>`
        """
        api_version = self._get_api_version(
            'ea_subscription_list_migration_date')
        if api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import EASubscriptionListMigrationDateOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'ea_subscription_list_migration_date'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def ea_subscription_migrate_to_new_pricing_model(self):
        """Instance depends on the API version:

           * 2017-10-01: :class:`EASubscriptionMigrateToNewPricingModelOperations<azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionMigrateToNewPricingModelOperations>`
        """
        api_version = self._get_api_version(
            'ea_subscription_migrate_to_new_pricing_model')
        if api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import EASubscriptionMigrateToNewPricingModelOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'ea_subscription_migrate_to_new_pricing_model'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def ea_subscription_rollback_to_legacy_pricing_model(self):
        """Instance depends on the API version:

           * 2017-10-01: :class:`EASubscriptionRollbackToLegacyPricingModelOperations<azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionRollbackToLegacyPricingModelOperations>`
        """
        api_version = self._get_api_version(
            'ea_subscription_rollback_to_legacy_pricing_model')
        if api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import EASubscriptionRollbackToLegacyPricingModelOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'ea_subscription_rollback_to_legacy_pricing_model'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def export_configurations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ExportConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ExportConfigurationsOperations>`
        """
        api_version = self._get_api_version('export_configurations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ExportConfigurationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'export_configurations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def favorites(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`FavoritesOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.FavoritesOperations>`
        """
        api_version = self._get_api_version('favorites')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import FavoritesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'favorites'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def live_token(self):
        """Instance depends on the API version:

           * 2020-06-02-preview: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.LiveTokenOperations>`
        """
        api_version = self._get_api_version('live_token')
        if api_version == '2020-06-02-preview':
            from ..v2020_06_02_preview.aio.operations import LiveTokenOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'live_token'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def my_workbooks(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`MyWorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.MyWorkbooksOperations>`
        """
        api_version = self._get_api_version('my_workbooks')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import MyWorkbooksOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'my_workbooks'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`Operations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.Operations>`
           * 2020-06-02-preview: :class:`Operations<azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import Operations as OperationClass
        elif api_version == '2020-06-02-preview':
            from ..v2020_06_02_preview.aio.operations import Operations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'operations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def proactive_detection_configurations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`ProactiveDetectionConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ProactiveDetectionConfigurationsOperations>`
           * 2018-05-01-preview: :class:`ProactiveDetectionConfigurationsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ProactiveDetectionConfigurationsOperations>`
        """
        api_version = self._get_api_version(
            'proactive_detection_configurations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass
        elif api_version == '2018-05-01-preview':
            from ..v2018_05_01_preview.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'proactive_detection_configurations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def web_test_locations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`WebTestLocationsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestLocationsOperations>`
        """
        api_version = self._get_api_version('web_test_locations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import WebTestLocationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'web_test_locations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def web_tests(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`WebTestsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestsOperations>`
        """
        api_version = self._get_api_version('web_tests')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import WebTestsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'web_tests'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def work_item_configurations(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`WorkItemConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkItemConfigurationsOperations>`
        """
        api_version = self._get_api_version('work_item_configurations')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import WorkItemConfigurationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'work_item_configurations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def workbook_templates(self):
        """Instance depends on the API version:

           * 2019-10-17-preview: :class:`WorkbookTemplatesOperations<azure.mgmt.applicationinsights.v2019_10_17_preview.aio.operations.WorkbookTemplatesOperations>`
        """
        api_version = self._get_api_version('workbook_templates')
        if api_version == '2019-10-17-preview':
            from ..v2019_10_17_preview.aio.operations import WorkbookTemplatesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'workbook_templates'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def workbooks(self):
        """Instance depends on the API version:

           * 2015-05-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkbooksOperations>`
           * 2018-06-17-preview: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2018_06_17_preview.aio.operations.WorkbooksOperations>`
        """
        api_version = self._get_api_version('workbooks')
        if api_version == '2015-05-01':
            from ..v2015_05_01.aio.operations import WorkbooksOperations as OperationClass
        elif api_version == '2018-06-17-preview':
            from ..v2018_06_17_preview.aio.operations import WorkbooksOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'workbooks'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
class KeyVaultManagementClient(MultiApiClientMixin, _SDKClient):
    """The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2019-09-01'
    _PROFILE_TAG = "azure.mgmt.keyvault.KeyVaultManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_id,  # type: str
            api_version=None,  # type: Optional[str]
            base_url=None,  # type: Optional[str]
            profile=KnownProfiles.default,  # type: KnownProfiles
            **kwargs  # type: Any
    ):
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = KeyVaultManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url,
                                         config=self._config,
                                         **kwargs)
        super(KeyVaultManagementClient, self).__init__(api_version=api_version,
                                                       profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2016-10-01: :mod:`v2016_10_01.models<azure.mgmt.keyvault.v2016_10_01.models>`
           * 2018-02-14: :mod:`v2018_02_14.models<azure.mgmt.keyvault.v2018_02_14.models>`
           * 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.keyvault.v2019_09_01.models>`
           * 2020-04-01-preview: :mod:`v2020_04_01_preview.models<azure.mgmt.keyvault.v2020_04_01_preview.models>`
           * 2021-04-01-preview: :mod:`v2021_04_01_preview.models<azure.mgmt.keyvault.v2021_04_01_preview.models>`
        """
        if api_version == '2016-10-01':
            from .v2016_10_01 import models
            return models
        elif api_version == '2018-02-14':
            from .v2018_02_14 import models
            return models
        elif api_version == '2019-09-01':
            from .v2019_09_01 import models
            return models
        elif api_version == '2020-04-01-preview':
            from .v2020_04_01_preview import models
            return models
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def keys(self):
        """Instance depends on the API version:

           * 2019-09-01: :class:`KeysOperations<azure.mgmt.keyvault.v2019_09_01.operations.KeysOperations>`
        """
        api_version = self._get_api_version('keys')
        if api_version == '2019-09-01':
            from .v2019_09_01.operations import KeysOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'keys'".format(
                    api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def managed_hsms(self):
        """Instance depends on the API version:

           * 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.ManagedHsmsOperations>`
           * 2021-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.ManagedHsmsOperations>`
        """
        api_version = self._get_api_version('managed_hsms')
        if api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import ManagedHsmsOperations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import ManagedHsmsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'managed_hsms'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def mhsm_private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2021-04-01-preview: :class:`MHSMPrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.MHSMPrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version(
            'mhsm_private_endpoint_connections')
        if api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import MHSMPrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'mhsm_private_endpoint_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def mhsm_private_link_resources(self):
        """Instance depends on the API version:

           * 2021-04-01-preview: :class:`MHSMPrivateLinkResourcesOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.MHSMPrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('mhsm_private_link_resources')
        if api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import MHSMPrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'mhsm_private_link_resources'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.operations.Operations>`
           * 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.operations.Operations>`
           * 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.operations.Operations>`
           * 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.operations.Operations>`
           * 2021-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2021_04_01_preview.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2016-10-01':
            from .v2016_10_01.operations import Operations as OperationClass
        elif api_version == '2018-02-14':
            from .v2018_02_14.operations import Operations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import Operations as OperationClass
        elif api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import Operations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import Operations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'operations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateEndpointConnectionsOperations>`
           * 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateEndpointConnectionsOperations>`
           * 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateEndpointConnectionsOperations>`
           * 2021-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2018-02-14':
            from .v2018_02_14.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_endpoint_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateLinkResourcesOperations>`
           * 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateLinkResourcesOperations>`
           * 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateLinkResourcesOperations>`
           * 2021-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2018-02-14':
            from .v2018_02_14.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_link_resources'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def secrets(self):
        """Instance depends on the API version:

           * 2020-04-01-preview: :class:`SecretsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.SecretsOperations>`
           * 2021-04-01-preview: :class:`SecretsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.SecretsOperations>`
        """
        api_version = self._get_api_version('secrets')
        if api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import SecretsOperations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import SecretsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'secrets'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def vaults(self):
        """Instance depends on the API version:

           * 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.operations.VaultsOperations>`
           * 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.operations.VaultsOperations>`
           * 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.operations.VaultsOperations>`
           * 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.VaultsOperations>`
           * 2021-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.VaultsOperations>`
        """
        api_version = self._get_api_version('vaults')
        if api_version == '2016-10-01':
            from .v2016_10_01.operations import VaultsOperations as OperationClass
        elif api_version == '2018-02-14':
            from .v2018_02_14.operations import VaultsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import VaultsOperations as OperationClass
        elif api_version == '2020-04-01-preview':
            from .v2020_04_01_preview.operations import VaultsOperations as OperationClass
        elif api_version == '2021-04-01-preview':
            from .v2021_04_01_preview.operations import VaultsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'vaults'".format(
                    api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #15
0
class SubscriptionClient(MultiApiClientMixin, SDKClient):
    """All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization.

    This ready contains multiple API versions, to help you deal with all Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, uses latest API version available on public Azure.
    For production, you should stick a particular api-version and/or profile.
    The profile sets a mapping between the operation group and an API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :ivar config: Configuration for client.
    :vartype config: SubscriptionClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2019-06-01'
    _PROFILE_TAG = "azure.mgmt.resource.subscriptions.SubscriptionClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        self.config = SubscriptionClientConfiguration(credentials, base_url)
        super(SubscriptionClient, self).__init__(credentials,
                                                 self.config,
                                                 api_version=api_version,
                                                 profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2016-06-01: :mod:`v2016_06_01.models<azure.mgmt.resource.subscriptions.v2016_06_01.models>`
           * 2018-06-01: :mod:`v2018_06_01.models<azure.mgmt.resource.subscriptions.v2018_06_01.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.resource.subscriptions.v2019_06_01.models>`
        """
        if api_version == '2016-06-01':
            from .v2016_06_01 import models
            return models
        elif api_version == '2018-06-01':
            from .v2018_06_01 import models
            return models
        elif api_version == '2019-06-01':
            from .v2019_06_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2016-06-01: :class:`Operations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.Operations>`
           * 2018-06-01: :class:`Operations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.Operations>`
           * 2019-06-01: :class:`Operations<azure.mgmt.resource.subscriptions.v2019_06_01.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2016-06-01':
            from .v2016_06_01.operations import Operations as OperationClass
        elif api_version == '2018-06-01':
            from .v2018_06_01.operations import Operations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import Operations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def subscriptions(self):
        """Instance depends on the API version:

           * 2016-06-01: :class:`SubscriptionsOperations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.SubscriptionsOperations>`
           * 2018-06-01: :class:`SubscriptionsOperations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.SubscriptionsOperations>`
           * 2019-06-01: :class:`SubscriptionsOperations<azure.mgmt.resource.subscriptions.v2019_06_01.operations.SubscriptionsOperations>`
        """
        api_version = self._get_api_version('subscriptions')
        if api_version == '2016-06-01':
            from .v2016_06_01.operations import SubscriptionsOperations as OperationClass
        elif api_version == '2018-06-01':
            from .v2018_06_01.operations import SubscriptionsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import SubscriptionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def tenants(self):
        """Instance depends on the API version:

           * 2016-06-01: :class:`TenantsOperations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.TenantsOperations>`
           * 2018-06-01: :class:`TenantsOperations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.TenantsOperations>`
           * 2019-06-01: :class:`TenantsOperations<azure.mgmt.resource.subscriptions.v2019_06_01.operations.TenantsOperations>`
        """
        api_version = self._get_api_version('tenants')
        if api_version == '2016-06-01':
            from .v2016_06_01.operations import TenantsOperations as OperationClass
        elif api_version == '2018-06-01':
            from .v2018_06_01.operations import TenantsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import TenantsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
class ContainerServiceClient(MultiApiClientMixin, _SDKClient):
    """The Container Service Client.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2021-11-01-preview'
    _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                None: DEFAULT_API_VERSION,
                'container_services': '2017-07-01',
                'open_shift_managed_clusters': '2019-04-30',
            }
        }, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_id,  # type: str
            api_version=None,  # type: Optional[str]
            base_url=None,  # type: Optional[str]
            profile=KnownProfiles.default,  # type: KnownProfiles
            **kwargs  # type: Any
    ):
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = ContainerServiceClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url,
                                         config=self._config,
                                         **kwargs)
        super(ContainerServiceClient, self).__init__(api_version=api_version,
                                                     profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2017-07-01: :mod:`v2017_07_01.models<azure.mgmt.containerservice.v2017_07_01.models>`
           * 2018-03-31: :mod:`v2018_03_31.models<azure.mgmt.containerservice.v2018_03_31.models>`
           * 2018-08-01-preview: :mod:`v2018_08_01_preview.models<azure.mgmt.containerservice.v2018_08_01_preview.models>`
           * 2018-09-30-preview: :mod:`v2018_09_30_preview.models<azure.mgmt.containerservice.v2018_09_30_preview.models>`
           * 2019-02-01: :mod:`v2019_02_01.models<azure.mgmt.containerservice.v2019_02_01.models>`
           * 2019-04-01: :mod:`v2019_04_01.models<azure.mgmt.containerservice.v2019_04_01.models>`
           * 2019-04-30: :mod:`v2019_04_30.models<azure.mgmt.containerservice.v2019_04_30.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.containerservice.v2019_06_01.models>`
           * 2019-08-01: :mod:`v2019_08_01.models<azure.mgmt.containerservice.v2019_08_01.models>`
           * 2019-09-30-preview: :mod:`v2019_09_30_preview.models<azure.mgmt.containerservice.v2019_09_30_preview.models>`
           * 2019-10-01: :mod:`v2019_10_01.models<azure.mgmt.containerservice.v2019_10_01.models>`
           * 2019-10-27-preview: :mod:`v2019_10_27_preview.models<azure.mgmt.containerservice.v2019_10_27_preview.models>`
           * 2019-11-01: :mod:`v2019_11_01.models<azure.mgmt.containerservice.v2019_11_01.models>`
           * 2020-01-01: :mod:`v2020_01_01.models<azure.mgmt.containerservice.v2020_01_01.models>`
           * 2020-02-01: :mod:`v2020_02_01.models<azure.mgmt.containerservice.v2020_02_01.models>`
           * 2020-03-01: :mod:`v2020_03_01.models<azure.mgmt.containerservice.v2020_03_01.models>`
           * 2020-04-01: :mod:`v2020_04_01.models<azure.mgmt.containerservice.v2020_04_01.models>`
           * 2020-06-01: :mod:`v2020_06_01.models<azure.mgmt.containerservice.v2020_06_01.models>`
           * 2020-07-01: :mod:`v2020_07_01.models<azure.mgmt.containerservice.v2020_07_01.models>`
           * 2020-09-01: :mod:`v2020_09_01.models<azure.mgmt.containerservice.v2020_09_01.models>`
           * 2020-11-01: :mod:`v2020_11_01.models<azure.mgmt.containerservice.v2020_11_01.models>`
           * 2020-12-01: :mod:`v2020_12_01.models<azure.mgmt.containerservice.v2020_12_01.models>`
           * 2021-02-01: :mod:`v2021_02_01.models<azure.mgmt.containerservice.v2021_02_01.models>`
           * 2021-03-01: :mod:`v2021_03_01.models<azure.mgmt.containerservice.v2021_03_01.models>`
           * 2021-05-01: :mod:`v2021_05_01.models<azure.mgmt.containerservice.v2021_05_01.models>`
           * 2021-07-01: :mod:`v2021_07_01.models<azure.mgmt.containerservice.v2021_07_01.models>`
           * 2021-08-01: :mod:`v2021_08_01.models<azure.mgmt.containerservice.v2021_08_01.models>`
           * 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.containerservice.v2021_09_01.models>`
           * 2021-10-01: :mod:`v2021_10_01.models<azure.mgmt.containerservice.v2021_10_01.models>`
           * 2021-11-01-preview: :mod:`v2021_11_01_preview.models<azure.mgmt.containerservice.v2021_11_01_preview.models>`
        """
        if api_version == '2017-07-01':
            from .v2017_07_01 import models
            return models
        elif api_version == '2018-03-31':
            from .v2018_03_31 import models
            return models
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview import models
            return models
        elif api_version == '2018-09-30-preview':
            from .v2018_09_30_preview import models
            return models
        elif api_version == '2019-02-01':
            from .v2019_02_01 import models
            return models
        elif api_version == '2019-04-01':
            from .v2019_04_01 import models
            return models
        elif api_version == '2019-04-30':
            from .v2019_04_30 import models
            return models
        elif api_version == '2019-06-01':
            from .v2019_06_01 import models
            return models
        elif api_version == '2019-08-01':
            from .v2019_08_01 import models
            return models
        elif api_version == '2019-09-30-preview':
            from .v2019_09_30_preview import models
            return models
        elif api_version == '2019-10-01':
            from .v2019_10_01 import models
            return models
        elif api_version == '2019-10-27-preview':
            from .v2019_10_27_preview import models
            return models
        elif api_version == '2019-11-01':
            from .v2019_11_01 import models
            return models
        elif api_version == '2020-01-01':
            from .v2020_01_01 import models
            return models
        elif api_version == '2020-02-01':
            from .v2020_02_01 import models
            return models
        elif api_version == '2020-03-01':
            from .v2020_03_01 import models
            return models
        elif api_version == '2020-04-01':
            from .v2020_04_01 import models
            return models
        elif api_version == '2020-06-01':
            from .v2020_06_01 import models
            return models
        elif api_version == '2020-07-01':
            from .v2020_07_01 import models
            return models
        elif api_version == '2020-09-01':
            from .v2020_09_01 import models
            return models
        elif api_version == '2020-11-01':
            from .v2020_11_01 import models
            return models
        elif api_version == '2020-12-01':
            from .v2020_12_01 import models
            return models
        elif api_version == '2021-02-01':
            from .v2021_02_01 import models
            return models
        elif api_version == '2021-03-01':
            from .v2021_03_01 import models
            return models
        elif api_version == '2021-05-01':
            from .v2021_05_01 import models
            return models
        elif api_version == '2021-07-01':
            from .v2021_07_01 import models
            return models
        elif api_version == '2021-08-01':
            from .v2021_08_01 import models
            return models
        elif api_version == '2021-09-01':
            from .v2021_09_01 import models
            return models
        elif api_version == '2021-10-01':
            from .v2021_10_01 import models
            return models
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def agent_pools(self):
        """Instance depends on the API version:

           * 2019-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_02_01.operations.AgentPoolsOperations>`
           * 2019-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations>`
           * 2019-06-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_06_01.operations.AgentPoolsOperations>`
           * 2019-08-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_08_01.operations.AgentPoolsOperations>`
           * 2019-10-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_10_01.operations.AgentPoolsOperations>`
           * 2019-11-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_11_01.operations.AgentPoolsOperations>`
           * 2020-01-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_01_01.operations.AgentPoolsOperations>`
           * 2020-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_02_01.operations.AgentPoolsOperations>`
           * 2020-03-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_03_01.operations.AgentPoolsOperations>`
           * 2020-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_04_01.operations.AgentPoolsOperations>`
           * 2020-06-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_06_01.operations.AgentPoolsOperations>`
           * 2020-07-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_07_01.operations.AgentPoolsOperations>`
           * 2020-09-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_09_01.operations.AgentPoolsOperations>`
           * 2020-11-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_11_01.operations.AgentPoolsOperations>`
           * 2020-12-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_12_01.operations.AgentPoolsOperations>`
           * 2021-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_02_01.operations.AgentPoolsOperations>`
           * 2021-03-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_03_01.operations.AgentPoolsOperations>`
           * 2021-05-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_05_01.operations.AgentPoolsOperations>`
           * 2021-07-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_07_01.operations.AgentPoolsOperations>`
           * 2021-08-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_08_01.operations.AgentPoolsOperations>`
           * 2021-09-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_09_01.operations.AgentPoolsOperations>`
           * 2021-10-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_10_01.operations.AgentPoolsOperations>`
           * 2021-11-01-preview: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.AgentPoolsOperations>`
        """
        api_version = self._get_api_version('agent_pools')
        if api_version == '2019-02-01':
            from .v2019_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import AgentPoolsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'agent_pools'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def container_services(self):
        """Instance depends on the API version:

           * 2017-07-01: :class:`ContainerServicesOperations<azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations>`
        """
        api_version = self._get_api_version('container_services')
        if api_version == '2017-07-01':
            from .v2017_07_01.operations import ContainerServicesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'container_services'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def maintenance_configurations(self):
        """Instance depends on the API version:

           * 2020-12-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2020_12_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-02-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_02_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-03-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_03_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-05-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_05_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-07-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_07_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-08-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_08_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-09-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_09_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-10-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_10_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-11-01-preview: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.MaintenanceConfigurationsOperations>`
        """
        api_version = self._get_api_version('maintenance_configurations')
        if api_version == '2020-12-01':
            from .v2020_12_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import MaintenanceConfigurationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'maintenance_configurations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def managed_clusters(self):
        """Instance depends on the API version:

           * 2018-03-31: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations>`
           * 2018-08-01-preview: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations>`
           * 2019-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations>`
           * 2019-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations>`
           * 2019-06-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_06_01.operations.ManagedClustersOperations>`
           * 2019-08-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations>`
           * 2019-10-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations>`
           * 2019-11-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_11_01.operations.ManagedClustersOperations>`
           * 2020-01-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_01_01.operations.ManagedClustersOperations>`
           * 2020-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_02_01.operations.ManagedClustersOperations>`
           * 2020-03-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_03_01.operations.ManagedClustersOperations>`
           * 2020-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_04_01.operations.ManagedClustersOperations>`
           * 2020-06-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_06_01.operations.ManagedClustersOperations>`
           * 2020-07-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_07_01.operations.ManagedClustersOperations>`
           * 2020-09-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_09_01.operations.ManagedClustersOperations>`
           * 2020-11-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_11_01.operations.ManagedClustersOperations>`
           * 2020-12-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_12_01.operations.ManagedClustersOperations>`
           * 2021-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_02_01.operations.ManagedClustersOperations>`
           * 2021-03-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_03_01.operations.ManagedClustersOperations>`
           * 2021-05-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_05_01.operations.ManagedClustersOperations>`
           * 2021-07-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_07_01.operations.ManagedClustersOperations>`
           * 2021-08-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_08_01.operations.ManagedClustersOperations>`
           * 2021-09-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_09_01.operations.ManagedClustersOperations>`
           * 2021-10-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_10_01.operations.ManagedClustersOperations>`
           * 2021-11-01-preview: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.ManagedClustersOperations>`
        """
        api_version = self._get_api_version('managed_clusters')
        if api_version == '2018-03-31':
            from .v2018_03_31.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import ManagedClustersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'managed_clusters'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def open_shift_managed_clusters(self):
        """Instance depends on the API version:

           * 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations>`
           * 2019-04-30: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2019_04_30.operations.OpenShiftManagedClustersOperations>`
           * 2019-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2019_09_30_preview.operations.OpenShiftManagedClustersOperations>`
           * 2019-10-27-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2019_10_27_preview.operations.OpenShiftManagedClustersOperations>`
        """
        api_version = self._get_api_version('open_shift_managed_clusters')
        if api_version == '2018-09-30-preview':
            from .v2018_09_30_preview.operations import OpenShiftManagedClustersOperations as OperationClass
        elif api_version == '2019-04-30':
            from .v2019_04_30.operations import OpenShiftManagedClustersOperations as OperationClass
        elif api_version == '2019-09-30-preview':
            from .v2019_09_30_preview.operations import OpenShiftManagedClustersOperations as OperationClass
        elif api_version == '2019-10-27-preview':
            from .v2019_10_27_preview.operations import OpenShiftManagedClustersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'open_shift_managed_clusters'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2018-03-31: :class:`Operations<azure.mgmt.containerservice.v2018_03_31.operations.Operations>`
           * 2018-08-01-preview: :class:`Operations<azure.mgmt.containerservice.v2018_08_01_preview.operations.Operations>`
           * 2019-02-01: :class:`Operations<azure.mgmt.containerservice.v2019_02_01.operations.Operations>`
           * 2019-04-01: :class:`Operations<azure.mgmt.containerservice.v2019_04_01.operations.Operations>`
           * 2019-06-01: :class:`Operations<azure.mgmt.containerservice.v2019_06_01.operations.Operations>`
           * 2019-08-01: :class:`Operations<azure.mgmt.containerservice.v2019_08_01.operations.Operations>`
           * 2019-10-01: :class:`Operations<azure.mgmt.containerservice.v2019_10_01.operations.Operations>`
           * 2019-11-01: :class:`Operations<azure.mgmt.containerservice.v2019_11_01.operations.Operations>`
           * 2020-01-01: :class:`Operations<azure.mgmt.containerservice.v2020_01_01.operations.Operations>`
           * 2020-02-01: :class:`Operations<azure.mgmt.containerservice.v2020_02_01.operations.Operations>`
           * 2020-03-01: :class:`Operations<azure.mgmt.containerservice.v2020_03_01.operations.Operations>`
           * 2020-04-01: :class:`Operations<azure.mgmt.containerservice.v2020_04_01.operations.Operations>`
           * 2020-06-01: :class:`Operations<azure.mgmt.containerservice.v2020_06_01.operations.Operations>`
           * 2020-07-01: :class:`Operations<azure.mgmt.containerservice.v2020_07_01.operations.Operations>`
           * 2020-09-01: :class:`Operations<azure.mgmt.containerservice.v2020_09_01.operations.Operations>`
           * 2020-11-01: :class:`Operations<azure.mgmt.containerservice.v2020_11_01.operations.Operations>`
           * 2020-12-01: :class:`Operations<azure.mgmt.containerservice.v2020_12_01.operations.Operations>`
           * 2021-02-01: :class:`Operations<azure.mgmt.containerservice.v2021_02_01.operations.Operations>`
           * 2021-03-01: :class:`Operations<azure.mgmt.containerservice.v2021_03_01.operations.Operations>`
           * 2021-05-01: :class:`Operations<azure.mgmt.containerservice.v2021_05_01.operations.Operations>`
           * 2021-07-01: :class:`Operations<azure.mgmt.containerservice.v2021_07_01.operations.Operations>`
           * 2021-08-01: :class:`Operations<azure.mgmt.containerservice.v2021_08_01.operations.Operations>`
           * 2021-09-01: :class:`Operations<azure.mgmt.containerservice.v2021_09_01.operations.Operations>`
           * 2021-10-01: :class:`Operations<azure.mgmt.containerservice.v2021_10_01.operations.Operations>`
           * 2021-11-01-preview: :class:`Operations<azure.mgmt.containerservice.v2021_10_01_preview.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2018-03-31':
            from .v2018_03_31.operations import Operations as OperationClass
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview.operations import Operations as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import Operations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import Operations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import Operations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import Operations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import Operations as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import Operations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import Operations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import Operations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import Operations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import Operations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import Operations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import Operations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import Operations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import Operations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import Operations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import Operations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import Operations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import Operations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import Operations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import Operations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import Operations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import Operations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import Operations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'operations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2020-06-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2020_06_01.operations.PrivateEndpointConnectionsOperations>`
           * 2020-07-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2020_07_01.operations.PrivateEndpointConnectionsOperations>`
           * 2020-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2020_09_01.operations.PrivateEndpointConnectionsOperations>`
           * 2020-11-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2020_11_01.operations.PrivateEndpointConnectionsOperations>`
           * 2020-12-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2020_12_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-02-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_02_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-03-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_03_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-05-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_05_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-07-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_07_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-08-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_08_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_09_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-10-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_10_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-11-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2020-06-01':
            from .v2020_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_endpoint_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2020-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2020_09_01.operations.PrivateLinkResourcesOperations>`
           * 2020-11-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2020_11_01.operations.PrivateLinkResourcesOperations>`
           * 2020-12-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2020_12_01.operations.PrivateLinkResourcesOperations>`
           * 2021-02-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_02_01.operations.PrivateLinkResourcesOperations>`
           * 2021-03-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_03_01.operations.PrivateLinkResourcesOperations>`
           * 2021-05-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_05_01.operations.PrivateLinkResourcesOperations>`
           * 2021-07-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_07_01.operations.PrivateLinkResourcesOperations>`
           * 2021-08-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_08_01.operations.PrivateLinkResourcesOperations>`
           * 2021-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_09_01.operations.PrivateLinkResourcesOperations>`
           * 2021-10-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_10_01.operations.PrivateLinkResourcesOperations>`
           * 2021-11-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2020-09-01':
            from .v2020_09_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_link_resources'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def resolve_private_link_service_id(self):
        """Instance depends on the API version:

           * 2020-09-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2020_09_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2020-11-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2020_11_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2020-12-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2020_12_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-02-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_02_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-03-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_03_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-05-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_05_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-07-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_07_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_08_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-09-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_09_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-10-01: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_10_01.operations.ResolvePrivateLinkServiceIdOperations>`
           * 2021-11-01-preview: :class:`ResolvePrivateLinkServiceIdOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.ResolvePrivateLinkServiceIdOperations>`
        """
        api_version = self._get_api_version('resolve_private_link_service_id')
        if api_version == '2020-09-01':
            from .v2020_09_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-07-01':
            from .v2021_07_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-08-01':
            from .v2021_08_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'resolve_private_link_service_id'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def snapshots(self):
        """Instance depends on the API version:

           * 2021-08-01: :class:`SnapshotsOperations<azure.mgmt.containerservice.v2021_08_01.operations.SnapshotsOperations>`
           * 2021-09-01: :class:`SnapshotsOperations<azure.mgmt.containerservice.v2021_09_01.operations.SnapshotsOperations>`
           * 2021-10-01: :class:`SnapshotsOperations<azure.mgmt.containerservice.v2021_10_01.operations.SnapshotsOperations>`
           * 2021-11-01-preview: :class:`SnapshotsOperations<azure.mgmt.containerservice.v2021_11_01_preview.operations.SnapshotsOperations>`
        """
        api_version = self._get_api_version('snapshots')
        if api_version == '2021-08-01':
            from .v2021_08_01.operations import SnapshotsOperations as OperationClass
        elif api_version == '2021-09-01':
            from .v2021_09_01.operations import SnapshotsOperations as OperationClass
        elif api_version == '2021-10-01':
            from .v2021_10_01.operations import SnapshotsOperations as OperationClass
        elif api_version == '2021-11-01-preview':
            from .v2021_11_01_preview.operations import SnapshotsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'snapshots'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #17
0
class DeploymentScriptsClient(MultiApiClientMixin, _SDKClient):
    """The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: Subscription Id which forms part of the URI for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2019-10-01-preview'
    _PROFILE_TAG = "azure.mgmt.resource.DeploymentScriptsClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_id,  # type: str
            api_version=None,
            base_url=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ):
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = DeploymentScriptsClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url,
                                         config=self._config,
                                         **kwargs)
        super(DeploymentScriptsClient, self).__init__(credential,
                                                      self._config,
                                                      api_version=api_version,
                                                      profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2019-10-01-preview: :mod:`v2019_10_preview.models<azure.mgmt.resource.v2019_10_preview.models>`
        """
        if api_version == '2019-10-01-preview':
            from .v2019_10_preview import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def deployment_scripts(self):
        """Instance depends on the API version:

           * 2019-10-01-preview: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2019_10_preview.operations.DeploymentScriptsOperations>`
        """
        api_version = self._get_api_version('deployment_scripts')
        if api_version == '2019-10-01-preview':
            from .v2019_10_preview.operations import DeploymentScriptsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
class PolicyClient(MultiApiClientMixin, SDKClient):
    """To manage and control access to your resources, you can define customized policies and assign them at a scope.

    This ready contains multiple API versions, to help you deal with all Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, uses latest API version available on public Azure.
    For production, you should stick a particular api-version and/or profile.
    The profile sets a mapping between the operation group and an API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :ivar config: Configuration for client.
    :vartype config: PolicyClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Subscription credentials which uniquely identify
     Microsoft Azure subscription. The subscription ID forms part of the URI
     for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2019-09-01'
    _PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
    LATEST_PROFILE = ProfileDefinition({
        _PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }},
        _PROFILE_TAG + " latest"
    )

    def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
        self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
        super(PolicyClient, self).__init__(
            credentials,
            self.config,
            api_version=api_version,
            profile=profile
        )

    @classmethod
    def _models_dict(cls, api_version):
        return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-10-01-preview: :mod:`v2015_10_01_preview.models<azure.mgmt.resource.policy.v2015_10_01_preview.models>`
           * 2016-04-01: :mod:`v2016_04_01.models<azure.mgmt.resource.policy.v2016_04_01.models>`
           * 2016-12-01: :mod:`v2016_12_01.models<azure.mgmt.resource.policy.v2016_12_01.models>`
           * 2017-06-01-preview: :mod:`v2017_06_01_preview.models<azure.mgmt.resource.policy.v2017_06_01_preview.models>`
           * 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.policy.v2018_03_01.models>`
           * 2018-05-01: :mod:`v2018_05_01.models<azure.mgmt.resource.policy.v2018_05_01.models>`
           * 2019-01-01: :mod:`v2019_01_01.models<azure.mgmt.resource.policy.v2019_01_01.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.resource.policy.v2019_06_01.models>`
           * 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.resource.policy.v2019_09_01.models>`
        """
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview import models
            return models
        elif api_version == '2016-04-01':
            from .v2016_04_01 import models
            return models
        elif api_version == '2016-12-01':
            from .v2016_12_01 import models
            return models
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview import models
            return models
        elif api_version == '2018-03-01':
            from .v2018_03_01 import models
            return models
        elif api_version == '2018-05-01':
            from .v2018_05_01 import models
            return models
        elif api_version == '2019-01-01':
            from .v2019_01_01 import models
            return models
        elif api_version == '2019-06-01':
            from .v2019_06_01 import models
            return models
        elif api_version == '2019-09-01':
            from .v2019_09_01 import models
            return models
        raise NotImplementedError("APIVersion {} is not available".format(api_version))

    @property
    def policy_assignments(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2015_10_01_preview.operations.PolicyAssignmentsOperations>`
           * 2016-04-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2016_04_01.operations.PolicyAssignmentsOperations>`
           * 2016-12-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2016_12_01.operations.PolicyAssignmentsOperations>`
           * 2017-06-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyAssignmentsOperations>`
           * 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyAssignmentsOperations>`
           * 2018-05-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyAssignmentsOperations>`
           * 2019-01-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations>`
           * 2019-06-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyAssignmentsOperations>`
           * 2019-09-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_09_01.operations.PolicyAssignmentsOperations>`
        """
        api_version = self._get_api_version('policy_assignments')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicyAssignmentsOperations as OperationClass
        else:
            raise NotImplementedError("APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def policy_definitions(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2015_10_01_preview.operations.PolicyDefinitionsOperations>`
           * 2016-04-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2016_04_01.operations.PolicyDefinitionsOperations>`
           * 2016-12-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2016_12_01.operations.PolicyDefinitionsOperations>`
           * 2017-06-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyDefinitionsOperations>`
           * 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyDefinitionsOperations>`
           * 2018-05-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyDefinitionsOperations>`
           * 2019-01-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations>`
           * 2019-06-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyDefinitionsOperations>`
           * 2019-09-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_09_01.operations.PolicyDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_definitions')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicyDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError("APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def policy_set_definitions(self):
        """Instance depends on the API version:

           * 2017-06-01-preview: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicySetDefinitionsOperations>`
           * 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicySetDefinitionsOperations>`
           * 2018-05-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicySetDefinitionsOperations>`
           * 2019-01-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations>`
           * 2019-06-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicySetDefinitionsOperations>`
           * 2019-09-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_09_01.operations.PolicySetDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_set_definitions')
        if api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2018-05-01':
            from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-01-01':
            from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import PolicySetDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError("APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Exemple #19
0
class FormRecognizerClient(FormRecognizerClientOperationsMixin,
                           MultiApiClientMixin, _SDKClient):
    """Extracts information from forms and images into structured data.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).
    :type endpoint: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2.1-preview.1'
    _PROFILE_TAG = "azure.ai.formrecognizer.FormRecognizerClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                None: DEFAULT_API_VERSION,
                'train_custom_model_async': '2.0',
            }
        }, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "AsyncTokenCredential"
            endpoint,  # type: str
            api_version=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if api_version == '2.0':
            base_url = '{endpoint}/formrecognizer/v2.0'
        elif api_version == '2.1-preview.1':
            base_url = '{endpoint}/formrecognizer/v2.1-preview.1'
        else:
            raise ValueError(
                "API version {} is not available".format(api_version))
        self._config = FormRecognizerClientConfiguration(
            credential, endpoint, **kwargs)
        self._client = AsyncPipelineClient(base_url=base_url,
                                           config=self._config,
                                           **kwargs)
        super(FormRecognizerClient, self).__init__(api_version=api_version,
                                                   profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2.0: :mod:`v2_0.models<azure.ai.formrecognizer.v2_0.models>`
           * 2.1-preview.1: :mod:`v2_1_preview_1.models<azure.ai.formrecognizer.v2_1_preview_1.models>`
        """
        if api_version == '2.0':
            from ..v2_0 import models
            return models
        elif api_version == '2.1-preview.1':
            from ..v2_1_preview_1 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
class PolicyClient(MultiApiClientMixin):
    """To manage and control access to your resources, you can define customized policies and assign them at a scope.

    :ivar config: Configuration for client.
    :vartype config: PolicyClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2018-03-01'
    _PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION
        }}, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        super(PolicyClient, self).__init__(credentials=credentials,
                                           subscription_id=subscription_id,
                                           api_version=api_version,
                                           base_url=base_url,
                                           profile=profile)

        self.config = PolicyClientConfiguration(credentials, subscription_id,
                                                base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-10-01-preview: :mod:`v2015_10_01_preview.models<azure.mgmt.resource.policy.v2015_10_01_preview.models>`
           * 2016-04-01: :mod:`v2016_04_01.models<azure.mgmt.resource.policy.v2016_04_01.models>`
           * 2016-12-01: :mod:`v2016_12_01.models<azure.mgmt.resource.policy.v2016_12_01.models>`
           * 2017-06-01-preview: :mod:`v2017_06_01_preview.models<azure.mgmt.resource.policy.v2017_06_01_preview.models>`
           * 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.policy.v2018_03_01.models>`
        """
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview import models
            return models
        elif api_version == '2016-04-01':
            from .v2016_04_01 import models
            return models
        elif api_version == '2016-12-01':
            from .v2016_12_01 import models
            return models
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview import models
            return models
        elif api_version == '2018-03-01':
            from .v2018_03_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def policy_assignments(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2015_10_01_preview.operations.PolicyAssignmentsOperations>`
           * 2016-04-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2016_04_01.operations.PolicyAssignmentsOperations>`
           * 2016-12-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2016_12_01.operations.PolicyAssignmentsOperations>`
           * 2017-06-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyAssignmentsOperations>`
           * 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyAssignmentsOperations>`
        """
        api_version = self._get_api_version('policy_assignments')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyAssignmentsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def policy_definitions(self):
        """Instance depends on the API version:

           * 2015-10-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2015_10_01_preview.operations.PolicyDefinitionsOperations>`
           * 2016-04-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2016_04_01.operations.PolicyDefinitionsOperations>`
           * 2016-12-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2016_12_01.operations.PolicyDefinitionsOperations>`
           * 2017-06-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyDefinitionsOperations>`
           * 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_definitions')
        if api_version == '2015-10-01-preview':
            from .v2015_10_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-04-01':
            from .v2016_04_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicyDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def policy_set_definitions(self):
        """Instance depends on the API version:

           * 2017-06-01-preview: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicySetDefinitionsOperations>`
           * 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicySetDefinitionsOperations>`
        """
        api_version = self._get_api_version('policy_set_definitions')
        if api_version == '2017-06-01-preview':
            from .v2017_06_01_preview.operations import PolicySetDefinitionsOperations as OperationClass
        elif api_version == '2018-03-01':
            from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
Exemple #21
0
class MySQLManagementClient(MySQLManagementClientOperationsMixin,
                            MultiApiClientMixin, _SDKClient):
    """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2020-01-01'
    _PROFILE_TAG = "azure.mgmt.rdbms.MySQLManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "AsyncTokenCredential"
            subscription_id,  # type: str
            api_version=None,
            base_url=None,
            profile=KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = MySQLManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(MySQLManagementClient, self).__init__(api_version=api_version,
                                                    profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2020-01-01: :mod:`v2020_01_01.models<azure.mgmt.rdbms.v2020_01_01.models>`
           * 2020-07-01-privatepreview: :mod:`v2020_07_01_privatepreview.models<azure.mgmt.rdbms.v2020_07_01_privatepreview.models>`
        """
        if api_version == '2020-01-01':
            from ..v2020_01_01 import models
            return models
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def advisors(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`AdvisorsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.AdvisorsOperations>`
        """
        api_version = self._get_api_version('advisors')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import AdvisorsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'advisors'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def check_name_availability(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`CheckNameAvailabilityOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.CheckNameAvailabilityOperations>`
           * 2020-07-01-privatepreview: :class:`CheckNameAvailabilityOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.CheckNameAvailabilityOperations>`
        """
        api_version = self._get_api_version('check_name_availability')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import CheckNameAvailabilityOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import CheckNameAvailabilityOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'check_name_availability'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def check_virtual_network_subnet_usage(self):
        """Instance depends on the API version:

           * 2020-07-01-privatepreview: :class:`CheckVirtualNetworkSubnetUsageOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.CheckVirtualNetworkSubnetUsageOperations>`
        """
        api_version = self._get_api_version(
            'check_virtual_network_subnet_usage')
        if api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import CheckVirtualNetworkSubnetUsageOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'check_virtual_network_subnet_usage'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def configurations(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ConfigurationsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ConfigurationsOperations>`
           * 2020-07-01-privatepreview: :class:`ConfigurationsOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.ConfigurationsOperations>`
        """
        api_version = self._get_api_version('configurations')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ConfigurationsOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import ConfigurationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'configurations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def databases(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`DatabasesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.DatabasesOperations>`
           * 2020-07-01-privatepreview: :class:`DatabasesOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.DatabasesOperations>`
        """
        api_version = self._get_api_version('databases')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import DatabasesOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import DatabasesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'databases'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def firewall_rules(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`FirewallRulesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.FirewallRulesOperations>`
           * 2020-07-01-privatepreview: :class:`FirewallRulesOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.FirewallRulesOperations>`
        """
        api_version = self._get_api_version('firewall_rules')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import FirewallRulesOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import FirewallRulesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'firewall_rules'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def location_based_capabilities(self):
        """Instance depends on the API version:

           * 2020-07-01-privatepreview: :class:`LocationBasedCapabilitiesOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.LocationBasedCapabilitiesOperations>`
        """
        api_version = self._get_api_version('location_based_capabilities')
        if api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import LocationBasedCapabilitiesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'location_based_capabilities'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def location_based_performance_tier(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`LocationBasedPerformanceTierOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.LocationBasedPerformanceTierOperations>`
        """
        api_version = self._get_api_version('location_based_performance_tier')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import LocationBasedPerformanceTierOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'location_based_performance_tier'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def location_based_recommended_action_sessions_operation_status(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`LocationBasedRecommendedActionSessionsOperationStatusOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.LocationBasedRecommendedActionSessionsOperationStatusOperations>`
        """
        api_version = self._get_api_version(
            'location_based_recommended_action_sessions_operation_status')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import LocationBasedRecommendedActionSessionsOperationStatusOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'location_based_recommended_action_sessions_operation_status'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def location_based_recommended_action_sessions_result(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`LocationBasedRecommendedActionSessionsResultOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.LocationBasedRecommendedActionSessionsResultOperations>`
        """
        api_version = self._get_api_version(
            'location_based_recommended_action_sessions_result')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import LocationBasedRecommendedActionSessionsResultOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'location_based_recommended_action_sessions_result'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def log_files(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`LogFilesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.LogFilesOperations>`
        """
        api_version = self._get_api_version('log_files')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import LogFilesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'log_files'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`Operations<azure.mgmt.rdbms.v2020_01_01.aio.operations.Operations>`
           * 2020-07-01-privatepreview: :class:`Operations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import Operations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import Operations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'operations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_endpoint_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_link_resources'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def query_texts(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`QueryTextsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.QueryTextsOperations>`
        """
        api_version = self._get_api_version('query_texts')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import QueryTextsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'query_texts'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def recommended_actions(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`RecommendedActionsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.RecommendedActionsOperations>`
        """
        api_version = self._get_api_version('recommended_actions')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import RecommendedActionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'recommended_actions'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def replicas(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ReplicasOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ReplicasOperations>`
           * 2020-07-01-privatepreview: :class:`ReplicasOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.ReplicasOperations>`
        """
        api_version = self._get_api_version('replicas')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ReplicasOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import ReplicasOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'replicas'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def server_administrators(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ServerAdministratorsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ServerAdministratorsOperations>`
        """
        api_version = self._get_api_version('server_administrators')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ServerAdministratorsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'server_administrators'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def server_keys(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ServerKeysOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ServerKeysOperations>`
           * 2020-07-01-privatepreview: :class:`ServerKeysOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.ServerKeysOperations>`
        """
        api_version = self._get_api_version('server_keys')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ServerKeysOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import ServerKeysOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'server_keys'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def server_security_alert_policies(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ServerSecurityAlertPoliciesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ServerSecurityAlertPoliciesOperations>`
        """
        api_version = self._get_api_version('server_security_alert_policies')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ServerSecurityAlertPoliciesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'server_security_alert_policies'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def servers(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`ServersOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.ServersOperations>`
           * 2020-07-01-privatepreview: :class:`ServersOperations<azure.mgmt.rdbms.v2020_07_01_privatepreview.aio.operations.ServersOperations>`
        """
        api_version = self._get_api_version('servers')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import ServersOperations as OperationClass
        elif api_version == '2020-07-01-privatepreview':
            from ..v2020_07_01_privatepreview.aio.operations import ServersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'servers'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def top_query_statistics(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`TopQueryStatisticsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.TopQueryStatisticsOperations>`
        """
        api_version = self._get_api_version('top_query_statistics')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import TopQueryStatisticsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'top_query_statistics'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def virtual_network_rules(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`VirtualNetworkRulesOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.VirtualNetworkRulesOperations>`
        """
        api_version = self._get_api_version('virtual_network_rules')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import VirtualNetworkRulesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'virtual_network_rules'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def wait_statistics(self):
        """Instance depends on the API version:

           * 2020-01-01: :class:`WaitStatisticsOperations<azure.mgmt.rdbms.v2020_01_01.aio.operations.WaitStatisticsOperations>`
        """
        api_version = self._get_api_version('wait_statistics')
        if api_version == '2020-01-01':
            from ..v2020_01_01.aio.operations import WaitStatisticsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'wait_statistics'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
class FeatureClient(MultiApiClientMixin):
    """Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality.

    :ivar config: Configuration for client.
    :vartype config: FeatureClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2015-12-01'
    _PROFILE_TAG = "azure.mgmt.resource.features.FeatureClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION
        }}, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        super(FeatureClient, self).__init__(credentials=credentials,
                                            subscription_id=subscription_id,
                                            api_version=api_version,
                                            base_url=base_url,
                                            profile=profile)

        self.config = FeatureClientConfiguration(credentials, subscription_id,
                                                 api_version, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-12-01: :mod:`v2015_12_01.models<azure.mgmt.resource.features.v2015_12_01.models>`
        """
        if api_version == '2015-12-01':
            from .v2015_12_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def features(self):
        """Instance depends on the API version:

           * 2015-12-01: :class:`FeaturesOperations<azure.mgmt.resource.features.v2015_12_01.operations.FeaturesOperations>`
        """
        api_version = self._get_api_version('features')
        if api_version == '2015-12-01':
            from .v2015_12_01.operations import FeaturesOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
class TemplateSpecsClient(MultiApiClientMixin, _SDKClient):
    """The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: Subscription Id which forms part of the URI for every service call.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2021-05-01'
    _PROFILE_TAG = "azure.mgmt.resource.templatespecs.TemplateSpecsClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential: "AsyncTokenCredential",
            subscription_id: str,
            api_version: Optional[str] = None,
            base_url: Optional[str] = None,
            profile: KnownProfiles = KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = TemplateSpecsClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(TemplateSpecsClient, self).__init__(api_version=api_version,
                                                  profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2019-06-01-preview: :mod:`v2019_06_01_preview.models<azure.mgmt.resource.templatespecs.v2019_06_01_preview.models>`
           * 2021-03-01-preview: :mod:`v2021_03_01_preview.models<azure.mgmt.resource.templatespecs.v2021_03_01_preview.models>`
           * 2021-05-01: :mod:`v2021_05_01.models<azure.mgmt.resource.templatespecs.v2021_05_01.models>`
        """
        if api_version == '2019-06-01-preview':
            from ..v2019_06_01_preview import models
            return models
        elif api_version == '2021-03-01-preview':
            from ..v2021_03_01_preview import models
            return models
        elif api_version == '2021-05-01':
            from ..v2021_05_01 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def template_spec_versions(self):
        """Instance depends on the API version:

           * 2019-06-01-preview: :class:`TemplateSpecVersionsOperations<azure.mgmt.resource.templatespecs.v2019_06_01_preview.aio.operations.TemplateSpecVersionsOperations>`
           * 2021-03-01-preview: :class:`TemplateSpecVersionsOperations<azure.mgmt.resource.templatespecs.v2021_03_01_preview.aio.operations.TemplateSpecVersionsOperations>`
           * 2021-05-01: :class:`TemplateSpecVersionsOperations<azure.mgmt.resource.templatespecs.v2021_05_01.aio.operations.TemplateSpecVersionsOperations>`
        """
        api_version = self._get_api_version('template_spec_versions')
        if api_version == '2019-06-01-preview':
            from ..v2019_06_01_preview.aio.operations import TemplateSpecVersionsOperations as OperationClass
        elif api_version == '2021-03-01-preview':
            from ..v2021_03_01_preview.aio.operations import TemplateSpecVersionsOperations as OperationClass
        elif api_version == '2021-05-01':
            from ..v2021_05_01.aio.operations import TemplateSpecVersionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'template_spec_versions'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def template_specs(self):
        """Instance depends on the API version:

           * 2019-06-01-preview: :class:`TemplateSpecsOperations<azure.mgmt.resource.templatespecs.v2019_06_01_preview.aio.operations.TemplateSpecsOperations>`
           * 2021-03-01-preview: :class:`TemplateSpecsOperations<azure.mgmt.resource.templatespecs.v2021_03_01_preview.aio.operations.TemplateSpecsOperations>`
           * 2021-05-01: :class:`TemplateSpecsOperations<azure.mgmt.resource.templatespecs.v2021_05_01.aio.operations.TemplateSpecsOperations>`
        """
        api_version = self._get_api_version('template_specs')
        if api_version == '2019-06-01-preview':
            from ..v2019_06_01_preview.aio.operations import TemplateSpecsOperations as OperationClass
        elif api_version == '2021-03-01-preview':
            from ..v2021_03_01_preview.aio.operations import TemplateSpecsOperations as OperationClass
        elif api_version == '2021-05-01':
            from ..v2021_05_01.aio.operations import TemplateSpecsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'template_specs'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
class ContainerServiceClient(MultiApiClientMixin, SDKClient):
    """The Container Service Client.

    :ivar config: Configuration for client.
    :vartype config: ContainerServiceClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Subscription credentials which uniquely identify
     Microsoft Azure subscription. The subscription ID forms part of the URI
     for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A dict using operation group name to API version.
    :type profile: dict[str, str]
    """

    DEFAULT_API_VERSION = '2018-09-01'
    _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                'open_shift_managed_clusters': '2018-09-30-preview',
                'container_services': '2017-07-01',
                'managed_clusters': '2020-01-01',
                'operations': '2018-03-31',
                None: DEFAULT_API_VERSION
            }
        }, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        self.config = ContainerServiceClientConfiguration(
            credentials, subscription_id, base_url)
        super(ContainerServiceClient, self).__init__(credentials,
                                                     self.config,
                                                     api_version=api_version,
                                                     profile=profile)

############ Generated from here ############

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2017-07-01: :mod:`v2017_07_01.models<azure.mgmt.containerservice.v2017_07_01.models>`
           * 2018-03-31: :mod:`v2018_03_31.models<azure.mgmt.containerservice.v2018_03_31.models>`
           * 2018-08-01-preview: :mod:`v2018_08_01_preview.models<azure.mgmt.containerservice.v2018_08_01_preview.models>`
           * 2018-09-30-preview: :mod:`v2018_09_30_preview.models<azure.mgmt.containerservice.v2018_09_30_preview.models>`
           * 2019-02-01: :mod:`v2019_02_01_.models<azure.mgmt.containerservice.v2019_02_01.models>`
           * 2019-04-01: :mod:`v2019_04_01_.models<azure.mgmt.containerservice.v2019_04_01.models>`
           * 2019-08-01: :mod:`v2019_08_01_.models<azure.mgmt.containerservice.v2019_08_01.models>`
           * 2019-10-01: :mod:`v2019_10_01_.models<azure.mgmt.containerservice.v2019_10_01.models>`
           * 2020-01-01: :mod:`v2020_01_01_.models<azure.mgmt.containerservice.v2020_01_01.models>`
           * 2020-02-01: :mod:`v2020_02_01_.models<azure.mgmt.containerservice.v2020_02_01.models>`
           * 2020-03-01: :mod:`v2020_03_01_.models<azure.mgmt.containerservice.v2020_03_01.models>`
           * 2020-04-01: :mod:`v2020_04_01_.models<azure.mgmt.containerservice.v2020_04_01.models>`
           * 2020-06-01: :mod:`v2020_06_01_.models<azure.mgmt.containerservice.v2020_06_01.models>`
           * 2020-11-01: :mod:`v2020_11_01_.models<azure.mgmt.containerservice.v2020_11_01.models>`
           * 2020-12-01: :mod:`v2020_12_01_.models<azure.mgmt.containerservice.v2020_12_01.models>`
           * 2021-02-01: :mod:`v2021_02_01_.models<azure.mgmt.containerservice.v2021_02_01.models>`
           * 2021-03-01: :mod:`v2021_03_01_.models<azure.mgmt.containerservice.v2021_03_01.models>`
           * 2021-05-01: :mod:`v2021_05_01_.models<azure.mgmt.containerservice.v2021_05_01.models>`
        """
        if api_version == '2017-07-01':
            from .v2017_07_01 import models
            return models
        elif api_version == '2018-03-31':
            from .v2018_03_31 import models
            return models
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview import models
            return models
        elif api_version == '2018-09-30-preview':
            from .v2018_09_30_preview import models
            return models
        elif api_version == '2019-02-01':
            from .v2019_02_01 import models
            return models
        elif api_version == '2019-04-01':
            from .v2019_04_01 import models
            return models
        elif api_version == '2019-08-01':
            from .v2019_08_01 import models
            return models
        elif api_version == '2019-10-01':
            from .v2019_10_01 import models
            return models
        elif api_version == '2020-01-01':
            from .v2020_01_01 import models
            return models
        elif api_version == '2020-02-01':
            from .v2020_02_01 import models
            return models
        elif api_version == '2020-03-01':
            from .v2020_03_01 import models
            return models
        elif api_version == '2020-04-01':
            from .v2020_04_01 import models
            return models
        elif api_version == '2020-06-01':
            from .v2020_06_01 import models
            return models
        elif api_version == '2020-09-01':
            from .v2020_09_01 import models
            return models
        elif api_version == '2020-11-01':
            from .v2020_11_01 import models
            return models
        elif api_version == '2020-12-01':
            from .v2020_12_01 import models
            return models
        elif api_version == '2021-02-01':
            from .v2021_02_01 import models
            return models
        elif api_version == '2021-03-01':
            from .v2021_03_01 import models
            return models
        elif api_version == '2021-05-01':
            from .v2021_05_01 import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def maintenance_configurations(self):
        """Instance depends on the API version:

           * 2020-12-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2020_12_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-02-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_02_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-03-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_03_01.operations.MaintenanceConfigurationsOperations>`
           * 2021-05-01: :class:`MaintenanceConfigurationsOperations<azure.mgmt.containerservice.v2021_05_01.operations.MaintenanceConfigurationsOperations>`
        """
        api_version = self._get_api_version('maintenance_configurations')
        if api_version == '2020-12-01':
            from .v2020_12_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import MaintenanceConfigurationsOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import MaintenanceConfigurationsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def agent_pools(self):
        """Instance depends on the API version:

           * 2019-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_02_01.operations.AgentPoolsOperations>`
           * 2019-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations>`
           * 2019-08-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_08_01.operations.AgentPoolsOperations>`
           * 2019-10-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_10_01.operations.AgentPoolsOperations>`
           * 2020-01-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_01_01.operations.AgentPoolsOperations>`
           * 2020-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_02_01.operations.AgentPoolsOperations>`
           * 2020-03-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_03_01.operations.AgentPoolsOperations>`
           * 2020-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_04_01.operations.AgentPoolsOperations>`
           * 2020-06-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_06_01.operations.AgentPoolsOperations>`
           * 2020-09-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_09_01.operations.AgentPoolsOperations>`
           * 2020-11-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_11_01.operations.AgentPoolsOperations>`
           * 2020-12-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2020_12_01.operations.AgentPoolsOperations>`
           * 2021-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_02_01.operations.AgentPoolsOperations>`
           * 2021-03-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_03_01.operations.AgentPoolsOperations>`
           * 2021-05-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2021_05_01.operations.AgentPoolsOperations>`
        """
        api_version = self._get_api_version('agent_pools')
        if api_version == '2019-02-01':
            from .v2019_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import AgentPoolsOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import AgentPoolsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def container_services(self):
        """Instance depends on the API version:

           * 2017-07-01: :class:`ContainerServicesOperations<azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations>`
        """
        api_version = self._get_api_version('container_services')
        if api_version == '2017-07-01':
            from .v2017_07_01.operations import ContainerServicesOperations as OperationClass
        elif api_version == "2019-04-01":
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2019-08-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2019-10-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2019-10-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-01-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-01-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-02-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-02-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-03-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-03-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-04-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-04-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-06-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-06-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-09-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-09-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-11-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-11-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2020-12-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2020-12-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2021-02-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2021-02-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2021-03-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2021-03-01 generated Python SDK contains no list_orchestrator op
        elif api_version == '2021-05-01':
            from .v2019_04_01.operations import ContainerServicesOperations as OperationClass
            api_version = "2019-04-01"  #2021-05-01 generated Python SDK contains no list_orchestrator op
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def managed_clusters(self):
        """Instance depends on the API version:

           * 2018-03-31: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations>`
           * 2018-08-01-preview: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations>`
           * 2019-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations>`
           * 2019-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations>`
           * 2019-08-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations>`
           * 2019-10-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations>`
           * 2020-01-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_01_01.operations.ManagedClustersOperations>`
           * 2020-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_02_01.operations.ManagedClustersOperations>`
           * 2020-03-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_03_01.operations.ManagedClustersOperations>`
           * 2020-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_04_01.operations.ManagedClustersOperations>`
           * 2020-06-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_06_01.operations.ManagedClustersOperations>`
           * 2020-09-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_09_01.operations.ManagedClustersOperations>`
           * 2020-11-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_11_01.operations.ManagedClustersOperations>`
           * 2020-12-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2020_12_01.operations.ManagedClustersOperations>`
           * 2021-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_02_01.operations.ManagedClustersOperations>`
           * 2021-03-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_03_01.operations.ManagedClustersOperations>`
           * 2021-05-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2021_05_01.operations.ManagedClustersOperations>`
        """
        api_version = self._get_api_version('managed_clusters')
        if api_version == '2018-03-31':
            from .v2018_03_31.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import ManagedClustersOperations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import ManagedClustersOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def open_shift_managed_clusters(self):
        """Instance depends on the API version:

           * 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations>`
        """
        api_version = self._get_api_version('open_shift_managed_clusters')
        if api_version == '2018-09-30-preview':
            from .v2018_09_30_preview.operations import OpenShiftManagedClustersOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2018-03-31: :class:`Operations<azure.mgmt.containerservice.v2018_03_31.operations.Operations>`
           * 2018-08-01-preview: :class:`Operations<azure.mgmt.containerservice.v2018_08_01_preview.operations.Operations>`
           * 2019-02-01: :class:`Operations<azure.mgmt.containerservice.v2019_02_01.operations.Operations>`
           * 2019-04-01: :class:`Operations<azure.mgmt.containerservice.v2019_04_01.operations.Operations>`
           * 2019-08-01: :class:`Operations<azure.mgmt.containerservice.v2019_08_01.operations.Operations>`
           * 2019-10-01: :class:`Operations<azure.mgmt.containerservice.v2019_10_01.operations.Operations>`
           * 2020-01-01: :class:`Operations<azure.mgmt.containerservice.v2020_01_01.operations.Operations>`
           * 2020-02-01: :class:`Operations<azure.mgmt.containerservice.v2020_02_01.operations.Operations>`
           * 2020-03-01: :class:`Operations<azure.mgmt.containerservice.v2020_03_01.operations.Operations>`
           * 2020-04-01: :class:`Operations<azure.mgmt.containerservice.v2020_04_01.operations.Operations>`
           * 2020-06-01: :class:`Operations<azure.mgmt.containerservice.v2020_06_01.operations.Operations>`
           * 2020-09-01: :class:`Operations<azure.mgmt.containerservice.v2020_09_01.operations.Operations>`
           * 2020-11-01: :class:`Operations<azure.mgmt.containerservice.v2020_11_01.operations.Operations>`
           * 2020-12-01: :class:`Operations<azure.mgmt.containerservice.v2020_12_01.operations.Operations>`
           * 2021-02-01: :class:`Operations<azure.mgmt.containerservice.v2021_02_01.operations.Operations>`
           * 2021-03-01: :class:`Operations<azure.mgmt.containerservice.v2021_03_01.operations.Operations>`
           * 2021-05-01: :class:`Operations<azure.mgmt.containerservice.v2021_05_01.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2018-03-31':
            from .v2018_03_31.operations import Operations as OperationClass
        elif api_version == '2018-08-01-preview':
            from .v2018_08_01_preview.operations import Operations as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import Operations as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import Operations as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import Operations as OperationClass
        elif api_version == '2019-10-01':
            from .v2019_10_01.operations import Operations as OperationClass
        elif api_version == '2020-01-01':
            from .v2020_01_01.operations import Operations as OperationClass
        elif api_version == '2020-02-01':
            from .v2020_02_01.operations import Operations as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import Operations as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import Operations as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import Operations as OperationClass
        elif api_version == '2020-09-01':
            from .v2020_09_01.operations import Operations as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import Operations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import Operations as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import Operations as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import Operations as OperationClass
        elif api_version == '2021-05-01':
            from .v2021_05_01.operations import Operations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
class AzureDigitalTwinsManagementClient(MultiApiClientMixin, _SDKClient):
    """Azure Digital Twins Client for managing DigitalTwinsInstance.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: The subscription identifier.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2020-12-01'
    _PROFILE_TAG = "azure.mgmt.digitaltwins.AzureDigitalTwinsManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_id,  # type: str
            api_version=None,  # type: Optional[str]
            base_url="https://management.azure.com",  # type: str
            profile=KnownProfiles.default,  # type: KnownProfiles
            **kwargs  # type: Any
    ):
        self._config = AzureDigitalTwinsManagementClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = ARMPipelineClient(base_url=base_url,
                                         config=self._config,
                                         **kwargs)
        super(AzureDigitalTwinsManagementClient,
              self).__init__(api_version=api_version, profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.digitaltwins.v2020_03_01_preview.models>`
           * 2020-10-31: :mod:`v2020_10_31.models<azure.mgmt.digitaltwins.v2020_10_31.models>`
           * 2020-12-01: :mod:`v2020_12_01.models<azure.mgmt.digitaltwins.v2020_12_01.models>`
           * 2021-06-30-preview: :mod:`v2021_06_30_preview.models<azure.mgmt.digitaltwins.v2021_06_30_preview.models>`
        """
        if api_version == '2020-03-01-preview':
            from .v2020_03_01_preview import models
            return models
        elif api_version == '2020-10-31':
            from .v2020_10_31 import models
            return models
        elif api_version == '2020-12-01':
            from .v2020_12_01 import models
            return models
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def digital_twins(self):
        """Instance depends on the API version:

           * 2020-03-01-preview: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.DigitalTwinsOperations>`
           * 2020-10-31: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_10_31.operations.DigitalTwinsOperations>`
           * 2020-12-01: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.DigitalTwinsOperations>`
           * 2021-06-30-preview: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.DigitalTwinsOperations>`
        """
        api_version = self._get_api_version('digital_twins')
        if api_version == '2020-03-01-preview':
            from .v2020_03_01_preview.operations import DigitalTwinsOperations as OperationClass
        elif api_version == '2020-10-31':
            from .v2020_10_31.operations import DigitalTwinsOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import DigitalTwinsOperations as OperationClass
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import DigitalTwinsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'digital_twins'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def digital_twins_endpoint(self):
        """Instance depends on the API version:

           * 2020-03-01-preview: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.DigitalTwinsEndpointOperations>`
           * 2020-10-31: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_10_31.operations.DigitalTwinsEndpointOperations>`
           * 2020-12-01: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.DigitalTwinsEndpointOperations>`
           * 2021-06-30-preview: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.DigitalTwinsEndpointOperations>`
        """
        api_version = self._get_api_version('digital_twins_endpoint')
        if api_version == '2020-03-01-preview':
            from .v2020_03_01_preview.operations import DigitalTwinsEndpointOperations as OperationClass
        elif api_version == '2020-10-31':
            from .v2020_10_31.operations import DigitalTwinsEndpointOperations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import DigitalTwinsEndpointOperations as OperationClass
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import DigitalTwinsEndpointOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'digital_twins_endpoint'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2020-03-01-preview: :class:`Operations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.Operations>`
           * 2020-10-31: :class:`Operations<azure.mgmt.digitaltwins.v2020_10_31.operations.Operations>`
           * 2020-12-01: :class:`Operations<azure.mgmt.digitaltwins.v2020_12_01.operations.Operations>`
           * 2021-06-30-preview: :class:`Operations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2020-03-01-preview':
            from .v2020_03_01_preview.operations import Operations as OperationClass
        elif api_version == '2020-10-31':
            from .v2020_10_31.operations import Operations as OperationClass
        elif api_version == '2020-12-01':
            from .v2020_12_01.operations import Operations as OperationClass
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import Operations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'operations'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2020-12-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.PrivateEndpointConnectionsOperations>`
           * 2021-06-30-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2020-12-01':
            from .v2020_12_01.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_endpoint_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2020-12-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.PrivateLinkResourcesOperations>`
           * 2021-06-30-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2020-12-01':
            from .v2020_12_01.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'private_link_resources'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def time_series_database_connections(self):
        """Instance depends on the API version:

           * 2021-06-30-preview: :class:`TimeSeriesDatabaseConnectionsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.TimeSeriesDatabaseConnectionsOperations>`
        """
        api_version = self._get_api_version('time_series_database_connections')
        if api_version == '2021-06-30-preview':
            from .v2021_06_30_preview.operations import TimeSeriesDatabaseConnectionsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'time_series_database_connections'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #26
0
class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin,
                     _SDKClient):
    """The key vault client performs cryptographic key operations and vault operations against the Key Vault service.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2016-10-01'
    _PROFILE_TAG = "azure.keyvault.KeyVaultClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            api_version=None,  # type: Optional[str]
            profile=KnownProfiles.default,  # type: KnownProfiles
            **kwargs  # type: Any
    ):
        if api_version == '2016-10-01' or api_version == '7.0' or api_version == '7.1' or api_version == '7.2' or api_version == '7.3':
            base_url = '{vaultBaseUrl}'
        else:
            raise ValueError(
                "API version {} is not available".format(api_version))
        self._config = KeyVaultClientConfiguration(**kwargs)
        self._client = PipelineClient(base_url=base_url,
                                      config=self._config,
                                      **kwargs)
        super(KeyVaultClient, self).__init__(api_version=api_version,
                                             profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2016-10-01: :mod:`v2016_10_01.models<azure.keyvault.v2016_10_01.models>`
           * 7.0: :mod:`v7_0.models<azure.keyvault.v7_0.models>`
           * 7.1: :mod:`v7_1.models<azure.keyvault.v7_1.models>`
           * 7.2: :mod:`v7_2.models<azure.keyvault.v7_2.models>`
           * 7.3: :mod:`v7_3.models<azure.keyvault.v7_3.models>`
        """
        if api_version == '2016-10-01':
            from .v2016_10_01 import models
            return models
        elif api_version == '7.0':
            from .v7_0 import models
            return models
        elif api_version == '7.1':
            from .v7_1 import models
            return models
        elif api_version == '7.2':
            from .v7_2 import models
            return models
        elif api_version == '7.3':
            from .v7_3 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
Exemple #27
0
class SearchClient(SearchClientOperationsMixin, MultiApiClientMixin,
                   _SDKClient):
    """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param endpoint: The endpoint URL of the search service.
    :type endpoint: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2020-06-30-Preview'
    _PROFILE_TAG = "azure.search.documents.SearchClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            endpoint,  # type: str
            api_version=None,  # type: Optional[str]
            profile=KnownProfiles.default,  # type: KnownProfiles
            **kwargs  # type: Any
    ):
        if api_version == '2020-06-30' or api_version == '2020-06-30-Preview':
            base_url = '{endpoint}'
        else:
            raise ValueError(
                "API version {} is not available".format(api_version))
        self._config = SearchClientConfiguration(endpoint, **kwargs)
        self._client = PipelineClient(base_url=base_url,
                                      config=self._config,
                                      **kwargs)
        super(SearchClient, self).__init__(api_version=api_version,
                                           profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2020-06-30: :mod:`v2020_06.models<azure.search.documents.v2020_06.models>`
           * 2020-06-30-Preview: :mod:`v2020_06_preview.models<azure.search.documents.v2020_06_preview.models>`
        """
        if api_version == '2020-06-30':
            from .v2020_06 import models
            return models
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def data_sources(self):
        """Instance depends on the API version:

           * 2020-06-30: :class:`DataSourcesOperations<azure.search.documents.v2020_06.operations.DataSourcesOperations>`
           * 2020-06-30-Preview: :class:`DataSourcesOperations<azure.search.documents.v2020_06_preview.operations.DataSourcesOperations>`
        """
        api_version = self._get_api_version('data_sources')
        if api_version == '2020-06-30':
            from .v2020_06.operations import DataSourcesOperations as OperationClass
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview.operations import DataSourcesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'data_sources'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def indexers(self):
        """Instance depends on the API version:

           * 2020-06-30: :class:`IndexersOperations<azure.search.documents.v2020_06.operations.IndexersOperations>`
           * 2020-06-30-Preview: :class:`IndexersOperations<azure.search.documents.v2020_06_preview.operations.IndexersOperations>`
        """
        api_version = self._get_api_version('indexers')
        if api_version == '2020-06-30':
            from .v2020_06.operations import IndexersOperations as OperationClass
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview.operations import IndexersOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'indexers'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def indexes(self):
        """Instance depends on the API version:

           * 2020-06-30: :class:`IndexesOperations<azure.search.documents.v2020_06.operations.IndexesOperations>`
           * 2020-06-30-Preview: :class:`IndexesOperations<azure.search.documents.v2020_06_preview.operations.IndexesOperations>`
        """
        api_version = self._get_api_version('indexes')
        if api_version == '2020-06-30':
            from .v2020_06.operations import IndexesOperations as OperationClass
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview.operations import IndexesOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'indexes'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def skillsets(self):
        """Instance depends on the API version:

           * 2020-06-30: :class:`SkillsetsOperations<azure.search.documents.v2020_06.operations.SkillsetsOperations>`
           * 2020-06-30-Preview: :class:`SkillsetsOperations<azure.search.documents.v2020_06_preview.operations.SkillsetsOperations>`
        """
        api_version = self._get_api_version('skillsets')
        if api_version == '2020-06-30':
            from .v2020_06.operations import SkillsetsOperations as OperationClass
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview.operations import SkillsetsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'skillsets'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def synonym_maps(self):
        """Instance depends on the API version:

           * 2020-06-30: :class:`SynonymMapsOperations<azure.search.documents.v2020_06.operations.SynonymMapsOperations>`
           * 2020-06-30-Preview: :class:`SynonymMapsOperations<azure.search.documents.v2020_06_preview.operations.SynonymMapsOperations>`
        """
        api_version = self._get_api_version('synonym_maps')
        if api_version == '2020-06-30':
            from .v2020_06.operations import SynonymMapsOperations as OperationClass
        elif api_version == '2020-06-30-Preview':
            from .v2020_06_preview.operations import SynonymMapsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'synonym_maps'".
                format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    def close(self):
        self._client.close()

    def __enter__(self):
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        self._client.__exit__(*exc_details)
class ManagementLockClient(MultiApiClientMixin, _SDKClient):
    """Azure resources can be locked to prevent other users in your organization from deleting or modifying resources.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2016-09-01'
    _PROFILE_TAG = "azure.mgmt.resource.locks.ManagementLockClient"
    LATEST_PROFILE = ProfileDefinition(
        {_PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
        }}, _PROFILE_TAG + " latest")

    def __init__(
            self,
            credential: "AsyncTokenCredential",
            subscription_id: str,
            api_version: Optional[str] = None,
            base_url: str = "https://management.azure.com",
            profile: KnownProfiles = KnownProfiles.default,
            **kwargs  # type: Any
    ) -> None:
        self._config = ManagementLockClientConfiguration(
            credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url,
                                              config=self._config,
                                              **kwargs)
        super(ManagementLockClient, self).__init__(api_version=api_version,
                                                   profile=profile)

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-01-01: :mod:`v2015_01_01.models<azure.mgmt.resource.locks.v2015_01_01.models>`
           * 2016-09-01: :mod:`v2016_09_01.models<azure.mgmt.resource.locks.v2016_09_01.models>`
        """
        if api_version == '2015-01-01':
            from ..v2015_01_01 import models
            return models
        elif api_version == '2016-09-01':
            from ..v2016_09_01 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def authorization_operations(self):
        """Instance depends on the API version:

           * 2016-09-01: :class:`AuthorizationOperationsOperations<azure.mgmt.resource.locks.v2016_09_01.aio.operations.AuthorizationOperationsOperations>`
        """
        api_version = self._get_api_version('authorization_operations')
        if api_version == '2016-09-01':
            from ..v2016_09_01.aio.operations import AuthorizationOperationsOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'authorization_operations'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def management_locks(self):
        """Instance depends on the API version:

           * 2015-01-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2015_01_01.aio.operations.ManagementLocksOperations>`
           * 2016-09-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2016_09_01.aio.operations.ManagementLocksOperations>`
        """
        api_version = self._get_api_version('management_locks')
        if api_version == '2015-01-01':
            from ..v2015_01_01.aio.operations import ManagementLocksOperations as OperationClass
        elif api_version == '2016-09-01':
            from ..v2016_09_01.aio.operations import ManagementLocksOperations as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation group 'management_locks'"
                .format(api_version))
        return OperationClass(self._client, self._config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()

    async def __aenter__(self):
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)
Exemple #29
0
class AuthorizationManagementClient(MultiApiClientMixin, SDKClient):
    """Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role definitions and role assignments. A role definition describes the set of actions that can be performed on resources. A role assignment grants access to Azure Active Directory users.

    This ready contains multiple API versions, to help you deal with all Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, uses latest API version available on public Azure.
    For production, you should stick a particular api-version and/or profile.
    The profile sets a mapping between the operation group and an API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :ivar config: Configuration for client.
    :vartype config: AuthorizationManagementClientConfiguration

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Subscription credentials which uniquely identify
     Microsoft Azure subscription. The subscription ID forms part of the URI
     for every service call.
    :type subscription_id: str
    :param str api_version: API version to use if no profile is provided, or if
     missing in profile.
    :param str base_url: Service URL
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    """

    DEFAULT_API_VERSION = '2018-01-01-preview'
    _PROFILE_TAG = "azure.mgmt.authorization.AuthorizationManagementClient"
    LATEST_PROFILE = ProfileDefinition(
        {
            _PROFILE_TAG: {
                'classic_administrators': '2015-06-01',
                'elevate_access': '2015-07-01',
                'deny_assignments': '2018-07-01-preview',
                'role_assignments': '2018-09-01-preview',
                None: DEFAULT_API_VERSION
            }
        }, _PROFILE_TAG + " latest")

    def __init__(self,
                 credentials,
                 subscription_id,
                 api_version=None,
                 base_url=None,
                 profile=KnownProfiles.default):
        self.config = AuthorizationManagementClientConfiguration(
            credentials, subscription_id, base_url)
        super(AuthorizationManagementClient,
              self).__init__(credentials,
                             self.config,
                             api_version=api_version,
                             profile=profile)

############ Generated from here ############

    @classmethod
    def _models_dict(cls, api_version):
        return {
            k: v
            for k, v in cls.models(api_version).__dict__.items()
            if isinstance(v, type)
        }

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-06-01: :mod:`v2015_06_01.models<azure.mgmt.authorization.v2015_06_01.models>`
           * 2015-07-01: :mod:`v2015_07_01.models<azure.mgmt.authorization.v2015_07_01.models>`
           * 2018-01-01-preview: :mod:`v2018_01_01_preview.models<azure.mgmt.authorization.v2018_01_01_preview.models>`
           * 2018-07-01-preview: :mod:`v2018_07_01_preview.models<azure.mgmt.authorization.v2018_07_01_preview.models>`
           * 2018-09-01-preview: :mod:`v2018_09_01_preview.models<azure.mgmt.authorization.v2018_09_01_preview.models>`
        """
        if api_version == '2015-06-01':
            from .v2015_06_01 import models
            return models
        elif api_version == '2015-07-01':
            from .v2015_07_01 import models
            return models
        elif api_version == '2018-01-01-preview':
            from .v2018_01_01_preview import models
            return models
        elif api_version == '2018-07-01-preview':
            from .v2018_07_01_preview import models
            return models
        elif api_version == '2018-09-01-preview':
            from .v2018_09_01_preview import models
            return models
        raise NotImplementedError(
            "APIVersion {} is not available".format(api_version))

    @property
    def classic_administrators(self):
        """Instance depends on the API version:

           * 2015-06-01: :class:`ClassicAdministratorsOperations<azure.mgmt.authorization.v2015_06_01.operations.ClassicAdministratorsOperations>`
        """
        api_version = self._get_api_version('classic_administrators')
        if api_version == '2015-06-01':
            from .v2015_06_01.operations import ClassicAdministratorsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def deny_assignments(self):
        """Instance depends on the API version:

           * 2018-07-01-preview: :class:`DenyAssignmentsOperations<azure.mgmt.authorization.v2018_07_01_preview.operations.DenyAssignmentsOperations>`
        """
        api_version = self._get_api_version('deny_assignments')
        if api_version == '2018-07-01-preview':
            from .v2018_07_01_preview.operations import DenyAssignmentsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def elevate_access(self):
        """Instance depends on the API version:

           * 2015-07-01: :class:`ElevateAccessOperations<azure.mgmt.authorization.v2015_07_01.operations.ElevateAccessOperations>`
        """
        api_version = self._get_api_version('elevate_access')
        if api_version == '2015-07-01':
            from .v2015_07_01.operations import ElevateAccessOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def permissions(self):
        """Instance depends on the API version:

           * 2015-07-01: :class:`PermissionsOperations<azure.mgmt.authorization.v2015_07_01.operations.PermissionsOperations>`
           * 2018-01-01-preview: :class:`PermissionsOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.PermissionsOperations>`
        """
        api_version = self._get_api_version('permissions')
        if api_version == '2015-07-01':
            from .v2015_07_01.operations import PermissionsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from .v2018_01_01_preview.operations import PermissionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def provider_operations_metadata(self):
        """Instance depends on the API version:

           * 2015-07-01: :class:`ProviderOperationsMetadataOperations<azure.mgmt.authorization.v2015_07_01.operations.ProviderOperationsMetadataOperations>`
           * 2018-01-01-preview: :class:`ProviderOperationsMetadataOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.ProviderOperationsMetadataOperations>`
        """
        api_version = self._get_api_version('provider_operations_metadata')
        if api_version == '2015-07-01':
            from .v2015_07_01.operations import ProviderOperationsMetadataOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from .v2018_01_01_preview.operations import ProviderOperationsMetadataOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def role_assignments(self):
        """Instance depends on the API version:

           * 2015-07-01: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2015_07_01.operations.RoleAssignmentsOperations>`
           * 2018-01-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.RoleAssignmentsOperations>`
           * 2018-09-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2018_09_01_preview.operations.RoleAssignmentsOperations>`
        """
        api_version = self._get_api_version('role_assignments')
        if api_version == '2015-07-01':
            from .v2015_07_01.operations import RoleAssignmentsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from .v2018_01_01_preview.operations import RoleAssignmentsOperations as OperationClass
        elif api_version == '2018-09-01-preview':
            from .v2018_09_01_preview.operations import RoleAssignmentsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))

    @property
    def role_definitions(self):
        """Instance depends on the API version:

           * 2015-07-01: :class:`RoleDefinitionsOperations<azure.mgmt.authorization.v2015_07_01.operations.RoleDefinitionsOperations>`
           * 2018-01-01-preview: :class:`RoleDefinitionsOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.RoleDefinitionsOperations>`
        """
        api_version = self._get_api_version('role_definitions')
        if api_version == '2015-07-01':
            from .v2015_07_01.operations import RoleDefinitionsOperations as OperationClass
        elif api_version == '2018-01-01-preview':
            from .v2018_01_01_preview.operations import RoleDefinitionsOperations as OperationClass
        else:
            raise NotImplementedError(
                "APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config,
                              Serializer(self._models_dict(api_version)),
                              Deserializer(self._models_dict(api_version)))
Exemple #30
0
class StorageManagementClient(MultiApiClientMixin, _SDKClient):
    """The Azure Storage Management API.

    This ready contains multiple API versions, to help you deal with all of the Azure clouds
    (Azure Stack, Azure Government, Azure China, etc.).
    By default, it uses the latest API version available on public Azure.
    For production, you should stick to a particular api-version and/or profile.
    The profile sets a mapping between an operation group and its API version.
    The api-version parameter sets the default API version if the operation
    group is not described in the profile.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_id: str
    :param api_version: API version to use if no profile is provided, or if missing in profile.
    :type api_version: str
    :param base_url: Service URL
    :type base_url: str
    :param profile: A profile definition, from KnownProfiles to dict.
    :type profile: azure.profiles.KnownProfiles
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """

    DEFAULT_API_VERSION = '2021-02-01'
    _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient"
    LATEST_PROFILE = ProfileDefinition({
        _PROFILE_TAG: {
            None: DEFAULT_API_VERSION,
            'usage': '2018-02-01',
        }},
        _PROFILE_TAG + " latest"
    )

    def __init__(
        self,
        credential: "AsyncTokenCredential",
        subscription_id: str,
        api_version: Optional[str] = None,
        base_url: Optional[str] = None,
        profile: KnownProfiles = KnownProfiles.default,
        **kwargs  # type: Any
    ) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = StorageManagementClientConfiguration(credential, subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
        super(StorageManagementClient, self).__init__(
            api_version=api_version,
            profile=profile
        )

    @classmethod
    def _models_dict(cls, api_version):
        return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

    @classmethod
    def models(cls, api_version=DEFAULT_API_VERSION):
        """Module depends on the API version:

           * 2015-06-15: :mod:`v2015_06_15.models<azure.mgmt.storage.v2015_06_15.models>`
           * 2016-01-01: :mod:`v2016_01_01.models<azure.mgmt.storage.v2016_01_01.models>`
           * 2016-12-01: :mod:`v2016_12_01.models<azure.mgmt.storage.v2016_12_01.models>`
           * 2017-06-01: :mod:`v2017_06_01.models<azure.mgmt.storage.v2017_06_01.models>`
           * 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.storage.v2017_10_01.models>`
           * 2018-02-01: :mod:`v2018_02_01.models<azure.mgmt.storage.v2018_02_01.models>`
           * 2018-03-01-preview: :mod:`v2018_03_01_preview.models<azure.mgmt.storage.v2018_03_01_preview.models>`
           * 2018-07-01: :mod:`v2018_07_01.models<azure.mgmt.storage.v2018_07_01.models>`
           * 2018-11-01: :mod:`v2018_11_01.models<azure.mgmt.storage.v2018_11_01.models>`
           * 2019-04-01: :mod:`v2019_04_01.models<azure.mgmt.storage.v2019_04_01.models>`
           * 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.storage.v2019_06_01.models>`
           * 2020-08-01-preview: :mod:`v2020_08_01_preview.models<azure.mgmt.storage.v2020_08_01_preview.models>`
           * 2021-01-01: :mod:`v2021_01_01.models<azure.mgmt.storage.v2021_01_01.models>`
           * 2021-02-01: :mod:`v2021_02_01.models<azure.mgmt.storage.v2021_02_01.models>`
        """
        if api_version == '2015-06-15':
            from ..v2015_06_15 import models
            return models
        elif api_version == '2016-01-01':
            from ..v2016_01_01 import models
            return models
        elif api_version == '2016-12-01':
            from ..v2016_12_01 import models
            return models
        elif api_version == '2017-06-01':
            from ..v2017_06_01 import models
            return models
        elif api_version == '2017-10-01':
            from ..v2017_10_01 import models
            return models
        elif api_version == '2018-02-01':
            from ..v2018_02_01 import models
            return models
        elif api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview import models
            return models
        elif api_version == '2018-07-01':
            from ..v2018_07_01 import models
            return models
        elif api_version == '2018-11-01':
            from ..v2018_11_01 import models
            return models
        elif api_version == '2019-04-01':
            from ..v2019_04_01 import models
            return models
        elif api_version == '2019-06-01':
            from ..v2019_06_01 import models
            return models
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview import models
            return models
        elif api_version == '2021-01-01':
            from ..v2021_01_01 import models
            return models
        elif api_version == '2021-02-01':
            from ..v2021_02_01 import models
            return models
        raise ValueError("API version {} is not available".format(api_version))

    @property
    def blob_containers(self):
        """Instance depends on the API version:

           * 2018-02-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_02_01.aio.operations.BlobContainersOperations>`
           * 2018-03-01-preview: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_03_01_preview.aio.operations.BlobContainersOperations>`
           * 2018-07-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_07_01.aio.operations.BlobContainersOperations>`
           * 2018-11-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2018_11_01.aio.operations.BlobContainersOperations>`
           * 2019-04-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2019_04_01.aio.operations.BlobContainersOperations>`
           * 2019-06-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2019_06_01.aio.operations.BlobContainersOperations>`
           * 2020-08-01-preview: :class:`BlobContainersOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobContainersOperations>`
           * 2021-01-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_01_01.aio.operations.BlobContainersOperations>`
           * 2021-02-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_02_01.aio.operations.BlobContainersOperations>`
        """
        api_version = self._get_api_version('blob_containers')
        if api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import BlobContainersOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import BlobContainersOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def blob_inventory_policies(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.BlobInventoryPoliciesOperations>`
           * 2020-08-01-preview: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobInventoryPoliciesOperations>`
           * 2021-01-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.BlobInventoryPoliciesOperations>`
           * 2021-02-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.BlobInventoryPoliciesOperations>`
        """
        api_version = self._get_api_version('blob_inventory_policies')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import BlobInventoryPoliciesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def blob_services(self):
        """Instance depends on the API version:

           * 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.aio.operations.BlobServicesOperations>`
           * 2018-11-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_11_01.aio.operations.BlobServicesOperations>`
           * 2019-04-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2019_04_01.aio.operations.BlobServicesOperations>`
           * 2019-06-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.BlobServicesOperations>`
           * 2020-08-01-preview: :class:`BlobServicesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobServicesOperations>`
           * 2021-01-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.BlobServicesOperations>`
           * 2021-02-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.BlobServicesOperations>`
        """
        api_version = self._get_api_version('blob_services')
        if api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import BlobServicesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import BlobServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def deleted_accounts(self):
        """Instance depends on the API version:

           * 2020-08-01-preview: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.DeletedAccountsOperations>`
           * 2021-01-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_01_01.aio.operations.DeletedAccountsOperations>`
           * 2021-02-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_02_01.aio.operations.DeletedAccountsOperations>`
        """
        api_version = self._get_api_version('deleted_accounts')
        if api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import DeletedAccountsOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import DeletedAccountsOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import DeletedAccountsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def encryption_scopes(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.EncryptionScopesOperations>`
           * 2020-08-01-preview: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.EncryptionScopesOperations>`
           * 2021-01-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.EncryptionScopesOperations>`
           * 2021-02-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.EncryptionScopesOperations>`
        """
        api_version = self._get_api_version('encryption_scopes')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import EncryptionScopesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import EncryptionScopesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import EncryptionScopesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import EncryptionScopesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def file_services(self):
        """Instance depends on the API version:

           * 2019-04-01: :class:`FileServicesOperations<azure.mgmt.storage.v2019_04_01.aio.operations.FileServicesOperations>`
           * 2019-06-01: :class:`FileServicesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.FileServicesOperations>`
           * 2020-08-01-preview: :class:`FileServicesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.FileServicesOperations>`
           * 2021-01-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.FileServicesOperations>`
           * 2021-02-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.FileServicesOperations>`
        """
        api_version = self._get_api_version('file_services')
        if api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import FileServicesOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import FileServicesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import FileServicesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import FileServicesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import FileServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'file_services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def file_shares(self):
        """Instance depends on the API version:

           * 2019-04-01: :class:`FileSharesOperations<azure.mgmt.storage.v2019_04_01.aio.operations.FileSharesOperations>`
           * 2019-06-01: :class:`FileSharesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.FileSharesOperations>`
           * 2020-08-01-preview: :class:`FileSharesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.FileSharesOperations>`
           * 2021-01-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.FileSharesOperations>`
           * 2021-02-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.FileSharesOperations>`
        """
        api_version = self._get_api_version('file_shares')
        if api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import FileSharesOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import FileSharesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import FileSharesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import FileSharesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import FileSharesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def management_policies(self):
        """Instance depends on the API version:

           * 2018-07-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2018_07_01.aio.operations.ManagementPoliciesOperations>`
           * 2018-11-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2018_11_01.aio.operations.ManagementPoliciesOperations>`
           * 2019-04-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2019_04_01.aio.operations.ManagementPoliciesOperations>`
           * 2019-06-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.ManagementPoliciesOperations>`
           * 2020-08-01-preview: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.ManagementPoliciesOperations>`
           * 2021-01-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.ManagementPoliciesOperations>`
           * 2021-02-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.ManagementPoliciesOperations>`
        """
        api_version = self._get_api_version('management_policies')
        if api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import ManagementPoliciesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import ManagementPoliciesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def object_replication_policies(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.ObjectReplicationPoliciesOperations>`
           * 2020-08-01-preview: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.ObjectReplicationPoliciesOperations>`
           * 2021-01-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.ObjectReplicationPoliciesOperations>`
           * 2021-02-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.ObjectReplicationPoliciesOperations>`
        """
        api_version = self._get_api_version('object_replication_policies')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def operations(self):
        """Instance depends on the API version:

           * 2017-06-01: :class:`Operations<azure.mgmt.storage.v2017_06_01.aio.operations.Operations>`
           * 2017-10-01: :class:`Operations<azure.mgmt.storage.v2017_10_01.aio.operations.Operations>`
           * 2018-02-01: :class:`Operations<azure.mgmt.storage.v2018_02_01.aio.operations.Operations>`
           * 2018-03-01-preview: :class:`Operations<azure.mgmt.storage.v2018_03_01_preview.aio.operations.Operations>`
           * 2018-07-01: :class:`Operations<azure.mgmt.storage.v2018_07_01.aio.operations.Operations>`
           * 2018-11-01: :class:`Operations<azure.mgmt.storage.v2018_11_01.aio.operations.Operations>`
           * 2019-04-01: :class:`Operations<azure.mgmt.storage.v2019_04_01.aio.operations.Operations>`
           * 2019-06-01: :class:`Operations<azure.mgmt.storage.v2019_06_01.aio.operations.Operations>`
           * 2020-08-01-preview: :class:`Operations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.Operations>`
           * 2021-01-01: :class:`Operations<azure.mgmt.storage.v2021_01_01.aio.operations.Operations>`
           * 2021-02-01: :class:`Operations<azure.mgmt.storage.v2021_02_01.aio.operations.Operations>`
        """
        api_version = self._get_api_version('operations')
        if api_version == '2017-06-01':
            from ..v2017_06_01.aio.operations import Operations as OperationClass
        elif api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import Operations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import Operations as OperationClass
        elif api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview.aio.operations import Operations as OperationClass
        elif api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import Operations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import Operations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import Operations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import Operations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import Operations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import Operations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import Operations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def private_endpoint_connections(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2019_06_01.aio.operations.PrivateEndpointConnectionsOperations>`
           * 2020-08-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.PrivateEndpointConnectionsOperations>`
           * 2021-01-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_01_01.aio.operations.PrivateEndpointConnectionsOperations>`
           * 2021-02-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_02_01.aio.operations.PrivateEndpointConnectionsOperations>`
        """
        api_version = self._get_api_version('private_endpoint_connections')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def private_link_resources(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.PrivateLinkResourcesOperations>`
           * 2020-08-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.PrivateLinkResourcesOperations>`
           * 2021-01-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.PrivateLinkResourcesOperations>`
           * 2021-02-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.PrivateLinkResourcesOperations>`
        """
        api_version = self._get_api_version('private_link_resources')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def queue(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`QueueOperations<azure.mgmt.storage.v2019_06_01.aio.operations.QueueOperations>`
           * 2020-08-01-preview: :class:`QueueOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.QueueOperations>`
           * 2021-01-01: :class:`QueueOperations<azure.mgmt.storage.v2021_01_01.aio.operations.QueueOperations>`
           * 2021-02-01: :class:`QueueOperations<azure.mgmt.storage.v2021_02_01.aio.operations.QueueOperations>`
        """
        api_version = self._get_api_version('queue')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import QueueOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import QueueOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import QueueOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import QueueOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'queue'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def queue_services(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.QueueServicesOperations>`
           * 2020-08-01-preview: :class:`QueueServicesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.QueueServicesOperations>`
           * 2021-01-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.QueueServicesOperations>`
           * 2021-02-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.QueueServicesOperations>`
        """
        api_version = self._get_api_version('queue_services')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import QueueServicesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import QueueServicesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import QueueServicesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import QueueServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def skus(self):
        """Instance depends on the API version:

           * 2017-06-01: :class:`SkusOperations<azure.mgmt.storage.v2017_06_01.aio.operations.SkusOperations>`
           * 2017-10-01: :class:`SkusOperations<azure.mgmt.storage.v2017_10_01.aio.operations.SkusOperations>`
           * 2018-02-01: :class:`SkusOperations<azure.mgmt.storage.v2018_02_01.aio.operations.SkusOperations>`
           * 2018-03-01-preview: :class:`SkusOperations<azure.mgmt.storage.v2018_03_01_preview.aio.operations.SkusOperations>`
           * 2018-07-01: :class:`SkusOperations<azure.mgmt.storage.v2018_07_01.aio.operations.SkusOperations>`
           * 2018-11-01: :class:`SkusOperations<azure.mgmt.storage.v2018_11_01.aio.operations.SkusOperations>`
           * 2019-04-01: :class:`SkusOperations<azure.mgmt.storage.v2019_04_01.aio.operations.SkusOperations>`
           * 2019-06-01: :class:`SkusOperations<azure.mgmt.storage.v2019_06_01.aio.operations.SkusOperations>`
           * 2020-08-01-preview: :class:`SkusOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.SkusOperations>`
           * 2021-01-01: :class:`SkusOperations<azure.mgmt.storage.v2021_01_01.aio.operations.SkusOperations>`
           * 2021-02-01: :class:`SkusOperations<azure.mgmt.storage.v2021_02_01.aio.operations.SkusOperations>`
        """
        api_version = self._get_api_version('skus')
        if api_version == '2017-06-01':
            from ..v2017_06_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview.aio.operations import SkusOperations as OperationClass
        elif api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import SkusOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import SkusOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import SkusOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'skus'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def storage_accounts(self):
        """Instance depends on the API version:

           * 2015-06-15: :class:`StorageAccountsOperations<azure.mgmt.storage.v2015_06_15.aio.operations.StorageAccountsOperations>`
           * 2016-01-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2016_01_01.aio.operations.StorageAccountsOperations>`
           * 2016-12-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2016_12_01.aio.operations.StorageAccountsOperations>`
           * 2017-06-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2017_06_01.aio.operations.StorageAccountsOperations>`
           * 2017-10-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2017_10_01.aio.operations.StorageAccountsOperations>`
           * 2018-02-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_02_01.aio.operations.StorageAccountsOperations>`
           * 2018-03-01-preview: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_03_01_preview.aio.operations.StorageAccountsOperations>`
           * 2018-07-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_07_01.aio.operations.StorageAccountsOperations>`
           * 2018-11-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2018_11_01.aio.operations.StorageAccountsOperations>`
           * 2019-04-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2019_04_01.aio.operations.StorageAccountsOperations>`
           * 2019-06-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2019_06_01.aio.operations.StorageAccountsOperations>`
           * 2020-08-01-preview: :class:`StorageAccountsOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.StorageAccountsOperations>`
           * 2021-01-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_01_01.aio.operations.StorageAccountsOperations>`
           * 2021-02-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_02_01.aio.operations.StorageAccountsOperations>`
        """
        api_version = self._get_api_version('storage_accounts')
        if api_version == '2015-06-15':
            from ..v2015_06_15.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2016-01-01':
            from ..v2016_01_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2016-12-01':
            from ..v2016_12_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2017-06-01':
            from ..v2017_06_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import StorageAccountsOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import StorageAccountsOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def table(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`TableOperations<azure.mgmt.storage.v2019_06_01.aio.operations.TableOperations>`
           * 2020-08-01-preview: :class:`TableOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.TableOperations>`
           * 2021-01-01: :class:`TableOperations<azure.mgmt.storage.v2021_01_01.aio.operations.TableOperations>`
           * 2021-02-01: :class:`TableOperations<azure.mgmt.storage.v2021_02_01.aio.operations.TableOperations>`
        """
        api_version = self._get_api_version('table')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import TableOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import TableOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import TableOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import TableOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'table'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def table_services(self):
        """Instance depends on the API version:

           * 2019-06-01: :class:`TableServicesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.TableServicesOperations>`
           * 2020-08-01-preview: :class:`TableServicesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.TableServicesOperations>`
           * 2021-01-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.TableServicesOperations>`
           * 2021-02-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.TableServicesOperations>`
        """
        api_version = self._get_api_version('table_services')
        if api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import TableServicesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import TableServicesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import TableServicesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import TableServicesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'table_services'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def usage(self):
        """Instance depends on the API version:

           * 2015-06-15: :class:`UsageOperations<azure.mgmt.storage.v2015_06_15.aio.operations.UsageOperations>`
           * 2016-01-01: :class:`UsageOperations<azure.mgmt.storage.v2016_01_01.aio.operations.UsageOperations>`
           * 2016-12-01: :class:`UsageOperations<azure.mgmt.storage.v2016_12_01.aio.operations.UsageOperations>`
           * 2017-06-01: :class:`UsageOperations<azure.mgmt.storage.v2017_06_01.aio.operations.UsageOperations>`
           * 2017-10-01: :class:`UsageOperations<azure.mgmt.storage.v2017_10_01.aio.operations.UsageOperations>`
           * 2018-02-01: :class:`UsageOperations<azure.mgmt.storage.v2018_02_01.aio.operations.UsageOperations>`
        """
        api_version = self._get_api_version('usage')
        if api_version == '2015-06-15':
            from ..v2015_06_15.aio.operations import UsageOperations as OperationClass
        elif api_version == '2016-01-01':
            from ..v2016_01_01.aio.operations import UsageOperations as OperationClass
        elif api_version == '2016-12-01':
            from ..v2016_12_01.aio.operations import UsageOperations as OperationClass
        elif api_version == '2017-06-01':
            from ..v2017_06_01.aio.operations import UsageOperations as OperationClass
        elif api_version == '2017-10-01':
            from ..v2017_10_01.aio.operations import UsageOperations as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import UsageOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'usage'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    @property
    def usages(self):
        """Instance depends on the API version:

           * 2018-03-01-preview: :class:`UsagesOperations<azure.mgmt.storage.v2018_03_01_preview.aio.operations.UsagesOperations>`
           * 2018-07-01: :class:`UsagesOperations<azure.mgmt.storage.v2018_07_01.aio.operations.UsagesOperations>`
           * 2018-11-01: :class:`UsagesOperations<azure.mgmt.storage.v2018_11_01.aio.operations.UsagesOperations>`
           * 2019-04-01: :class:`UsagesOperations<azure.mgmt.storage.v2019_04_01.aio.operations.UsagesOperations>`
           * 2019-06-01: :class:`UsagesOperations<azure.mgmt.storage.v2019_06_01.aio.operations.UsagesOperations>`
           * 2020-08-01-preview: :class:`UsagesOperations<azure.mgmt.storage.v2020_08_01_preview.aio.operations.UsagesOperations>`
           * 2021-01-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_01_01.aio.operations.UsagesOperations>`
           * 2021-02-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_02_01.aio.operations.UsagesOperations>`
        """
        api_version = self._get_api_version('usages')
        if api_version == '2018-03-01-preview':
            from ..v2018_03_01_preview.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2018-07-01':
            from ..v2018_07_01.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2018-11-01':
            from ..v2018_11_01.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2019-04-01':
            from ..v2019_04_01.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2019-06-01':
            from ..v2019_06_01.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2020-08-01-preview':
            from ..v2020_08_01_preview.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import UsagesOperations as OperationClass
        elif api_version == '2021-02-01':
            from ..v2021_02_01.aio.operations import UsagesOperations as OperationClass
        else:
            raise ValueError("API version {} does not have operation group 'usages'".format(api_version))
        return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

    async def close(self):
        await self._client.close()
    async def __aenter__(self):
        await self._client.__aenter__()
        return self
    async def __aexit__(self, *exc_details):
        await self._client.__aexit__(*exc_details)