Skip to content

Commit a5e4473

Browse files
authored
azure-keyvault-administration generated code (#12098)
1 parent 421c152 commit a5e4473

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5679
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Release History
2+
3+
## 1.0.0b1 (Unreleased)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include *.md
2+
include azure/__init__.py
3+
include azure/keyvault/__init__.py
4+
recursive-include samples *.py
5+
recursive-include tests *.py
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Azure Key Vault Administration client library for Python
2+
3+
## Getting started
4+
5+
## Key concepts
6+
7+
## Examples
8+
9+
## Troubleshooting
10+
11+
## Next steps
12+
13+
## Contributing
14+
This project welcomes contributions and suggestions. Most contributions require
15+
you to agree to a Contributor License Agreement (CLA) declaring that you have
16+
the right to, and actually do, grant us the rights to use your contribution.
17+
For details, visit https://cla.microsoft.com.
18+
19+
When you submit a pull request, a CLA-bot will automatically determine whether
20+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
21+
comment). Simply follow the instructions provided by the bot. You will only
22+
need to do this once across all repos using our CLA.
23+
24+
This project has adopted the
25+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
26+
see the Code of Conduct FAQ or contact opencode@microsoft.com with any
27+
additional questions or comments.
28+
29+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Fkeyvault%2Fazure-keyvault-administration%2FFREADME.png)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._key_vault_client import KeyVaultClient
10+
__all__ = ['KeyVaultClient']
11+
12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
from typing import Any
12+
13+
from azure.core.configuration import Configuration
14+
from azure.core.pipeline import policies
15+
16+
from ._version import VERSION
17+
18+
19+
class KeyVaultClientConfiguration(Configuration):
20+
"""Configuration for KeyVaultClient.
21+
22+
Note that all parameters used to create this instance are saved as instance
23+
attributes.
24+
"""
25+
26+
def __init__(
27+
self,
28+
**kwargs # type: Any
29+
):
30+
# type: (...) -> None
31+
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
32+
33+
kwargs.setdefault('sdk_moniker', 'azure-keyvault/{}'.format(VERSION))
34+
self._configure(**kwargs)
35+
36+
def _configure(
37+
self,
38+
**kwargs # type: Any
39+
):
40+
# type: (...) -> None
41+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
42+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
43+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
44+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
45+
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
46+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
47+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
48+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
49+
self.authentication_policy = kwargs.get('authentication_policy')
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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 azure.core import PipelineClient
13+
from msrest import Serializer, Deserializer
14+
15+
from azure.profiles import KnownProfiles, ProfileDefinition
16+
from azure.profiles.multiapiclient import MultiApiClientMixin
17+
from ._configuration import KeyVaultClientConfiguration
18+
from ._operations_mixin import KeyVaultClientOperationsMixin
19+
class _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+
26+
class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKClient):
27+
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
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+
:param str api_version: API version to use if no profile is provided, or if
37+
missing in profile.
38+
:param profile: A profile definition, from KnownProfiles to dict.
39+
:type profile: azure.profiles.KnownProfiles
40+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
41+
"""
42+
43+
DEFAULT_API_VERSION = '7.2-preview'
44+
_PROFILE_TAG = "azure.keyvault.KeyVaultClient"
45+
LATEST_PROFILE = ProfileDefinition({
46+
_PROFILE_TAG: {
47+
None: DEFAULT_API_VERSION,
48+
}},
49+
_PROFILE_TAG + " latest"
50+
)
51+
52+
def __init__(
53+
self,
54+
api_version=None,
55+
profile=KnownProfiles.default,
56+
**kwargs # type: Any
57+
):
58+
if api_version == '7.2-preview':
59+
base_url = '{vaultBaseUrl}'
60+
else:
61+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
62+
self._config = KeyVaultClientConfiguration(**kwargs)
63+
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
64+
super(KeyVaultClient, self).__init__(
65+
api_version=api_version,
66+
profile=profile
67+
)
68+
69+
@classmethod
70+
def _models_dict(cls, api_version):
71+
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
72+
73+
@classmethod
74+
def models(cls, api_version=DEFAULT_API_VERSION):
75+
"""Module depends on the API version:
76+
77+
* 7.2-preview: :mod:`v7_2_preview.models<azure.keyvault.v7_2_preview.models>`
78+
"""
79+
if api_version == '7.2-preview':
80+
from .v7_2_preview import models
81+
return models
82+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
83+
84+
@property
85+
def role_assignments(self):
86+
"""Instance depends on the API version:
87+
88+
* 7.2-preview: :class:`RoleAssignmentsOperations<azure.keyvault.v7_2_preview.operations.RoleAssignmentsOperations>`
89+
"""
90+
api_version = self._get_api_version('role_assignments')
91+
if api_version == '7.2-preview':
92+
from .v7_2_preview.operations import RoleAssignmentsOperations as OperationClass
93+
else:
94+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
95+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
96+
97+
@property
98+
def role_definitions(self):
99+
"""Instance depends on the API version:
100+
101+
* 7.2-preview: :class:`RoleDefinitionsOperations<azure.keyvault.v7_2_preview.operations.RoleDefinitionsOperations>`
102+
"""
103+
api_version = self._get_api_version('role_definitions')
104+
if api_version == '7.2-preview':
105+
from .v7_2_preview.operations import RoleDefinitionsOperations as OperationClass
106+
else:
107+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
108+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
109+
110+
def close(self):
111+
self._client.close()
112+
def __enter__(self):
113+
self._client.__enter__()
114+
return self
115+
def __exit__(self, *exc_details):
116+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)