diff --git a/sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md b/sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md index 7529d367127e..6d8c7a64d0bd 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md +++ b/sdk/computelimit/azure-mgmt-computelimit/CHANGELOG.md @@ -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. + ## 1.2.0 (2026-06-20) ### Features Added diff --git a/sdk/computelimit/azure-mgmt-computelimit/_metadata.json b/sdk/computelimit/azure-mgmt-computelimit/_metadata.json index 9a7869297472..094e2ddfbcf7 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/_metadata.json +++ b/sdk/computelimit/azure-mgmt-computelimit/_metadata.json @@ -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" } \ No newline at end of file diff --git a/sdk/computelimit/azure-mgmt-computelimit/api.md b/sdk/computelimit/azure-mgmt-computelimit/api.md index a8e3c8d27556..f047cb542628 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/api.md +++ b/sdk/computelimit/azure-mgmt-computelimit/api.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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] + + ``` \ No newline at end of file diff --git a/sdk/computelimit/azure-mgmt-computelimit/api.metadata.yml b/sdk/computelimit/azure-mgmt-computelimit/api.metadata.yml index 04292e89dd38..4106bc8990ac 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/api.metadata.yml +++ b/sdk/computelimit/azure-mgmt-computelimit/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 2f646c9516086482d09d0963c173413635c4faf3038ad1ef694ca86ddde9c0b7 +apiMdSha256: d1b3b06ccae9f908925c5895d676a4a1516d1634b6823252a256a503f434b370 parserVersion: 0.3.28 -pythonVersion: 3.13.13 +pythonVersion: 3.13.14 diff --git a/sdk/computelimit/azure-mgmt-computelimit/apiview-properties.json b/sdk/computelimit/azure-mgmt-computelimit/apiview-properties.json index 9169f4a28623..47b6d9df9deb 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/apiview-properties.json +++ b/sdk/computelimit/azure-mgmt-computelimit/apiview-properties.json @@ -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" } \ No newline at end of file diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/model_base.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/model_base.py index d725c55906d3..b93f5120d517 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/model_base.py +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/model_base.py @@ -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": @@ -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 @@ -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"), } @@ -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 diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/serialization.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/serialization.py index a088671e9c51..75906e2eb77f 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/serialization.py +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_utils/serialization.py @@ -520,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1109,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1381,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1393,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1954,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_version.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_version.py index a73f358d285a..67abacd47f96 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_version.py +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0" +VERSION = "1.2.1" diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/aio/operations/_operations.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/aio/operations/_operations.py index 6575ffb1882f..c8f30081b78b 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/aio/operations/_operations.py +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -67,7 +67,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list @@ -298,7 +297,7 @@ async def create( self, location: str, guest_subscription_id: str, - resource: JSON, + resource: _types.GuestSubscription, *, content_type: str = "application/json", **kwargs: Any @@ -310,7 +309,7 @@ async def create( :param guest_subscription_id: The name of the GuestSubscription. Required. :type guest_subscription_id: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.GuestSubscription :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -350,7 +349,7 @@ async def create( self, location: str, guest_subscription_id: str, - resource: Union[_models.GuestSubscription, JSON, IO[bytes]], + resource: Union[_models.GuestSubscription, _types.GuestSubscription, IO[bytes]], **kwargs: Any ) -> _models.GuestSubscription: """Adds a subscription as a guest to consume the compute limits shared by the host subscription. @@ -359,9 +358,10 @@ async def create( :type location: str :param guest_subscription_id: The name of the GuestSubscription. Required. :type guest_subscription_id: str - :param resource: Resource create parameters. Is one of the following types: GuestSubscription, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.GuestSubscription or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a GuestSubscription type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.GuestSubscription or + ~azure.mgmt.computelimit.types.GuestSubscription or IO[bytes] :return: GuestSubscription. The GuestSubscription is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.GuestSubscription :raises ~azure.core.exceptions.HttpResponseError: @@ -705,7 +705,13 @@ async def create( @overload async def create( - self, location: str, name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + name: str, + resource: _types.SharedLimit, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SharedLimit: """Enables sharing of a compute limit by the host subscription with its guest subscriptions. @@ -714,7 +720,7 @@ async def create( :param name: The name of the SharedLimit. Required. :type name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.SharedLimit :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -745,7 +751,11 @@ async def create( @distributed_trace_async async def create( - self, location: str, name: str, resource: Union[_models.SharedLimit, JSON, IO[bytes]], **kwargs: Any + self, + location: str, + name: str, + resource: Union[_models.SharedLimit, _types.SharedLimit, IO[bytes]], + **kwargs: Any ) -> _models.SharedLimit: """Enables sharing of a compute limit by the host subscription with its guest subscriptions. @@ -753,9 +763,10 @@ async def create( :type location: str :param name: The name of the SharedLimit. Required. :type name: str - :param resource: Resource create parameters. Is one of the following types: SharedLimit, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.SharedLimit or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a SharedLimit type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.computelimit.models.SharedLimit or + ~azure.mgmt.computelimit.types.SharedLimit or IO[bytes] :return: SharedLimit. The SharedLimit is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SharedLimit :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1196,7 @@ async def _enable_initial( self, location: str, feature_name: str, - body: Optional[Union[_models.FeatureEnableRequest, JSON, IO[bytes]]] = None, + body: Optional[Union[_models.FeatureEnableRequest, _types.FeatureEnableRequest, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1270,7 +1281,8 @@ async def begin_enable( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -1293,19 +1305,20 @@ async def begin_enable( self, location: str, feature_name: str, - body: Optional[JSON] = None, + body: Optional[_types.FeatureEnableRequest] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str :param feature_name: The name of the Feature. Required. :type feature_name: str :param body: The content of the action request. Default value is None. - :type body: JSON + :type body: ~azure.mgmt.computelimit.types.FeatureEnableRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1326,7 +1339,8 @@ async def begin_enable( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -1356,18 +1370,20 @@ async def begin_enable( self, location: str, feature_name: str, - body: Optional[Union[_models.FeatureEnableRequest, JSON, IO[bytes]]] = None, + body: Optional[Union[_models.FeatureEnableRequest, _types.FeatureEnableRequest, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str :param feature_name: The name of the Feature. Required. :type feature_name: str - :param body: The content of the action request. Is one of the following types: - FeatureEnableRequest, JSON, IO[bytes] Default value is None. - :type body: ~azure.mgmt.computelimit.models.FeatureEnableRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a FeatureEnableRequest type or a + IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.computelimit.models.FeatureEnableRequest or + ~azure.mgmt.computelimit.types.FeatureEnableRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -1500,7 +1516,8 @@ async def _disable_initial(self, location: str, feature_name: str, **kwargs: Any async def begin_disable( self, location: str, feature_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Disables a compute limit feature for the subscription at the specified location. + """Disables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -1885,7 +1902,7 @@ async def create_or_update( self, location: str, vm_family_name: str, - resource: JSON, + resource: _types.SharedLimitCap, *, content_type: str = "application/json", **kwargs: Any @@ -1897,7 +1914,7 @@ async def create_or_update( :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.SharedLimitCap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1944,7 +1961,7 @@ async def create_or_update( self, location: str, vm_family_name: str, - resource: Union[_models.SharedLimitCap, JSON, IO[bytes]], + resource: Union[_models.SharedLimitCap, _types.SharedLimitCap, IO[bytes]], **kwargs: Any ) -> _models.SharedLimitCap: """Creates or replaces the shared limit cap configuration for a VM family. @@ -1953,9 +1970,10 @@ async def create_or_update( :type location: str :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str - :param resource: Resource create parameters. Is one of the following types: SharedLimitCap, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.SharedLimitCap or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a SharedLimitCap type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.SharedLimitCap or + ~azure.mgmt.computelimit.types.SharedLimitCap or IO[bytes] :return: SharedLimitCap. The SharedLimitCap is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SharedLimitCap :raises ~azure.core.exceptions.HttpResponseError: @@ -2223,7 +2241,13 @@ async def set_member_cap_overrides( @overload async def set_member_cap_overrides( - self, location: str, vm_family_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + vm_family_name: str, + body: _types.SetMemberCapOverridesRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SetMemberCapOverridesResult: """Replaces the full set of per-member cap overrides for this shared limit cap. The supplied array becomes the new complete set of overrides; supplying an empty array clears all existing @@ -2234,7 +2258,7 @@ async def set_member_cap_overrides( :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str :param body: The content of the action request. Required. - :type body: JSON + :type body: ~azure.mgmt.computelimit.types.SetMemberCapOverridesRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2285,7 +2309,7 @@ async def set_member_cap_overrides( self, location: str, vm_family_name: str, - body: Union[_models.SetMemberCapOverridesRequest, JSON, IO[bytes]], + body: Union[_models.SetMemberCapOverridesRequest, _types.SetMemberCapOverridesRequest, IO[bytes]], **kwargs: Any ) -> _models.SetMemberCapOverridesResult: """Replaces the full set of per-member cap overrides for this shared limit cap. The supplied array @@ -2296,9 +2320,10 @@ async def set_member_cap_overrides( :type location: str :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str - :param body: The content of the action request. Is one of the following types: - SetMemberCapOverridesRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.computelimit.models.SetMemberCapOverridesRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a SetMemberCapOverridesRequest type + or a IO[bytes] type. Required. + :type body: ~azure.mgmt.computelimit.models.SetMemberCapOverridesRequest or + ~azure.mgmt.computelimit.types.SetMemberCapOverridesRequest or IO[bytes] :return: SetMemberCapOverridesResult. The SetMemberCapOverridesResult is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SetMemberCapOverridesResult @@ -2512,7 +2537,7 @@ async def create_or_update( location: str, vm_family_name: str, member_subscription_id: str, - resource: JSON, + resource: _types.MemberCapOverride, *, content_type: str = "application/json", **kwargs: Any @@ -2526,7 +2551,7 @@ async def create_or_update( :param member_subscription_id: The name of the MemberCapOverride. Required. :type member_subscription_id: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.MemberCapOverride :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2585,7 +2610,7 @@ async def create_or_update( location: str, vm_family_name: str, member_subscription_id: str, - resource: Union[_models.MemberCapOverride, JSON, IO[bytes]], + resource: Union[_models.MemberCapOverride, _types.MemberCapOverride, IO[bytes]], **kwargs: Any ) -> _models.MemberCapOverride: """Creates or replaces the cap override for a single member subscription. @@ -2596,9 +2621,10 @@ async def create_or_update( :type vm_family_name: str :param member_subscription_id: The name of the MemberCapOverride. Required. :type member_subscription_id: str - :param resource: Resource create parameters. Is one of the following types: MemberCapOverride, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.MemberCapOverride or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a MemberCapOverride type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.MemberCapOverride or + ~azure.mgmt.computelimit.types.MemberCapOverride or IO[bytes] :return: MemberCapOverride. The MemberCapOverride is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.MemberCapOverride :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/operations/_operations.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/operations/_operations.py index b387068ede5a..319ffb6e932c 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/operations/_operations.py +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import ComputeLimitMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -923,7 +922,7 @@ def create( self, location: str, guest_subscription_id: str, - resource: JSON, + resource: _types.GuestSubscription, *, content_type: str = "application/json", **kwargs: Any @@ -935,7 +934,7 @@ def create( :param guest_subscription_id: The name of the GuestSubscription. Required. :type guest_subscription_id: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.GuestSubscription :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -975,7 +974,7 @@ def create( self, location: str, guest_subscription_id: str, - resource: Union[_models.GuestSubscription, JSON, IO[bytes]], + resource: Union[_models.GuestSubscription, _types.GuestSubscription, IO[bytes]], **kwargs: Any ) -> _models.GuestSubscription: """Adds a subscription as a guest to consume the compute limits shared by the host subscription. @@ -984,9 +983,10 @@ def create( :type location: str :param guest_subscription_id: The name of the GuestSubscription. Required. :type guest_subscription_id: str - :param resource: Resource create parameters. Is one of the following types: GuestSubscription, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.GuestSubscription or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a GuestSubscription type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.GuestSubscription or + ~azure.mgmt.computelimit.types.GuestSubscription or IO[bytes] :return: GuestSubscription. The GuestSubscription is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.GuestSubscription :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1331,13 @@ def create( @overload def create( - self, location: str, name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + name: str, + resource: _types.SharedLimit, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SharedLimit: """Enables sharing of a compute limit by the host subscription with its guest subscriptions. @@ -1340,7 +1346,7 @@ def create( :param name: The name of the SharedLimit. Required. :type name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.SharedLimit :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1371,7 +1377,11 @@ def create( @distributed_trace def create( - self, location: str, name: str, resource: Union[_models.SharedLimit, JSON, IO[bytes]], **kwargs: Any + self, + location: str, + name: str, + resource: Union[_models.SharedLimit, _types.SharedLimit, IO[bytes]], + **kwargs: Any ) -> _models.SharedLimit: """Enables sharing of a compute limit by the host subscription with its guest subscriptions. @@ -1379,9 +1389,10 @@ def create( :type location: str :param name: The name of the SharedLimit. Required. :type name: str - :param resource: Resource create parameters. Is one of the following types: SharedLimit, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.SharedLimit or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a SharedLimit type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.computelimit.models.SharedLimit or + ~azure.mgmt.computelimit.types.SharedLimit or IO[bytes] :return: SharedLimit. The SharedLimit is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SharedLimit :raises ~azure.core.exceptions.HttpResponseError: @@ -1809,7 +1820,7 @@ def _enable_initial( self, location: str, feature_name: str, - body: Optional[Union[_models.FeatureEnableRequest, JSON, IO[bytes]]] = None, + body: Optional[Union[_models.FeatureEnableRequest, _types.FeatureEnableRequest, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1894,7 +1905,8 @@ def begin_enable( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -1916,19 +1928,20 @@ def begin_enable( self, location: str, feature_name: str, - body: Optional[JSON] = None, + body: Optional[_types.FeatureEnableRequest] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str :param feature_name: The name of the Feature. Required. :type feature_name: str :param body: The content of the action request. Default value is None. - :type body: JSON + :type body: ~azure.mgmt.computelimit.types.FeatureEnableRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1948,7 +1961,8 @@ def begin_enable( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -1977,18 +1991,20 @@ def begin_enable( self, location: str, feature_name: str, - body: Optional[Union[_models.FeatureEnableRequest, JSON, IO[bytes]]] = None, + body: Optional[Union[_models.FeatureEnableRequest, _types.FeatureEnableRequest, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Enables a compute limit feature for the subscription at the specified location. + """Enables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str :param feature_name: The name of the Feature. Required. :type feature_name: str - :param body: The content of the action request. Is one of the following types: - FeatureEnableRequest, JSON, IO[bytes] Default value is None. - :type body: ~azure.mgmt.computelimit.models.FeatureEnableRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a FeatureEnableRequest type or a + IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.computelimit.models.FeatureEnableRequest or + ~azure.mgmt.computelimit.types.FeatureEnableRequest or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computelimit.models.OperationStatusResult] @@ -2120,7 +2136,8 @@ def _disable_initial(self, location: str, feature_name: str, **kwargs: Any) -> I def begin_disable( self, location: str, feature_name: str, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Disables a compute limit feature for the subscription at the specified location. + """Disables a compute limit feature for the subscription at the specified location. Requires the + Contributor role. :param location: The name of the Azure region. Required. :type location: str @@ -2504,7 +2521,7 @@ def create_or_update( self, location: str, vm_family_name: str, - resource: JSON, + resource: _types.SharedLimitCap, *, content_type: str = "application/json", **kwargs: Any @@ -2516,7 +2533,7 @@ def create_or_update( :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.SharedLimitCap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2563,7 +2580,7 @@ def create_or_update( self, location: str, vm_family_name: str, - resource: Union[_models.SharedLimitCap, JSON, IO[bytes]], + resource: Union[_models.SharedLimitCap, _types.SharedLimitCap, IO[bytes]], **kwargs: Any ) -> _models.SharedLimitCap: """Creates or replaces the shared limit cap configuration for a VM family. @@ -2572,9 +2589,10 @@ def create_or_update( :type location: str :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str - :param resource: Resource create parameters. Is one of the following types: SharedLimitCap, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.SharedLimitCap or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a SharedLimitCap type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.SharedLimitCap or + ~azure.mgmt.computelimit.types.SharedLimitCap or IO[bytes] :return: SharedLimitCap. The SharedLimitCap is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SharedLimitCap :raises ~azure.core.exceptions.HttpResponseError: @@ -2844,7 +2862,13 @@ def set_member_cap_overrides( @overload def set_member_cap_overrides( - self, location: str, vm_family_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + vm_family_name: str, + body: _types.SetMemberCapOverridesRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SetMemberCapOverridesResult: """Replaces the full set of per-member cap overrides for this shared limit cap. The supplied array becomes the new complete set of overrides; supplying an empty array clears all existing @@ -2855,7 +2879,7 @@ def set_member_cap_overrides( :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str :param body: The content of the action request. Required. - :type body: JSON + :type body: ~azure.mgmt.computelimit.types.SetMemberCapOverridesRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2906,7 +2930,7 @@ def set_member_cap_overrides( self, location: str, vm_family_name: str, - body: Union[_models.SetMemberCapOverridesRequest, JSON, IO[bytes]], + body: Union[_models.SetMemberCapOverridesRequest, _types.SetMemberCapOverridesRequest, IO[bytes]], **kwargs: Any ) -> _models.SetMemberCapOverridesResult: """Replaces the full set of per-member cap overrides for this shared limit cap. The supplied array @@ -2917,9 +2941,10 @@ def set_member_cap_overrides( :type location: str :param vm_family_name: The name of the SharedLimitCap. Required. :type vm_family_name: str - :param body: The content of the action request. Is one of the following types: - SetMemberCapOverridesRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.computelimit.models.SetMemberCapOverridesRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a SetMemberCapOverridesRequest type + or a IO[bytes] type. Required. + :type body: ~azure.mgmt.computelimit.models.SetMemberCapOverridesRequest or + ~azure.mgmt.computelimit.types.SetMemberCapOverridesRequest or IO[bytes] :return: SetMemberCapOverridesResult. The SetMemberCapOverridesResult is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.SetMemberCapOverridesResult @@ -3133,7 +3158,7 @@ def create_or_update( location: str, vm_family_name: str, member_subscription_id: str, - resource: JSON, + resource: _types.MemberCapOverride, *, content_type: str = "application/json", **kwargs: Any @@ -3147,7 +3172,7 @@ def create_or_update( :param member_subscription_id: The name of the MemberCapOverride. Required. :type member_subscription_id: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.computelimit.types.MemberCapOverride :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3206,7 +3231,7 @@ def create_or_update( location: str, vm_family_name: str, member_subscription_id: str, - resource: Union[_models.MemberCapOverride, JSON, IO[bytes]], + resource: Union[_models.MemberCapOverride, _types.MemberCapOverride, IO[bytes]], **kwargs: Any ) -> _models.MemberCapOverride: """Creates or replaces the cap override for a single member subscription. @@ -3217,9 +3242,10 @@ def create_or_update( :type vm_family_name: str :param member_subscription_id: The name of the MemberCapOverride. Required. :type member_subscription_id: str - :param resource: Resource create parameters. Is one of the following types: MemberCapOverride, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.computelimit.models.MemberCapOverride or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a MemberCapOverride type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.computelimit.models.MemberCapOverride or + ~azure.mgmt.computelimit.types.MemberCapOverride or IO[bytes] :return: MemberCapOverride. The MemberCapOverride is compatible with MutableMapping :rtype: ~azure.mgmt.computelimit.models.MemberCapOverride :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/types.py b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/types.py new file mode 100644 index 000000000000..ed954bc2ade5 --- /dev/null +++ b/sdk/computelimit/azure-mgmt-computelimit/azure/mgmt/computelimit/types.py @@ -0,0 +1,343 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import CreatedByType, ResourceProvisioningState + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + +class FeatureEnableRequest(TypedDict, total=False): + """Request body for feature enable action. + + :ivar service_tree_id: The Service Tree identifier associated with this feature action. + :vartype service_tree_id: str + """ + + serviceTreeId: str + """The Service Tree identifier associated with this feature action.""" + + +class GuestSubscription(ProxyResource): + """Guest subscription that consumes shared compute limits. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "GuestSubscriptionProperties" + """ + + properties: "GuestSubscriptionProperties" + """The resource-specific properties for this resource.""" + + +class GuestSubscriptionProperties(TypedDict, total=False): + """Properties for guest subscription. + + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ResourceProvisioningState"] + """ + + provisioningState: Union[str, "ResourceProvisioningState"] + """The provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class LimitName(TypedDict, total=False): + """Properties of the limit name. + + :ivar value: The limit name. Required. + :vartype value: str + :ivar localized_value: The localized limit name. + :vartype localized_value: str + """ + + value: Required[str] + """The limit name. Required.""" + localizedValue: str + """The localized limit name.""" + + +class MemberCap(TypedDict, total=False): + """Per-member cap override. Pairs a member subscription with its cap value. + + :ivar subscription_id: The member subscription identifier this cap applies to. Required. + :vartype subscription_id: str + :ivar cap: The cap value in count units for this member subscription. Required. + :vartype cap: int + """ + + subscriptionId: Required[str] + """The member subscription identifier this cap applies to. Required.""" + cap: Required[int] + """The cap value in count units for this member subscription. Required.""" + + +class MemberCapOverride(ProxyResource): + """Member cap override as a standalone child resource of ``SharedLimitCap``. Use this resource to + read or modify a single member's cap without resending the entire ``memberCapOverrides`` array + on the parent. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "MemberCapOverrideProperties" + """ + + properties: "MemberCapOverrideProperties" + """The resource-specific properties for this resource.""" + + +class MemberCapOverrideProperties(TypedDict, total=False): + """Properties of a per-member cap override. + + :ivar cap: The cap value in count units for this member subscription. Required. + :vartype cap: int + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ResourceProvisioningState"] + """ + + cap: Required[int] + """The cap value in count units for this member subscription. Required.""" + provisioningState: Union[str, "ResourceProvisioningState"] + """The provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class SetMemberCapOverridesRequest(TypedDict, total=False): + """Request body for the ``setMemberCapOverrides`` action. + + :ivar member_cap_overrides: The full set of per-member cap overrides to persist for this + resource. This call replaces the existing set entirely; supply an empty array (``[]``) to clear + all overrides. Required. + :vartype member_cap_overrides: list["MemberCap"] + """ + + memberCapOverrides: Required[list["MemberCap"]] + """The full set of per-member cap overrides to persist for this resource. This call replaces the + existing set entirely; supply an empty array (``[]``) to clear all overrides. Required.""" + + +class SharedLimit(ProxyResource): + """Compute limits shared by the subscription. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SharedLimitProperties" + """ + + properties: "SharedLimitProperties" + """The resource-specific properties for this resource.""" + + +class SharedLimitCap(ProxyResource): + """Shared limit cap configuration for a VM family, owned by a host subscription and propagated to + its member subscriptions. The same resource type is readable by host and member subscriptions, + but write operations (PUT/DELETE) are scoped to the caller's subscription as the host. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SharedLimitCapProperties" + """ + + properties: "SharedLimitCapProperties" + """The resource-specific properties for this resource.""" + + +class SharedLimitCapProperties(TypedDict, total=False): + """Properties of a shared limit cap resource. + + :ivar default_member_cap: The default member cap value (in count units). Set to a non-negative + integer to apply a cap to all member subscriptions that do not have a per-member override. Omit + the property to leave no default cap in effect. + :vartype default_member_cap: int + :ivar is_bounded_cap: Controls whether the service validates the aggregate cap against the + group limit for the VM family. + + SUM(caps) is the sum of all per-member overrides' cap values plus + ``defaultMemberCap`` multiplied by the number of member subscriptions without an override. + + When true, the service rejects any configuration where SUM(caps) + exceeds the group limit. When false, SUM(caps) is permitted to exceed + the group limit. + + Enabling this flag is rejected if the current configuration already breaches the group limit; + reduce caps first, then enable. Required. + :vartype is_bounded_cap: bool + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ResourceProvisioningState"] + """ + + defaultMemberCap: int + """The default member cap value (in count units). Set to a non-negative integer to apply a cap to + all member subscriptions that do not have a per-member override. Omit the property to leave no + default cap in effect.""" + isBoundedCap: Required[bool] + """Controls whether the service validates the aggregate cap against the + group limit for the VM family. + + SUM(caps) is the sum of all per-member overrides' cap values plus + ``defaultMemberCap`` multiplied by the number of member subscriptions without an override. + + When true, the service rejects any configuration where SUM(caps) + exceeds the group limit. When false, SUM(caps) is permitted to exceed + the group limit. + + Enabling this flag is rejected if the current configuration already breaches the group limit; + reduce caps first, then enable. Required.""" + provisioningState: Union[str, "ResourceProvisioningState"] + """The provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class SharedLimitProperties(TypedDict, total=False): + """Properties of the compute shared limit. + + :ivar resource_name: The limit name properties. + :vartype resource_name: "LimitName" + :ivar limit: The maximum permitted usage of the resource. + :vartype limit: int + :ivar unit: The quota units, such as Count. + :vartype unit: str + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ResourceProvisioningState"] + """ + + resourceName: "LimitName" + """The limit name properties.""" + limit: int + """The maximum permitted usage of the resource.""" + unit: str + """The quota units, such as Count.""" + provisioningState: Union[str, "ResourceProvisioningState"] + """The provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" diff --git a/sdk/computelimit/azure-mgmt-computelimit/tsp-location.yaml b/sdk/computelimit/azure-mgmt-computelimit/tsp-location.yaml index 7455bd14f6a7..4f9025121d0a 100644 --- a/sdk/computelimit/azure-mgmt-computelimit/tsp-location.yaml +++ b/sdk/computelimit/azure-mgmt-computelimit/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit -commit: 18ebae7ea8f6aefd83268aacdb1f480b24842726 +commit: 723a657f70e944d62515f29a59a914ab911dc32c repo: Azure/azure-rest-api-specs additionalDirectories: