Skip to content

Commit 6fdea23

Browse files
author
SDKAuto
committed
CodeGen from PR 32741 in Azure/azure-rest-api-specs
Merge e64756157328c1d3837acd37bf82342874372d9b into c2afa6e1f7ced1b3c1fdd3518a9d49b44871d7a7
1 parent ada2aa3 commit 6fdea23

36 files changed

+620
-501
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "e6fde2ac19d0202f0e72217a3e0f9edb63dba273",
2+
"commit": "fbb413f68a8ca8acf5f03ac50fbf54a63cf1d716",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/codesigning/CodeSigning.Management",
5-
"@azure-tools/typespec-python": "0.33.0"
5+
"@azure-tools/typespec-python": "0.38.4"
66
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.CodeSigning",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.trustedsigning.models.AccountSku": "Microsoft.CodeSigning.AccountSku",
5+
"azure.mgmt.trustedsigning.models.AccountSkuPatch": "Microsoft.CodeSigning.AccountSkuPatch",
6+
"azure.mgmt.trustedsigning.models.Certificate": "Microsoft.CodeSigning.Certificate",
7+
"azure.mgmt.trustedsigning.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
8+
"azure.mgmt.trustedsigning.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
9+
"azure.mgmt.trustedsigning.models.CertificateProfile": "Microsoft.CodeSigning.CertificateProfile",
10+
"azure.mgmt.trustedsigning.models.CertificateProfileProperties": "Microsoft.CodeSigning.CertificateProfileProperties",
11+
"azure.mgmt.trustedsigning.models.CheckNameAvailability": "Microsoft.CodeSigning.CheckNameAvailability",
12+
"azure.mgmt.trustedsigning.models.CheckNameAvailabilityResult": "Microsoft.CodeSigning.CheckNameAvailabilityResult",
13+
"azure.mgmt.trustedsigning.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
14+
"azure.mgmt.trustedsigning.models.CodeSigningAccount": "Microsoft.CodeSigning.CodeSigningAccount",
15+
"azure.mgmt.trustedsigning.models.CodeSigningAccountPatch": "Microsoft.CodeSigning.CodeSigningAccountPatch",
16+
"azure.mgmt.trustedsigning.models.CodeSigningAccountPatchProperties": "Microsoft.CodeSigning.CodeSigningAccountPatchProperties",
17+
"azure.mgmt.trustedsigning.models.CodeSigningAccountProperties": "Microsoft.CodeSigning.CodeSigningAccountProperties",
18+
"azure.mgmt.trustedsigning.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
19+
"azure.mgmt.trustedsigning.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
20+
"azure.mgmt.trustedsigning.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
21+
"azure.mgmt.trustedsigning.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
22+
"azure.mgmt.trustedsigning.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
23+
"azure.mgmt.trustedsigning.models.Revocation": "Microsoft.CodeSigning.Revocation",
24+
"azure.mgmt.trustedsigning.models.RevokeCertificate": "Microsoft.CodeSigning.RevokeCertificate",
25+
"azure.mgmt.trustedsigning.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
26+
"azure.mgmt.trustedsigning.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
27+
"azure.mgmt.trustedsigning.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
28+
"azure.mgmt.trustedsigning.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
29+
"azure.mgmt.trustedsigning.models.SkuName": "Microsoft.CodeSigning.SkuName",
30+
"azure.mgmt.trustedsigning.models.ProvisioningState": "Microsoft.CodeSigning.ProvisioningState",
31+
"azure.mgmt.trustedsigning.models.NameUnavailabilityReason": "Microsoft.CodeSigning.NameUnavailabilityReason",
32+
"azure.mgmt.trustedsigning.models.ProfileType": "Microsoft.CodeSigning.ProfileType",
33+
"azure.mgmt.trustedsigning.models.CertificateProfileStatus": "Microsoft.CodeSigning.CertificateProfileStatus",
34+
"azure.mgmt.trustedsigning.models.CertificateStatus": "Microsoft.CodeSigning.CertificateStatus",
35+
"azure.mgmt.trustedsigning.models.RevocationStatus": "Microsoft.CodeSigning.RevocationStatus",
36+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
37+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.get": "Microsoft.CodeSigning.CodeSigningAccounts.get",
38+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.begin_create": "Microsoft.CodeSigning.CodeSigningAccounts.create",
39+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.begin_update": "Microsoft.CodeSigning.CodeSigningAccounts.update",
40+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.begin_delete": "Microsoft.CodeSigning.CodeSigningAccounts.delete",
41+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.list_by_resource_group": "Microsoft.CodeSigning.CodeSigningAccounts.listByResourceGroup",
42+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.list_by_subscription": "Microsoft.CodeSigning.CodeSigningAccounts.listBySubscription",
43+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.code_signing_accounts.check_name_availability": "Microsoft.CodeSigning.CodeSigningAccounts.checkNameAvailability",
44+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.certificate_profiles.get": "Microsoft.CodeSigning.CertificateProfiles.get",
45+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.certificate_profiles.begin_create": "Microsoft.CodeSigning.CertificateProfiles.create",
46+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.certificate_profiles.begin_delete": "Microsoft.CodeSigning.CertificateProfiles.delete",
47+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.certificate_profiles.list_by_code_signing_account": "Microsoft.CodeSigning.CertificateProfiles.listByCodeSigningAccount",
48+
"azure.mgmt.trustedsigning.TrustedSigningMgmtClient.certificate_profiles.revoke_certificate": "Microsoft.CodeSigning.CertificateProfiles.revokeCertificate"
49+
}
50+
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
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 TrustedSigningMgmtClient
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 TrustedSigningMgmtClient # 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
2026

