Skip to content

Commit d6d2089

Browse files
author
SDKAuto
committed
CodeGen from PR 31543 in Azure/azure-rest-api-specs
Merge b9933f6f77779bdd9c747533813f3b4766b4230f into 43ce04961ccb6496e421789c54798ba1e0880f64
1 parent 9114d29 commit d6d2089

File tree

17 files changed

+185
-242
lines changed

17 files changed

+185
-242
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "95e89f00932d2a8f04ff80e28f8ce10ee586ca7d",
2+
"commit": "405438c72094a0a43fbcba18a56aa71110b78db8",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management",
5-
"@azure-tools/typespec-python": "0.36.0"
5+
"@azure-tools/typespec-python": "0.36.5"
66
}

sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/__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 DevOpsInfrastructureMgmtClient
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 DevOpsInfrastructureMgmtClient # 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/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_model_base.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Licensed under the MIT License. See License.txt in the project root for
66
# license information.
77
# --------------------------------------------------------------------------
8-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
8+
# pylint: disable=protected-access, broad-except
99

1010
import copy
1111
import calendar
@@ -574,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
574574
def copy(self) -> "Model":
575575
return Model(self.__dict__)
576576

577-
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:
578578
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
579579
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
580580
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -585,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
585585
annotations = {
586586
k: v
587587
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
588+
if hasattr(mro_class, "__annotations__")
589+
for k, v in mro_class.__annotations__.items()
590590
}
591591
for attr, rf in attr_to_rest_field.items():
592592
rf._module = cls.__module__
@@ -601,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
601601

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

607607
@classmethod
608608
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -613,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
613613

614614
@classmethod
615615
def _deserialize(cls, data, exist_discriminators):
616-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
616+
if not hasattr(cls, "__mapping__"):
617617
return cls(data)
618618
discriminator = cls._get_discriminator(exist_discriminators)
619619
if discriminator is None:
@@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators):
633633
discriminator_value = data.find(xml_name).text # pyright: ignore
634634
else:
635635
discriminator_value = data.get(discriminator._rest_name)
636-
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
637637
return mapped_cls._deserialize(data, exist_discriminators)
638638

639639
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
@@ -754,7 +754,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
754754
except AttributeError:
755755
model_name = annotation
756756
if module is not None:
757-
annotation = _get_model(module, model_name)
757+
annotation = _get_model(module, model_name) # type: ignore
758758

759759
try:
760760
if module and _is_model(annotation):

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=too-many-lines
12
# --------------------------------------------------------------------------
23
#
34
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -506,7 +507,6 @@ def _flatten_subtype(cls, key, objects):
506507
def _classify(cls, response, objects):
507508
"""Check the class _subtype_map for any child classes.
508509
We want to ignore any inherited _subtype_maps.
509-
Remove the polymorphic key from the initial data.
510510
511511
:param dict response: The initial data
512512
:param dict objects: The class objects
@@ -518,7 +518,7 @@ def _classify(cls, response, objects):
518518

519519
if not isinstance(response, ET.Element):
520520
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
521-
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)
522522
else:
523523
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
524524
if subtype_value:
@@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
16831683
subtype = getattr(response, "_subtype_map", {})
16841684
try:
16851685
readonly = [
1686-
k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
1686+
k
1687+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1688+
if v.get("readonly")
16871689
]
16881690
const = [
1689-
k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
1691+
k
1692+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1693+
if v.get("constant")
16901694
]
16911695
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
16921696
response_obj = response(**kwargs)
16931697
for attr in readonly:
16941698
setattr(response_obj, attr, attrs.get(attr))
16951699
if additional_properties:
1696-
response_obj.additional_properties = additional_properties
1700+
response_obj.additional_properties = additional_properties # type: ignore
16971701
return response_obj
16981702
except TypeError as err:
16991703
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore

sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@
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 DevOpsInfrastructureMgmtClient
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 DevOpsInfrastructureMgmtClient # 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

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
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 PoolsOperations
11-
from ._operations import ResourceDetailsOperations
12-
from ._operations import SkuOperations
13-
from ._operations import SubscriptionUsagesOperations
14-
from ._operations import ImageVersionsOperations
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 PoolsOperations # type: ignore
17+
from ._operations import ResourceDetailsOperations # type: ignore
18+
from ._operations import SkuOperations # type: ignore
19+
from ._operations import SubscriptionUsagesOperations # type: ignore
20+
from ._operations import ImageVersionsOperations # type: ignore
1521

1622
from ._patch import __all__ as _patch_all
17-
from ._patch import * # pylint: disable=unused-wildcard-import
23+
from ._patch import *
1824
from ._patch import patch_sdk as _patch_sdk
1925

2026
__all__ = [

sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, *args, **kwargs) -> None:
7575
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
7676

7777
@distributed_trace
78-
def list(self, **kwargs: Any) -> AsyncIterable["_models._models.Operation"]:
78+
def _list(self, **kwargs: Any) -> AsyncIterable["_models._models.Operation"]:
7979
"""List the operations for the provider.
8080
8181
:return: An iterator like instance of Operation

sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/__init__.py

