Skip to content

Commit 937d032

Browse files
author
SDKAuto
committed
CodeGen from PR 15745 in Azure/azure-rest-api-specs
Merge e26a830e03bc305c2403c6c9b18acc7c0b03f371 into 0abf5a4
1 parent e81050e commit 937d032

16 files changed

+278
-121
lines changed

sdk/relay/azure-mgmt-relay/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": "d6ada0692de405c53d89416cba1f7a7bd1b3a8fa",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/relay/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/relay/resource-manager/readme.md"
11+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"chosen_version": "2017-04-01",
3+
"total_api_version_list": ["2017-04-01"],
4+
"client": {
5+
"name": "RelayAPI",
6+
"filename": "_relay_api",
7+
"description": "Use these API to manage Azure Relay resources through Azure Resource Manager.",
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\": [\"RelayAPIConfiguration\"]}}, \"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\": [\"RelayAPIConfiguration\"]}}, \"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": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
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": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
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+
"operations": "Operations",
102+
"namespaces": "NamespacesOperations",
103+
"hybrid_connections": "HybridConnectionsOperations",
104+
"wcf_relays": "WCFRelaysOperations"
105+
}
106+
}

sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.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 RelayAPIConfiguration
2122
from .operations import Operations
@@ -71,6 +72,24 @@ def __init__(
7172
self.wcf_relays = WCFRelaysOperations(
7273
self._client, self._config, self._serialize, self._deserialize)
7374

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

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

sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.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

@@ -68,6 +69,23 @@ def __init__(
6869
self.wcf_relays = WCFRelaysOperations(
6970
self._client, self._config, self._serialize, self._deserialize)
7071

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

sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def list_by_namespace(
4545
self,
4646
resource_group_name: str,
4747
namespace_name: str,
48-
**kwargs
48+
**kwargs: Any
4949
) -> AsyncIterable["_models.HybridConnectionListResult"]:
5050
"""Lists the hybrid connection within the namespace.
5151
@@ -105,7 +105,7 @@ async def get_next(next_link=None):
105105
response = pipeline_response.http_response
106106

107107
if response.status_code not in [200]:
108-
error = self._deserialize(_models.ErrorResponse, response)
108+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
109109
map_error(status_code=response.status_code, response=response, error_map=error_map)
110110
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
111111

@@ -122,7 +122,7 @@ async def create_or_update(
122122
namespace_name: str,
123123
hybrid_connection_name: str,
124124
parameters: "_models.HybridConnection",
125-
**kwargs
125+
**kwargs: Any
126126
) -> "_models.HybridConnection":
127127
"""Creates or updates a service hybrid connection. This operation is idempotent.
128128
@@ -176,7 +176,7 @@ async def create_or_update(
176176

177177
if response.status_code not in [200]:
178178
map_error(status_code=response.status_code, response=response, error_map=error_map)
179-
error = self._deserialize(_models.ErrorResponse, response)
179+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
180180
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
181181

182182
deserialized = self._deserialize('HybridConnection', pipeline_response)
@@ -192,7 +192,7 @@ async def delete(
192192
resource_group_name: str,
193193
namespace_name: str,
194194
hybrid_connection_name: str,
195-
**kwargs
195+
**kwargs: Any
196196
) -> None:
197197
"""Deletes a hybrid connection.
198198
@@ -239,7 +239,7 @@ async def delete(
239239

240240
if response.status_code not in [200, 204]:
241241
map_error(status_code=response.status_code, response=response, error_map=error_map)
242-
error = self._deserialize(_models.ErrorResponse, response)
242+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
243243
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
244244

245245
if cls:
@@ -252,7 +252,7 @@ async def get(
252252
resource_group_name: str,
253253
namespace_name: str,
254254
hybrid_connection_name: str,
255-
**kwargs
255+
**kwargs: Any
256256
) -> "_models.HybridConnection":
257257
"""Returns the description for the specified hybrid connection.
258258
@@ -299,7 +299,7 @@ async def get(
299299

300300
if response.status_code not in [200]:
301301
map_error(status_code=response.status_code, response=response, error_map=error_map)
302-
error = self._deserialize(_models.ErrorResponse, response)
302+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
303303
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
304304

305305
deserialized = self._deserialize('HybridConnection', pipeline_response)
@@ -315,7 +315,7 @@ def list_authorization_rules(
315315
resource_group_name: str,
316316
namespace_name: str,
317317
hybrid_connection_name: str,
318-
**kwargs
318+
**kwargs: Any
319319
) -> AsyncIterable["_models.AuthorizationRuleListResult"]:
320320
"""Authorization rules for a hybrid connection.
321321
@@ -378,7 +378,7 @@ async def get_next(next_link=None):
378378
response = pipeline_response.http_response
379379

380380
if response.status_code not in [200]:
381-
error = self._deserialize(_models.ErrorResponse, response)
381+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
382382
map_error(status_code=response.status_code, response=response, error_map=error_map)
383383
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
384384

@@ -396,7 +396,7 @@ async def create_or_update_authorization_rule(
396396
hybrid_connection_name: str,
397397
authorization_rule_name: str,
398398
parameters: "_models.AuthorizationRule",
399-
**kwargs
399+
**kwargs: Any
400400
) -> "_models.AuthorizationRule":
401401
"""Creates or updates an authorization rule for a hybrid connection.
402402
@@ -453,7 +453,7 @@ async def create_or_update_authorization_rule(
453453

454454
if response.status_code not in [200]:
455455
map_error(status_code=response.status_code, response=response, error_map=error_map)
456-
error = self._deserialize(_models.ErrorResponse, response)
456+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
457457
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
458458

459459
deserialized = self._deserialize('AuthorizationRule', pipeline_response)
@@ -470,7 +470,7 @@ async def delete_authorization_rule(
470470
namespace_name: str,
471471
hybrid_connection_name: str,
472472
authorization_rule_name: str,
473-
**kwargs
473+
**kwargs: Any
474474
) -> None:
475475
"""Deletes a hybrid connection authorization rule.
476476
@@ -520,7 +520,7 @@ async def delete_authorization_rule(
520520

521521
if response.status_code not in [200, 204]:
522522
map_error(status_code=response.status_code, response=response, error_map=error_map)
523-
error = self._deserialize(_models.ErrorResponse, response)
523+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
524524
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
525525

526526
if cls:
@@ -534,7 +534,7 @@ async def get_authorization_rule(
534534
namespace_name: str,
535535
hybrid_connection_name: str,
536536
authorization_rule_name: str,
537-
**kwargs
537+
**kwargs: Any
538538
) -> "_models.AuthorizationRule":
539539
"""Hybrid connection authorization rule for a hybrid connection by name.
540540
@@ -584,7 +584,7 @@ async def get_authorization_rule(
584584

585585
if response.status_code not in [200]:
586586
map_error(status_code=response.status_code, response=response, error_map=error_map)
587-
error = self._deserialize(_models.ErrorResponse, response)
587+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
588588
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
589589

590590
deserialized = self._deserialize('AuthorizationRule', pipeline_response)
@@ -601,7 +601,7 @@ async def list_keys(
601601
namespace_name: str,
602602
hybrid_connection_name: str,
603603
authorization_rule_name: str,
604-
**kwargs
604+
**kwargs: Any
605605
) -> "_models.AccessKeys":
606606
"""Primary and secondary connection strings to the hybrid connection.
607607
@@ -651,7 +651,7 @@ async def list_keys(
651651

652652
if response.status_code not in [200]:
653653
map_error(status_code=response.status_code, response=response, error_map=error_map)
654-
error = self._deserialize(_models.ErrorResponse, response)
654+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
655655
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
656656

657657
deserialized = self._deserialize('AccessKeys', pipeline_response)
@@ -669,7 +669,7 @@ async def regenerate_keys(
669669
hybrid_connection_name: str,
670670
authorization_rule_name: str,
671671
parameters: "_models.RegenerateAccessKeyParameters",
672-
**kwargs
672+
**kwargs: Any
673673
) -> "_models.AccessKeys":
674674
"""Regenerates the primary or secondary connection strings to the hybrid connection.
675675
@@ -726,7 +726,7 @@ async def regenerate_keys(
726726

727727
if response.status_code not in [200]:
728728
map_error(status_code=response.status_code, response=response, error_map=error_map)
729-
error = self._deserialize(_models.ErrorResponse, response)
729+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
730730
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
731731

732732
deserialized = self._deserialize('AccessKeys', pipeline_response)

0 commit comments

Comments
 (0)