1# coding=utf-8 2# -------------------------------------------------------------------------- 3# Copyright (c) Microsoft Corporation. All rights reserved. 4# Licensed under the MIT License. See License.txt in the project root for 5# license information. 6# 7# Code generated by Microsoft (R) AutoRest Code Generator. 8# Changes may cause incorrect behavior and will be lost if the code is 9# regenerated. 10# -------------------------------------------------------------------------- 11 12from azure.mgmt.core import ARMPipelineClient 13from msrest import Serializer, Deserializer 14 15from azure.profiles import KnownProfiles, ProfileDefinition 16from azure.profiles.multiapiclient import MultiApiClientMixin 17from ._configuration import ApplicationInsightsManagementClientConfiguration 18 19class _SDKClient(object): 20 def __init__(self, *args, **kwargs): 21 """This is a fake class to support current implemetation of MultiApiClientMixin." 22 Will be removed in final version of multiapi azure-core based client 23 """ 24 pass 25 26class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): 27 """Composite Swagger for Application Insights Management Client. 28 29 This ready contains multiple API versions, to help you deal with all of the Azure clouds 30 (Azure Stack, Azure Government, Azure China, etc.). 31 By default, it uses the latest API version available on public Azure. 32 For production, you should stick to a particular api-version and/or profile. 33 The profile sets a mapping between an operation group and its API version. 34 The api-version parameter sets the default API version if the operation 35 group is not described in the profile. 36 37 :param credential: Credential needed for the client to connect to Azure. 38 :type credential: ~azure.core.credentials.TokenCredential 39 :param subscription_id: The ID of the target subscription. 40 :type subscription_id: str 41 :param str api_version: API version to use if no profile is provided, or if 42 missing in profile. 43 :param str base_url: Service URL 44 :param profile: A profile definition, from KnownProfiles to dict. 45 :type profile: azure.profiles.KnownProfiles 46 """ 47 48 DEFAULT_API_VERSION = '2017-10-01' 49 _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient" 50 LATEST_PROFILE = ProfileDefinition({ 51 _PROFILE_TAG: { 52 None: DEFAULT_API_VERSION, 53 'analytics_items': '2015-05-01', 54 'annotations': '2015-05-01', 55 'api_keys': '2015-05-01', 56 'component_available_features': '2015-05-01', 57 'component_current_billing_features': '2015-05-01', 58 'component_feature_capabilities': '2015-05-01', 59 'component_quota_status': '2015-05-01', 60 'components': '2015-05-01', 61 'export_configurations': '2015-05-01', 62 'favorites': '2015-05-01', 63 'my_workbooks': '2015-05-01', 64 'operations': '2015-05-01', 65 'proactive_detection_configurations': '2015-05-01', 66 'web_test_locations': '2015-05-01', 67 'web_tests': '2015-05-01', 68 'work_item_configurations': '2015-05-01', 69 'workbooks': '2015-05-01', 70 }}, 71 _PROFILE_TAG + " latest" 72 ) 73 74 def __init__( 75 self, 76 credential, # type: "TokenCredential" 77 subscription_id, # type: str 78 api_version=None, 79 base_url=None, 80 profile=KnownProfiles.default, 81 **kwargs # type: Any 82 ): 83 if not base_url: 84 base_url = 'https://management.azure.com' 85 self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs) 86 self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) 87 super(ApplicationInsightsManagementClient, self).__init__( 88 api_version=api_version, 89 profile=profile 90 ) 91 92 @classmethod 93 def _models_dict(cls, api_version): 94 return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} 95 96 @classmethod 97 def models(cls, api_version=DEFAULT_API_VERSION): 98 """Module depends on the API version: 99 100 * 2015-05-01: :mod:`v2015_05_01.models<azure.mgmt.applicationinsights.v2015_05_01.models>` 101 * 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.applicationinsights.v2017_10_01.models>` 102 * 2018-05-01-preview: :mod:`v2018_05_01_preview.models<azure.mgmt.applicationinsights.v2018_05_01_preview.models>` 103 * 2018-06-17-preview: :mod:`v2018_06_17_preview.models<azure.mgmt.applicationinsights.v2018_06_17_preview.models>` 104 * 2019-09-01-preview: :mod:`v2019_09_01_preview.models<azure.mgmt.applicationinsights.v2019_09_01_preview.models>` 105 * 2019-10-17-preview: :mod:`v2019_10_17_preview.models<azure.mgmt.applicationinsights.v2019_10_17_preview.models>` 106 * 2020-02-02-preview: :mod:`v2020_02_02_preview.models<azure.mgmt.applicationinsights.v2020_02_02_preview.models>` 107 * 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.applicationinsights.v2020_03_01_preview.models>` 108 * 2020-06-02-preview: :mod:`v2020_06_02_preview.models<azure.mgmt.applicationinsights.v2020_06_02_preview.models>` 109 """ 110 if api_version == '2015-05-01': 111 from .v2015_05_01 import models 112 return models 113 elif api_version == '2017-10-01': 114 from .v2017_10_01 import models 115 return models 116 elif api_version == '2018-05-01-preview': 117 from .v2018_05_01_preview import models 118 return models 119 elif api_version == '2018-06-17-preview': 120 from .v2018_06_17_preview import models 121 return models 122 elif api_version == '2019-09-01-preview': 123 from .v2019_09_01_preview import models 124 return models 125 elif api_version == '2019-10-17-preview': 126 from .v2019_10_17_preview import models 127 return models 128 elif api_version == '2020-02-02-preview': 129 from .v2020_02_02_preview import models 130 return models 131 elif api_version == '2020-03-01-preview': 132 from .v2020_03_01_preview import models 133 return models 134 elif api_version == '2020-06-02-preview': 135 from .v2020_06_02_preview import models 136 return models 137 raise ValueError("API version {} is not available".format(api_version)) 138 139 @property 140 def analytics_items(self): 141 """Instance depends on the API version: 142 143 * 2015-05-01: :class:`AnalyticsItemsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations>` 144 """ 145 api_version = self._get_api_version('analytics_items') 146 if api_version == '2015-05-01': 147 from .v2015_05_01.operations import AnalyticsItemsOperations as OperationClass 148 else: 149 raise ValueError("API version {} does not have operation group 'analytics_items'".format(api_version)) 150 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 151 152 @property 153 def annotations(self): 154 """Instance depends on the API version: 155 156 * 2015-05-01: :class:`AnnotationsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.AnnotationsOperations>` 157 """ 158 api_version = self._get_api_version('annotations') 159 if api_version == '2015-05-01': 160 from .v2015_05_01.operations import AnnotationsOperations as OperationClass 161 else: 162 raise ValueError("API version {} does not have operation group 'annotations'".format(api_version)) 163 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 164 165 @property 166 def api_keys(self): 167 """Instance depends on the API version: 168 169 * 2015-05-01: :class:`APIKeysOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.APIKeysOperations>` 170 """ 171 api_version = self._get_api_version('api_keys') 172 if api_version == '2015-05-01': 173 from .v2015_05_01.operations import APIKeysOperations as OperationClass 174 else: 175 raise ValueError("API version {} does not have operation group 'api_keys'".format(api_version)) 176 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 177 178 @property 179 def component_available_features(self): 180 """Instance depends on the API version: 181 182 * 2015-05-01: :class:`ComponentAvailableFeaturesOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentAvailableFeaturesOperations>` 183 """ 184 api_version = self._get_api_version('component_available_features') 185 if api_version == '2015-05-01': 186 from .v2015_05_01.operations import ComponentAvailableFeaturesOperations as OperationClass 187 else: 188 raise ValueError("API version {} does not have operation group 'component_available_features'".format(api_version)) 189 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 190 191 @property 192 def component_current_billing_features(self): 193 """Instance depends on the API version: 194 195 * 2015-05-01: :class:`ComponentCurrentBillingFeaturesOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentCurrentBillingFeaturesOperations>` 196 """ 197 api_version = self._get_api_version('component_current_billing_features') 198 if api_version == '2015-05-01': 199 from .v2015_05_01.operations import ComponentCurrentBillingFeaturesOperations as OperationClass 200 else: 201 raise ValueError("API version {} does not have operation group 'component_current_billing_features'".format(api_version)) 202 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 203 204 @property 205 def component_current_pricing_plan(self): 206 """Instance depends on the API version: 207 208 * 2017-10-01: :class:`ComponentCurrentPricingPlanOperations<azure.mgmt.applicationinsights.v2017_10_01.operations.ComponentCurrentPricingPlanOperations>` 209 """ 210 api_version = self._get_api_version('component_current_pricing_plan') 211 if api_version == '2017-10-01': 212 from .v2017_10_01.operations import ComponentCurrentPricingPlanOperations as OperationClass 213 else: 214 raise ValueError("API version {} does not have operation group 'component_current_pricing_plan'".format(api_version)) 215 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 216 217 @property 218 def component_feature_capabilities(self): 219 """Instance depends on the API version: 220 221 * 2015-05-01: :class:`ComponentFeatureCapabilitiesOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentFeatureCapabilitiesOperations>` 222 """ 223 api_version = self._get_api_version('component_feature_capabilities') 224 if api_version == '2015-05-01': 225 from .v2015_05_01.operations import ComponentFeatureCapabilitiesOperations as OperationClass 226 else: 227 raise ValueError("API version {} does not have operation group 'component_feature_capabilities'".format(api_version)) 228 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 229 230 @property 231 def component_linked_storage_accounts(self): 232 """Instance depends on the API version: 233 234 * 2020-03-01-preview: :class:`ComponentLinkedStorageAccountsOperations<azure.mgmt.applicationinsights.v2020_03_01_preview.operations.ComponentLinkedStorageAccountsOperations>` 235 """ 236 api_version = self._get_api_version('component_linked_storage_accounts') 237 if api_version == '2020-03-01-preview': 238 from .v2020_03_01_preview.operations import ComponentLinkedStorageAccountsOperations as OperationClass 239 else: 240 raise ValueError("API version {} does not have operation group 'component_linked_storage_accounts'".format(api_version)) 241 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 242 243 @property 244 def component_quota_status(self): 245 """Instance depends on the API version: 246 247 * 2015-05-01: :class:`ComponentQuotaStatusOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentQuotaStatusOperations>` 248 """ 249 api_version = self._get_api_version('component_quota_status') 250 if api_version == '2015-05-01': 251 from .v2015_05_01.operations import ComponentQuotaStatusOperations as OperationClass 252 else: 253 raise ValueError("API version {} does not have operation group 'component_quota_status'".format(api_version)) 254 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 255 256 @property 257 def components(self): 258 """Instance depends on the API version: 259 260 * 2015-05-01: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentsOperations>` 261 * 2018-05-01-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.operations.ComponentsOperations>` 262 * 2020-02-02-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02_preview.operations.ComponentsOperations>` 263 """ 264 api_version = self._get_api_version('components') 265 if api_version == '2015-05-01': 266 from .v2015_05_01.operations import ComponentsOperations as OperationClass 267 elif api_version == '2018-05-01-preview': 268 from .v2018_05_01_preview.operations import ComponentsOperations as OperationClass 269 elif api_version == '2020-02-02-preview': 270 from .v2020_02_02_preview.operations import ComponentsOperations as OperationClass 271 else: 272 raise ValueError("API version {} does not have operation group 'components'".format(api_version)) 273 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 274 275 @property 276 def ea_subscription_list_migration_date(self): 277 """Instance depends on the API version: 278 279 * 2017-10-01: :class:`EASubscriptionListMigrationDateOperations<azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionListMigrationDateOperations>` 280 """ 281 api_version = self._get_api_version('ea_subscription_list_migration_date') 282 if api_version == '2017-10-01': 283 from .v2017_10_01.operations import EASubscriptionListMigrationDateOperations as OperationClass 284 else: 285 raise ValueError("API version {} does not have operation group 'ea_subscription_list_migration_date'".format(api_version)) 286 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 287 288 @property 289 def ea_subscription_migrate_to_new_pricing_model(self): 290 """Instance depends on the API version: 291 292 * 2017-10-01: :class:`EASubscriptionMigrateToNewPricingModelOperations<azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionMigrateToNewPricingModelOperations>` 293 """ 294 api_version = self._get_api_version('ea_subscription_migrate_to_new_pricing_model') 295 if api_version == '2017-10-01': 296 from .v2017_10_01.operations import EASubscriptionMigrateToNewPricingModelOperations as OperationClass 297 else: 298 raise ValueError("API version {} does not have operation group 'ea_subscription_migrate_to_new_pricing_model'".format(api_version)) 299 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 300 301 @property 302 def ea_subscription_rollback_to_legacy_pricing_model(self): 303 """Instance depends on the API version: 304 305 * 2017-10-01: :class:`EASubscriptionRollbackToLegacyPricingModelOperations<azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionRollbackToLegacyPricingModelOperations>` 306 """ 307 api_version = self._get_api_version('ea_subscription_rollback_to_legacy_pricing_model') 308 if api_version == '2017-10-01': 309 from .v2017_10_01.operations import EASubscriptionRollbackToLegacyPricingModelOperations as OperationClass 310 else: 311 raise ValueError("API version {} does not have operation group 'ea_subscription_rollback_to_legacy_pricing_model'".format(api_version)) 312 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 313 314 @property 315 def export_configurations(self): 316 """Instance depends on the API version: 317 318 * 2015-05-01: :class:`ExportConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ExportConfigurationsOperations>` 319 """ 320 api_version = self._get_api_version('export_configurations') 321 if api_version == '2015-05-01': 322 from .v2015_05_01.operations import ExportConfigurationsOperations as OperationClass 323 else: 324 raise ValueError("API version {} does not have operation group 'export_configurations'".format(api_version)) 325 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 326 327 @property 328 def favorites(self): 329 """Instance depends on the API version: 330 331 * 2015-05-01: :class:`FavoritesOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.FavoritesOperations>` 332 """ 333 api_version = self._get_api_version('favorites') 334 if api_version == '2015-05-01': 335 from .v2015_05_01.operations import FavoritesOperations as OperationClass 336 else: 337 raise ValueError("API version {} does not have operation group 'favorites'".format(api_version)) 338 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 339 340 @property 341 def live_token(self): 342 """Instance depends on the API version: 343 344 * 2020-06-02-preview: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2020_06_02_preview.operations.LiveTokenOperations>` 345 """ 346 api_version = self._get_api_version('live_token') 347 if api_version == '2020-06-02-preview': 348 from .v2020_06_02_preview.operations import LiveTokenOperations as OperationClass 349 else: 350 raise ValueError("API version {} does not have operation group 'live_token'".format(api_version)) 351 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 352 353 @property 354 def my_workbooks(self): 355 """Instance depends on the API version: 356 357 * 2015-05-01: :class:`MyWorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations>` 358 """ 359 api_version = self._get_api_version('my_workbooks') 360 if api_version == '2015-05-01': 361 from .v2015_05_01.operations import MyWorkbooksOperations as OperationClass 362 else: 363 raise ValueError("API version {} does not have operation group 'my_workbooks'".format(api_version)) 364 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 365 366 @property 367 def operations(self): 368 """Instance depends on the API version: 369 370 * 2015-05-01: :class:`Operations<azure.mgmt.applicationinsights.v2015_05_01.operations.Operations>` 371 * 2019-09-01-preview: :class:`Operations<azure.mgmt.applicationinsights.v2019_09_01_preview.operations.Operations>` 372 * 2020-06-02-preview: :class:`Operations<azure.mgmt.applicationinsights.v2020_06_02_preview.operations.Operations>` 373 """ 374 api_version = self._get_api_version('operations') 375 if api_version == '2015-05-01': 376 from .v2015_05_01.operations import Operations as OperationClass 377 elif api_version == '2019-09-01-preview': 378 from .v2019_09_01_preview.operations import Operations as OperationClass 379 elif api_version == '2020-06-02-preview': 380 from .v2020_06_02_preview.operations import Operations as OperationClass 381 else: 382 raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) 383 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 384 385 @property 386 def proactive_detection_configurations(self): 387 """Instance depends on the API version: 388 389 * 2015-05-01: :class:`ProactiveDetectionConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ProactiveDetectionConfigurationsOperations>` 390 * 2018-05-01-preview: :class:`ProactiveDetectionConfigurationsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.operations.ProactiveDetectionConfigurationsOperations>` 391 """ 392 api_version = self._get_api_version('proactive_detection_configurations') 393 if api_version == '2015-05-01': 394 from .v2015_05_01.operations import ProactiveDetectionConfigurationsOperations as OperationClass 395 elif api_version == '2018-05-01-preview': 396 from .v2018_05_01_preview.operations import ProactiveDetectionConfigurationsOperations as OperationClass 397 else: 398 raise ValueError("API version {} does not have operation group 'proactive_detection_configurations'".format(api_version)) 399 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 400 401 @property 402 def queries(self): 403 """Instance depends on the API version: 404 405 * 2019-09-01-preview: :class:`QueriesOperations<azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueriesOperations>` 406 """ 407 api_version = self._get_api_version('queries') 408 if api_version == '2019-09-01-preview': 409 from .v2019_09_01_preview.operations import QueriesOperations as OperationClass 410 else: 411 raise ValueError("API version {} does not have operation group 'queries'".format(api_version)) 412 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 413 414 @property 415 def query_packs(self): 416 """Instance depends on the API version: 417 418 * 2019-09-01-preview: :class:`QueryPacksOperations<azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueryPacksOperations>` 419 """ 420 api_version = self._get_api_version('query_packs') 421 if api_version == '2019-09-01-preview': 422 from .v2019_09_01_preview.operations import QueryPacksOperations as OperationClass 423 else: 424 raise ValueError("API version {} does not have operation group 'query_packs'".format(api_version)) 425 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 426 427 @property 428 def web_test_locations(self): 429 """Instance depends on the API version: 430 431 * 2015-05-01: :class:`WebTestLocationsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestLocationsOperations>` 432 """ 433 api_version = self._get_api_version('web_test_locations') 434 if api_version == '2015-05-01': 435 from .v2015_05_01.operations import WebTestLocationsOperations as OperationClass 436 else: 437 raise ValueError("API version {} does not have operation group 'web_test_locations'".format(api_version)) 438 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 439 440 @property 441 def web_tests(self): 442 """Instance depends on the API version: 443 444 * 2015-05-01: :class:`WebTestsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestsOperations>` 445 """ 446 api_version = self._get_api_version('web_tests') 447 if api_version == '2015-05-01': 448 from .v2015_05_01.operations import WebTestsOperations as OperationClass 449 else: 450 raise ValueError("API version {} does not have operation group 'web_tests'".format(api_version)) 451 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 452 453 @property 454 def work_item_configurations(self): 455 """Instance depends on the API version: 456 457 * 2015-05-01: :class:`WorkItemConfigurationsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.WorkItemConfigurationsOperations>` 458 """ 459 api_version = self._get_api_version('work_item_configurations') 460 if api_version == '2015-05-01': 461 from .v2015_05_01.operations import WorkItemConfigurationsOperations as OperationClass 462 else: 463 raise ValueError("API version {} does not have operation group 'work_item_configurations'".format(api_version)) 464 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 465 466 @property 467 def workbook_templates(self): 468 """Instance depends on the API version: 469 470 * 2019-10-17-preview: :class:`WorkbookTemplatesOperations<azure.mgmt.applicationinsights.v2019_10_17_preview.operations.WorkbookTemplatesOperations>` 471 """ 472 api_version = self._get_api_version('workbook_templates') 473 if api_version == '2019-10-17-preview': 474 from .v2019_10_17_preview.operations import WorkbookTemplatesOperations as OperationClass 475 else: 476 raise ValueError("API version {} does not have operation group 'workbook_templates'".format(api_version)) 477 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 478 479 @property 480 def workbooks(self): 481 """Instance depends on the API version: 482 483 * 2015-05-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations>` 484 * 2018-06-17-preview: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2018_06_17_preview.operations.WorkbooksOperations>` 485 """ 486 api_version = self._get_api_version('workbooks') 487 if api_version == '2015-05-01': 488 from .v2015_05_01.operations import WorkbooksOperations as OperationClass 489 elif api_version == '2018-06-17-preview': 490 from .v2018_06_17_preview.operations import WorkbooksOperations as OperationClass 491 else: 492 raise ValueError("API version {} does not have operation group 'workbooks'".format(api_version)) 493 return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 494 495 def close(self): 496 self._client.close() 497 def __enter__(self): 498 self._client.__enter__() 499 return self 500 def __exit__(self, *exc_details): 501 self._client.__exit__(*exc_details) 502