Lines changed: 73 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,82 @@
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 ._models import AgentProfile
10-
from ._models import AutomaticResourcePredictionsProfile
11-
from ._models import AzureDevOpsOrganizationProfile
12-
from ._models import AzureDevOpsPermissionProfile
13-
from ._models import DataDisk
14-
from ._models import DevOpsAzureSku
15-
from ._models import ErrorAdditionalInfo
16-
from ._models import ErrorDetail
17-
from ._models import ErrorResponse
18-
from ._models import FabricProfile
19-
from ._models import GitHubOrganization
20-
from ._models import GitHubOrganizationProfile
21-
from ._models import ImageVersion
22-
from ._models import ImageVersionProperties
23-
from ._models import ManagedServiceIdentity
24-
from ._models import ManualResourcePredictionsProfile
25-
from ._models import NetworkProfile
26-
from ._models import Organization
27-
from ._models import OrganizationProfile
28-
from ._models import OsProfile
29-
from ._models import Pool
30-
from ._models import PoolImage
31-
from ._models import PoolProperties
32-
from ._models import PoolUpdate
33-
from ._models import PoolUpdateProperties
34-
from ._models import ProxyResource
35-
from ._models import Quota
36-
from ._models import QuotaName
37-
from ._models import Resource
38-
from ._models import ResourceDetailsObject
39-
from ._models import ResourceDetailsObjectProperties
40-
from ._models import ResourcePredictions
41-
from ._models import ResourcePredictionsProfile
42-
from ._models import ResourceSku
43-
from ._models import ResourceSkuCapabilities
44-
from ._models import ResourceSkuLocationInfo
45-
from ._models import ResourceSkuProperties
46-
from ._models import ResourceSkuRestrictionInfo
47-
from ._models import ResourceSkuRestrictions
48-
from ._models import ResourceSkuZoneDetails
49-
from ._models import SecretsManagementSettings
50-
from ._models import Stateful
51-
from ._models import StatelessAgentProfile
52-
from ._models import StorageProfile
53-
from ._models import SystemData
54-
from ._models import TrackedResource
55-
from ._models import UserAssignedIdentity
56-
from ._models import VmssFabricProfile
10+
from typing import TYPE_CHECKING
5711

58-
from ._enums import AzureDevOpsPermissionType
59-
from ._enums import CachingType
60-
from ._enums import CreatedByType
61-
from ._enums import LogonType
62-
from ._enums import ManagedServiceIdentityType
63-
from ._enums import OsDiskStorageAccountType
64-
from ._enums import PredictionPreference
65-
from ._enums import ProvisioningState
66-
from ._enums import ResourcePredictionsProfileType
67-
from ._enums import ResourceSkuRestrictionsReasonCode
68-
from ._enums import ResourceSkuRestrictionsType
69-
from ._enums import ResourceStatus
70-
from ._enums import StorageAccountType
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
16+
from ._models import ( # type: ignore
17+
AgentProfile,
18+
AutomaticResourcePredictionsProfile,
19+
AzureDevOpsOrganizationProfile,
20+
AzureDevOpsPermissionProfile,
21+
DataDisk,
22+
DevOpsAzureSku,
23+
ErrorAdditionalInfo,
24+
ErrorDetail,
25+
ErrorResponse,
26+
FabricProfile,
27+
GitHubOrganization,
28+
GitHubOrganizationProfile,
29+
ImageVersion,
30+
ImageVersionProperties,
31+
ManagedServiceIdentity,
32+
ManualResourcePredictionsProfile,
33+
NetworkProfile,
34+
Organization,
35+
OrganizationProfile,
36+
OsProfile,
37+
Pool,
38+
PoolImage,
39+
PoolProperties,
40+
PoolUpdate,
41+
PoolUpdateProperties,
42+
ProxyResource,
43+
Quota,
44+
QuotaName,
45+
Resource,
46+
ResourceDetailsObject,
47+
ResourceDetailsObjectProperties,
48+
ResourcePredictions,
49+
ResourcePredictionsProfile,
50+
ResourceSku,
51+
ResourceSkuCapabilities,
52+
ResourceSkuLocationInfo,
53+
ResourceSkuProperties,
54+
ResourceSkuRestrictionInfo,
55+
ResourceSkuRestrictions,
56+
ResourceSkuZoneDetails,
57+
SecretsManagementSettings,
58+
Stateful,
59+
StatelessAgentProfile,
60+
StorageProfile,
61+
SystemData,
62+
TrackedResource,
63+
UserAssignedIdentity,
64+
VmssFabricProfile,
65+
)
66+
67+
from ._enums import ( # type: ignore
68+
AzureDevOpsPermissionType,
69+
CachingType,
70+
CreatedByType,
71+
LogonType,
72+
ManagedServiceIdentityType,
73+
OsDiskStorageAccountType,
74+
PredictionPreference,
75+
ProvisioningState,
76+
ResourcePredictionsProfileType,
77+
ResourceSkuRestrictionsReasonCode,
78+
ResourceSkuRestrictionsType,
79+
ResourceStatus,
80+
StorageAccountType,
81+
)
7182
from ._patch import __all__ as _patch_all
72-
from ._patch import * # pylint: disable=unused-wildcard-import
83+
from ._patch import *
7384
from ._patch import patch_sdk as _patch_sdk
7485

7586
__all__ = [

0 commit comments

Comments
 (0)