Skip to content

Commit 227dbcd

Browse files
author
SDKAuto
committed
CodeGen from PR 14294 in Azure/azure-rest-api-specs
Merge 358cd4a37bc24d737ee1e3836337616ddf72fdb1 into 038e917
1 parent 4486c6a commit 227dbcd

Some content is hidden

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

46 files changed

+830
-4324
lines changed

sdk/devtestlabs/azure-mgmt-devtestlabs/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.3.0",
3+
"use": "@autorest/[email protected]",
4+
"commit": "3edc88aa4be9f81ebb7d04604103f8a04259b60f",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/devtestlabs/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.3.0",
7+
"readme": "specification/devtestlabs/resource-manager/readme.md"
8+
}

sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_dev_test_labs_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import DevTestLabsClientConfiguration
2122
from .operations import ProviderOperationsOperations
@@ -176,6 +177,24 @@ def __init__(
176177
self.virtual_networks = VirtualNetworksOperations(
177178
self._client, self._config, self._serialize, self._deserialize)
178179

180+
def _send_request(self, http_request, **kwargs):
181+
# type: (HttpRequest, Any) -> HttpResponse
182+
"""Runs the network request through the client's chained policies.
183+
184+
:param http_request: The network request you want to make. Required.
185+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
186+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
187+
:return: The response of your network call. Does not do error handling on your response.
188+
:rtype: ~azure.core.pipeline.transport.HttpResponse
189+
"""
190+
path_format_arguments = {
191+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
192+
}
193+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
194+
stream = kwargs.pop("stream", True)
195+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
196+
return pipeline_response.http_response
197+
179198
def close(self):
180199
# type: () -> None
181200
self._client.close()
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"chosen_version": "2018-09-15",
3+
"total_api_version_list": ["2018-09-15"],
4+
"client": {
5+
"name": "DevTestLabsClient",
6+
"filename": "_dev_test_labs_client",
7+
"description": "The DevTest Labs Client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DevTestLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DevTestLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
},
24+
"subscription_id": {
25+
"signature": "subscription_id, # type: str",
26+
"description": "The subscription ID.",
27+
"docstring_type": "str",
28+
"required": true
29+
}
30+
},
31+
"async": {
32+
"credential": {
33+
"signature": "credential: \"AsyncTokenCredential\",",
34+
"description": "Credential needed for the client to connect to Azure.",
35+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
36+
"required": true
37+
},
38+
"subscription_id": {
39+
"signature": "subscription_id: str,",
40+
"description": "The subscription ID.",
41+
"docstring_type": "str",
42+
"required": true
43+
}
44+
},
45+
"constant": {
46+
},
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
90+
},
91+
"config": {
92+
"credential": true,
93+
"credential_scopes": ["https://management.azure.com/.default"],
94+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
95+
"credential_default_policy_type_has_async_version": true,
96+
"credential_key_header_name": null,
97+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
99+
},
100+
"operation_groups": {
101+
"provider_operations": "ProviderOperationsOperations",
102+
"labs": "LabsOperations",
103+
"operations": "Operations",
104+
"global_schedules": "GlobalSchedulesOperations",
105+
"artifact_sources": "ArtifactSourcesOperations",
106+
"arm_templates": "ArmTemplatesOperations",
107+
"artifacts": "ArtifactsOperations",
108+
"costs": "CostsOperations",
109+
"custom_images": "CustomImagesOperations",
110+
"formulas": "FormulasOperations",
111+
"gallery_images": "GalleryImagesOperations",
112+
"notification_channels": "NotificationChannelsOperations",
113+
"policy_sets": "PolicySetsOperations",
114+
"policies": "PoliciesOperations",
115+
"schedules": "SchedulesOperations",
116+
"service_runners": "ServiceRunnersOperations",
117+
"users": "UsersOperations",
118+
"disks": "DisksOperations",
119+
"environments": "EnvironmentsOperations",
120+
"secrets": "SecretsOperations",
121+
"service_fabrics": "ServiceFabricsOperations",
122+
"service_fabric_schedules": "ServiceFabricSchedulesOperations",
123+
"virtual_machines": "VirtualMachinesOperations",
124+
"virtual_machine_schedules": "VirtualMachineSchedulesOperations",
125+
"virtual_networks": "VirtualNetworksOperations"
126+
}
127+
}

sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_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 = "9.0.0"
9+
VERSION = "1.0.0"

sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/_dev_test_labs_client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -173,6 +174,23 @@ def __init__(
173174
self.virtual_networks = VirtualNetworksOperations(
174175
self._client, self._config, self._serialize, self._deserialize)
175176

177+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
178+
"""Runs the network request through the client's chained policies.
179+
180+
:param http_request: The network request you want to make. Required.
181+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
182+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
183+
:return: The response of your network call. Does not do error handling on your response.
184+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
185+
"""
186+
path_format_arguments = {
187+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
188+
}
189+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
190+
stream = kwargs.pop("stream", True)
191+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
192+
return pipeline_response.http_response
193+
176194
async def close(self) -> None:
177195
await self._client.close()
178196

sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifact_sources_operations.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ async def update(
341341
resource_group_name: str,
342342
lab_name: str,
343343
name: str,
344-
artifact_source: "_models.ArtifactSourceFragment",
344+
tags: Optional[Dict[str, str]] = None,
345345
**kwargs
346346
) -> "_models.ArtifactSource":
347347
"""Allows modifying tags of artifact sources. All other properties will be ignored.
@@ -352,8 +352,8 @@ async def update(
352352
:type lab_name: str
353353
:param name: The name of the artifact source.
354354
:type name: str
355-
:param artifact_source: Properties of an artifact source.
356-
:type artifact_source: ~azure.mgmt.devtestlabs.models.ArtifactSourceFragment
355+
:param tags: The tags of the resource.
356+
:type tags: dict[str, str]
357357
:keyword callable cls: A custom type or function that will be passed the direct response
358358
:return: ArtifactSource, or the result of cls(response)
359359
:rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource
@@ -364,6 +364,8 @@ async def update(
364364
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
365365
}
366366
error_map.update(kwargs.pop('error_map', {}))
367+
368+
_artifact_source = _models.ArtifactSourceFragment(tags=tags)
367369
api_version = "2018-09-15"
368370
content_type = kwargs.pop("content_type", "application/json")
369371
accept = "application/json"
@@ -388,7 +390,7 @@ async def update(
388390
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
389391

390392
body_content_kwargs = {} # type: Dict[str, Any]
391-
body_content = self._serialize.body(artifact_source, 'ArtifactSourceFragment')
393+
body_content = self._serialize.body(_artifact_source, 'ArtifactSourceFragment')
392394
body_content_kwargs['content'] = body_content
393395
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
394396
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)

sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_custom_images_operations.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ async def begin_create_or_update(
284284
:type custom_image: ~azure.mgmt.devtestlabs.models.CustomImage
285285
:keyword callable cls: A custom type or function that will be passed the direct response
286286
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
287-
:keyword polling: True for ARMPolling, False for no polling, or a
288-
polling object for personal polling strategy
287+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
288+
False for no polling, or your own initialized polling object for a personal polling strategy.
289289
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
290290
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
291291
:return: An instance of AsyncLROPoller that returns either CustomImage or the result of cls(response)
@@ -403,8 +403,8 @@ async def begin_delete(
403403
:type name: str
404404
:keyword callable cls: A custom type or function that will be passed the direct response
405405
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
406-
:keyword polling: True for ARMPolling, False for no polling, or a
407-
polling object for personal polling strategy
406+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
407+
False for no polling, or your own initialized polling object for a personal polling strategy.
408408
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
409409
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
410410
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
@@ -460,7 +460,7 @@ async def update(
460460
resource_group_name: str,
461461
lab_name: str,
462462
name: str,
463-
custom_image: "_models.CustomImageFragment",
463+
tags: Optional[Dict[str, str]] = None,
464464
**kwargs
465465
) -> "_models.CustomImage":
466466
"""Allows modifying tags of custom images. All other properties will be ignored.
@@ -471,8 +471,8 @@ async def update(
471471
:type lab_name: str
472472
:param name: The name of the custom image.
473473
:type name: str
474-
:param custom_image: A custom image.
475-
:type custom_image: ~azure.mgmt.devtestlabs.models.CustomImageFragment
474+
:param tags: The tags of the resource.
475+
:type tags: dict[str, str]
476476
:keyword callable cls: A custom type or function that will be passed the direct response
477477
:return: CustomImage, or the result of cls(response)
478478
:rtype: ~azure.mgmt.devtestlabs.models.CustomImage
@@ -483,6 +483,8 @@ async def update(
483483
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
484484
}
485485
error_map.update(kwargs.pop('error_map', {}))
486+
487+
_custom_image = _models.CustomImageFragment(tags=tags)
486488
api_version = "2018-09-15"
487489
content_type = kwargs.pop("content_type", "application/json")
488490
accept = "application/json"
@@ -507,7 +509,7 @@ async def update(
507509
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
508510

509511
body_content_kwargs = {} # type: Dict[str, Any]
510-
body_content = self._serialize.body(custom_image, 'CustomImageFragment')
512+
body_content = self._serialize.body(_custom_image, 'CustomImageFragment')
511513
body_content_kwargs['content'] = body_content
512514
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
513515
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)

0 commit comments

Comments
 (0)