Skip to content

Commit 59d16cd

Browse files
authored
code and test (#35049)
Co-authored-by: azure-sdk <PythonSdkPipelines>
1 parent 22fda36 commit 59d16cd

File tree

169 files changed

+7215
-6316
lines changed

Some content is hidden

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

169 files changed

+7215
-6316
lines changed

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

+77
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,82 @@
11
# Release History
22

3+
## 1.1.0 (2024-04-22)
4+
5+
### Features Added
6+
7+
- Added operation CatalogsOperations.begin_connect
8+
- Added operation CatalogsOperations.get_sync_error_details
9+
- Added operation group CheckScopedNameAvailabilityOperations
10+
- Added operation group EnvironmentDefinitionsOperations
11+
- Added operation group ProjectCatalogEnvironmentDefinitionsOperations
12+
- Added operation group ProjectCatalogsOperations
13+
- Model AllowedEnvironmentType has a new parameter display_name
14+
- Model Catalog has a new parameter connection_state
15+
- Model Catalog has a new parameter last_connection_time
16+
- Model Catalog has a new parameter last_sync_stats
17+
- Model Catalog has a new parameter sync_type
18+
- Model Catalog has a new parameter tags
19+
- Model CatalogProperties has a new parameter connection_state
20+
- Model CatalogProperties has a new parameter last_connection_time
21+
- Model CatalogProperties has a new parameter last_sync_stats
22+
- Model CatalogProperties has a new parameter sync_type
23+
- Model CatalogProperties has a new parameter tags
24+
- Model CatalogUpdate has a new parameter sync_type
25+
- Model CatalogUpdateProperties has a new parameter sync_type
26+
- Model CatalogUpdateProperties has a new parameter tags
27+
- Model DevBoxDefinition has a new parameter validation_status
28+
- Model DevBoxDefinitionProperties has a new parameter validation_status
29+
- Model DevCenter has a new parameter display_name
30+
- Model DevCenter has a new parameter encryption
31+
- Model DevCenter has a new parameter project_catalog_settings
32+
- Model DevCenterUpdate has a new parameter display_name
33+
- Model DevCenterUpdate has a new parameter encryption
34+
- Model DevCenterUpdate has a new parameter project_catalog_settings
35+
- Model EnvironmentType has a new parameter display_name
36+
- Model EnvironmentTypeUpdate has a new parameter display_name
37+
- Model OperationStatusResult has a new parameter resource_id
38+
- Model Pool has a new parameter dev_box_count
39+
- Model Pool has a new parameter display_name
40+
- Model Pool has a new parameter managed_virtual_network_regions
41+
- Model Pool has a new parameter single_sign_on_status
42+
- Model Pool has a new parameter virtual_network_type
43+
- Model PoolProperties has a new parameter dev_box_count
44+
- Model PoolProperties has a new parameter display_name
45+
- Model PoolProperties has a new parameter managed_virtual_network_regions
46+
- Model PoolProperties has a new parameter single_sign_on_status
47+
- Model PoolProperties has a new parameter virtual_network_type
48+
- Model PoolUpdate has a new parameter display_name
49+
- Model PoolUpdate has a new parameter managed_virtual_network_regions
50+
- Model PoolUpdate has a new parameter single_sign_on_status
51+
- Model PoolUpdate has a new parameter virtual_network_type
52+
- Model PoolUpdateProperties has a new parameter display_name
53+
- Model PoolUpdateProperties has a new parameter managed_virtual_network_regions
54+
- Model PoolUpdateProperties has a new parameter single_sign_on_status
55+
- Model PoolUpdateProperties has a new parameter virtual_network_type
56+
- Model Project has a new parameter catalog_settings
57+
- Model Project has a new parameter display_name
58+
- Model Project has a new parameter identity
59+
- Model ProjectEnvironmentType has a new parameter display_name
60+
- Model ProjectEnvironmentType has a new parameter environment_count
61+
- Model ProjectEnvironmentTypeProperties has a new parameter display_name
62+
- Model ProjectEnvironmentTypeProperties has a new parameter environment_count
63+
- Model ProjectEnvironmentTypeUpdate has a new parameter display_name
64+
- Model ProjectEnvironmentTypeUpdateProperties has a new parameter display_name
65+
- Model ProjectProperties has a new parameter catalog_settings
66+
- Model ProjectProperties has a new parameter display_name
67+
- Model ProjectUpdate has a new parameter catalog_settings
68+
- Model ProjectUpdate has a new parameter display_name
69+
- Model ProjectUpdate has a new parameter identity
70+
- Model ProjectUpdateProperties has a new parameter catalog_settings
71+
- Model ProjectUpdateProperties has a new parameter display_name
72+
- Model Schedule has a new parameter location
73+
- Model Schedule has a new parameter tags
74+
- Model ScheduleProperties has a new parameter location
75+
- Model ScheduleProperties has a new parameter tags
76+
- Model ScheduleUpdateProperties has a new parameter location
77+
- Model ScheduleUpdateProperties has a new parameter tags
78+
- Model Usage has a new parameter id
79+
380
## 1.1.0b1 (2023-10-23)
481

582
### Features Added

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Devcenter Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "f776434f63fb6505926273db8d4f9a93b75ee4a1",
2+
"commit": "0a589a481da1288f9d3458572e580113002bd53b",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --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.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/devcenter/resource-manager/readme.md"
1111
}

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class DevCenterMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for DevCenterMgmtClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,14 +28,13 @@ class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-ma
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The ID of the target subscription. Required.
3130
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
31+
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
32+
default value may result in unsupported behavior.
3433
:paramtype api_version: str
3534
"""
3635

3736
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(DevCenterMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
37+
api_version: str = kwargs.pop("api_version", "2024-02-01")
4038

4139
if credential is None:
4240
raise ValueError("Parameter 'credential' must not be None.")
@@ -48,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4846
self.api_version = api_version
4947
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5048
kwargs.setdefault("sdk_moniker", "mgmt-devcenter/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6261
self.authentication_policy = kwargs.get("authentication_policy")
6362
if self.credential and not self.authentication_policy:
6463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

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

+50-22
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import DevCenterMgmtClientConfiguration
1719
from ._serialization import Deserializer, Serializer
1820
from .operations import (
1921
AttachedNetworksOperations,
20-
CatalogDevBoxDefinitionsOperations,
2122
CatalogsOperations,
2223
CheckNameAvailabilityOperations,
23-
CustomizationTasksOperations,
24+
CheckScopedNameAvailabilityOperations,
2425
DevBoxDefinitionsOperations,
2526
DevCentersOperations,
2627
EnvironmentDefinitionsOperations,
@@ -33,6 +34,8 @@
3334
Operations,
3435
PoolsOperations,
3536
ProjectAllowedEnvironmentTypesOperations,
37+
ProjectCatalogEnvironmentDefinitionsOperations,
38+
ProjectCatalogsOperations,
3639
ProjectEnvironmentTypesOperations,
3740
ProjectsOperations,
3841
SchedulesOperations,
@@ -54,6 +57,15 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
5457
:vartype projects: azure.mgmt.devcenter.operations.ProjectsOperations
5558
:ivar attached_networks: AttachedNetworksOperations operations
5659
:vartype attached_networks: azure.mgmt.devcenter.operations.AttachedNetworksOperations
60+
:ivar project_catalogs: ProjectCatalogsOperations operations
61+
:vartype project_catalogs: azure.mgmt.devcenter.operations.ProjectCatalogsOperations
62+
:ivar environment_definitions: EnvironmentDefinitionsOperations operations
63+
:vartype environment_definitions:
64+
azure.mgmt.devcenter.operations.EnvironmentDefinitionsOperations
65+
:ivar project_catalog_environment_definitions: ProjectCatalogEnvironmentDefinitionsOperations
66+
operations
67+
:vartype project_catalog_environment_definitions:
68+
azure.mgmt.devcenter.operations.ProjectCatalogEnvironmentDefinitionsOperations
5769
:ivar galleries: GalleriesOperations operations
5870
:vartype galleries: azure.mgmt.devcenter.operations.GalleriesOperations
5971
:ivar images: ImagesOperations operations
@@ -81,14 +93,9 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
8193
:ivar check_name_availability: CheckNameAvailabilityOperations operations
8294
:vartype check_name_availability:
8395
azure.mgmt.devcenter.operations.CheckNameAvailabilityOperations
84-
:ivar catalog_dev_box_definitions: CatalogDevBoxDefinitionsOperations operations
85-
:vartype catalog_dev_box_definitions:
86-
azure.mgmt.devcenter.operations.CatalogDevBoxDefinitionsOperations
87-
:ivar customization_tasks: CustomizationTasksOperations operations
88-
:vartype customization_tasks: azure.mgmt.devcenter.operations.CustomizationTasksOperations
89-
:ivar environment_definitions: EnvironmentDefinitionsOperations operations
90-
:vartype environment_definitions:
91-
azure.mgmt.devcenter.operations.EnvironmentDefinitionsOperations
96+
:ivar check_scoped_name_availability: CheckScopedNameAvailabilityOperations operations
97+
:vartype check_scoped_name_availability:
98+
azure.mgmt.devcenter.operations.CheckScopedNameAvailabilityOperations
9299
:ivar skus: SkusOperations operations
93100
:vartype skus: azure.mgmt.devcenter.operations.SkusOperations
94101
:ivar pools: PoolsOperations operations
@@ -103,8 +110,8 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
103110
:type subscription_id: str
104111
:param base_url: Service URL. Default value is "https://management.azure.com".
105112
:type base_url: str
106-
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
107-
this default value may result in unsupported behavior.
113+
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
114+
default value may result in unsupported behavior.
108115
:paramtype api_version: str
109116
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
110117
Retry-After header is present.
@@ -120,7 +127,25 @@ def __init__(
120127
self._config = DevCenterMgmtClientConfiguration(
121128
credential=credential, subscription_id=subscription_id, **kwargs
122129
)
123-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
130+
_policies = kwargs.pop("policies", None)
131+
if _policies is None:
132+
_policies = [
133+
policies.RequestIdPolicy(**kwargs),
134+
self._config.headers_policy,
135+
self._config.user_agent_policy,
136+
self._config.proxy_policy,
137+
policies.ContentDecodePolicy(**kwargs),
138+
ARMAutoResourceProviderRegistrationPolicy(),
139+
self._config.redirect_policy,
140+
self._config.retry_policy,
141+
self._config.authentication_policy,
142+
self._config.custom_hook_policy,
143+
self._config.logging_policy,
144+
policies.DistributedTracingPolicy(**kwargs),
145+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
146+
self._config.http_logging_policy,
147+
]
148+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
124149

125150
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
126151
self._serialize = Serializer(client_models)
@@ -131,6 +156,15 @@ def __init__(
131156
self.attached_networks = AttachedNetworksOperations(
132157
self._client, self._config, self._serialize, self._deserialize
133158
)
159+
self.project_catalogs = ProjectCatalogsOperations(
160+
self._client, self._config, self._serialize, self._deserialize
161+
)
162+
self.environment_definitions = EnvironmentDefinitionsOperations(
163+
self._client, self._config, self._serialize, self._deserialize
164+
)
165+
self.project_catalog_environment_definitions = ProjectCatalogEnvironmentDefinitionsOperations(
166+
self._client, self._config, self._serialize, self._deserialize
167+
)
134168
self.galleries = GalleriesOperations(self._client, self._config, self._serialize, self._deserialize)
135169
self.images = ImagesOperations(self._client, self._config, self._serialize, self._deserialize)
136170
self.image_versions = ImageVersionsOperations(self._client, self._config, self._serialize, self._deserialize)
@@ -155,13 +189,7 @@ def __init__(
155189
self.check_name_availability = CheckNameAvailabilityOperations(
156190
self._client, self._config, self._serialize, self._deserialize
157191
)
158-
self.catalog_dev_box_definitions = CatalogDevBoxDefinitionsOperations(
159-
self._client, self._config, self._serialize, self._deserialize
160-
)
161-
self.customization_tasks = CustomizationTasksOperations(
162-
self._client, self._config, self._serialize, self._deserialize
163-
)
164-
self.environment_definitions = EnvironmentDefinitionsOperations(
192+
self.check_scoped_name_availability = CheckScopedNameAvailabilityOperations(
165193
self._client, self._config, self._serialize, self._deserialize
166194
)
167195
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
@@ -171,7 +199,7 @@ def __init__(
171199
self._client, self._config, self._serialize, self._deserialize
172200
)
173201

174-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
202+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
175203
"""Runs the network request through the client's chained policies.
176204
177205
>>> from azure.core.rest import HttpRequest
@@ -191,7 +219,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
191219

192220
request_copy = deepcopy(request)
193221
request_copy.url = self._client.format_url(request_copy.url)
194-
return self._client.send_request(request_copy, **kwargs)
222+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
195223

196224
def close(self) -> None:
197225
self._client.close()

0 commit comments

Comments
 (0)