Skip to content

Commit e38d018

Browse files
azure-sdk-automation[bot]azure-sdkyanle66Copilotmsyyc
authored
[AutoPR azure-mgmt-computelimit]-generated-from-SDK Generation - Python-6531405 (#47921)
* Configurations: 'specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit/tspconfig.yaml', SDK Release Type: stable, and CommitSHA: '723a657f70e944d62515f29a59a914ab911dc32c' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6531405 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Fix CHANGELOG.md for azure-mgmt-computelimit 1.3.0 release Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @msyyc * Apply suggestion from @msyyc --------- Co-authored-by: azure-sdk <azuresdk@microsoft.com> Co-authored-by: Le Yang <yanle@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 0ccf783 commit e38d018

12 files changed

Lines changed: 799 additions & 109 deletions

File tree

sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.2.1 (2026-07-07)
4+
5+
### Other Changes
6+
7+
- Added `azure.mgmt.computelimit.types` module with `TypedDict` definitions (e.g. `GuestSubscription`, `SharedLimit`, `SharedLimitCap`, `MemberCapOverride`, `SetMemberCapOverridesRequest`, `FeatureEnableRequest`) that can be used in place of raw `JSON` when calling operations, providing better editor autocompletion and type checking.
8+
39
## 1.2.0 (2026-06-20)
410

511
### Features Added

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"apiVersions": {
44
"Microsoft.ComputeLimit": "2026-07-01"
55
},
6-
"commit": "18ebae7ea8f6aefd83268aacdb1f480b24842726",
6+
"commit": "723a657f70e944d62515f29a59a914ab911dc32c",
77
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
88
"typespec_src": "specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit",
9-
"emitterVersion": "0.63.1",
10-
"httpClientPythonVersion": "^0.32.0"
9+
"emitterVersion": "0.63.2",
10+
"httpClientPythonVersion": "^0.34.1"
1111
}

sdk/computelimit/azure-mgmt-computelimit/api.md

Lines changed: 159 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace azure.mgmt.computelimit.aio.operations
102102
self,
103103
location: str,
104104
feature_name: str,
105-
body: Optional[JSON] = None,
105+
body: Optional[FeatureEnableRequest] = None,
106106
*,
107107
content_type: str = "application/json",
108108
**kwargs: Any
@@ -161,7 +161,7 @@ namespace azure.mgmt.computelimit.aio.operations
161161
self,
162162
location: str,
163163
guest_subscription_id: str,
164-
resource: JSON,
164+
resource: GuestSubscription,
165165
*,
166166
content_type: str = "application/json",
167167
**kwargs: Any
@@ -228,7 +228,7 @@ namespace azure.mgmt.computelimit.aio.operations
228228
location: str,
229229
vm_family_name: str,
230230
member_subscription_id: str,
231-
resource: JSON,
231+
resource: MemberCapOverride,
232232
*,
233233
content_type: str = "application/json",
234234
**kwargs: Any
@@ -312,7 +312,7 @@ namespace azure.mgmt.computelimit.aio.operations
312312
self,
313313
location: str,
314314
vm_family_name: str,
315-
resource: JSON,
315+
resource: SharedLimitCap,
316316
*,
317317
content_type: str = "application/json",
318318
**kwargs: Any
@@ -371,7 +371,7 @@ namespace azure.mgmt.computelimit.aio.operations
371371
self,
372372
location: str,
373373
vm_family_name: str,
374-
body: JSON,
374+
body: SetMemberCapOverridesRequest,
375375
*,
376376
content_type: str = "application/json",
377377
**kwargs: Any
@@ -413,7 +413,7 @@ namespace azure.mgmt.computelimit.aio.operations
413413
self,
414414
location: str,
415415
name: str,
416-
resource: JSON,
416+
resource: SharedLimit,
417417
*,
418418
content_type: str = "application/json",
419419
**kwargs: Any
@@ -920,7 +920,7 @@ namespace azure.mgmt.computelimit.operations
920920
self,
921921
location: str,
922922
feature_name: str,
923-
body: Optional[JSON] = None,
923+
body: Optional[FeatureEnableRequest] = None,
924924
*,
925925
content_type: str = "application/json",
926926
**kwargs: Any
@@ -979,7 +979,7 @@ namespace azure.mgmt.computelimit.operations
979979
self,
980980
location: str,
981981
guest_subscription_id: str,
982-
resource: JSON,
982+
resource: GuestSubscription,
983983
*,
984984
content_type: str = "application/json",
985985
**kwargs: Any
@@ -1046,7 +1046,7 @@ namespace azure.mgmt.computelimit.operations
10461046
location: str,
10471047
vm_family_name: str,
10481048
member_subscription_id: str,
1049-
resource: JSON,
1049+
resource: MemberCapOverride,
10501050
*,
10511051
content_type: str = "application/json",
10521052
**kwargs: Any
@@ -1130,7 +1130,7 @@ namespace azure.mgmt.computelimit.operations
11301130
self,
11311131
location: str,
11321132
vm_family_name: str,
1133-
resource: JSON,
1133+
resource: SharedLimitCap,
11341134
*,
11351135
content_type: str = "application/json",
11361136
**kwargs: Any
@@ -1189,7 +1189,7 @@ namespace azure.mgmt.computelimit.operations
11891189
self,
11901190
location: str,
11911191
vm_family_name: str,
1192-
body: JSON,
1192+
body: SetMemberCapOverridesRequest,
11931193
*,
11941194
content_type: str = "application/json",
11951195
**kwargs: Any
@@ -1231,7 +1231,7 @@ namespace azure.mgmt.computelimit.operations
12311231
self,
12321232
location: str,
12331233
name: str,
1234-
resource: JSON,
1234+
resource: SharedLimit,
12351235
*,
12361236
content_type: str = "application/json",
12371237
**kwargs: Any
@@ -1300,4 +1300,151 @@ namespace azure.mgmt.computelimit.operations
13001300
) -> ItemPaged[VmFamily]: ...
13011301

