Skip to content

Commit 3bdc11a

Browse files
author
SDKAuto
committed
CodeGen from PR 14830 in Azure/azure-rest-api-specs
Merge d98744647dd59d2a657b878285b5b4b6e45be3dd into c2e43f8
1 parent 074f36d commit 3bdc11a

22 files changed

+391
-189
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.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "91dda01ac49af2d6559483101b8335bcbc4ca4ab",
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.2",
10+
"readme": "specification/batch/resource-manager/readme.md"
11+
}

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

Lines changed: 20 additions & 0 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 BatchManagementConfiguration
2122
from .operations import BatchAccountOperations
@@ -74,6 +75,7 @@ def __init__(
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,6 +97,24 @@ 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()

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

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
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\": [\"BatchManagementConfiguration\"]}}, \"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\": [\"BatchManagementConfiguration\"]}}, \"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/_batch_management.py

Lines changed: 19 additions & 0 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

@@ -71,6 +72,7 @@ def __init__(
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,6 +94,23 @@ 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

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def create(
4747
account_name: str,
4848
application_name: str,
4949
parameters: Optional["_models.Application"] = None,
50-
**kwargs
50+
**kwargs: Any
5151
) -> "_models.Application":
5252
"""Adds an application to the specified Batch account.
5353
@@ -119,7 +119,7 @@ async def delete(
119119
resource_group_name: str,
120120
account_name: str,
121121
application_name: str,
122-
**kwargs
122+
**kwargs: Any
123123
) -> None:
124124
"""Deletes an application.
125125
@@ -178,7 +178,7 @@ async def get(
178178
resource_group_name: str,
179179
account_name: str,
180180
application_name: str,
181-
**kwargs
181+
**kwargs: Any
182182
) -> "_models.Application":
183183
"""Gets information about the specified application.
184184
@@ -241,7 +241,7 @@ async def update(
241241
account_name: str,
242242
application_name: str,
243243
parameters: "_models.Application",
244-
**kwargs
244+
**kwargs: Any
245245
) -> "_models.Application":
246246
"""Updates settings for the specified application.
247247
@@ -310,7 +310,7 @@ def list(
310310
resource_group_name: str,
311311
account_name: str,
312312
maxresults: Optional[int] = None,
313-
**kwargs
313+
**kwargs: Any
314314
) -> AsyncIterable["_models.ListApplicationsResult"]:
315315
"""Lists all of the applications in the specified account.
316316

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def activate(
4848
application_name: str,
4949
version_name: str,
5050
parameters: "_models.ActivateApplicationPackageParameters",
51-
**kwargs
51+
**kwargs: Any
5252
) -> "_models.ApplicationPackage":
5353
"""Activates the specified application package. This should be done after the
5454
``ApplicationPackage`` was created and uploaded. This needs to be done before an
@@ -124,7 +124,7 @@ async def create(
124124
application_name: str,
125125
version_name: str,
126126
parameters: Optional["_models.ApplicationPackage"] = None,
127-
**kwargs
127+
**kwargs: Any
128128
) -> "_models.ApplicationPackage":
129129
"""Creates an application package record. The record contains the SAS where the package should be
130130
uploaded to. Once it is uploaded the ``ApplicationPackage`` needs to be activated using
@@ -202,7 +202,7 @@ async def delete(
202202
account_name: str,
203203
application_name: str,
204204
version_name: str,
205-
**kwargs
205+
**kwargs: Any
206206
) -> None:
207207
"""Deletes an application package record and its associated binary file.
208208
@@ -265,7 +265,7 @@ async def get(
265265
account_name: str,
266266
application_name: str,
267267
version_name: str,
268-
**kwargs
268+
**kwargs: Any
269269
) -> "_models.ApplicationPackage":
270270
"""Gets information about the specified application package.
271271
@@ -331,7 +331,7 @@ def list(
331331
account_name: str,
332332
application_name: str,
333333
maxresults: Optional[int] = None,
334-
**kwargs
334+
**kwargs: Any
335335
) -> AsyncIterable["_models.ListApplicationPackagesResult"]:
336336
"""Lists all of the application packages in the specified application.
337337

0 commit comments

Comments
 (0)