2127
__all__ = [
2228
"TrustedSigningMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
from .operations import CertificateProfilesOperations, CodeSigningAccountsOperations, Operations
2121

2222
if TYPE_CHECKING:
23-
# pylint: disable=unused-import,ungrouped-imports
2423
from azure.core.credentials import TokenCredential
2524

2625

27-
class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26+
class TrustedSigningMgmtClient:
2827
"""Code Signing resource provider api.
2928
3029
:ivar operations: Operations operations
@@ -42,7 +41,7 @@ class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-ke
4241
:param base_url: Service host. Default value is "https://management.azure.com".
4342
:type base_url: str
4443
:keyword api_version: The API version to use for this operation. Default value is
45-
"2024-02-05-preview". Note that overriding this default value may result in unsupported
44+
"2024-09-30-preview". Note that overriding this default value may result in unsupported
4645
behavior.
4746
:paramtype api_version: str
4847
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for TrustedSigningMgmtClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
@@ -31,7 +30,7 @@ class TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instanc
3130
:param base_url: Service host. Default value is "https://management.azure.com".
3231
:type base_url: str
3332
:keyword api_version: The API version to use for this operation. Default value is
34-
"2024-02-05-preview". Note that overriding this default value may result in unsupported
33+
"2024-09-30-preview". Note that overriding this default value may result in unsupported
3534
behavior.
3635
:paramtype api_version: str
3736
"""
@@ -43,7 +42,7 @@ def __init__(
4342
base_url: str = "https://management.azure.com",
4443
**kwargs: Any
4544
) -> None:
46-
api_version: str = kwargs.pop("api_version", "2024-02-05-preview")
45+
api_version: str = kwargs.pop("api_version", "2024-09-30-preview")
4746

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

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

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# pylint: disable=too-many-lines
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.
45
# Licensed under the MIT License. See License.txt in the project root for
56
# license information.
67
# --------------------------------------------------------------------------
7-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
8+
# pylint: disable=protected-access, broad-except
89

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

374375
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+
"""
375380
return self._data.keys()
376381

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

380389
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+
"""
381394
return self._data.items()
382395

383396
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+
"""
384404
try:
385405
return self[key]
386406
except KeyError:
@@ -396,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ...
396416
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
397417

398418
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+
"""
399427
if default is _UNSET:
400428
return self._data.pop(key)
401429
return self._data.pop(key, default)
402430

403431
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+
"""
404438
return self._data.popitem()
405439

406440
def clear(self) -> None:
441+
"""
442+
Remove all items from D.
443+
"""
407444
self._data.clear()
408445

409446
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+
"""
410451
self._data.update(*args, **kwargs)
411452

412453
@typing.overload
@@ -416,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
416457
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
417458

418459
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+
"""
419467
if default is _UNSET:
420468
return self._data.setdefault(key)
421469
return self._data.setdefault(key, default)
@@ -573,7 +621,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
573621
def copy(self) -> "Model":
574622
return Model(self.__dict__)
575623

576-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
624+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
577625
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
578626
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
579627
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -584,8 +632,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
584632
annotations = {
585633
k: v
586634
for mro_class in mros
587-
if hasattr(mro_class, "__annotations__") # pylint: disable=no-member
588-
for k, v in mro_class.__annotations__.items() # pylint: disable=no-member
635+
if hasattr(mro_class, "__annotations__")
636+
for k, v in mro_class.__annotations__.items()
589637
}
590638
for attr, rf in attr_to_rest_field.items():
591639
rf._module = cls.__module__
@@ -600,8 +648,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
600648

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

606654
@classmethod
607655
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -612,7 +660,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
612660

613661
@classmethod
614662
def _deserialize(cls, data, exist_discriminators):
615-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
663+
if not hasattr(cls, "__mapping__"):
616664
return cls(data)
617665
discriminator = cls._get_discriminator(exist_discriminators)
618666
if discriminator is None:
@@ -632,11 +680,11 @@ def _deserialize(cls, data, exist_discriminators):
632680
discriminator_value = data.find(xml_name).text # pyright: ignore
633681
else:
634682
discriminator_value = data.get(discriminator._rest_name)
635-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
683+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636684
return mapped_cls._deserialize(data, exist_discriminators)
637685

638686
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
639-
"""Return a dict that can be JSONify using json.dump.
687+
"""Return a dict that can be turned into json using json.dump.
640688
641689
:keyword bool exclude_readonly: Whether to remove the readonly properties.
642690
:returns: A dict JSON compatible object
@@ -733,7 +781,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An
733781
)
734782

735783

736-
def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912
784+
def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches
737785
annotation: typing.Any,
738786
module: typing.Optional[str],
739787
rf: typing.Optional["_RestField"] = None,
@@ -753,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915,
753801
except AttributeError:
754802
model_name = annotation
755803
if module is not None:
756-
annotation = _get_model(module, model_name)
804+
annotation = _get_model(module, model_name) # type: ignore
757805

758806
try:
759807
if module and _is_model(annotation):
@@ -893,6 +941,35 @@ def _deserialize(
893941
return _deserialize_with_callable(deserializer, value)
894942

895943

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+
896973
class _RestField:
897974
def __init__(
898975
self,

0 commit comments

Comments
 (0)