Skip to content

Commit fbe6118

Browse files
author
SDKAuto
committed
CodeGen from PR 15461 in Azure/azure-rest-api-specs
Alias description change (Azure#15461)
1 parent 31c370f commit fbe6118

21 files changed

+355
-192
lines changed

sdk/subscription/azure-mgmt-subscription/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "5a26835f26fdb1ef29b1d1da6c51b10500f9de46",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/subscription/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/subscription/resource-manager/readme.md"
11+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# --------------------------------------------------------------------------
88

99
from ._subscription_client import SubscriptionClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
1013
__all__ = ['SubscriptionClient']
1114

1215
try:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
from azure.core.pipeline import policies
1313
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1414

15+
from ._version import VERSION
16+
1517
if TYPE_CHECKING:
1618
# pylint: disable=unused-import,ungrouped-imports
1719
from typing import Any
1820

1921
from azure.core.credentials import TokenCredential
2022

21-
VERSION = "unknown"
2223

2324
class SubscriptionClientConfiguration(Configuration):
2425
"""Configuration for SubscriptionClient.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"chosen_version": "",
3+
"total_api_version_list": ["2016-06-01", "2020-09-01"],
4+
"client": {
5+
"name": "SubscriptionClient",
6+
"filename": "_subscription_client",
7+
"description": "The subscription client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SubscriptionClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SubscriptionClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
}
24+
},
25+
"async": {
26+
"credential": {
27+
"signature": "credential: \"AsyncTokenCredential\",",
28+
"description": "Credential needed for the client to connect to Azure.",
29+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
30+
"required": true
31+
}
32+
},
33+
"constant": {
34+
},
35+
"call": "credential",
36+
"service_client_specific": {
37+
"sync": {
38+
"api_version": {
39+
"signature": "api_version=None, # type: Optional[str]",
40+
"description": "API version to use if no profile is provided, or if missing in profile.",
41+
"docstring_type": "str",
42+
"required": false
43+
},
44+
"base_url": {
45+
"signature": "base_url=None, # type: Optional[str]",
46+
"description": "Service URL",
47+
"docstring_type": "str",
48+
"required": false
49+
},
50+
"profile": {
51+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
52+
"description": "A profile definition, from KnownProfiles to dict.",
53+
"docstring_type": "azure.profiles.KnownProfiles",
54+
"required": false
55+
}
56+
},
57+
"async": {
58+
"api_version": {
59+
"signature": "api_version: Optional[str] = None,",
60+
"description": "API version to use if no profile is provided, or if missing in profile.",
61+
"docstring_type": "str",
62+
"required": false
63+
},
64+
"base_url": {
65+
"signature": "base_url: Optional[str] = None,",
66+
"description": "Service URL",
67+
"docstring_type": "str",
68+
"required": false
69+
},
70+
"profile": {
71+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
72+
"description": "A profile definition, from KnownProfiles to dict.",
73+
"docstring_type": "azure.profiles.KnownProfiles",
74+
"required": false
75+
}
76+
}
77+
}
78+
},
79+
"config": {
80+
"credential": true,
81+
"credential_scopes": ["https://management.azure.com/.default"],
82+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
83+
"credential_default_policy_type_has_async_version": true,
84+
"credential_key_header_name": null,
85+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
86+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
87+
},
88+
"operation_groups": {
89+
"subscriptions": "SubscriptionsOperations",
90+
"tenants": "TenantsOperations",
91+
"subscription": "SubscriptionOperations",
92+
"operations": "Operations",
93+
"alias": "AliasOperations"
94+
}
95+
}

sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/_subscription_client.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import SubscriptionClientConfiguration
2122
from .operations import SubscriptionsOperations
@@ -30,15 +31,15 @@ class SubscriptionClient(object):
3031
"""The subscription client.
3132
3233
:ivar subscriptions: SubscriptionsOperations operations
33-
:vartype subscriptions: subscription_client.operations.SubscriptionsOperations
34+
:vartype subscriptions: azure.mgmt.subscription.operations.SubscriptionsOperations
3435
:ivar tenants: TenantsOperations operations
35-
:vartype tenants: subscription_client.operations.TenantsOperations
36+
:vartype tenants: azure.mgmt.subscription.operations.TenantsOperations
3637
:ivar subscription: SubscriptionOperations operations
37-
:vartype subscription: subscription_client.operations.SubscriptionOperations
38+
:vartype subscription: azure.mgmt.subscription.operations.SubscriptionOperations
3839
:ivar operations: Operations operations
39-
:vartype operations: subscription_client.operations.Operations
40+
:vartype operations: azure.mgmt.subscription.operations.Operations
4041
:ivar alias: AliasOperations operations
41-
:vartype alias: subscription_client.operations.AliasOperations
42+
:vartype alias: azure.mgmt.subscription.operations.AliasOperations
4243
:param credential: Credential needed for the client to connect to Azure.
4344
:type credential: ~azure.core.credentials.TokenCredential
4445
:param str base_url: Service URL
@@ -73,6 +74,21 @@ def __init__(
7374
self.alias = AliasOperations(
7475
self._client, self._config, self._serialize, self._deserialize)
7576

77+
def _send_request(self, http_request, **kwargs):
78+
# type: (HttpRequest, Any) -> HttpResponse
79+
"""Runs the network request through the client's chained policies.
80+
81+
:param http_request: The network request you want to make. Required.
82+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
83+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
84+
:return: The response of your network call. Does not do error handling on your response.
85+
:rtype: ~azure.core.pipeline.transport.HttpResponse
86+
"""
87+
http_request.url = self._client.format_url(http_request.url)
88+
stream = kwargs.pop("stream", True)
89+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
90+
return pipeline_response.http_response
91+
7692
def close(self):
7793
# type: () -> None
7894
self._client.close()

sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/aio/_configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
from azure.core.pipeline import policies
1313
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1414

15+
from .._version import VERSION
16+
1517
if TYPE_CHECKING:
1618
# pylint: disable=unused-import,ungrouped-imports
1719
from azure.core.credentials_async import AsyncTokenCredential
1820

19-
VERSION = "unknown"
2021

2122
class SubscriptionClientConfiguration(Configuration):
2223
"""Configuration for SubscriptionClient.

sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/aio/_subscription_client.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -28,15 +29,15 @@ class SubscriptionClient(object):
2829
"""The subscription client.
2930
3031
:ivar subscriptions: SubscriptionsOperations operations
31-
:vartype subscriptions: subscription_client.aio.operations.SubscriptionsOperations
32+
:vartype subscriptions: azure.mgmt.subscription.aio.operations.SubscriptionsOperations
3233
:ivar tenants: TenantsOperations operations
33-
:vartype tenants: subscription_client.aio.operations.TenantsOperations
34+
:vartype tenants: azure.mgmt.subscription.aio.operations.TenantsOperations
3435
:ivar subscription: SubscriptionOperations operations
35-
:vartype subscription: subscription_client.aio.operations.SubscriptionOperations
36+
:vartype subscription: azure.mgmt.subscription.aio.operations.SubscriptionOperations
3637
:ivar operations: Operations operations
37-
:vartype operations: subscription_client.aio.operations.Operations
38+
:vartype operations: azure.mgmt.subscription.aio.operations.Operations
3839
:ivar alias: AliasOperations operations
39-
:vartype alias: subscription_client.aio.operations.AliasOperations
40+
:vartype alias: azure.mgmt.subscription.aio.operations.AliasOperations
4041
:param credential: Credential needed for the client to connect to Azure.
4142
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
4243
:param str base_url: Service URL
@@ -70,6 +71,20 @@ def __init__(
7071
self.alias = AliasOperations(
7172
self._client, self._config, self._serialize, self._deserialize)
7273

74+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
75+
"""Runs the network request through the client's chained policies.
76+
77+
:param http_request: The network request you want to make. Required.
78+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
79+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
80+
:return: The response of your network call. Does not do error handling on your response.
81+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
82+
"""
83+
http_request.url = self._client.format_url(http_request.url)
84+
stream = kwargs.pop("stream", True)
85+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
86+
return pipeline_response.http_response
87+
7388
async def close(self) -> None:
7489
await self._client.close()
7590

0 commit comments

Comments
 (0)