|
| 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 | + |
| 12 | +from msrest.service_client import SDKClient |
| 13 | +from msrest import Serializer, Deserializer |
| 14 | +from msrestazure import AzureConfiguration |
| 15 | +from .version import VERSION |
| 16 | +from .operations.vaults_operations import VaultsOperations |
| 17 | +from .operations.operations import Operations |
| 18 | +from . import models |
| 19 | + |
| 20 | + |
| 21 | +class KeyVaultManagementClientConfiguration(AzureConfiguration): |
| 22 | + """Configuration for KeyVaultManagementClient |
| 23 | + Note that all parameters used to create this instance are saved as instance |
| 24 | + attributes. |
| 25 | +
|
| 26 | + :param credentials: Credentials needed for the client to connect to Azure. |
| 27 | + :type credentials: :mod:`A msrestazure Credentials |
| 28 | + object<msrestazure.azure_active_directory>` |
| 29 | + :param subscription_id: Subscription credentials which uniquely identify |
| 30 | + Microsoft Azure subscription. The subscription ID forms part of the URI |
| 31 | + for every service call. |
| 32 | + :type subscription_id: str |
| 33 | + :param str base_url: Service URL |
| 34 | + """ |
| 35 | + |
| 36 | + def __init__( |
| 37 | + self, credentials, subscription_id, base_url=None): |
| 38 | + |
| 39 | + if credentials is None: |
| 40 | + raise ValueError("Parameter 'credentials' must not be None.") |
| 41 | + if subscription_id is None: |
| 42 | + raise ValueError("Parameter 'subscription_id' must not be None.") |
| 43 | + if not base_url: |
| 44 | + base_url = 'https://management.azure.com' |
| 45 | + |
| 46 | + super(KeyVaultManagementClientConfiguration, self).__init__(base_url) |
| 47 | + |
| 48 | + self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION)) |
| 49 | + self.add_user_agent('Azure-SDK-For-Python') |
| 50 | + |
| 51 | + self.credentials = credentials |
| 52 | + self.subscription_id = subscription_id |
| 53 | + |
| 54 | + |
| 55 | +class KeyVaultManagementClient(SDKClient): |
| 56 | + """The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. |
| 57 | +
|
| 58 | + :ivar config: Configuration for client. |
| 59 | + :vartype config: KeyVaultManagementClientConfiguration |
| 60 | +
|
| 61 | + :ivar vaults: Vaults operations |
| 62 | + :vartype vaults: azure.mgmt.keyvault.v2016_10_01.operations.VaultsOperations |
| 63 | + :ivar operations: Operations operations |
| 64 | + :vartype operations: azure.mgmt.keyvault.v2016_10_01.operations.Operations |
| 65 | +
|
| 66 | + :param credentials: Credentials needed for the client to connect to Azure. |
| 67 | + :type credentials: :mod:`A msrestazure Credentials |
| 68 | + object<msrestazure.azure_active_directory>` |
| 69 | + :param subscription_id: Subscription credentials which uniquely identify |
| 70 | + Microsoft Azure subscription. The subscription ID forms part of the URI |
| 71 | + for every service call. |
| 72 | + :type subscription_id: str |
| 73 | + :param str base_url: Service URL |
| 74 | + """ |
| 75 | + |
| 76 | + def __init__( |
| 77 | + self, credentials, subscription_id, base_url=None): |
| 78 | + |
| 79 | + self.config = KeyVaultManagementClientConfiguration(credentials, subscription_id, base_url) |
| 80 | + super(KeyVaultManagementClient, self).__init__(self.config.credentials, self.config) |
| 81 | + |
| 82 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 83 | + self.api_version = '2016-10-01' |
| 84 | + self._serialize = Serializer(client_models) |
| 85 | + self._deserialize = Deserializer(client_models) |
| 86 | + |
| 87 | + self.vaults = VaultsOperations( |
| 88 | + self._client, self.config, self._serialize, self._deserialize) |
| 89 | + self.operations = Operations( |
| 90 | + self._client, self.config, self._serialize, self._deserialize) |
0 commit comments