Skip to content

Commit 339aa5b

Browse files
azure-sdkWzb123456789Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD)
authored
[AutoRelease] t2-relay-2022-11-08-46875(can only be merged by SDK owner) (Azure#27362)
* code and test * Update CHANGELOG.md * Update _version.py * fix test break Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <[email protected]> Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent 9cfc15a commit 339aa5b

File tree

88 files changed

+14470
-8656
lines changed

Some content is hidden

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

88 files changed

+14470
-8656
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Release History
22

3+
## 2.0.0b1 (2022-11-08)
4+
5+
### Features Added
6+
7+
- Added operation NamespacesOperations.create_or_update_network_rule_set
8+
- Added operation NamespacesOperations.get_network_rule_set
9+
- Added operation group PrivateEndpointConnectionsOperations
10+
- Added operation group PrivateLinkResourcesOperations
11+
- Model AuthorizationRule has a new parameter location
12+
- Model AuthorizationRule has a new parameter system_data
13+
- Model ErrorResponse has a new parameter error
14+
- Model HybridConnection has a new parameter location
15+
- Model HybridConnection has a new parameter system_data
16+
- Model Operation has a new parameter is_data_action
17+
- Model Operation has a new parameter origin
18+
- Model Operation has a new parameter properties
19+
- Model OperationDisplay has a new parameter description
20+
- Model RelayNamespace has a new parameter private_endpoint_connections
21+
- Model RelayNamespace has a new parameter public_network_access
22+
- Model RelayNamespace has a new parameter status
23+
- Model RelayNamespace has a new parameter system_data
24+
- Model RelayUpdateParameters has a new parameter private_endpoint_connections
25+
- Model RelayUpdateParameters has a new parameter public_network_access
26+
- Model RelayUpdateParameters has a new parameter status
27+
- Model WcfRelay has a new parameter location
28+
- Model WcfRelay has a new parameter system_data
29+
30+
### Breaking Changes
31+
32+
- Model ErrorResponse no longer has parameter code
33+
- Model ErrorResponse no longer has parameter message
34+
335
## 1.1.0 (2021-09-06)
436

537
**Features**

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include _meta.json
22
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"commit": "51db80e40c32f4bf4c57169476d81d36fb8c81d8",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/modelerfour@4.19.2"
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "327b222a6bb23bd1edfe14a75fd8cdc53b4faf61",
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",
9+
"autorest_command": "autorest specification/relay/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/relay/resource-manager/readme.md"
1111
}

sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['RelayAPI']
1413

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"RelayAPI",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

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

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

9-
from typing import TYPE_CHECKING
9+
import sys
10+
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
1213
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1415

1516
from ._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2125
from azure.core.credentials import TokenCredential
2226

2327

24-
class RelayAPIConfiguration(Configuration):
28+
class RelayAPIConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2529
"""Configuration for RelayAPI.
2630
2731
Note that all parameters used to create this instance are saved as instance
2832
attributes.
2933
30-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
3135
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
36+
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
37+
subscription. The subscription ID forms part of the URI for every service call. Required.
3338
:type subscription_id: str
39+
:keyword api_version: Api Version. Default value is "2021-11-01". Note that overriding this
40+
default value may result in unsupported behavior.
41+
:paramtype api_version: str
3442
"""
3543

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
44+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
45+
super(RelayAPIConfiguration, self).__init__(**kwargs)
46+
api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"]
47+
4348
if credential is None:
4449
raise ValueError("Parameter 'credential' must not be None.")
4550
if subscription_id is None:
4651
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(RelayAPIConfiguration, self).__init__(**kwargs)
4852

4953
self.credential = credential
5054
self.subscription_id = subscription_id
51-
self.api_version = "2017-04-01"
52-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53-
kwargs.setdefault('sdk_moniker', 'mgmt-relay/{}'.format(VERSION))
55+
self.api_version = api_version
56+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
57+
kwargs.setdefault("sdk_moniker", "mgmt-relay/{}".format(VERSION))
5458
self._configure(**kwargs)
5559

5660
def _configure(
57-
self,
58-
**kwargs # type: Any
61+
self, **kwargs # type: Any
5962
):
6063
# type: (...) -> None
61-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69-
self.authentication_policy = kwargs.get('authentication_policy')
64+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
65+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
66+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
67+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
68+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
69+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
70+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
71+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
72+
self.authentication_policy = kwargs.get("authentication_policy")
7073
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
74+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
75+
self.credential, *self.credential_scopes, **kwargs
76+
)

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

Lines changed: 0 additions & 106 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
14+
def patch_sdk():
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

0 commit comments

Comments
 (0)