Skip to content

Commit 9cd8ea8

Browse files
author
SDKAuto
committed
CodeGen from PR 32938 in Azure/azure-rest-api-specs
Merge 0a04a5454a0f5616f7cf7d6e728c8d0b7a8c12ba into 8a0168458930c86636a76bcd7acfdc9c81291bfc
1 parent 8c14799 commit 9cd8ea8

12 files changed

+650
-452
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "14f4f6b25fe74f90f4ee74fdac5cd7e05d419245",
2+
"commit": "883bc62c8f73a8e837c484e5dbd4621da7962d51",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/connectedcache/ConnectedCache.Management",
5-
"@azure-tools/typespec-python": "0.36.4"
5+
"@azure-tools/typespec-python": "0.39.0"
66
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.ConnectedCache",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.connectedcache.models.AdditionalCacheNodeProperties": "Microsoft.ConnectedCache.AdditionalCacheNodeProperties",
5+
"azure.mgmt.connectedcache.models.AdditionalCustomerProperties": "Microsoft.ConnectedCache.AdditionalCustomerProperties",
6+
"azure.mgmt.connectedcache.models.BgpCidrsConfiguration": "Microsoft.ConnectedCache.BgpCidrsConfiguration",
7+
"azure.mgmt.connectedcache.models.BgpConfiguration": "Microsoft.ConnectedCache.BgpConfiguration",
8+
"azure.mgmt.connectedcache.models.CacheNodeDriveConfiguration": "Microsoft.ConnectedCache.CacheNodeDriveConfiguration",
9+
"azure.mgmt.connectedcache.models.CacheNodeEntity": "Microsoft.ConnectedCache.CacheNodeEntity",
10+
"azure.mgmt.connectedcache.models.CacheNodeInstallProperties": "Microsoft.ConnectedCache.CacheNodeInstallProperties",
11+
"azure.mgmt.connectedcache.models.CacheNodeOldResponse": "Microsoft.ConnectedCache.CacheNodeOldResponse",
12+
"azure.mgmt.connectedcache.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
13+
"azure.mgmt.connectedcache.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
14+
"azure.mgmt.connectedcache.models.CacheNodePreviewResource": "Microsoft.ConnectedCache.CacheNodePreviewResource",
15+
"azure.mgmt.connectedcache.models.CacheNodeProperty": "Microsoft.ConnectedCache.CacheNodeProperty",
16+
"azure.mgmt.connectedcache.models.ConnectedCachePatchResource": "Microsoft.ConnectedCache.ConnectedCachePatchResource",
17+
"azure.mgmt.connectedcache.models.CustomerEntity": "Microsoft.ConnectedCache.CustomerEntity",
18+
"azure.mgmt.connectedcache.models.CustomerProperty": "Microsoft.ConnectedCache.CustomerProperty",
19+
"azure.mgmt.connectedcache.models.EnterpriseMccCacheNodeResource": "Microsoft.ConnectedCache.EnterpriseMccCacheNodeResource",
20+
"azure.mgmt.connectedcache.models.EnterpriseMccCustomerResource": "Microsoft.ConnectedCache.EnterpriseMccCustomerResource",
21+
"azure.mgmt.connectedcache.models.EnterprisePreviewResource": "Microsoft.ConnectedCache.EnterprisePreviewResource",
22+
"azure.mgmt.connectedcache.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
23+
"azure.mgmt.connectedcache.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
24+
"azure.mgmt.connectedcache.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
25+
"azure.mgmt.connectedcache.models.IspCacheNodeResource": "Microsoft.ConnectedCache.IspCacheNodeResource",
26+
"azure.mgmt.connectedcache.models.IspCustomerResource": "Microsoft.ConnectedCache.IspCustomerResource",
27+
"azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails": "Microsoft.ConnectedCache.MccCacheNodeBgpCidrDetails",
28+
"azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails": "Microsoft.ConnectedCache.MccCacheNodeInstallDetails",
29+
"azure.mgmt.connectedcache.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
30+
"azure.mgmt.connectedcache.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
31+
"azure.mgmt.connectedcache.models.ProxyUrlConfiguration": "Microsoft.ConnectedCache.ProxyUrlConfiguration",
32+
"azure.mgmt.connectedcache.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
33+
"azure.mgmt.connectedcache.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
34+
"azure.mgmt.connectedcache.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
35+
"azure.mgmt.connectedcache.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
36+
"azure.mgmt.connectedcache.models.ProvisioningState": "Microsoft.ConnectedCache.ProvisioningState",
37+
"azure.mgmt.connectedcache.models.CustomerTransitState": "Microsoft.ConnectedCache.CustomerTransitState",
38+
"azure.mgmt.connectedcache.models.BgpReviewStateEnum": "Microsoft.ConnectedCache.BgpReviewStateEnum",
39+
"azure.mgmt.connectedcache.models.ConfigurationState": "Microsoft.ConnectedCache.ConfigurationState",
40+
"azure.mgmt.connectedcache.models.AutoUpdateRingType": "Microsoft.ConnectedCache.autoUpdateRingType",
41+
"azure.mgmt.connectedcache.models.ProxyRequired": "Microsoft.ConnectedCache.ProxyRequired",
42+
"azure.mgmt.connectedcache.models.OsType": "Microsoft.ConnectedCache.OsType",
43+
"azure.mgmt.connectedcache.models.CycleType": "Microsoft.ConnectedCache.CycleType",
44+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
45+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.get": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.get",
46+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.createOrUpdate",
47+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.update": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.update",
48+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.delete": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.delete",
49+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.list_by_resource_group": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.listByResourceGroup",
50+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_customer_operations.list_by_subscription": "Microsoft.ConnectedCache.EnterpriseCustomerOperations.listBySubscription",
51+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.get": "Microsoft.ConnectedCache.CacheNodesOperations.get",
52+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.begin_createor_update": "Microsoft.ConnectedCache.CacheNodesOperations.createorUpdate",
53+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.delete": "Microsoft.ConnectedCache.CacheNodesOperations.delete",
54+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.update": "Microsoft.ConnectedCache.CacheNodesOperations.update",
55+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.list_by_resource_group": "Microsoft.ConnectedCache.CacheNodesOperations.listByResourceGroup",
56+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.cache_nodes_operations.list_by_subscription": "Microsoft.ConnectedCache.CacheNodesOperations.listBySubscription",
57+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.get": "Microsoft.ConnectedCache.IspCustomers.get",
58+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.begin_create_or_update": "Microsoft.ConnectedCache.IspCustomers.createOrUpdate",
59+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.update": "Microsoft.ConnectedCache.IspCustomers.update",
60+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.begin_delete": "Microsoft.ConnectedCache.IspCustomers.delete",
61+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.list_by_resource_group": "Microsoft.ConnectedCache.IspCustomers.listByResourceGroup",
62+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_customers.list_by_subscription": "Microsoft.ConnectedCache.IspCustomers.listBySubscription",
63+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.get": "Microsoft.ConnectedCache.IspCacheNodesOperations.get",
64+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.begin_create_or_update": "Microsoft.ConnectedCache.IspCacheNodesOperations.createOrUpdate",
65+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.update": "Microsoft.ConnectedCache.IspCacheNodesOperations.update",
66+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.begin_delete": "Microsoft.ConnectedCache.IspCacheNodesOperations.delete",
67+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.list_by_isp_customer_resource": "Microsoft.ConnectedCache.IspCacheNodesOperations.listByIspCustomerResource",
68+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.get_bgp_cidrs": "Microsoft.ConnectedCache.IspCacheNodesOperations.getBgpCidrs",
69+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.isp_cache_nodes_operations.get_cache_node_install_details": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeInstallDetails",
70+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.get": "Microsoft.ConnectedCache.EnterpriseMccCustomers.get",
71+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.createOrUpdate",
72+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.update",
73+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCustomers.delete",
74+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.list_by_resource_group": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listByResourceGroup",
75+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_customers.list_by_subscription": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listBySubscription",
76+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.get": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.get",
77+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.createOrUpdate",
78+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.update",
79+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.delete",
80+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.list_by_enterprise_mcc_customer_resource": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource",
81+
"azure.mgmt.connectedcache.ConnectedCacheMgmtClient.enterprise_mcc_cache_nodes_operations.get_cache_node_install_details": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeInstallDetails"
82+
}
83+
}

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

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool:
373373
return not self.__eq__(other)
374374

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

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

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

