Skip to content

Commit 31d59dd

Browse files
author
SDKAuto
committed
CodeGen from PR 33581 in Azure/azure-rest-api-specs
Merge a125de51987277115941b197c6ff60b0055eafb6 into 1b47f62ee9da78db7e011c709c48ecd700095a5a
1 parent 25d9d1c commit 31d59dd

File tree

74 files changed

+4775
-4970
lines changed

Some content is hidden

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

74 files changed

+4775
-4970
lines changed

sdk/devcenter/azure-developer-devcenter/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ include azure/developer/devcenter/py.typed
44
recursive-include tests *.py
55
recursive-include samples *.py *.md
66
include azure/__init__.py
7-
include azure/developer/__init__.py
7+
include azure/developer/__init__.py
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "db0a427dd608866367df1ab1af02bc0eaf3f6d4e",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/devcenter/DevCenter",
5+
"@azure-tools/typespec-python": "0.41.0"
6+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"CrossLanguagePackageId": "DevCenterService",
3+
"CrossLanguageDefinitionId": {
4+
"azure.developer.devcenter.models.Catalog": "DevCenterService.Catalog",
5+
"azure.developer.devcenter.models.DevBox": "DevCenterService.DevBox",
6+
"azure.developer.devcenter.models.DevBoxAction": "DevCenterService.DevBoxAction",
7+
"azure.developer.devcenter.models.DevBoxActionDelayResult": "DevCenterService.DevBoxActionDelayResult",
8+
"azure.developer.devcenter.models.DevBoxNextAction": "DevCenterService.DevBoxNextAction",
9+
"azure.developer.devcenter.models.Environment": "DevCenterService.Environment",
10+
"azure.developer.devcenter.models.EnvironmentDefinition": "DevCenterService.EnvironmentDefinition",
11+
"azure.developer.devcenter.models.EnvironmentDefinitionParameter": "DevCenterService.EnvironmentDefinitionParameter",
12+
"azure.developer.devcenter.models.EnvironmentType": "DevCenterService.EnvironmentType",
13+
"azure.developer.devcenter.models.HardwareProfile": "DevCenterService.HardwareProfile",
14+
"azure.developer.devcenter.models.ImageReference": "DevCenterService.ImageReference",
15+
"azure.developer.devcenter.models.OsDisk": "DevCenterService.OsDisk",
16+
"azure.developer.devcenter.models.Pool": "DevCenterService.Pool",
17+
"azure.developer.devcenter.models.Project": "DevCenterService.Project",
18+
"azure.developer.devcenter.models.RemoteConnection": "DevCenterService.RemoteConnection",
19+
"azure.developer.devcenter.models.Schedule": "DevCenterService.Schedule",
20+
"azure.developer.devcenter.models.StopOnDisconnectConfiguration": "DevCenterService.StopOnDisconnectConfiguration",
21+
"azure.developer.devcenter.models.StorageProfile": "DevCenterService.StorageProfile",
22+
"azure.developer.devcenter.models.OsType": "DevCenterService.OsType",
23+
"azure.developer.devcenter.models.SkuName": "DevCenterService.SkuName",
24+
"azure.developer.devcenter.models.HibernateSupport": "DevCenterService.HibernateSupport",
25+
"azure.developer.devcenter.models.LocalAdministratorStatus": "DevCenterService.LocalAdminStatus",
26+
"azure.developer.devcenter.models.StopOnDisconnectStatus": "DevCenterService.StopOnDisconnectEnableStatus",
27+
"azure.developer.devcenter.models.PoolHealthStatus": "DevCenterService.PoolHealthStatus",
28+
"azure.developer.devcenter.models.ScheduledType": "DevCenterService.ScheduledType",
29+
"azure.developer.devcenter.models.ScheduledFrequency": "DevCenterService.ScheduledFrequency",
30+
"azure.developer.devcenter.models.DevBoxProvisioningState": "DevCenterService.DevBoxProvisioningState",
31+
"azure.developer.devcenter.models.PowerState": "DevCenterService.PowerState",
32+
"azure.developer.devcenter.models.DevBoxActionType": "DevCenterService.DevBoxActionType",
33+
"azure.developer.devcenter.models.DevBoxActionDelayStatus": "DevCenterService.DevBoxActionDelayResultStatus",
34+
"azure.developer.devcenter.models.EnvironmentProvisioningState": "DevCenterService.EnvironmentProvisioningState",
35+
"azure.developer.devcenter.models.ParameterType": "DevCenterService.ParameterType",
36+
"azure.developer.devcenter.models.EnvironmentTypeStatus": "DevCenterService.EnvironmentTypeEnableStatus",
37+
"azure.developer.devcenter.DevCenterClient.list_projects": "SdkCustomizations.DevCenterClientOperations.listProjects",
38+
"azure.developer.devcenter.DevCenterClient.get_project": "SdkCustomizations.DevCenterClientOperations.getProject",
39+
"azure.developer.devcenter.DevBoxesClient.list_pools": "SdkCustomizations.DevBoxesClientOperations.listPools",
40+
"azure.developer.devcenter.DevBoxesClient.get_pool": "SdkCustomizations.DevBoxesClientOperations.getPool",
41+
"azure.developer.devcenter.DevBoxesClient.list_schedules": "SdkCustomizations.DevBoxesClientOperations.listSchedules",
42+
"azure.developer.devcenter.DevBoxesClient.get_schedule": "SdkCustomizations.DevBoxesClientOperations.getSchedule",
43+
"azure.developer.devcenter.DevBoxesClient.list_all_dev_boxes": "SdkCustomizations.DevBoxesClientOperations.listAllDevBoxes",
44+
"azure.developer.devcenter.DevBoxesClient.list_all_dev_boxes_by_user": "SdkCustomizations.DevBoxesClientOperations.listAllDevBoxesByUser",
45+
"azure.developer.devcenter.DevBoxesClient.list_dev_boxes": "SdkCustomizations.DevBoxesClientOperations.listDevBoxes",
46+
"azure.developer.devcenter.DevBoxesClient.get_dev_box": "SdkCustomizations.DevBoxesClientOperations.getDevBox",
47+
"azure.developer.devcenter.DevBoxesClient.begin_create_dev_box": "SdkCustomizations.DevBoxesClientOperations.createDevBox",
48+
"azure.developer.devcenter.DevBoxesClient.begin_delete_dev_box": "SdkCustomizations.DevBoxesClientOperations.deleteDevBox",
49+
"azure.developer.devcenter.DevBoxesClient.begin_start_dev_box": "SdkCustomizations.DevBoxesClientOperations.startDevBox",
50+
"azure.developer.devcenter.DevBoxesClient.begin_stop_dev_box": "SdkCustomizations.DevBoxesClientOperations.stopDevBox",
51+
"azure.developer.devcenter.DevBoxesClient.begin_restart_dev_box": "SdkCustomizations.DevBoxesClientOperations.restartDevBox",
52+
"azure.developer.devcenter.DevBoxesClient.get_remote_connection": "SdkCustomizations.DevBoxesClientOperations.getRemoteConnection",
53+
"azure.developer.devcenter.DevBoxesClient.list_dev_box_actions": "SdkCustomizations.DevBoxesClientOperations.listDevBoxActions",
54+
"azure.developer.devcenter.DevBoxesClient.get_dev_box_action": "SdkCustomizations.DevBoxesClientOperations.getDevBoxAction",
55+
"azure.developer.devcenter.DevBoxesClient.skip_action": "SdkCustomizations.DevBoxesClientOperations.skipAction",
56+
"azure.developer.devcenter.DevBoxesClient.delay_action": "SdkCustomizations.DevBoxesClientOperations.delayAction",
57+
"azure.developer.devcenter.DevBoxesClient.delay_all_actions": "SdkCustomizations.DevBoxesClientOperations.delayAllActions",
58+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_all_environments": "SdkCustomizations.EnvironmentClientOperations.listAllEnvironments",
59+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_environments": "SdkCustomizations.EnvironmentClientOperations.listEnvironments",
60+
"azure.developer.devcenter.DeploymentEnvironmentsClient.get_environment": "SdkCustomizations.EnvironmentClientOperations.getEnvironment",
61+
"azure.developer.devcenter.DeploymentEnvironmentsClient.begin_create_or_update_environment": "SdkCustomizations.EnvironmentClientOperations.createOrUpdateEnvironment",
62+
"azure.developer.devcenter.DeploymentEnvironmentsClient.begin_delete_environment": "SdkCustomizations.EnvironmentClientOperations.deleteEnvironment",
63+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_catalogs": "SdkCustomizations.EnvironmentClientOperations.listCatalogs",
64+
"azure.developer.devcenter.DeploymentEnvironmentsClient.get_catalog": "SdkCustomizations.EnvironmentClientOperations.getCatalog",
65+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_environment_definitions": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentDefinitions",
66+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_environment_definitions_by_catalog": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentDefinitionsByCatalog",
67+
"azure.developer.devcenter.DeploymentEnvironmentsClient.get_environment_definition": "SdkCustomizations.EnvironmentClientOperations.getEnvironmentDefinition",
68+
"azure.developer.devcenter.DeploymentEnvironmentsClient.list_environment_types": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentTypes"
69+
}
70+
}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@
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 DevCenterClient
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 DevCenterClient # type: ignore
16+
from ._client import DevBoxesClient # type: ignore
17+
from ._client import DeploymentEnvironmentsClient # type: ignore
1018
from ._version import VERSION
1119

