Skip to content

Commit 0e49a79

Browse files
author
SDKAuto
committed
CodeGen from PR 34238 in Azure/azure-rest-api-specs
Merge 967db350c17d45620e3ad3904e4f4d22da0ce6c3 into 37a849b656ecfb33424822b9f245aebff2ae994f
1 parent 206fa48 commit 0e49a79

File tree

69 files changed

+12110
-8458
lines changed

Some content is hidden

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

69 files changed

+12110
-8458
lines changed

sdk/edgeorder/azure-mgmt-edgeorder/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Edge Order Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
2+
"commit": "821ad495424b6cfa6bf1362294439445192b9551",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2021-12 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/edgeorder/resource-manager/readme.md"
4+
"typespec_src": "specification/edgeorder/EdgeOrder.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}

sdk/edgeorder/azure-mgmt-edgeorder/apiview-properties.json

Lines changed: 166 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._edge_order_management_client import EdgeOrderManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import EdgeOrderClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
22-
"EdgeOrderManagementClient",
28+
"EdgeOrderClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import EdgeOrderClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
AddressResourcesOperations,
24+
Operations,
25+
OrderItemResourcesOperations,
26+
OrderResourcesOperations,
27+
OrdersOperationGroupOperations,
28+
ProductsAndConfigurationsOperationGroupOperations,
29+
)
30+
31+
if TYPE_CHECKING:
32+
from azure.core.credentials import TokenCredential
33+
34+
35+
class EdgeOrderClient:
36+
"""Edge Order API's.
37+
38+
:ivar operations: Operations operations
39+
:vartype operations: azure.mgmt.edgeorder.operations.Operations
40+
:ivar address_resources: AddressResourcesOperations operations
41+
:vartype address_resources: azure.mgmt.edgeorder.operations.AddressResourcesOperations
42+
:ivar order_item_resources: OrderItemResourcesOperations operations
43+
:vartype order_item_resources: azure.mgmt.edgeorder.operations.OrderItemResourcesOperations
44+
:ivar order_resources: OrderResourcesOperations operations
45+
:vartype order_resources: azure.mgmt.edgeorder.operations.OrderResourcesOperations
46+
:ivar products_and_configurations_operation_group:
47+
ProductsAndConfigurationsOperationGroupOperations operations
48+
:vartype products_and_configurations_operation_group:
49+
azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperationGroupOperations
50+
:ivar orders_operation_group: OrdersOperationGroupOperations operations
51+
:vartype orders_operation_group: azure.mgmt.edgeorder.operations.OrdersOperationGroupOperations
52+
:param credential: Credential used to authenticate requests to the service. Required.
53+
:type credential: ~azure.core.credentials.TokenCredential
54+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
55+
:type subscription_id: str
56+
:param base_url: Service host. Default value is None.
57+
:type base_url: str
58+
:keyword api_version: The API version to use for this operation. Default value is "2024-02-01".
59+
Note that overriding this default value may result in unsupported behavior.
60+
:paramtype api_version: str
61+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
62+
Retry-After header is present.
63+
"""
64+
65+
def __init__(
66+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
67+
) -> None:
68+
_endpoint = "{endpoint}"
69+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
70+
_endpoints = get_arm_endpoints(_cloud)
71+
if not base_url:
72+
base_url = _endpoints["resource_manager"]
73+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
74+
self._config = EdgeOrderClientConfiguration(
75+
credential=credential,
76+
subscription_id=subscription_id,
77+
base_url=cast(str, base_url),
78+
credential_scopes=credential_scopes,
79+
**kwargs
80+
)
81+
82+
_policies = kwargs.pop("policies", None)
83+
if _policies is None:
84+
_policies = [
85+
policies.RequestIdPolicy(**kwargs),
86+
self._config.headers_policy,
87+
self._config.user_agent_policy,
88+
self._config.proxy_policy,
89+
policies.ContentDecodePolicy(**kwargs),
90+
ARMAutoResourceProviderRegistrationPolicy(),
91+
self._config.redirect_policy,
92+
self._config.retry_policy,
93+
self._config.authentication_policy,
94+
self._config.custom_hook_policy,
95+
self._config.logging_policy,
96+
policies.DistributedTracingPolicy(**kwargs),
97+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
98+
self._config.http_logging_policy,
99+
]
100+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
101+
102+
self._serialize = Serializer()
103+
self._deserialize = Deserializer()
104+
self._serialize.client_side_validation = False
105+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
106+
self.address_resources = AddressResourcesOperations(
107+
self._client, self._config, self._serialize, self._deserialize
108+
)
109+
self.order_item_resources = OrderItemResourcesOperations(
110+
self._client, self._config, self._serialize, self._deserialize
111+
)
112+
self.order_resources = OrderResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
113+
self.products_and_configurations_operation_group = ProductsAndConfigurationsOperationGroupOperations(
114+
self._client, self._config, self._serialize, self._deserialize
115+
)
116+
self.orders_operation_group = OrdersOperationGroupOperations(
117+
self._client, self._config, self._serialize, self._deserialize
118+
)
119+
120+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
121+
"""Runs the network request through the client's chained policies.
122+
123+
>>> from azure.core.rest import HttpRequest
124+
>>> request = HttpRequest("GET", "https://www.example.org/")
125+
<HttpRequest [GET], url: 'https://www.example.org/'>
126+
>>> response = client.send_request(request)
127+
<HttpResponse: 200 OK>
128+
129+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
130+
131+
:param request: The network request you want to make. Required.
132+
:type request: ~azure.core.rest.HttpRequest
133+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
134+
:return: The response of your network call. Does not do error handling on your response.
135+
:rtype: ~azure.core.rest.HttpResponse
136+
"""
137+
138+
request_copy = deepcopy(request)
139+
path_format_arguments = {
140+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
141+
}
142+
143+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
144+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
145+
146+
def close(self) -> None:
147+
self._client.close()
148+
149+
def __enter__(self) -> Self:
150+
self._client.__enter__()
151+
return self
152+
153+
def __exit__(self, *exc_details: Any) -> None:
154+
self._client.__exit__(*exc_details)

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -14,27 +14,34 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class EdgeOrderManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for EdgeOrderManagementClient.
20+
class EdgeOrderClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for EdgeOrderClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The ID of the target subscription. Required.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
:type subscription_id: str
31-
:keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this
32-
default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2024-02-01".
33+
Note that overriding this default value may result in unsupported behavior.
3334
:paramtype api_version: str
3435
"""
3536

36-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37-
api_version: str = kwargs.pop("api_version", "2021-12-01")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2024-02-01")
3845

3946
if credential is None:
4047
raise ValueError("Parameter 'credential' must not be None.")
@@ -43,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4350

4451
self.credential = credential
4552
self.subscription_id = subscription_id
53+
self.base_url = base_url
4654
self.api_version = api_version
4755
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4856
kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION))

0 commit comments

Comments
 (0)