384396
def get(self, key: str, default: typing.Any = None) -> typing.Any:
397+
"""
398+
Get the value for key if key is in the dictionary, else default.
399+
:param str key: The key to look up.
400+
:param any default: The value to return if key is not in the dictionary. Defaults to None
401+
:returns: D[k] if k in D, else d.
402+
:rtype: any
403+
"""
385404
try:
386405
return self[key]
387406
except KeyError:
@@ -397,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ...
397416
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
398417

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

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

407440
def clear(self) -> None:
441+
"""
442+
Remove all items from D.
443+
"""
408444
self._data.clear()
409445

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

413453
@typing.overload
@@ -417,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
417457
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
418458

419459
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
460+
"""
461+
Same as calling D.get(k, d), and setting D[k]=d if k not found
462+
:param str key: The key to look up.
463+
:param any default: The value to set if key is not in the dictionary
464+
:returns: D[k] if k in D, else d.
465+
:rtype: any
466+
"""
420467
if default is _UNSET:
421468
return self._data.setdefault(key)
422469
return self._data.setdefault(key, default)
@@ -754,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
754801
except AttributeError:
755802
model_name = annotation
756803
if module is not None:
757-
annotation = _get_model(module, model_name)
804+
annotation = _get_model(module, model_name) # type: ignore
758805

759806
try:
760807
if module and _is_model(annotation):
@@ -894,6 +941,35 @@ def _deserialize(
894941
return _deserialize_with_callable(deserializer, value)
895942

896943

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

0 commit comments

Comments
 (0)