1220
__version__ = VERSION
1321

1422
try:
1523
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
24+
from ._patch import *
1725
except ImportError:
1826
_patch_all = []
1927
from ._patch import patch_sdk as _patch_sdk
2028

2129
__all__ = [
2230
"DevCenterClient",
31+
"DevBoxesClient",
32+
"DeploymentEnvironmentsClient",
2333
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
34+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2535

2636
_patch_sdk()

sdk/devcenter/azure-developer-devcenter/azure/developer/devcenter/_client.py

Lines changed: 166 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,106 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.pipeline import policies
1415
from azure.core.rest import HttpRequest, HttpResponse
1516

16-
from ._configuration import DevCenterClientConfiguration
17-
from ._operations import DevCenterClientOperationsMixin
17+
from ._configuration import (
18+
DeploymentEnvironmentsClientConfiguration,
19+
DevBoxesClientConfiguration,
20+
DevCenterClientConfiguration,
21+
)
22+
from ._operations import (
23+
DeploymentEnvironmentsClientOperationsMixin,
24+
DevBoxesClientOperationsMixin,
25+
DevCenterClientOperationsMixin,
26+
)
1827
from ._serialization import Deserializer, Serializer
1928

2029
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
2230
from azure.core.credentials import TokenCredential
2331

2432

25-
class DevCenterClient(DevCenterClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
33+
class DevCenterClient(DevCenterClientOperationsMixin):
2634
"""DevCenterClient.
2735
36+
:param endpoint: The DevCenter-specific URI to operate on. Required.
37+
:type endpoint: str
38+
:param credential: Credential used to authenticate requests to the service. Required.
39+
:type credential: ~azure.core.credentials.TokenCredential
40+
:keyword api_version: The API version to use for this operation. Default value is "2023-04-01".
41+
Note that overriding this default value may result in unsupported behavior.
42+
:paramtype api_version: str
43+
"""
44+
45+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
46+
_endpoint = "{endpoint}"
47+
self._config = DevCenterClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
48+
_policies = kwargs.pop("policies", None)
49+
if _policies is None:
50+
_policies = [
51+
policies.RequestIdPolicy(**kwargs),
52+
self._config.headers_policy,
53+
self._config.user_agent_policy,
54+
self._config.proxy_policy,
55+
policies.ContentDecodePolicy(**kwargs),
56+
self._config.redirect_policy,
57+
self._config.retry_policy,
58+
self._config.authentication_policy,
59+
self._config.custom_hook_policy,
60+
self._config.logging_policy,
61+
policies.DistributedTracingPolicy(**kwargs),
62+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
63+
self._config.http_logging_policy,
64+
]
65+
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
66+
67+
self._serialize = Serializer()
68+
self._deserialize = Deserializer()
69+
self._serialize.client_side_validation = False
70+
71+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
72+
"""Runs the network request through the client's chained policies.
73+
74+
>>> from azure.core.rest import HttpRequest
75+
>>> request = HttpRequest("GET", "https://www.example.org/")
76+
<HttpRequest [GET], url: 'https://www.example.org/'>
77+
>>> response = client.send_request(request)
78+
<HttpResponse: 200 OK>
79+
80+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
81+
82+
:param request: The network request you want to make. Required.
83+
:type request: ~azure.core.rest.HttpRequest
84+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
85+
:return: The response of your network call. Does not do error handling on your response.
86+
:rtype: ~azure.core.rest.HttpResponse
87+
"""
88+
89+
request_copy = deepcopy(request)
90+
path_format_arguments = {
91+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
92+
}
93+
94+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
95+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
96+
97+
def close(self) -> None:
98+
self._client.close()
99+
100+
def __enter__(self) -> Self:
101+
self._client.__enter__()
102+
return self
103+
104+
def __exit__(self, *exc_details: Any) -> None:
105+
self._client.__exit__(*exc_details)
106+
107+
108+
class DevBoxesClient(DevBoxesClientOperationsMixin):
109+
"""DevBoxesClient.
110+
28111
:param endpoint: The DevCenter-specific URI to operate on. Required.
29112
:type endpoint: str
30113
:param credential: Credential used to authenticate requests to the service. Required.
@@ -38,7 +121,84 @@ class DevCenterClient(DevCenterClientOperationsMixin): # pylint: disable=client
38121

39122
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
40123
_endpoint = "{endpoint}"
41-
self._config = DevCenterClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
124+
self._config = DevBoxesClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
125+
_policies = kwargs.pop("policies", None)
126+
if _policies is None:
127+
_policies = [
128+
policies.RequestIdPolicy(**kwargs),
129+
self._config.headers_policy,
130+
self._config.user_agent_policy,
131+
self._config.proxy_policy,
132+
policies.ContentDecodePolicy(**kwargs),
133+
self._config.redirect_policy,
134+
self._config.retry_policy,
135+
self._config.authentication_policy,
136+
self._config.custom_hook_policy,
137+
self._config.logging_policy,
138+
policies.DistributedTracingPolicy(**kwargs),
139+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
140+
self._config.http_logging_policy,
141+
]
142+
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
143+
144+
self._serialize = Serializer()
145+
self._deserialize = Deserializer()
146+
self._serialize.client_side_validation = False
147+
148+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
149+
"""Runs the network request through the client's chained policies.
150+
151+
>>> from azure.core.rest import HttpRequest
152+
>>> request = HttpRequest("GET", "https://www.example.org/")
153+
<HttpRequest [GET], url: 'https://www.example.org/'>
154+
>>> response = client.send_request(request)
155+
<HttpResponse: 200 OK>
156+
157+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
158+
159+
:param request: The network request you want to make. Required.
160+
:type request: ~azure.core.rest.HttpRequest
161+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
162+
:return: The response of your network call. Does not do error handling on your response.
163+
:rtype: ~azure.core.rest.HttpResponse
164+
"""
165+
166+
request_copy = deepcopy(request)
167+
path_format_arguments = {
168+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
169+
}
170+
171+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
172+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
173+
174+
def close(self) -> None:
175+
self._client.close()
176+
177+
def __enter__(self) -> Self:
178+
self._client.__enter__()
179+
return self
180+
181+
def __exit__(self, *exc_details: Any) -> None:
182+
self._client.__exit__(*exc_details)
183+
184+
185+
class DeploymentEnvironmentsClient(DeploymentEnvironmentsClientOperationsMixin):
186+
"""DeploymentEnvironmentsClient.
187+
188+
:param endpoint: The DevCenter-specific URI to operate on. Required.
189+
:type endpoint: str
190+
:param credential: Credential used to authenticate requests to the service. Required.
191+
:type credential: ~azure.core.credentials.TokenCredential
192+
:keyword api_version: The API version to use for this operation. Default value is "2023-04-01".
193+
Note that overriding this default value may result in unsupported behavior.
194+
:paramtype api_version: str
195+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
196+
Retry-After header is present.
197+
"""
198+
199+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
200+
_endpoint = "{endpoint}"
201+
self._config = DeploymentEnvironmentsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
42202
_policies = kwargs.pop("policies", None)
43203
if _policies is None:
44204
_policies = [
@@ -91,7 +251,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
91251
def close(self) -> None:
92252
self._client.close()
93253

94-
def __enter__(self) -> "DevCenterClient":
254+
def __enter__(self) -> Self:
95255
self._client.__enter__()
96256
return self
97257

0 commit comments

Comments
 (0)