13021302

1303+
namespace azure.mgmt.computelimit.types
1304+
1305+
class azure.mgmt.computelimit.types.FeatureEnableRequest(TypedDict, total=False):
1306+
key "serviceTreeId": str
1307+
service_tree_id: str
1308+
1309+
1310+
class azure.mgmt.computelimit.types.GuestSubscription(ProxyResource):
1311+
key "id": str
1312+
key "name": str
1313+
key "properties": ForwardRef('GuestSubscriptionProperties', module='types')
1314+
key "systemData": ForwardRef('SystemData', module='types')
1315+
key "type": str
1316+
id: str
1317+
name: str
1318+
properties: GuestSubscriptionProperties
1319+
system_data: SystemData
1320+
type: str
1321+
1322+
1323+
class azure.mgmt.computelimit.types.GuestSubscriptionProperties(TypedDict, total=False):
1324+
key "provisioningState": Union[str, ResourceProvisioningState]
1325+
provisioning_state: Union[str, ResourceProvisioningState]
1326+
1327+
1328+
class azure.mgmt.computelimit.types.LimitName(TypedDict, total=False):
1329+
key "localizedValue": str
1330+
key "value": Required[str]
1331+
localized_value: str
1332+
value: str
1333+
1334+
1335+
class azure.mgmt.computelimit.types.MemberCap(TypedDict, total=False):
1336+
key "cap": Required[int]
1337+
key "subscriptionId": Required[str]
1338+
cap: int
1339+
subscription_id: str
1340+
1341+
1342+
class azure.mgmt.computelimit.types.MemberCapOverride(ProxyResource):
1343+
key "id": str
1344+
key "name": str
1345+
key "properties": ForwardRef('MemberCapOverrideProperties', module='types')
1346+
key "systemData": ForwardRef('SystemData', module='types')
1347+
key "type": str
1348+
id: str
1349+
name: str
1350+
properties: MemberCapOverrideProperties
1351+
system_data: SystemData
1352+
type: str
1353+
1354+
1355+
class azure.mgmt.computelimit.types.MemberCapOverrideProperties(TypedDict, total=False):
1356+
key "cap": Required[int]
1357+
key "provisioningState": Union[str, ResourceProvisioningState]
1358+
cap: int
1359+
provisioning_state: Union[str, ResourceProvisioningState]
1360+
1361+
1362+
class azure.mgmt.computelimit.types.ProxyResource(Resource):
1363+
key "id": str
1364+
key "name": str
1365+
key "systemData": ForwardRef('SystemData', module='types')
1366+
key "type": str
1367+
id: str
1368+
name: str
1369+
system_data: SystemData
1370+
type: str
1371+
1372+
1373+
class azure.mgmt.computelimit.types.Resource(TypedDict, total=False):
1374+
key "id": str
1375+
key "name": str
1376+
key "systemData": ForwardRef('SystemData', module='types')
1377+
key "type": str
1378+
id: str
1379+
name: str
1380+
system_data: SystemData
1381+
type: str
1382+
1383+
1384+
class azure.mgmt.computelimit.types.SetMemberCapOverridesRequest(TypedDict, total=False):
1385+
key "memberCapOverrides": Required[list[MemberCap]]
1386+
member_cap_overrides: list[MemberCap]
1387+
1388+
1389+
class azure.mgmt.computelimit.types.SharedLimit(ProxyResource):
1390+
key "id": str
1391+
key "name": str
1392+
key "properties": ForwardRef('SharedLimitProperties', module='types')
1393+
key "systemData": ForwardRef('SystemData', module='types')
1394+
key "type": str
1395+
id: str
1396+
name: str
1397+
properties: SharedLimitProperties
1398+
system_data: SystemData
1399+
type: str
1400+
1401+
1402+
class azure.mgmt.computelimit.types.SharedLimitCap(ProxyResource):
1403+
key "id": str
1404+
key "name": str
1405+
key "properties": ForwardRef('SharedLimitCapProperties', module='types')
1406+
key "systemData": ForwardRef('SystemData', module='types')
1407+
key "type": str
1408+
id: str
1409+
name: str
1410+
properties: SharedLimitCapProperties
1411+
system_data: SystemData
1412+
type: str
1413+
1414+
1415+
class azure.mgmt.computelimit.types.SharedLimitCapProperties(TypedDict, total=False):
1416+
key "defaultMemberCap": int
1417+
key "isBoundedCap": Required[bool]
1418+
key "provisioningState": Union[str, ResourceProvisioningState]
1419+
default_member_cap: int
1420+
is_bounded_cap: bool
1421+
provisioning_state: Union[str, ResourceProvisioningState]
1422+
1423+
1424+
class azure.mgmt.computelimit.types.SharedLimitProperties(TypedDict, total=False):
1425+
key "limit": int
1426+
key "provisioningState": Union[str, ResourceProvisioningState]
1427+
key "resourceName": ForwardRef('LimitName', module='types')
1428+
key "unit": str
1429+
limit: int
1430+
provisioning_state: Union[str, ResourceProvisioningState]
1431+
resource_name: LimitName
1432+
unit: str
1433+
1434+
1435+
class azure.mgmt.computelimit.types.SystemData(TypedDict, total=False):
1436+
key "createdAt": str
1437+
key "createdBy": str
1438+
key "createdByType": Union[str, CreatedByType]
1439+
key "lastModifiedAt": str
1440+
key "lastModifiedBy": str
1441+
key "lastModifiedByType": Union[str, CreatedByType]
1442+
created_at: str
1443+
created_by: str
1444+
created_by_type: Union[str, CreatedByType]
1445+
last_modified_at: str
1446+
last_modified_by: str
1447+
last_modified_by_type: Union[str, CreatedByType]
1448+
1449+
13031450
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
apiMdSha256: 2f646c9516086482d09d0963c173413635c4faf3038ad1ef694ca86ddde9c0b7
1+
apiMdSha256: d1b3b06ccae9f908925c5895d676a4a1516d1634b6823252a256a503f434b370
22
parserVersion: 0.3.28
3-
pythonVersion: 3.13.13
3+
pythonVersion: 3.13.14

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@
8181
"azure.mgmt.computelimit.operations.MemberCapOverridesOperations.list_by_parent": "Microsoft.ComputeLimit.MemberCapOverrides.listByParent",
8282
"azure.mgmt.computelimit.aio.operations.MemberCapOverridesOperations.list_by_parent": "Microsoft.ComputeLimit.MemberCapOverrides.listByParent"
8383
},
84-
"CrossLanguageVersion": "93dafd596341"
84+
"CrossLanguageVersion": "b7b6a993f3b0"
8585
}

sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/model_base.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str:
109109
return encoded
110110

111111

112+
def _serialize_duration(td: timedelta, format: typing.Optional[str] = None):
113+
"""Serialize a timedelta to its wire representation.
114+
115+
For the ``seconds``/``milliseconds`` encodings the value is converted to a
116+
numeric value, otherwise it falls back to an ISO 8601 duration string.
117+
118+
:param timedelta td: The timedelta to serialize.
119+
:param str format: The duration encoding format.
120+
:rtype: int or float or str
121+
:return: serialized duration
122+
"""
123+
seconds = td.total_seconds()
124+
if format == "duration-seconds-int":
125+
return int(seconds)
126+
if format == "duration-seconds-float":
127+
return seconds
128+
if format == "duration-milliseconds-int":
129+
return int(seconds * 1000)
130+
if format == "duration-milliseconds-float":
131+
return seconds * 1000
132+
return _timedelta_as_isostr(td)
133+
134+
112135
def _serialize_datetime(o, format: typing.Optional[str] = None):
113136
if hasattr(o, "year") and hasattr(o, "hour"):
114137
if format == "rfc7231":
@@ -301,6 +324,12 @@ def _deserialize_duration(attr):
301324
return isodate.parse_duration(attr)
302325

303326

327+
def _deserialize_duration_numeric(attr, unit):
328+
if isinstance(attr, timedelta):
329+
return attr
330+
return timedelta(**{unit: float(attr)})
331+
332+
304333
def _deserialize_decimal(attr):
305334
if isinstance(attr, decimal.Decimal):
306335
return attr
@@ -330,6 +359,10 @@ def _deserialize_int_as_str(attr):
330359
"unix-timestamp": _deserialize_datetime_unix_timestamp,
331360
"base64": _deserialize_bytes,
332361
"base64url": _deserialize_bytes_base64,
362+
"duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"),
363+
"duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"),
364+
"duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"),
365+
"duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"),
333366
}
334367

335368

@@ -564,7 +597,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m
564597
pass
565598
# Last, try datetime.timedelta
566599
try:
567-
return _timedelta_as_isostr(o)
600+
return _serialize_duration(o, format)
568601
except AttributeError:
569602
# This will be raised when it hits value.total_seconds in the method above
570603
pass

0 commit comments

Comments
 (0)