Skip to content

Commit 664720c

Browse files
author
SDKAuto
committed
CodeGen from PR 33581 in Azure/azure-rest-api-specs
Merge 54772594db79974841efa55b3f2e0dc497586457 into eb9abbcdb08fe6c2faca5c2a6182568b52a3b1ce
1 parent 8fcb2d2 commit 664720c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+830
-380
lines changed

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

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

3+
## 1.1.0b1 (2025-04-10)
4+
5+
### Features Added
6+
7+
- Added model `Quota`
8+
- Added model `QuotaName`
9+
- Model `FabricCapacitiesOperations` added method `list_usages`
10+
- Method `Operation.__init__` has a new overload `def __init__(self: None, display: Optional[_models.OperationDisplay])`
11+
- Method `Quota.__init__` has a new overload `def __init__(self: None, unit: str, current_value: int, limit: int)`
12+
- Method `Quota.__init__` has a new overload `def __init__(self: None, mapping: Mapping[str, Any])`
13+
- Method `QuotaName.__init__` has a new overload `def __init__(self: None, value: Optional[str], localized_value: Optional[str])`
14+
- Method `QuotaName.__init__` has a new overload `def __init__(self: None, mapping: Mapping[str, Any])`
15+
316
## 1.0.0 (2024-10-21)
417

518
### Other Changes

sdk/fabric/azure-mgmt-fabric/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "9ce76c4f113368361dac4de5d0a71eb058602756",
2+
"commit": "97849587351381820da57e022831a3591b3cb0b2",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/fabric/Microsoft.Fabric.Management",
5-
"@azure-tools/typespec-python": "0.36.0"
5+
"@azure-tools/typespec-python": "0.42.2"
66
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.Fabric",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.fabric.models.CapacityAdministration": "Microsoft.Fabric.CapacityAdministration",
5+
"azure.mgmt.fabric.models.CheckNameAvailabilityRequest": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest",
6+
"azure.mgmt.fabric.models.CheckNameAvailabilityResponse": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse",
7+
"azure.mgmt.fabric.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
8+
"azure.mgmt.fabric.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
9+
"azure.mgmt.fabric.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
10+
"azure.mgmt.fabric.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
11+
"azure.mgmt.fabric.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
12+
"azure.mgmt.fabric.models.FabricCapacity": "Microsoft.Fabric.FabricCapacity",
13+
"azure.mgmt.fabric.models.FabricCapacityProperties": "Microsoft.Fabric.FabricCapacityProperties",
14+
"azure.mgmt.fabric.models.FabricCapacityUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
15+
"azure.mgmt.fabric.models.FabricCapacityUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
16+
"azure.mgmt.fabric.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
17+
"azure.mgmt.fabric.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
18+
"azure.mgmt.fabric.models.Quota": "Microsoft.Fabric.Quota",
19+
"azure.mgmt.fabric.models.QuotaName": "Microsoft.Fabric.QuotaName",
20+
"azure.mgmt.fabric.models.RpSku": "Microsoft.Fabric.RpSku",
21+
"azure.mgmt.fabric.models.RpSkuDetailsForExistingResource": "Microsoft.Fabric.RpSkuDetailsForExistingResource",
22+
"azure.mgmt.fabric.models.RpSkuDetailsForNewResource": "Microsoft.Fabric.RpSkuDetailsForNewResource",
23+
"azure.mgmt.fabric.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
24+
"azure.mgmt.fabric.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
25+
"azure.mgmt.fabric.models.ProvisioningState": "Microsoft.Fabric.ProvisioningState",
26+
"azure.mgmt.fabric.models.ResourceState": "Microsoft.Fabric.ResourceState",
27+
"azure.mgmt.fabric.models.RpSkuTier": "Microsoft.Fabric.RpSkuTier",
28+
"azure.mgmt.fabric.models.CheckNameAvailabilityReason": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason",
29+
"azure.mgmt.fabric.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
30+
"azure.mgmt.fabric.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
31+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.get": "Microsoft.Fabric.FabricCapacities.get",
32+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.begin_create_or_update": "Microsoft.Fabric.FabricCapacities.createOrUpdate",
33+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.begin_update": "Microsoft.Fabric.FabricCapacities.update",
34+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.begin_delete": "Microsoft.Fabric.FabricCapacities.delete",
35+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.list_by_resource_group": "Microsoft.Fabric.FabricCapacities.listByResourceGroup",
36+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.list_by_subscription": "Microsoft.Fabric.FabricCapacities.listBySubscription",
37+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.begin_resume": "Microsoft.Fabric.FabricCapacities.resume",
38+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.begin_suspend": "Microsoft.Fabric.FabricCapacities.suspend",
39+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.check_name_availability": "Microsoft.Fabric.FabricCapacities.checkNameAvailability",
40+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.list_skus_for_capacity": "Microsoft.Fabric.FabricCapacities.listSkusForCapacity",
41+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.list_skus": "Microsoft.Fabric.FabricCapacities.listSkus",
42+
"azure.mgmt.fabric.FabricMgmtClient.fabric_capacities.list_usages": "Microsoft.Fabric.FabricCapacities.listUsages",
43+
"azure.mgmt.fabric.FabricMgmtClient.operations.list": "Azure.ResourceManager.Operations.list"
44+
}
45+
}

