Skip to content

Commit 43029f6

Browse files
author
SDKAuto
committed
CodeGen from PR 16085 in Azure/azure-rest-api-specs
Merge a858c577d7b5ba1178681c985157b64c1ba57df7 into afd16a9
1 parent da36d30 commit 43029f6

24 files changed

+3095
-184
lines changed

sdk/deviceupdate/azure-mgmt-deviceupdate/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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "d8e7212ec3249448e74480b0114c3d1cea222abe",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/deviceupdate/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] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/deviceupdate/resource-manager/readme.md"
11+
}

sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_device_update.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,29 @@
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 DeviceUpdateConfiguration
22+
from .operations import DeviceUpdateOperationsMixin
2123
from .operations import AccountsOperations
2224
from .operations import InstancesOperations
25+
from .operations import PrivateEndpointConnectionsOperations
26+
from .operations import PrivateLinkResourcesOperations
2327
from .operations import Operations
2428
from . import models
2529

2630

27-
class DeviceUpdate(object):
31+
class DeviceUpdate(DeviceUpdateOperationsMixin):
2832
"""Microsoft Device Update resource provider.
2933
3034
:ivar accounts: AccountsOperations operations
3135
:vartype accounts: device_update.operations.AccountsOperations
3236
:ivar instances: InstancesOperations operations
3337
:vartype instances: device_update.operations.InstancesOperations
38+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39+
:vartype private_endpoint_connections: device_update.operations.PrivateEndpointConnectionsOperations
40+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
41+
:vartype private_link_resources: device_update.operations.PrivateLinkResourcesOperations
3442
:ivar operations: Operations operations
3543
:vartype operations: device_update.operations.Operations
3644
:param credential: Credential needed for the client to connect to Azure.
@@ -56,15 +64,38 @@ def __init__(
5664

5765
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5866
self._serialize = Serializer(client_models)
67+
self._serialize.client_side_validation = False
5968
self._deserialize = Deserializer(client_models)
6069

6170
self.accounts = AccountsOperations(
6271
self._client, self._config, self._serialize, self._deserialize)
6372
self.instances = InstancesOperations(
6473
self._client, self._config, self._serialize, self._deserialize)
74+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
75+
self._client, self._config, self._serialize, self._deserialize)
76+
self.private_link_resources = PrivateLinkResourcesOperations(
77+
self._client, self._config, self._serialize, self._deserialize)
6578
self.operations = Operations(
6679
self._client, self._config, self._serialize, self._deserialize)
6780

81+
def _send_request(self, http_request, **kwargs):
82+
# type: (HttpRequest, Any) -> HttpResponse
83+
"""Runs the network request through the client's chained policies.
84+
85+
:param http_request: The network request you want to make. Required.
86+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
87+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
88+
:return: The response of your network call. Does not do error handling on your response.
89+
:rtype: ~azure.core.pipeline.transport.HttpResponse
90+
"""
91+
path_format_arguments = {
92+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
93+
}
94+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
95+
stream = kwargs.pop("stream", True)
96+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
97+
return pipeline_response.http_response
98+
6899
def close(self):
69100
# type: () -> None
70101
self._client.close()

sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_metadata.json

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
12-
"client_side_validation": 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\": [\"DeviceUpdateConfiguration\"], \"._operations_mixin\": [\"DeviceUpdateOperationsMixin\"]}}, \"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\": [\"DeviceUpdateConfiguration\"], \"._operations_mixin\": [\"DeviceUpdateOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,36 +30,96 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "The Azure subscription ID.",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
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+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
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\"]}}}"
5399
},
54100
"operation_groups": {
55101
"accounts": "AccountsOperations",
56102
"instances": "InstancesOperations",
103+
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
104+
"private_link_resources": "PrivateLinkResourcesOperations",
57105
"operations": "Operations"
58106
},
59107
"operation_mixins": {
60-
},
61-
"sync_imports": "None",
62-
"async_imports": "None"
108+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
109+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
110+
"operations": {
111+
"check_name_availability" : {
112+
"sync": {
113+
"signature": "def check_name_availability(\n self,\n request, # type: \"_models.CheckNameAvailabilityRequest\"\n **kwargs # type: Any\n):\n",
114+
"doc": "\"\"\"Checks ADU resource name availability.\n\n:param request: Check Name Availability Request.\n:type request: ~device_update.models.CheckNameAvailabilityRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckNameAvailabilityResponse, or the result of cls(response)\n:rtype: ~device_update.models.CheckNameAvailabilityResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
115+
},
116+
"async": {
117+
"coroutine": true,
118+
"signature": "async def check_name_availability(\n self,\n request: \"_models.CheckNameAvailabilityRequest\",\n **kwargs: Any\n) -\u003e \"_models.CheckNameAvailabilityResponse\":\n",
119+
"doc": "\"\"\"Checks ADU resource name availability.\n\n:param request: Check Name Availability Request.\n:type request: ~device_update.models.CheckNameAvailabilityRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckNameAvailabilityResponse, or the result of cls(response)\n:rtype: ~device_update.models.CheckNameAvailabilityResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
120+
},
121+
"call": "request"
122+
}
123+
}
124+
}
63125
}

sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_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.0b1"

sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/_device_update.py

Lines changed: 31 additions & 1 deletion
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

@@ -16,19 +17,26 @@
1617
from azure.core.credentials_async import AsyncTokenCredential
1718

1819
from ._configuration import DeviceUpdateConfiguration
20+
from .operations import DeviceUpdateOperationsMixin
1921
from .operations import AccountsOperations
2022
from .operations import InstancesOperations
23+
from .operations import PrivateEndpointConnectionsOperations
24+
from .operations import PrivateLinkResourcesOperations
2125
from .operations import Operations
2226
from .. import models
2327

2428

25-
class DeviceUpdate(object):
29+
class DeviceUpdate(DeviceUpdateOperationsMixin):
2630
"""Microsoft Device Update resource provider.
2731
2832
:ivar accounts: AccountsOperations operations
2933
:vartype accounts: device_update.aio.operations.AccountsOperations
3034
:ivar instances: InstancesOperations operations
3135
:vartype instances: device_update.aio.operations.InstancesOperations
36+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
37+
:vartype private_endpoint_connections: device_update.aio.operations.PrivateEndpointConnectionsOperations
38+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
39+
:vartype private_link_resources: device_update.aio.operations.PrivateLinkResourcesOperations
3240
:ivar operations: Operations operations
3341
:vartype operations: device_update.aio.operations.Operations
3442
:param credential: Credential needed for the client to connect to Azure.
@@ -53,15 +61,37 @@ def __init__(
5361

5462
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5563
self._serialize = Serializer(client_models)
64+
self._serialize.client_side_validation = False
5665
self._deserialize = Deserializer(client_models)
5766

5867
self.accounts = AccountsOperations(
5968
self._client, self._config, self._serialize, self._deserialize)
6069
self.instances = InstancesOperations(
6170
self._client, self._config, self._serialize, self._deserialize)
71+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
72+
self._client, self._config, self._serialize, self._deserialize)
73+
self.private_link_resources = PrivateLinkResourcesOperations(
74+
self._client, self._config, self._serialize, self._deserialize)
6275
self.operations = Operations(
6376
self._client, self._config, self._serialize, self._deserialize)
6477

78+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
79+
"""Runs the network request through the client's chained policies.
80+
81+
:param http_request: The network request you want to make. Required.
82+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
83+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
84+
:return: The response of your network call. Does not do error handling on your response.
85+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
86+
"""
87+
path_format_arguments = {
88+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
89+
}
90+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
91+
stream = kwargs.pop("stream", True)
92+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
93+
return pipeline_response.http_response
94+
6595
async def close(self) -> None:
6696
await self._client.close()
6797

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

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

9+
from ._device_update_operations import DeviceUpdateOperationsMixin
910
from ._accounts_operations import AccountsOperations
1011
from ._instances_operations import InstancesOperations
12+
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
13+
from ._private_link_resources_operations import PrivateLinkResourcesOperations
1114
from ._operations import Operations
1215

1316
__all__ = [
17+
'DeviceUpdateOperationsMixin',
1418
'AccountsOperations',
1519
'InstancesOperations',
20+
'PrivateEndpointConnectionsOperations',
21+
'PrivateLinkResourcesOperations',
1622
'Operations',
1723
]

0 commit comments

Comments
 (0)