Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.2.1 (2026-07-07)

### Other Changes

- 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.

Comment thread
ChenxiJiang333 marked this conversation as resolved.
## 1.2.0 (2026-06-20)

### Features Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/computelimit/azure-mgmt-computelimit/_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"apiVersions": {
"Microsoft.ComputeLimit": "2026-07-01"
},
"commit": "18ebae7ea8f6aefd83268aacdb1f480b24842726",
"commit": "723a657f70e944d62515f29a59a914ab911dc32c",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit",
"emitterVersion": "0.63.1",
"httpClientPythonVersion": "^0.32.0"
"emitterVersion": "0.63.2",
"httpClientPythonVersion": "^0.34.1"
}
171 changes: 159 additions & 12 deletions sdk/computelimit/azure-mgmt-computelimit/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace azure.mgmt.computelimit.aio.operations
self,
location: str,
feature_name: str,
body: Optional[JSON] = None,
body: Optional[FeatureEnableRequest] = None,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -161,7 +161,7 @@ namespace azure.mgmt.computelimit.aio.operations
self,
location: str,
guest_subscription_id: str,
resource: JSON,
resource: GuestSubscription,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -228,7 +228,7 @@ namespace azure.mgmt.computelimit.aio.operations
location: str,
vm_family_name: str,
member_subscription_id: str,
resource: JSON,
resource: MemberCapOverride,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -312,7 +312,7 @@ namespace azure.mgmt.computelimit.aio.operations
self,
location: str,
vm_family_name: str,
resource: JSON,
resource: SharedLimitCap,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -371,7 +371,7 @@ namespace azure.mgmt.computelimit.aio.operations
self,
location: str,
vm_family_name: str,
body: JSON,
body: SetMemberCapOverridesRequest,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -413,7 +413,7 @@ namespace azure.mgmt.computelimit.aio.operations
self,
location: str,
name: str,
resource: JSON,
resource: SharedLimit,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -920,7 +920,7 @@ namespace azure.mgmt.computelimit.operations
self,
location: str,
feature_name: str,
body: Optional[JSON] = None,
body: Optional[FeatureEnableRequest] = None,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -979,7 +979,7 @@ namespace azure.mgmt.computelimit.operations
self,
location: str,
guest_subscription_id: str,
resource: JSON,
resource: GuestSubscription,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -1046,7 +1046,7 @@ namespace azure.mgmt.computelimit.operations
location: str,
vm_family_name: str,
member_subscription_id: str,
resource: JSON,
resource: MemberCapOverride,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -1130,7 +1130,7 @@ namespace azure.mgmt.computelimit.operations
self,
location: str,
vm_family_name: str,
resource: JSON,
resource: SharedLimitCap,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -1189,7 +1189,7 @@ namespace azure.mgmt.computelimit.operations
self,
location: str,
vm_family_name: str,
body: JSON,
body: SetMemberCapOverridesRequest,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -1231,7 +1231,7 @@ namespace azure.mgmt.computelimit.operations
self,
location: str,
name: str,
resource: JSON,
resource: SharedLimit,
*,
content_type: str = "application/json",
**kwargs: Any
Expand Down Expand Up @@ -1300,4 +1300,151 @@ namespace azure.mgmt.computelimit.operations
) -> ItemPaged[VmFamily]: ...


namespace azure.mgmt.computelimit.types

class azure.mgmt.computelimit.types.FeatureEnableRequest(TypedDict, total=False):
key "serviceTreeId": str
service_tree_id: str


class azure.mgmt.computelimit.types.GuestSubscription(ProxyResource):
key "id": str
key "name": str
key "properties": ForwardRef('GuestSubscriptionProperties', module='types')
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
properties: GuestSubscriptionProperties
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.GuestSubscriptionProperties(TypedDict, total=False):
key "provisioningState": Union[str, ResourceProvisioningState]
provisioning_state: Union[str, ResourceProvisioningState]


class azure.mgmt.computelimit.types.LimitName(TypedDict, total=False):
key "localizedValue": str
key "value": Required[str]
localized_value: str
value: str


class azure.mgmt.computelimit.types.MemberCap(TypedDict, total=False):
key "cap": Required[int]
key "subscriptionId": Required[str]
cap: int
subscription_id: str


class azure.mgmt.computelimit.types.MemberCapOverride(ProxyResource):
key "id": str
key "name": str
key "properties": ForwardRef('MemberCapOverrideProperties', module='types')
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
properties: MemberCapOverrideProperties
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.MemberCapOverrideProperties(TypedDict, total=False):
key "cap": Required[int]
key "provisioningState": Union[str, ResourceProvisioningState]
cap: int
provisioning_state: Union[str, ResourceProvisioningState]


