Skip to content

Commit 416193d

Browse files
author
SDKAuto
committed
CodeGen from PR 15424 in Azure/azure-rest-api-specs
Merge bdd6ea27462880a3ed90dd464fb838755300586d into 74dbcfe
1 parent 8228131 commit 416193d

33 files changed

+2075
-693
lines changed

sdk/batch/azure-mgmt-batch/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

sdk/batch/azure-mgmt-batch/_meta.json

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": "ac7f5e01642e26d90f1c52d6399fbb6559b6e545",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/batch/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/batch/resource-manager/readme.md"
11+
}

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

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

9-
from ._batch_management import BatchManagement
9+
from ._batch_management_client import BatchManagementClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['BatchManagement']
13+
__all__ = ['BatchManagementClient']
1414

1515
try:
1616
from ._patch import patch_sdk # type: ignore

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management.py renamed to sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py

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

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

20-
from ._configuration import BatchManagementConfiguration
21+
from ._configuration import BatchManagementClientConfiguration
2122
from .operations import BatchAccountOperations
2223
from .operations import ApplicationPackageOperations
2324
from .operations import ApplicationOperations
@@ -30,8 +31,8 @@
3031
from . import models
3132

3233

33-
class BatchManagement(object):
34-
"""BatchManagement.
34+
class BatchManagementClient(object):
35+
"""Batch Client.
3536
3637
:ivar batch_account: BatchAccountOperations operations
3738
:vartype batch_account: azure.mgmt.batch.operations.BatchAccountOperations
@@ -69,11 +70,12 @@ def __init__(
6970
# type: (...) -> None
7071
if not base_url:
7172
base_url = 'https://management.azure.com'
72-
self._config = BatchManagementConfiguration(credential, subscription_id, **kwargs)
73+
self._config = BatchManagementClientConfiguration(credential, subscription_id, **kwargs)
7374
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7475

7576
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7677
self._serialize = Serializer(client_models)
78+
self._serialize.client_side_validation = False
7779
self._deserialize = Deserializer(client_models)
7880

7981
self.batch_account = BatchAccountOperations(
@@ -95,12 +97,30 @@ def __init__(
9597
self.pool = PoolOperations(
9698
self._client, self._config, self._serialize, self._deserialize)
9799

100+
def _send_request(self, http_request, **kwargs):
101+
# type: (HttpRequest, Any) -> HttpResponse
102+
"""Runs the network request through the client's chained policies.
103+
104+
:param http_request: The network request you want to make. Required.
105+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
106+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
107+
:return: The response of your network call. Does not do error handling on your response.
108+
:rtype: ~azure.core.pipeline.transport.HttpResponse
109+
"""
110+
path_format_arguments = {
111+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
112+
}
113+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
114+
stream = kwargs.pop("stream", True)
115+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
116+
return pipeline_response.http_response
117+
98118
def close(self):
99119
# type: () -> None
100120
self._client.close()
101121

102122
def __enter__(self):
103-
# type: () -> BatchManagement
123+
# type: () -> BatchManagementClient
104124
self._client.__enter__()
105125
return self
106126

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from azure.core.credentials import TokenCredential
2222

2323

24-
class BatchManagementConfiguration(Configuration):
25-
"""Configuration for BatchManagement.
24+
class BatchManagementClientConfiguration(Configuration):
25+
"""Configuration for BatchManagementClient.
2626
2727
Note that all parameters used to create this instance are saved as instance
2828
attributes.
@@ -44,11 +44,11 @@ def __init__(
4444
raise ValueError("Parameter 'credential' must not be None.")
4545
if subscription_id is None:
4646
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(BatchManagementConfiguration, self).__init__(**kwargs)
47+
super(BatchManagementClientConfiguration, self).__init__(**kwargs)
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2021-01-01"
51+
self.api_version = "2021-06-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-batch/{}'.format(VERSION))
5454
self._configure(**kwargs)
Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"chosen_version": "2021-01-01",
3-
"total_api_version_list": ["2021-01-01"],
2+
"chosen_version": "2021-06-01",
3+
"total_api_version_list": ["2021-06-01"],
44
"client": {
5-
"name": "BatchManagement",
6-
"filename": "_batch_management",
7-
"description": "BatchManagement.",
5+
"name": "BatchManagementClient",
6+
"filename": "_batch_management_client",
7+
"description": "Batch Client.",
88
"base_url": "\u0027https://management.azure.com\u0027",
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
12-
"client_side_validation": 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\": [\"BatchManagementClientConfiguration\"]}}, \"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\": [\"BatchManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,28 +30,72 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"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\"]}}}",
98+
"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\"]}}}"
5399
},
54100
"operation_groups": {
55101
"batch_account": "BatchAccountOperations",
@@ -61,9 +107,5 @@
61107
"private_link_resource": "PrivateLinkResourceOperations",
62108
"private_endpoint_connection": "PrivateEndpointConnectionOperations",
63109
"pool": "PoolOperations"
64-
},
65-
"operation_mixins": {
66-
},
67-
"sync_imports": "None",
68-
"async_imports": "None"
110+
}
69111
}

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_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 = "15.0.0"
9+
VERSION = "14.0.0b1"

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/__init__.py

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

9-
from ._batch_management import BatchManagement
10-
__all__ = ['BatchManagement']
9+
from ._batch_management_client import BatchManagementClient
10+
__all__ = ['BatchManagementClient']

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management.py renamed to sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management_client.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
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

1415
if TYPE_CHECKING:
1516
# pylint: disable=unused-import,ungrouped-imports
1617
from azure.core.credentials_async import AsyncTokenCredential
1718

18-
from ._configuration import BatchManagementConfiguration
19+
from ._configuration import BatchManagementClientConfiguration
1920
from .operations import BatchAccountOperations
2021
from .operations import ApplicationPackageOperations
2122
from .operations import ApplicationOperations
@@ -28,8 +29,8 @@
2829
from .. import models
2930

3031

31-
class BatchManagement(object):
32-
"""BatchManagement.
32+
class BatchManagementClient(object):
33+
"""Batch Client.
3334
3435
:ivar batch_account: BatchAccountOperations operations
3536
:vartype batch_account: azure.mgmt.batch.aio.operations.BatchAccountOperations
@@ -66,11 +67,12 @@ def __init__(
6667
) -> None:
6768
if not base_url:
6869
base_url = 'https://management.azure.com'
69-
self._config = BatchManagementConfiguration(credential, subscription_id, **kwargs)
70+
self._config = BatchManagementClientConfiguration(credential, subscription_id, **kwargs)
7071
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7172

7273
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7374
self._serialize = Serializer(client_models)
75+
self._serialize.client_side_validation = False
7476
self._deserialize = Deserializer(client_models)
7577

7678
self.batch_account = BatchAccountOperations(
@@ -92,10 +94,27 @@ def __init__(
9294
self.pool = PoolOperations(
9395
self._client, self._config, self._serialize, self._deserialize)
9496

97+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
98+
"""Runs the network request through the client's chained policies.
99+
100+
:param http_request: The network request you want to make. Required.
101+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
102+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
103+
:return: The response of your network call. Does not do error handling on your response.
104+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
105+
"""
106+
path_format_arguments = {
107+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
108+
}
109+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
110+
stream = kwargs.pop("stream", True)
111+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
112+
return pipeline_response.http_response
113+
95114
async def close(self) -> None:
96115
await self._client.close()
97116

98-
async def __aenter__(self) -> "BatchManagement":
117+
async def __aenter__(self) -> "BatchManagementClient":
99118
await self._client.__aenter__()
100119
return self
101120

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from azure.core.credentials_async import AsyncTokenCredential
2020

2121

22-
class BatchManagementConfiguration(Configuration):
23-
"""Configuration for BatchManagement.
22+
class BatchManagementClientConfiguration(Configuration):
23+
"""Configuration for BatchManagementClient.
2424
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
@@ -41,11 +41,11 @@ def __init__(
4141
raise ValueError("Parameter 'credential' must not be None.")
4242
if subscription_id is None:
4343
raise ValueError("Parameter 'subscription_id' must not be None.")
44-
super(BatchManagementConfiguration, self).__init__(**kwargs)
44+
super(BatchManagementClientConfiguration, self).__init__(**kwargs)
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-01-01"
48+
self.api_version = "2021-06-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-batch/{}'.format(VERSION))
5151
self._configure(**kwargs)

0 commit comments

Comments
 (0)