Skip to content

Commit 4c09853

Browse files
authored
code and test (Azure#27356)
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
1 parent 461dff5 commit 4c09853

File tree

127 files changed

+6007
-991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+6007
-991
lines changed

sdk/devcenter/azure-mgmt-devcenter/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Release History
22

3+
## 1.0.0b3 (2022-11-08)
4+
5+
### Features Added
6+
7+
- Model Catalog has a new parameter sync_state
8+
- Model CatalogProperties has a new parameter sync_state
9+
- Model OperationStatus has a new parameter operations
10+
- Model OperationStatus has a new parameter resource_id
11+
12+
### Breaking Changes
13+
14+
- Client name is changed from `DevCenterClient` to `DevCenterMgmtClient`
15+
- Parameter status of model OperationStatus is now required
16+
317
## 1.0.0b2 (2022-09-29)
418

519
### Features Added
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2+
"commit": "4903b1ed79e30f689d7c469cfa06734cfcd106d6",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
24
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@6.1.6",
6+
"@autorest/python@6.2.1",
57
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "14677ba21f6b5676e79b33d699f7a103dd8f255f",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/devcenter/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/devcenter/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/devcenter/resource-manager/readme.md"
1111
}

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

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

9-
from ._dev_center_client import DevCenterClient
9+
from ._dev_center_mgmt_client import DevCenterMgmtClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
@@ -18,7 +18,9 @@
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
2020

21-
__all__ = ["DevCenterClient"]
21+
__all__ = [
22+
"DevCenterMgmtClient",
23+
]
2224
__all__.extend([p for p in _patch_all if p not in __all__])
2325

2426
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,30 +15,34 @@
1415

1516
from ._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials import TokenCredential
2026

2127

22-
class DevCenterClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
23-
"""Configuration for DevCenterClient.
28+
class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
29+
"""Configuration for DevCenterMgmtClient.
2430
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
2834
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: Unique identifier of the Azure subscription. This is a GUID-formatted
31-
string (e.g. 00000000-0000-0000-0000-000000000000). Required.
36+
:param subscription_id: The ID of the target subscription. Required.
3237
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
38+
:keyword api_version: Api Version. Default value is "2022-10-12-preview". Note that overriding
3439
this default value may result in unsupported behavior.
3540
:paramtype api_version: str
3641
"""
3742

3843
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39-
super(DevCenterClientConfiguration, self).__init__(**kwargs)
40-
api_version = kwargs.pop("api_version", "2022-09-01-preview") # type: str
44+
super(DevCenterMgmtClientConfiguration, self).__init__(**kwargs)
45+
api_version = kwargs.pop("api_version", "2022-10-12-preview") # type: Literal["2022-10-12-preview"]
4146

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

sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_client.py renamed to sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_mgmt_client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from azure.mgmt.core import ARMPipelineClient
1414

1515
from . import models
16-
from ._configuration import DevCenterClientConfiguration
16+
from ._configuration import DevCenterMgmtClientConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
1919
AttachedNetworksOperations,
@@ -41,7 +41,7 @@
4141
from azure.core.credentials import TokenCredential
4242

4343

44-
class DevCenterClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
44+
class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4545
"""DevCenter Management API.
4646
4747
:ivar dev_centers: DevCentersOperations operations
@@ -84,12 +84,11 @@ class DevCenterClient: # pylint: disable=client-accepts-api-version-keyword,too
8484
:vartype network_connections: azure.mgmt.devcenter.operations.NetworkConnectionsOperations
8585
:param credential: Credential needed for the client to connect to Azure. Required.
8686
:type credential: ~azure.core.credentials.TokenCredential
87-
:param subscription_id: Unique identifier of the Azure subscription. This is a GUID-formatted
88-
string (e.g. 00000000-0000-0000-0000-000000000000). Required.
87+
:param subscription_id: The ID of the target subscription. Required.
8988
:type subscription_id: str
9089
:param base_url: Service URL. Default value is "https://management.azure.com".
9190
:type base_url: str
92-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
91+
:keyword api_version: Api Version. Default value is "2022-10-12-preview". Note that overriding
9392
this default value may result in unsupported behavior.
9493
:paramtype api_version: str
9594
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -103,7 +102,9 @@ def __init__(
103102
base_url: str = "https://management.azure.com",
104103
**kwargs: Any
105104
) -> None:
106-
self._config = DevCenterClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
105+
self._config = DevCenterMgmtClientConfiguration(
106+
credential=credential, subscription_id=subscription_id, **kwargs
107+
)
107108
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
108109