class azure.mgmt.computelimit.types.ProxyResource(Resource):
key "id": str
key "name": str
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.Resource(TypedDict, total=False):
key "id": str
key "name": str
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.SetMemberCapOverridesRequest(TypedDict, total=False):
key "memberCapOverrides": Required[list[MemberCap]]
member_cap_overrides: list[MemberCap]


class azure.mgmt.computelimit.types.SharedLimit(ProxyResource):
key "id": str
key "name": str
key "properties": ForwardRef('SharedLimitProperties', module='types')
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
properties: SharedLimitProperties
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.SharedLimitCap(ProxyResource):
key "id": str
key "name": str
key "properties": ForwardRef('SharedLimitCapProperties', module='types')
key "systemData": ForwardRef('SystemData', module='types')
key "type": str
id: str
name: str
properties: SharedLimitCapProperties
system_data: SystemData
type: str


class azure.mgmt.computelimit.types.SharedLimitCapProperties(TypedDict, total=False):
key "defaultMemberCap": int
key "isBoundedCap": Required[bool]
key "provisioningState": Union[str, ResourceProvisioningState]
default_member_cap: int
is_bounded_cap: bool
provisioning_state: Union[str, ResourceProvisioningState]


class azure.mgmt.computelimit.types.SharedLimitProperties(TypedDict, total=False):
key "limit": int
key "provisioningState": Union[str, ResourceProvisioningState]
key "resourceName": ForwardRef('LimitName', module='types')
key "unit": str
limit: int
provisioning_state: Union[str, ResourceProvisioningState]
resource_name: LimitName
unit: str


class azure.mgmt.computelimit.types.SystemData(TypedDict, total=False):
key "createdAt": str
key "createdBy": str
key "createdByType": Union[str, CreatedByType]
key "lastModifiedAt": str
key "lastModifiedBy": str
key "lastModifiedByType": Union[str, CreatedByType]
created_at: str
created_by: str
created_by_type: Union[str, CreatedByType]
last_modified_at: str
last_modified_by: str
last_modified_by_type: Union[str, CreatedByType]


```
4 changes: 2 additions & 2 deletions sdk/computelimit/azure-mgmt-computelimit/api.metadata.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
apiMdSha256: 2f646c9516086482d09d0963c173413635c4faf3038ad1ef694ca86ddde9c0b7
apiMdSha256: d1b3b06ccae9f908925c5895d676a4a1516d1634b6823252a256a503f434b370
parserVersion: 0.3.28
pythonVersion: 3.13.13
pythonVersion: 3.13.14
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@
"azure.mgmt.computelimit.operations.MemberCapOverridesOperations.list_by_parent": "Microsoft.ComputeLimit.MemberCapOverrides.listByParent",
"azure.mgmt.computelimit.aio.operations.MemberCapOverridesOperations.list_by_parent": "Microsoft.ComputeLimit.MemberCapOverrides.listByParent"
},
"CrossLanguageVersion": "93dafd596341"
"CrossLanguageVersion": "b7b6a993f3b0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str:
return encoded


def _serialize_duration(td: timedelta, format: typing.Optional[str] = None):
"""Serialize a timedelta to its wire representation.

For the ``seconds``/``milliseconds`` encodings the value is converted to a
numeric value, otherwise it falls back to an ISO 8601 duration string.

:param timedelta td: The timedelta to serialize.
:param str format: The duration encoding format.
:rtype: int or float or str
:return: serialized duration
"""
seconds = td.total_seconds()
if format == "duration-seconds-int":
return int(seconds)
if format == "duration-seconds-float":
return seconds
if format == "duration-milliseconds-int":
return int(seconds * 1000)
if format == "duration-milliseconds-float":
return seconds * 1000
return _timedelta_as_isostr(td)


def _serialize_datetime(o, format: typing.Optional[str] = None):
if hasattr(o, "year") and hasattr(o, "hour"):
if format == "rfc7231":
Expand Down Expand Up @@ -301,6 +324,12 @@ def _deserialize_duration(attr):
return isodate.parse_duration(attr)


def _deserialize_duration_numeric(attr, unit):
if isinstance(attr, timedelta):
return attr
return timedelta(**{unit: float(attr)})


def _deserialize_decimal(attr):
if isinstance(attr, decimal.Decimal):
return attr
Expand Down Expand Up @@ -330,6 +359,10 @@ def _deserialize_int_as_str(attr):
"unix-timestamp": _deserialize_datetime_unix_timestamp,
"base64": _deserialize_bytes,
"base64url": _deserialize_bytes_base64,
"duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"),
"duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"),
"duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"),
"duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"),
}


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