Skip to content

Commit add6a95

Browse files
author
SDKAuto
committed
CodeGen from PR 32768 in Azure/azure-rest-api-specs
Merge 4eb6cd61b20e626f9a7aa0d29ea6df13160e58aa into 9d92b4dae0a6ac2f23afeffecce650bb008ed688
1 parent 52c99e1 commit add6a95

File tree

18 files changed

+397
-1576
lines changed

18 files changed

+397
-1576
lines changed

sdk/batch/azure-batch/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ include LICENSE
33
include azure/batch/py.typed
44
recursive-include tests *.py
55
recursive-include samples *.py *.md
6-
include azure/__init__.py
6+
include azure/__init__.py

sdk/batch/azure-batch/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "11f9e89eab7159fb3cbcbdb6df91f00d5d87a45b",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/batch/Azure.Batch",
5+
"@azure-tools/typespec-python": "0.42.2"
6+
}

sdk/batch/azure-batch/apiview-properties.json

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

sdk/batch/azure-batch/azure/batch/_model_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
# Licensed under the MIT License. See License.txt in the project root for
6-
# license information.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
78
# --------------------------------------------------------------------------
89
# pylint: disable=protected-access, broad-except
910

sdk/batch/azure-batch/azure/batch/_operations/_operations.py

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,11 @@ def build_batch_enable_pool_auto_scale_request( # pylint: disable=name-too-long
478478
# Construct headers
479479
if ocpdate is not None:
480480
_headers["ocp-date"] = _SERIALIZER.header("ocpdate", ocpdate, "rfc-1123")
481+
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
481482
if if_modified_since is not None:
482483
_headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123")
483484
if if_unmodified_since is not None:
484485
_headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123")
485-
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
486486
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
487487
if_match = prep_if_match(etag, match_condition)
488488
if if_match is not None:
@@ -560,11 +560,11 @@ def build_batch_resize_pool_request(
560560
# Construct headers
561561
if ocpdate is not None:
562562
_headers["ocp-date"] = _SERIALIZER.header("ocpdate", ocpdate, "rfc-1123")
563+
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
563564
if if_modified_since is not None:
564565
_headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123")
565566
if if_unmodified_since is not None:
566567
_headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123")
567-
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
568568
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
569569
if_match = prep_if_match(etag, match_condition)
570570
if if_match is not None:
@@ -690,11 +690,11 @@ def build_batch_remove_nodes_request(
690690
# Construct headers
691691
if ocpdate is not None:
692692
_headers["ocp-date"] = _SERIALIZER.header("ocpdate", ocpdate, "rfc-1123")
693+
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
693694
if if_modified_since is not None:
694695
_headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123")
695696
if if_unmodified_since is not None:
696697
_headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123")
697-
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
698698
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
699699
if_match = prep_if_match(etag, match_condition)
700700
if if_match is not None:
@@ -1013,11 +1013,11 @@ def build_batch_disable_job_request(
10131013
# Construct headers
10141014
if ocpdate is not None:
10151015
_headers["ocp-date"] = _SERIALIZER.header("ocpdate", ocpdate, "rfc-1123")
1016+
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
10161017
if if_modified_since is not None:
10171018
_headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123")
10181019
if if_unmodified_since is not None:
10191020
_headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123")
1020-
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
10211021
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
10221022
if_match = prep_if_match(etag, match_condition)
10231023
if if_match is not None:
@@ -1114,11 +1114,11 @@ def build_batch_terminate_job_request(
11141114
# Construct headers
11151115
if ocpdate is not None:
11161116
_headers["ocp-date"] = _SERIALIZER.header("ocpdate", ocpdate, "rfc-1123")
1117+
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
11171118
if if_modified_since is not None:
11181119
_headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123")
11191120
if if_unmodified_since is not None:
11201121
_headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123")
1121-
_headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str")
11221122
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
11231123
if_match = prep_if_match(etag, match_condition)
11241124
if if_match is not None:
@@ -3387,7 +3387,7 @@ def prepare_request(next_link=None):
33873387

33883388
def extract_data(pipeline_response):
33893389
deserialized = pipeline_response.http_response.json()
3390-
list_of_elem = _deserialize(List[_models.BatchApplication], deserialized["value"])
3390+
list_of_elem = _deserialize(List[_models.BatchApplication], deserialized.get("value", []))
33913391
if cls:
33923392
list_of_elem = cls(list_of_elem) # type: ignore
33933393
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -3610,7 +3610,7 @@ def prepare_request(next_link=None):
36103610

36113611
def extract_data(pipeline_response):
36123612
deserialized = pipeline_response.http_response.json()
3613-
list_of_elem = _deserialize(List[_models.BatchPoolUsageMetrics], deserialized["value"])
3613+
list_of_elem = _deserialize(List[_models.BatchPoolUsageMetrics], deserialized.get("value", []))
36143614
if cls:
36153615
list_of_elem = cls(list_of_elem) # type: ignore
36163616
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -3814,7 +3814,7 @@ def prepare_request(next_link=None):
38143814

38153815
def extract_data(pipeline_response):
38163816
deserialized = pipeline_response.http_response.json()
3817-
list_of_elem = _deserialize(List[_models.BatchPool], deserialized["value"])
3817+
list_of_elem = _deserialize(List[_models.BatchPool], deserialized.get("value", []))
38183818
if cls:
38193819
list_of_elem = cls(list_of_elem) # type: ignore
38203820
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -5101,7 +5101,7 @@ def prepare_request(next_link=None):
51015101

51025102
def extract_data(pipeline_response):
51035103
deserialized = pipeline_response.http_response.json()
5104-
list_of_elem = _deserialize(List[_models.BatchSupportedImage], deserialized["value"])
5104+
list_of_elem = _deserialize(List[_models.BatchSupportedImage], deserialized.get("value", []))
51055105
if cls:
51065106
list_of_elem = cls(list_of_elem) # type: ignore
51075107
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -5214,7 +5214,7 @@ def prepare_request(next_link=None):
52145214

52155215
def extract_data(pipeline_response):
52165216
deserialized = pipeline_response.http_response.json()
5217-
list_of_elem = _deserialize(List[_models.BatchPoolNodeCounts], deserialized["value"])
5217+
list_of_elem = _deserialize(List[_models.BatchPoolNodeCounts], deserialized.get("value", []))
52185218
if cls:
52195219
list_of_elem = cls(list_of_elem) # type: ignore
52205220
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -6249,7 +6249,7 @@ def prepare_request(next_link=None):
62496249

62506250
def extract_data(pipeline_response):
62516251
deserialized = pipeline_response.http_response.json()
6252-
list_of_elem = _deserialize(List[_models.BatchJob], deserialized["value"])
6252+
list_of_elem = _deserialize(List[_models.BatchJob], deserialized.get("value", []))
62536253
if cls:
62546254
list_of_elem = cls(list_of_elem) # type: ignore
62556255
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -6375,7 +6375,7 @@ def prepare_request(next_link=None):
63756375

63766376
def extract_data(pipeline_response):
63776377
deserialized = pipeline_response.http_response.json()
6378-
list_of_elem = _deserialize(List[_models.BatchJob], deserialized["value"])
6378+
list_of_elem = _deserialize(List[_models.BatchJob], deserialized.get("value", []))
63796379
if cls:
63806380
list_of_elem = cls(list_of_elem) # type: ignore
63816381
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -6503,7 +6503,9 @@ def prepare_request(next_link=None):
65036503

65046504
def extract_data(pipeline_response):
65056505
deserialized = pipeline_response.http_response.json()
6506-
list_of_elem = _deserialize(List[_models.BatchJobPreparationAndReleaseTaskStatus], deserialized["value"])
6506+
list_of_elem = _deserialize(
6507+
List[_models.BatchJobPreparationAndReleaseTaskStatus], deserialized.get("value", [])
6508+
)
65076509
if cls:
65086510
list_of_elem = cls(list_of_elem) # type: ignore
65096511
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -6785,7 +6787,7 @@ def prepare_request(next_link=None):
67856787

67866788
def extract_data(pipeline_response):
67876789
deserialized = pipeline_response.http_response.json()
6788-
list_of_elem = _deserialize(List[_models.BatchCertificate], deserialized["value"])
6790+
list_of_elem = _deserialize(List[_models.BatchCertificate], deserialized.get("value", []))
67896791
if cls:
67906792
list_of_elem = cls(list_of_elem) # type: ignore
67916793
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -6991,7 +6993,7 @@ def get_certificate(
69916993
ocpdate: Optional[datetime.datetime] = None,
69926994
select: Optional[List[str]] = None,
69936995
**kwargs: Any
6994-
) -> _models.GetCertificateResponse:
6996+
) -> _models.BatchCertificate:
69956997
"""Gets information about the specified Certificate.
69966998

69976999
:param thumbprint_algorithm: The algorithm used to derive the thumbprint parameter. This must
@@ -7009,8 +7011,8 @@ def get_certificate(
70097011
:paramtype ocpdate: ~datetime.datetime
70107012
:keyword select: An OData $select clause. Default value is None.
70117013
:paramtype select: list[str]
7012-
:return: GetCertificateResponse. The GetCertificateResponse is compatible with MutableMapping
7013-
:rtype: ~azure.batch.models.GetCertificateResponse
7014+
:return: BatchCertificate. The BatchCertificate is compatible with MutableMapping
7015+
:rtype: ~azure.batch.models.BatchCertificate
70147016
:raises ~azure.core.exceptions.HttpResponseError:
70157017
"""
70167018
error_map: MutableMapping = {
@@ -7024,7 +7026,7 @@ def get_certificate(
70247026
_headers = kwargs.pop("headers", {}) or {}
70257027
_params = kwargs.pop("params", {}) or {}
70267028

7027-
cls: ClsType[_models.GetCertificateResponse] = kwargs.pop("cls", None)
7029+
cls: ClsType[_models.BatchCertificate] = kwargs.pop("cls", None)
70287030

70297031
_request = build_batch_get_certificate_request(
70307032
thumbprint_algorithm=thumbprint_algorithm,
@@ -7067,7 +7069,7 @@ def get_certificate(
70677069
if _stream:
70687070
deserialized = response.iter_bytes()
70697071
else:
7070-
deserialized = _deserialize(_models.GetCertificateResponse, response.json())
7072+
deserialized = _deserialize(_models.BatchCertificate, response.json())
70717073

70727074
if cls:
70737075
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -8143,7 +8145,7 @@ def prepare_request(next_link=None):
81438145

81448146
def extract_data(pipeline_response):
81458147
deserialized = pipeline_response.http_response.json()
8146-
list_of_elem = _deserialize(List[_models.BatchJobSchedule], deserialized["value"])
8148+
list_of_elem = _deserialize(List[_models.BatchJobSchedule], deserialized.get("value", []))
81478149
if cls:
81488150
list_of_elem = cls(list_of_elem) # type: ignore
81498151
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -8357,7 +8359,7 @@ def prepare_request(next_link=None):
83578359

83588360
def extract_data(pipeline_response):
83598361
deserialized = pipeline_response.http_response.json()
8360-
list_of_elem = _deserialize(List[_models.BatchTask], deserialized["value"])
8362+
list_of_elem = _deserialize(List[_models.BatchTask], deserialized.get("value", []))
83618363
if cls:
83628364
list_of_elem = cls(list_of_elem) # type: ignore
83638365
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -8936,7 +8938,7 @@ def prepare_request(next_link=None):
89368938

89378939
def extract_data(pipeline_response):
89388940
deserialized = pipeline_response.http_response.json()
8939-
list_of_elem = _deserialize(List[_models.BatchSubtask], deserialized["value"])
8941+
list_of_elem = _deserialize(List[_models.BatchSubtask], deserialized.get("value", []))
89408942
if cls:
89418943
list_of_elem = cls(list_of_elem) # type: ignore
89428944
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -9389,10 +9391,8 @@ def get_task_file(
93899391

93909392
return deserialized # type: ignore
93919393

9392-
# manually renamed
9393-
# rename will be through typespec in next version
93949394
@distributed_trace
9395-
def _get_task_file_properties_internal(
9395+
def get_task_file_properties(
93969396
self,
93979397
job_id: str,
93989398
task_id: str,
@@ -9597,7 +9597,7 @@ def prepare_request(next_link=None):
95979597

95989598
def extract_data(pipeline_response):
95999599
deserialized = pipeline_response.http_response.json()
9600-
list_of_elem = _deserialize(List[_models.BatchNodeFile], deserialized["value"])
9600+
list_of_elem = _deserialize(List[_models.BatchNodeFile], deserialized.get("value", []))
96019601
if cls:
96029602
list_of_elem = cls(list_of_elem) # type: ignore
96039603
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -10811,7 +10811,7 @@ def prepare_request(next_link=None):
1081110811

1081210812
def extract_data(pipeline_response):
1081310813
deserialized = pipeline_response.http_response.json()
10814-
list_of_elem = _deserialize(List[_models.BatchNode], deserialized["value"])
10814+
list_of_elem = _deserialize(List[_models.BatchNode], deserialized.get("value", []))
1081510815
if cls:
1081610816
list_of_elem = cls(list_of_elem) # type: ignore
1081710817
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -11028,7 +11028,7 @@ def prepare_request(next_link=None):
1102811028

1102911029
def extract_data(pipeline_response):
1103011030
deserialized = pipeline_response.http_response.json()
11031-
list_of_elem = _deserialize(List[_models.BatchNodeVMExtension], deserialized["value"])
11031+
list_of_elem = _deserialize(List[_models.BatchNodeVMExtension], deserialized.get("value", []))
1103211032
if cls:
1103311033
list_of_elem = cls(list_of_elem) # type: ignore
1103411034
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)
@@ -11256,10 +11256,8 @@ def get_node_file(
1125611256

1125711257
return deserialized # type: ignore
1125811258

11259-
# manually renamed
11260-
# rename will be through typespec in next version
1126111259
@distributed_trace
11262-
def _get_node_file_properties_internal(
11260+
def get_node_file_properties(
1126311261
self,
1126411262
pool_id: str,
1126511263
node_id: str,
@@ -11462,7 +11460,7 @@ def prepare_request(next_link=None):
1146211460

1146311461
def extract_data(pipeline_response):
1146411462
deserialized = pipeline_response.http_response.json()
11465-
list_of_elem = _deserialize(List[_models.BatchNodeFile], deserialized["value"])
11463+
list_of_elem = _deserialize(List[_models.BatchNodeFile], deserialized.get("value", []))
1146611464
if cls:
1146711465
list_of_elem = cls(list_of_elem) # type: ignore
1146811466
return deserialized.get("odata.nextLink") or None, iter(list_of_elem)

0 commit comments

Comments
 (0)