Skip to content

Commit 374a626

Browse files
author
SDKAuto
committed
CodeGen from PR 30578 in Azure/azure-rest-api-specs
Merge 34c5aaf5e8c5b95bf963ac0821fd0359e31097f7 into 0035f4bd79ef31f8d4e3303ed0a38c1087f57fcf
1 parent fd3d6b9 commit 374a626

35 files changed

+270
-275
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": "ad3531d07f936c972731c9230a5483bdce9e28cd",
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.36.1"
66
}

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: 11 additions & 10 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
@@ -573,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
573574
def copy(self) -> "Model":
574575
return Model(self.__dict__)
575576

576-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
577+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
577578
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
578579
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
579580
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -584,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
584585
annotations = {
585586
k: v
586587
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
588+
if hasattr(mro_class, "__annotations__")
589+
for k, v in mro_class.__annotations__.items()
589590
}
590591
for attr, rf in attr_to_rest_field.items():
591592
rf._module = cls.__module__
@@ -600,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
600601

601602
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
602603
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
604+
if hasattr(base, "__mapping__"):
605+
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore
605606

606607
@classmethod
607608
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -612,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
612613

613614
@classmethod
614615
def _deserialize(cls, data, exist_discriminators):
615-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
616+
if not hasattr(cls, "__mapping__"):
616617
return cls(data)
617618
discriminator = cls._get_discriminator(exist_discriminators)
618619
if discriminator is None:
@@ -632,11 +633,11 @@ def _deserialize(cls, data, exist_discriminators):
632633
discriminator_value = data.find(xml_name).text # pyright: ignore
633634
else:
634635
discriminator_value = data.get(discriminator._rest_name)
635-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
636+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636637
return mapped_cls._deserialize(data, exist_discriminators)
637638

638639
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
639-
"""Return a dict that can be JSONify using json.dump.
640+
"""Return a dict that can be turned into json using json.dump.
640641
641642
:keyword bool exclude_readonly: Whether to remove the readonly properties.
642643
:returns: A dict JSON compatible object
@@ -733,7 +734,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An
733734
)
734735

735736

736-
def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912
737+
def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches
737738
annotation: typing.Any,
738739
module: typing.Optional[str],
739740
rf: typing.Optional["_RestField"] = None,

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
227227
:param datetime.timedelta offset: offset in timedelta format
228228
"""
229229

230-
def __init__(self, offset):
230+
def __init__(self, offset) -> None:
231231
self.__offset = offset
232232

233233
def utcoffset(self, dt):
@@ -507,7 +507,6 @@ def _flatten_subtype(cls, key, objects):
507507
def _classify(cls, response, objects):
508508
"""Check the class _subtype_map for any child classes.
509509
We want to ignore any inherited _subtype_maps.
510-
Remove the polymorphic key from the initial data.
511510
512511
:param dict response: The initial data
513512
:param dict objects: The class objects
@@ -519,7 +518,7 @@ def _classify(cls, response, objects):
519518

520519
if not isinstance(response, ET.Element):
521520
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
522-
subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
521+
subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
523522
else:
524523
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
525524
if subtype_value:
@@ -599,7 +598,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
599598
"multiple": lambda x, y: x % y != 0,
600599
}
601600

602-
def __init__(self, classes: Optional[Mapping[str, type]] = None):
601+
def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
603602
self.serialize_type = {
604603
"iso-8601": Serializer.serialize_iso,
605604
"rfc-1123": Serializer.serialize_rfc,
@@ -1453,7 +1452,7 @@ class Deserializer(object):
14531452

14541453
valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
14551454

1456-
def __init__(self, classes: Optional[Mapping[str, type]] = None):
1455+
def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
14571456
self.deserialize_type = {
14581457
"iso-8601": Deserializer.deserialize_iso,
14591458
"rfc-1123": Deserializer.deserialize_rfc,

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
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

1117
try:
1218
from ._patch import __all__ as _patch_all
13-
from ._patch import * # pylint: disable=unused-wildcard-import
19+
from ._patch import *
1420
except ImportError:
1521
_patch_all = []
1622
from ._patch import patch_sdk as _patch_sdk
1723

1824
__all__ = [
1925
"TrustedSigningMgmtClient",
2026
]
21-
__all__.extend([p for p in _patch_all if p not in __all__])
27+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2228

2329
_patch_sdk()

sdk/trustedsigning/azure-mgmt-trustedsigning/azure/mgmt/trustedsigning/aio/_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_async import AsyncTokenCredential
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/aio/_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_async import AsyncTokenCredential
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/aio/operations/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
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 ._operations import Operations
10-
from ._operations import CodeSigningAccountsOperations
11-
from ._operations import CertificateProfilesOperations
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._operations import Operations # type: ignore
16+
from ._operations import CodeSigningAccountsOperations # type: ignore
17+
from ._operations import CertificateProfilesOperations # type: ignore
1218

1319
from ._patch import __all__ as _patch_all
14-
from ._patch import * # pylint: disable=unused-wildcard-import
20+
from ._patch import *
1521
from ._patch import patch_sdk as _patch_sdk
1622

1723
__all__ = [
1824
"Operations",
1925
"CodeSigningAccountsOperations",
2026
"CertificateProfilesOperations",
2127
]
22-
__all__.extend([p for p in _patch_all if p not in __all__])
28+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2329
_patch_sdk()

0 commit comments

Comments
 (0)