Skip to content

Commit 2d3610d

Browse files
author
SDKAuto
committed
CodeGen from PR 30578 in Azure/azure-rest-api-specs
Merge 2e7642da2ac21fa179fdac1b59f1ec10df039917 into f14445d3b414c86ef608ac9c6750ff203702e1f2
1 parent 5136a43 commit 2d3610d

File tree

18 files changed

+231
-202
lines changed

18 files changed

+231
-202
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "4883fa5dbf6f2c9093fac8ce334547e9dfac68fa",
2+
"commit": "5d09a716e1f6191dc135d8655e194784a8cea25e",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/computeschedule/ComputeSchedule.Management",
5-
"@azure-tools/typespec-python": "0.33.0"
5+
"@azure-tools/typespec-python": "0.36.1"
66
}

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/__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 ComputeScheduleMgmtClient
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 ComputeScheduleMgmtClient # 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
"ComputeScheduleMgmtClient",
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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
from .operations import Operations, ScheduledActionsOperations
2121

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

2625

27-
class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26+
class ComputeScheduleMgmtClient:
2827
"""Microsoft.ComputeSchedule Resource Provider management API.
2928
3029
:ivar operations: Operations operations

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

Lines changed: 1 addition & 2 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 ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for ComputeScheduleMgmtClient.
2322
2423
Note that all parameters used to create this instance are saved as instance

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/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 ComputeScheduleMgmtClient
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 ComputeScheduleMgmtClient # 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
"ComputeScheduleMgmtClient",
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/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
from .operations import Operations, ScheduledActionsOperations
2121

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

2625

27-
class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26+
class ComputeScheduleMgmtClient:
2827
"""Microsoft.ComputeSchedule Resource Provider management API.
2928
3029
:ivar operations: Operations operations

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py

Lines changed: 1 addition & 2 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 ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for ComputeScheduleMgmtClient.
2322
2423
Note that all parameters used to create this instance are saved as instance

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@
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 ScheduledActionsOperations
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 ScheduledActionsOperations # type: ignore
1117

1218
from ._patch import __all__ as _patch_all
13-
from ._patch import * # pylint: disable=unused-wildcard-import
19+
from ._patch import *
1420
from ._patch import patch_sdk as _patch_sdk
1521

1622
__all__ = [
1723
"Operations",
1824
"ScheduledActionsOperations",
1925
]
20-
__all__.extend([p for p in _patch_all if p not in __all__])
26+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2127
_patch_sdk()

0 commit comments

Comments
 (0)