109110
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
@@ -170,7 +171,7 @@ def close(self):
170171
self._client.close()
171172

172173
def __enter__(self):
173-
# type: () -> DevCenterClient
174+
# type: () -> DevCenterMgmtClient
174175
self._client.__enter__()
175176
return self
176177

sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_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.0b2"
9+
VERSION = "1.0.0b3"

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

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

9-
from ._dev_center_client import DevCenterClient
9+
from ._dev_center_mgmt_client import DevCenterMgmtClient
1010

1111
try:
1212
from ._patch import __all__ as _patch_all
@@ -15,7 +15,9 @@
1515
_patch_all = []
1616
from ._patch import patch_sdk as _patch_sdk
1717

18-
__all__ = ["DevCenterClient"]
18+
__all__ = [
19+
"DevCenterMgmtClient",
20+
]
1921
__all__.extend([p for p in _patch_all if p not in __all__])
2022

2123
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,30 +15,34 @@
1415

1516
from .._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials_async import AsyncTokenCredential
2026

2127

22-
class DevCenterClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
23-
"""Configuration for DevCenterClient.
28+
class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
29+
"""Configuration for DevCenterMgmtClient.
2430
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
2834
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
30-
:param subscription_id: Unique identifier of the Azure subscription. This is a GUID-formatted
31-
string (e.g. 00000000-0000-0000-0000-000000000000). Required.
36+
:param subscription_id: The ID of the target subscription. Required.
3237
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
38+
:keyword api_version: Api Version. Default value is "2022-10-12-preview". Note that overriding
3439
this default value may result in unsupported behavior.
3540
:paramtype api_version: str
3641
"""
3742

3843
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
39-
super(DevCenterClientConfiguration, self).__init__(**kwargs)
40-
api_version = kwargs.pop("api_version", "2022-09-01-preview") # type: str
44+
super(DevCenterMgmtClientConfiguration, self).__init__(**kwargs)
45+
api_version = kwargs.pop("api_version", "2022-10-12-preview") # type: Literal["2022-10-12-preview"]
4146

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

sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_client.py renamed to sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_mgmt_client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from .. import models
1616
from .._serialization import Deserializer, Serializer
17-
from ._configuration import DevCenterClientConfiguration
17+
from ._configuration import DevCenterMgmtClientConfiguration
1818
from .operations import (
1919
AttachedNetworksOperations,
2020
CatalogsOperations,
@@ -41,7 +41,7 @@
4141
from azure.core.credentials_async import AsyncTokenCredential
4242

4343

44-
class DevCenterClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
44+
class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4545
"""DevCenter Management API.
4646
4747
:ivar dev_centers: DevCentersOperations operations
@@ -84,12 +84,11 @@ class DevCenterClient: # pylint: disable=client-accepts-api-version-keyword,too
8484
:vartype network_connections: azure.mgmt.devcenter.aio.operations.NetworkConnectionsOperations
8585
:param credential: Credential needed for the client to connect to Azure. Required.
8686
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
87-
:param subscription_id: Unique identifier of the Azure subscription. This is a GUID-formatted
88-
string (e.g. 00000000-0000-0000-0000-000000000000). Required.
87+
:param subscription_id: The ID of the target subscription. Required.
8988
:type subscription_id: str
9089
:param base_url: Service URL. Default value is "https://management.azure.com".
9190
:type base_url: str
92-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
91+
:keyword api_version: Api Version. Default value is "2022-10-12-preview". Note that overriding
9392
this default value may result in unsupported behavior.
9493
:paramtype api_version: str
9594
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -103,7 +102,9 @@ def __init__(
103102
base_url: str = "https://management.azure.com",
104103
**kwargs: Any
105104
) -> None:
106-
self._config = DevCenterClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
105+
self._config = DevCenterMgmtClientConfiguration(
106+
credential=credential, subscription_id=subscription_id, **kwargs
107+
)
107108
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
108109

109110
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
@@ -168,7 +169,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH
168169
async def close(self) -> None:
169170
await self._client.close()
170171

171-
async def __aenter__(self) -> "DevCenterClient":
172+
async def __aenter__(self) -> "DevCenterMgmtClient":
172173
await self._client.__aenter__()
173174
return self
174175

0 commit comments

Comments
 (0)