sdk/fabric/azure-mgmt-fabric/azure/mgmt/fabric/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import FabricMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import FabricMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk

sdk/fabric/azure-mgmt-fabric/azure/mgmt/fabric/_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class FabricMgmtClient:
3636
:type subscription_id: str
3737
:param base_url: Service host. Default value is "https://management.azure.com".
3838
:type base_url: str
39-
:keyword api_version: The API version to use for this operation. Default value is "2023-11-01".
40-
Note that overriding this default value may result in unsupported behavior.
39+
:keyword api_version: The API version to use for this operation. Default value is
40+
"2025-01-15-preview". Note that overriding this default value may result in unsupported
41+
behavior.
4142
:paramtype api_version: str
4243
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4344
Retry-After header is present.

sdk/fabric/azure-mgmt-fabric/azure/mgmt/fabric/_configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class FabricMgmtClientConfiguration: # pylint: disable=too-many-instance-attrib
2929
:type subscription_id: str
3030
:param base_url: Service host. Default value is "https://management.azure.com".
3131
:type base_url: str
32-
:keyword api_version: The API version to use for this operation. Default value is "2023-11-01".
33-
Note that overriding this default value may result in unsupported behavior.
32+
:keyword api_version: The API version to use for this operation. Default value is
33+
"2025-01-15-preview". Note that overriding this default value may result in unsupported
34+
behavior.
3435
:paramtype api_version: str
3536
"""
3637

@@ -41,7 +42,7 @@ def __init__(
4142
base_url: str = "https://management.azure.com",
4243
**kwargs: Any
4344
) -> None:
44-
api_version: str = kwargs.pop("api_version", "2023-11-01")
45+
api_version: str = kwargs.pop("api_version", "2025-01-15-preview")
4546

4647
if credential is None:
4748
raise ValueError("Parameter 'credential' must not be None.")

sdk/fabric/azure-mgmt-fabric/azure/mgmt/fabric/_model_base.py

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
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
# --------------------------------------------------------------------------
8-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
9+
# pylint: disable=protected-access, broad-except
910

1011
import copy
1112
import calendar
@@ -373,15 +374,34 @@ def __ne__(self, other: typing.Any) -> bool:
373374
return not self.__eq__(other)
374375

375376
def keys(self) -> typing.KeysView[str]:
377+
"""
378+
:returns: a set-like object providing a view on D's keys
379+
:rtype: ~typing.KeysView
380+
"""
376381
return self._data.keys()
377382

378383
def values(self) -> typing.ValuesView[typing.Any]:
384+
"""
385+
:returns: an object providing a view on D's values
386+
:rtype: ~typing.ValuesView
387+
"""
379388
return self._data.values()
380389

381390
def items(self) -> typing.ItemsView[str, typing.Any]:
391+
"""
392+
:returns: set-like object providing a view on D's items
393+
:rtype: ~typing.ItemsView
394+
"""
382395
return self._data.items()
383396

384397
def get(self, key: str, default: typing.Any = None) -> typing.Any:
398+
"""
399+
Get the value for key if key is in the dictionary, else default.
400+
:param str key: The key to look up.
401+
:param any default: The value to return if key is not in the dictionary. Defaults to None
402+
:returns: D[k] if k in D, else d.
403+
:rtype: any
404+
"""
385405
try:
386406
return self[key]
387407
except KeyError:
@@ -397,17 +417,38 @@ def pop(self, key: str, default: _T) -> _T: ...
397417
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
398418

399419
def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
420+
"""
421+
Removes specified key and return the corresponding value.
422+
:param str key: The key to pop.
423+
:param any default: The value to return if key is not in the dictionary
424+
:returns: The value corresponding to the key.
425+
:rtype: any
426+
:raises KeyError: If key is not found and default is not given.
427+
"""
400428
if default is _UNSET:
401429
return self._data.pop(key)
402430
return self._data.pop(key, default)
403431

404432
def popitem(self) -> typing.Tuple[str, typing.Any]:
433+
"""
434+
Removes and returns some (key, value) pair
435+
:returns: The (key, value) pair.
436+
:rtype: tuple
437+
:raises KeyError: if D is empty.
438+
"""
405439
return self._data.popitem()
406440

407441
def clear(self) -> None:
442+
"""
443+
Remove all items from D.
444+
"""
408445
self._data.clear()
409446

410447
def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
448+
"""
449+
Updates D from mapping/iterable E and F.
450+
:param any args: Either a mapping object or an iterable of key-value pairs.
451+
"""
411452
self._data.update(*args, **kwargs)
412453

413454
@typing.overload
@@ -417,6 +458,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
417458
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
418459

419460
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
461+
"""
462+
Same as calling D.get(k, d), and setting D[k]=d if k not found
463+
:param str key: The key to look up.
464+
:param any default: The value to set if key is not in the dictionary
465+
:returns: D[k] if k in D, else d.
466+
:rtype: any
467+
"""
420468
if default is _UNSET:
421469
return self._data.setdefault(key)
422470
return self._data.setdefault(key, default)
@@ -574,7 +622,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
574622
def copy(self) -> "Model":
575623
return Model(self.__dict__)
576624

577-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
625+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
578626
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
579627
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
580628
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -585,8 +633,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
585633
annotations = {
586634
k: v
587635
for mro_class in mros
588-
if hasattr(mro_class, "__annotations__") # pylint: disable=no-member
589-
for k, v in mro_class.__annotations__.items() # pylint: disable=no-member
636+
if hasattr(mro_class, "__annotations__")
637+
for k, v in mro_class.__annotations__.items()
590638
}
591639
for attr, rf in attr_to_rest_field.items():
592640
rf._module = cls.__module__
@@ -601,8 +649,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
601649

602650
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
603651
for base in cls.__bases__:
604-
if hasattr(base, "__mapping__"): # pylint: disable=no-member
605-
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member
652+
if hasattr(base, "__mapping__"):
653+
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore
606654

607655
@classmethod
608656
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -613,7 +661,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
613661

614662
@classmethod
615663
def _deserialize(cls, data, exist_discriminators):
616-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
664+
if not hasattr(cls, "__mapping__"):
617665
return cls(data)
618666
discriminator = cls._get_discriminator(exist_discriminators)
619667
if discriminator is None:
@@ -633,7 +681,7 @@ def _deserialize(cls, data, exist_discriminators):
633681
discriminator_value = data.find(xml_name).text # pyright: ignore
634682
else:
635683
discriminator_value = data.get(discriminator._rest_name)
636-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
684+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
637685
return mapped_cls._deserialize(data, exist_discriminators)
638686

639687
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
@@ -754,7 +802,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
754802
except AttributeError:
755803
model_name = annotation
756804
if module is not None:
757-
annotation = _get_model(module, model_name)
805+
annotation = _get_model(module, model_name) # type: ignore
758806

759807
try:
760808
if module and _is_model(annotation):
@@ -894,6 +942,35 @@ def _deserialize(
894942
return _deserialize_with_callable(deserializer, value)
895943

896944

945+
def _failsafe_deserialize(
946+
deserializer: typing.Any,
947+
value: typing.Any,
948+
module: typing.Optional[str] = None,
949+
rf: typing.Optional["_RestField"] = None,
950+
format: typing.Optional[str] = None,
951+
) -> typing.Any:
952+
try:
953+
return _deserialize(deserializer, value, module, rf, format)
954+
except DeserializationError:
955+
_LOGGER.warning(
956+
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
957+
)
958+
return None
959+
960+
961+
def _failsafe_deserialize_xml(
962+
deserializer: typing.Any,
963+
value: typing.Any,
964+
) -> typing.Any:
965+
try:
966+
return _deserialize_xml(deserializer, value)
967+
except DeserializationError:
968+
_LOGGER.warning(
969+
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
970+
)
971+
return None
972+
973+
897974
class _RestField:
898975
def __init__(
899976
self,

sdk/fabric/azure-mgmt-fabric/azure/mgmt/fabric/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)