Skip to content

Commit 921c776

Browse files
author
SDKAuto
committed
CodeGen from PR 20671 in Azure/azure-rest-api-specs
Merge a5a9c1e30356c18e62aa46af3f18cb7be51d0755 into 5552a893886b8323c807e3a342332c31cd9ab93c
1 parent fda90e7 commit 921c776

Some content is hidden

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

41 files changed

+9336
-4267
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.8.4",
33
"use": [
4-
"@autorest/python@5.13.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.1.5",
5+
"@autorest/modelerfour@4.23.5"
66
],
7-
"commit": "b1bbbab2f04c23e279c717f955d9a86bc4757946",
7+
"commit": "faed328d0f9c39355cfe8cc86346a68e6f4e7228",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/reservations/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/reservations/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
1010
"readme": "specification/reservations/resource-manager/readme.md"
1111
}

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['AzureReservationAPI']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["AzureReservationAPI"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_azure_reservation_api.py

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,33 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12-
from msrest import Deserializer, Serializer
13-
1412
from azure.core.rest import HttpRequest, HttpResponse
1513
from azure.mgmt.core import ARMPipelineClient
1614

1715
from . import models
1816
from ._configuration import AzureReservationAPIConfiguration
19-
from .operations import AzureReservationAPIOperationsMixin, CalculateExchangeOperations, ExchangeOperations, OperationOperations, QuotaOperations, QuotaRequestStatusOperations, ReservationOperations, ReservationOrderOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
AzureReservationAPIOperationsMixin,
20+
CalculateExchangeOperations,
21+
CalculateRefundOperations,
22+
ExchangeOperations,
23+
OperationOperations,
24+
QuotaOperations,
25+
QuotaRequestStatusOperations,
26+
ReservationOperations,
27+
ReservationOrderOperations,
28+
ReturnOperations,
29+
)
2030

2131
if TYPE_CHECKING:
2232
# pylint: disable=unused-import,ungrouped-imports
2333
from azure.core.credentials import TokenCredential
2434

25-
class AzureReservationAPI(AzureReservationAPIOperationsMixin): # pylint: disable=too-many-instance-attributes
35+
36+
class AzureReservationAPI(
37+
AzureReservationAPIOperationsMixin
38+
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2639
"""This API describe Azure Reservation.
2740
2841
:ivar reservation: ReservationOperations operations
@@ -31,6 +44,10 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin): # pylint: disa
3144
:vartype reservation_order: azure.mgmt.reservations.operations.ReservationOrderOperations
3245
:ivar operation: OperationOperations operations
3346
:vartype operation: azure.mgmt.reservations.operations.OperationOperations
47+
:ivar calculate_refund: CalculateRefundOperations operations
48+
:vartype calculate_refund: azure.mgmt.reservations.operations.CalculateRefundOperations
49+
:ivar return_operations: ReturnOperations operations
50+
:vartype return_operations: azure.mgmt.reservations.operations.ReturnOperations
3451
:ivar calculate_exchange: CalculateExchangeOperations operations
3552
:vartype calculate_exchange: azure.mgmt.reservations.operations.CalculateExchangeOperations
3653
:ivar exchange: ExchangeOperations operations
@@ -39,7 +56,7 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin): # pylint: disa
3956
:vartype quota: azure.mgmt.reservations.operations.QuotaOperations
4057
:ivar quota_request_status: QuotaRequestStatusOperations operations
4158
:vartype quota_request_status: azure.mgmt.reservations.operations.QuotaRequestStatusOperations
42-
:param credential: Credential needed for the client to connect to Azure.
59+
:param credential: Credential needed for the client to connect to Azure. Required.
4360
:type credential: ~azure.core.credentials.TokenCredential
4461
:param base_url: Service URL. Default value is "https://management.azure.com".
4562
:type base_url: str
@@ -48,10 +65,7 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin): # pylint: disa
4865
"""
4966

5067
def __init__(
51-
self,
52-
credential: "TokenCredential",
53-
base_url: str = "https://management.azure.com",
54-
**kwargs: Any
68+
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
5569
) -> None:
5670
self._config = AzureReservationAPIConfiguration(credential=credential, **kwargs)
5771
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
@@ -61,19 +75,24 @@ def __init__(
6175
self._deserialize = Deserializer(client_models)
6276
self._serialize.client_side_validation = False
6377
self.reservation = ReservationOperations(self._client, self._config, self._serialize, self._deserialize)
64-
self.reservation_order = ReservationOrderOperations(self._client, self._config, self._serialize, self._deserialize)
78+
self.reservation_order = ReservationOrderOperations(
79+
self._client, self._config, self._serialize, self._deserialize
80+
)
6581
self.operation = OperationOperations(self._client, self._config, self._serialize, self._deserialize)
66-
self.calculate_exchange = CalculateExchangeOperations(self._client, self._config, self._serialize, self._deserialize)
82+
self.calculate_refund = CalculateRefundOperations(
83+
self._client, self._config, self._serialize, self._deserialize
84+
)
85+
self.return_operations = ReturnOperations(self._client, self._config, self._serialize, self._deserialize)
86+
self.calculate_exchange = CalculateExchangeOperations(
87+
self._client, self._config, self._serialize, self._deserialize
88+
)
6789
self.exchange = ExchangeOperations(self._client, self._config, self._serialize, self._deserialize)
6890
self.quota = QuotaOperations(self._client, self._config, self._serialize, self._deserialize)
69-
self.quota_request_status = QuotaRequestStatusOperations(self._client, self._config, self._serialize, self._deserialize)
70-
91+
self.quota_request_status = QuotaRequestStatusOperations(
92+
self._client, self._config, self._serialize, self._deserialize
93+
)
7194

72-
def _send_request(
73-
self,
74-
request: HttpRequest,
75-
**kwargs: Any
76-
) -> HttpResponse:
95+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7796
"""Runs the network request through the client's chained policies.
7897
7998
>>> from azure.core.rest import HttpRequest
@@ -82,7 +101,7 @@ def _send_request(
82101
>>> response = client._send_request(request)
83102
<HttpResponse: 200 OK>
84103
85-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
104+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
86105
87106
:param request: The network request you want to make. Required.
88107
:type request: ~azure.core.rest.HttpRequest

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_configuration.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,34 @@ class AzureReservationAPIConfiguration(Configuration): # pylint: disable=too-ma
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
"""
3131

32-
def __init__(
33-
self,
34-
credential: "TokenCredential",
35-
**kwargs: Any
36-
) -> None:
32+
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
3733
super(AzureReservationAPIConfiguration, self).__init__(**kwargs)
3834
if credential is None:
3935
raise ValueError("Parameter 'credential' must not be None.")
4036

4137
self.credential = credential
42-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
43-
kwargs.setdefault('sdk_moniker', 'mgmt-reservations/{}'.format(VERSION))
38+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
39+
kwargs.setdefault("sdk_moniker", "mgmt-reservations/{}".format(VERSION))
4440
self._configure(**kwargs)
4541

4642
def _configure(
47-
self,
48-
**kwargs # type: Any
43+
self, **kwargs # type: Any
4944
):
5045
# type: (...) -> None
51-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
52-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
53-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
54-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
55-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
56-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
57-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
58-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
59-
self.authentication_policy = kwargs.get('authentication_policy')
46+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
47+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
48+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
49+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
50+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
51+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
52+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
53+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
54+
self.authentication_policy = kwargs.get("authentication_policy")
6055
if self.credential and not self.authentication_policy:
61-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
56+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
57+
self.credential, *self.credential_scopes, **kwargs
58+
)

sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)