Skip to content

Commit

Permalink
Generated Key Vault 7.1-preview client (#10037)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored Mar 5, 2020
1 parent 40f56c6 commit 7a471b9
Show file tree
Hide file tree
Showing 45 changed files with 52,809 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._key_vault_client import KeyVaultClient
__all__ = ['KeyVaultClient']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from azure.core.configuration import Configuration
from azure.core.pipeline import policies

from .version import VERSION


class KeyVaultClientConfiguration(Configuration):
"""Configuration for KeyVaultClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(self, credentials, **kwargs):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")

super(KeyVaultClientConfiguration, self).__init__(**kwargs)
self._configure(**kwargs)

self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
self.generate_client_request_id = True

self.credentials = credentials

def _configure(self, **kwargs):
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.core import PipelineClient
from msrest import Serializer, Deserializer

from ._configuration import KeyVaultClientConfiguration
from .operations import KeyVaultClientOperationsMixin
from . import models


class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(
self, credentials, **kwargs):

base_url = '{vaultBaseUrl}'
self._config = KeyVaultClientConfiguration(credentials, **kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '7.1-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)


def close(self):
self._client.close()
def __enter__(self):
self._client.__enter__()
return self
def __exit__(self, *exc_details):
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._key_vault_client_async import KeyVaultClient
__all__ = ['KeyVaultClient']
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from azure.core.configuration import Configuration
from azure.core.pipeline import policies

from ..version import VERSION


class KeyVaultClientConfiguration(Configuration):
"""Configuration for KeyVaultClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(self, credentials, **kwargs):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")

super(KeyVaultClientConfiguration, self).__init__(**kwargs)
self._configure(**kwargs)

self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
self.generate_client_request_id = True

self.credentials = credentials

def _configure(self, **kwargs):
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.core import AsyncPipelineClient
from msrest import Serializer, Deserializer

from ._configuration_async import KeyVaultClientConfiguration
from .operations_async import KeyVaultClientOperationsMixin
from .. import models


class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(
self, credentials, **kwargs):

base_url = '{vaultBaseUrl}'
self._config = KeyVaultClientConfiguration(credentials, **kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '7.1-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)


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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._key_vault_client_operations_async import KeyVaultClientOperationsMixin

__all__ = [
'KeyVaultClientOperationsMixin',
]
Loading

0 comments on commit 7a471b9

Please sign in to comment.