-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump http-client-python 0.6.8 (#3029)
* Update dependencies (2025-01-23 06:19:17) * Regenerate for typespec-python (2025-01-23 06:23:29) * Regenerate for autorest.python (2025-01-23 06:37:21) * Update dependencies (2025-01-23 09:07:09) * Regenerate for autorest.python (2025-01-23 09:25:12) * add test case for arm * add test case for data-plan SDK generation * fix test case * fix cspell * add changelog * Update dependencies (2025-01-24 03:12:49) * Regenerate for typespec-python (2025-01-24 03:16:58) * bump http-client-python 0.6.8 * update version --------- Co-authored-by: AutoPrFromHttpClientPython <AutoPrFromHttpClientPython>
- Loading branch information
Showing
290 changed files
with
14,173 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...nus/changes/auto-iscai-msft-python-selfInsteadOfModelType-2025-0-22-15-35-35.md
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...nus/changes/auto-iscai-msft-python-selfInsteadOfModelType-2025-0-22-15-35-51.md
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.chronus/changes/auto-iscai-msft-python-sphinxRaisesDoc-2025-0-21-15-26-8.md
This file was deleted.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
packages/autorest.python/samples/specification/azure-mgmt-test/readme.md
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Sample Management Generation | ||
|
||
This file is to check whether standard [readme.python.md](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/samplefiles/readme.python.md) template could work. | ||
|
||
### Settings | ||
|
||
``` yaml $(python) | ||
input-file: ../../../node_modules/@microsoft.azure/autorest.testserver/swagger/head.json | ||
azure-arm: true | ||
license-header: MICROSOFT_MIT_NO_VERSION | ||
package-name: azure-mgmt-test | ||
namespace: azure.mgmt.test | ||
package-version: 1.0.0b1 | ||
clear-output-folder: true | ||
``` | ||
``` yaml $(python) | ||
no-namespace-folders: true | ||
output-folder: $(python-sdks-folder)/test/azure-mgmt-test/azure/mgmt/test | ||
``` | ||
``` yaml $(python) | ||
modelerfour: | ||
flatten-models: false | ||
``` |
1 change: 1 addition & 0 deletions
1
...orest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/__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 |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore |
1 change: 1 addition & 0 deletions
1
....python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/__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 |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore |
32 changes: 32 additions & 0 deletions
32
...on/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/__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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wrong-import-position | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from ._patch import * # pylint: disable=unused-wildcard-import | ||
|
||
from ._client import AutoRestHeadTestService # type: ignore | ||
from ._version import VERSION | ||
|
||
__version__ = VERSION | ||
|
||
try: | ||
from ._patch import __all__ as _patch_all | ||
from ._patch import * | ||
except ImportError: | ||
_patch_all = [] | ||
from ._patch import patch_sdk as _patch_sdk | ||
|
||
__all__ = [ | ||
"AutoRestHeadTestService", | ||
] | ||
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore | ||
|
||
_patch_sdk() |
94 changes: 94 additions & 0 deletions
94
...hon/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_client.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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# 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 copy import deepcopy | ||
from typing import Any, TYPE_CHECKING | ||
from typing_extensions import Self | ||
|
||
from azure.core.pipeline import policies | ||
from azure.core.rest import HttpRequest, HttpResponse | ||
from azure.mgmt.core import ARMPipelineClient | ||
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy | ||
|
||
from ._configuration import AutoRestHeadTestServiceConfiguration | ||
from ._serialization import Deserializer, Serializer | ||
from .operations import HttpSuccessOperations | ||
|
||
if TYPE_CHECKING: | ||
from azure.core.credentials import TokenCredential | ||
|
||
|
||
class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-keyword | ||
"""Test Infrastructure for AutoRest. | ||
:ivar http_success: HttpSuccessOperations operations | ||
:vartype http_success: azure.mgmt.test.operations.HttpSuccessOperations | ||
:param credential: Credential needed for the client to connect to Azure. Required. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
:param endpoint: Service URL. Default value is "http://localhost:3000". | ||
:type endpoint: str | ||
""" | ||
|
||
def __init__(self, credential: "TokenCredential", endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: | ||
self._config = AutoRestHeadTestServiceConfiguration(credential=credential, **kwargs) | ||
_policies = kwargs.pop("policies", None) | ||
if _policies is None: | ||
_policies = [ | ||
policies.RequestIdPolicy(**kwargs), | ||
self._config.headers_policy, | ||
self._config.user_agent_policy, | ||
self._config.proxy_policy, | ||
policies.ContentDecodePolicy(**kwargs), | ||
ARMAutoResourceProviderRegistrationPolicy(), | ||
self._config.redirect_policy, | ||
self._config.retry_policy, | ||
self._config.authentication_policy, | ||
self._config.custom_hook_policy, | ||
self._config.logging_policy, | ||
policies.DistributedTracingPolicy(**kwargs), | ||
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, | ||
self._config.http_logging_policy, | ||
] | ||
self._client: ARMPipelineClient = ARMPipelineClient(base_url=endpoint, policies=_policies, **kwargs) | ||
|
||
self._serialize = Serializer() | ||
self._deserialize = Deserializer() | ||
self._serialize.client_side_validation = False | ||
self.http_success = HttpSuccessOperations(self._client, self._config, self._serialize, self._deserialize) | ||
|
||
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: | ||
"""Runs the network request through the client's chained policies. | ||
>>> from azure.core.rest import HttpRequest | ||
>>> request = HttpRequest("GET", "https://www.example.org/") | ||
<HttpRequest [GET], url: 'https://www.example.org/'> | ||
>>> response = client.send_request(request) | ||
<HttpResponse: 200 OK> | ||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request | ||
:param request: The network request you want to make. Required. | ||
:type request: ~azure.core.rest.HttpRequest | ||
:keyword bool stream: Whether the response payload will be streamed. Defaults to False. | ||
:return: The response of your network call. Does not do error handling on your response. | ||
:rtype: ~azure.core.rest.HttpResponse | ||
""" | ||
|
||
request_copy = deepcopy(request) | ||
request_copy.url = self._client.format_url(request_copy.url) | ||
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore | ||
|
||
def close(self) -> None: | ||
self._client.close() | ||
|
||
def __enter__(self) -> Self: | ||
self._client.__enter__() | ||
return self | ||
|
||
def __exit__(self, *exc_details: Any) -> None: | ||
self._client.__exit__(*exc_details) |
53 changes: 53 additions & 0 deletions
53
...ples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 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 typing import Any, TYPE_CHECKING | ||
|
||
from azure.core.pipeline import policies | ||
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy | ||
|
||
from ._version import VERSION | ||
|
||
if TYPE_CHECKING: | ||
from azure.core.credentials import TokenCredential | ||
|
||
|
||
class AutoRestHeadTestServiceConfiguration: # pylint: disable=too-many-instance-attributes | ||
"""Configuration for AutoRestHeadTestService. | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credential: Credential needed for the client to connect to Azure. Required. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
""" | ||
|
||
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: | ||
if credential is None: | ||
raise ValueError("Parameter 'credential' must not be None.") | ||
|
||
self.credential = credential | ||
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) | ||
kwargs.setdefault("sdk_moniker", "mgmt-test/{}".format(VERSION)) | ||
self.polling_interval = kwargs.get("polling_interval", 30) | ||
self._configure(**kwargs) | ||
|
||
def _configure(self, **kwargs: Any) -> 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 ARMHttpLoggingPolicy(**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.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get("authentication_policy") | ||
if self.credential and not self.authentication_policy: | ||
self.authentication_policy = ARMChallengeAuthenticationPolicy( | ||
self.credential, *self.credential_scopes, **kwargs | ||
) |
20 changes: 20 additions & 0 deletions
20
...thon/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_patch.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
"""Customize generated code here. | ||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize | ||
""" | ||
from typing import List | ||
|
||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level | ||
|
||
|
||
def patch_sdk(): | ||
"""Do not remove from this file. | ||
`patch_sdk` is a last resort escape hatch that allows you to do customizations | ||
you can't accomplish using the techniques described in | ||
https://aka.ms/azsdk/python/dpcodegen/python/customize | ||
""" |
Oops, something went wrong.