-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updating generated code * adding generated folder * getting error about rawdeserializer * fixes to error throwing * lint fixes * ignore swagger readme
- Loading branch information
1 parent
6b640a4
commit 6f01b19
Showing
24 changed files
with
2,472 additions
and
1,849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_generated/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +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. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_app_configuration import AzureAppConfiguration | ||
__all__ = ['AzureAppConfiguration'] | ||
|
||
from .version import VERSION | ||
|
||
__version__ = VERSION | ||
|
||
try: | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
68 changes: 52 additions & 16 deletions
68
...tion/azure-appconfiguration/azure/appconfiguration/_generated/_azure_app_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,84 @@ | ||
# 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. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from azure.core import PipelineClient | ||
from msrest import Serializer, Deserializer | ||
from msrest import Deserializer, Serializer | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any, Optional | ||
|
||
from azure.core.credentials import TokenCredential | ||
from azure.core.pipeline.transport import HttpRequest, HttpResponse | ||
|
||
from ._configuration import AzureAppConfigurationConfiguration | ||
from .operations import AzureAppConfigurationOperationsMixin | ||
from . import models | ||
|
||
|
||
class AzureAppConfiguration(AzureAppConfigurationOperationsMixin): | ||
"""AzureAppConfiguration | ||
"""AzureAppConfiguration. | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
:param endpoint: The endpoint of the App Configuration instance to send | ||
requests to. | ||
:param credential: Credential needed for the client to connect to Azure. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
:param endpoint: The endpoint of the App Configuration instance to send requests to. | ||
:type endpoint: str | ||
:param sync_token: Used to guarantee real-time consistency between | ||
requests. | ||
:param sync_token: Used to guarantee real-time consistency between requests. | ||
:type sync_token: str | ||
""" | ||
|
||
def __init__( | ||
self, credentials, endpoint, sync_token=None, **kwargs): | ||
|
||
self, | ||
credential, # type: "TokenCredential" | ||
endpoint, # type: str | ||
sync_token=None, # type: Optional[str] | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
base_url = '{endpoint}' | ||
self._config = AzureAppConfigurationConfiguration(credentials, endpoint, sync_token, **kwargs) | ||
self._config = AzureAppConfigurationConfiguration(credential, endpoint, sync_token, **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 = '1.0' | ||
self._serialize = Serializer(client_models) | ||
self._serialize.client_side_validation = False | ||
self._deserialize = Deserializer(client_models) | ||
|
||
|
||
def _send_request(self, http_request, **kwargs): | ||
# type: (HttpRequest, Any) -> HttpResponse | ||
"""Runs the network request through the client's chained policies. | ||
:param http_request: The network request you want to make. Required. | ||
:type http_request: ~azure.core.pipeline.transport.HttpRequest | ||
:keyword bool stream: Whether the response payload will be streamed. Defaults to True. | ||
:return: The response of your network call. Does not do error handling on your response. | ||
:rtype: ~azure.core.pipeline.transport.HttpResponse | ||
""" | ||
path_format_arguments = { | ||
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), | ||
} | ||
http_request.url = self._client.format_url(http_request.url, **path_format_arguments) | ||
stream = kwargs.pop("stream", True) | ||
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) | ||
return pipeline_response.http_response | ||
|
||
def close(self): | ||
# type: () -> None | ||
self._client.close() | ||
|
||
def __enter__(self): | ||
# type: () -> AzureAppConfiguration | ||
self._client.__enter__() | ||
return self | ||
|
||
def __exit__(self, *exc_details): | ||
# type: (Any) -> None | ||
self._client.__exit__(*exc_details) |
66 changes: 44 additions & 22 deletions
66
...pconfiguration/azure-appconfiguration/azure/appconfiguration/_generated/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,75 @@ | ||
# 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. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
|
||
from .version import VERSION | ||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any, Optional | ||
|
||
from azure.core.credentials import TokenCredential | ||
|
||
VERSION = "unknown" | ||
|
||
class AzureAppConfigurationConfiguration(Configuration): | ||
"""Configuration for AzureAppConfiguration | ||
"""Configuration for AzureAppConfiguration. | ||
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>` | ||
:param endpoint: The endpoint of the App Configuration instance to send | ||
requests to. | ||
:param credential: Credential needed for the client to connect to Azure. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
:param endpoint: The endpoint of the App Configuration instance to send requests to. | ||
:type endpoint: str | ||
:param sync_token: Used to guarantee real-time consistency between | ||
requests. | ||
:param sync_token: Used to guarantee real-time consistency between requests. | ||
:type sync_token: str | ||
""" | ||
|
||
def __init__(self, credentials, endpoint, sync_token=None, **kwargs): | ||
|
||
if credentials is None: | ||
raise ValueError("Parameter 'credentials' must not be None.") | ||
def __init__( | ||
self, | ||
credential, # type: "TokenCredential" | ||
endpoint, # type: str | ||
sync_token=None, # type: Optional[str] | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
if credential is None: | ||
raise ValueError("Parameter 'credential' must not be None.") | ||
if endpoint is None: | ||
raise ValueError("Parameter 'endpoint' must not be None.") | ||
|
||
super(AzureAppConfigurationConfiguration, self).__init__(**kwargs) | ||
self._configure(**kwargs) | ||
|
||
self.user_agent_policy.add_user_agent('azsdk-python-azureappconfiguration/{}'.format(VERSION)) | ||
self.generate_client_request_id = True | ||
|
||
self.credentials = credentials | ||
self.credential = credential | ||
self.endpoint = endpoint | ||
self.sync_token = sync_token | ||
self.api_version = "1.0" | ||
self.credential_scopes = kwargs.pop('credential_scopes', []) | ||
kwargs.setdefault('sdk_moniker', 'appconfiguration/{}'.format(VERSION)) | ||
self._configure(**kwargs) | ||
|
||
def _configure(self, **kwargs): | ||
def _configure( | ||
self, | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
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.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**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) | ||
self.authentication_policy = kwargs.get('authentication_policy') | ||
if not self.credential_scopes and not self.authentication_policy: | ||
raise ValueError("You must provide either credential_scopes or authentication_policy as kwargs") | ||
if self.credential and not self.authentication_policy: | ||
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) |
7 changes: 4 additions & 3 deletions
7
...appconfiguration/azure-appconfiguration/azure/appconfiguration/_generated/aio/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# 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. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_app_configuration_async import AzureAppConfiguration | ||
from ._azure_app_configuration import AzureAppConfiguration | ||
__all__ = ['AzureAppConfiguration'] |
Oops, something went wrong.