Skip to content

Commit ea94f14

Browse files
[AutoRelease] t2-fluidrelay-2022-12-14-67464(can only be merged by SDK owner) (Azure#27944)
* code and test * Update CHANGELOG.md * Update _version.py * Update CHANGELOG.md Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <[email protected]>
1 parent 0e9c6d7 commit ea94f14

Some content is hidden

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

45 files changed

+4410
-1392
lines changed

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

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

3+
## 1.1.0b1 (2022-12-14)
4+
5+
### Other Changes
6+
7+
- Added generated samples in github repo
8+
- Drop support for python<3.7.0
9+
310
## 1.0.0 (2022-08-04)
411

512
**Features**

sdk/fluidrelay/azure-mgmt-fluidrelay/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

sdk/fluidrelay/azure-mgmt-fluidrelay/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Fluid Relay Management Client Library.
4-
This package has been tested with Python 3.6+.
4+
This package has been tested with Python 3.7+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313

1414
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
1715

1816
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
1917
Code samples for this package can be found at [Fluid Relay Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "2647ee494ecbe4668bdf16486207fecd67843e57",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.16.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.2.7",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "e59b6449e6613c0e4ecb73daacacdff320d65f67",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/fluidrelay/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/fluidrelay/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/fluidrelay/resource-manager/readme.md"
1111
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
20-
__all__ = ['FluidRelayManagementClient']
20+
21+
__all__ = [
22+
"FluidRelayManagementClient",
23+
]
2124
__all__.extend([p for p in _patch_all if p not in __all__])
2225

2326
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,6 +15,11 @@
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
1925
from azure.core.credentials import TokenCredential
@@ -25,23 +31,18 @@ class FluidRelayManagementClientConfiguration(Configuration): # pylint: disable
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
28-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The subscription id (GUID) for this resource.
36+
:param subscription_id: The subscription id (GUID) for this resource. Required.
3137
:type subscription_id: str
3238
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
3339
default value may result in unsupported behavior.
3440
:paramtype api_version: str
3541
"""
3642

37-
def __init__(
38-
self,
39-
credential: "TokenCredential",
40-
subscription_id: str,
41-
**kwargs: Any
42-
) -> None:
43+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4344
super(FluidRelayManagementClientConfiguration, self).__init__(**kwargs)
44-
api_version = kwargs.pop('api_version', "2022-06-01") # type: str
45+
api_version: Literal["2022-06-01"] = kwargs.pop("api_version", "2022-06-01")
4546

4647
if credential is None:
4748
raise ValueError("Parameter 'credential' must not be None.")
@@ -51,23 +52,21 @@ def __init__(
5152
self.credential = credential
5253
self.subscription_id = subscription_id
5354
self.api_version = api_version
54-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
55-
kwargs.setdefault('sdk_moniker', 'mgmt-fluidrelay/{}'.format(VERSION))
55+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
56+
kwargs.setdefault("sdk_moniker", "mgmt-fluidrelay/{}".format(VERSION))
5657
self._configure(**kwargs)
5758

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

sdk/fluidrelay/azure-mgmt-fluidrelay/azure/mgmt/fluidrelay/_fluid_relay_management_client.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12-
from msrest import Deserializer, Serializer
13-
1412
from azure.core.rest import HttpRequest, HttpResponse
1513
from azure.mgmt.core import ARMPipelineClient
1614

17-
from . import models
15+
from . import models as _models
1816
from ._configuration import FluidRelayManagementClientConfiguration
17+
from ._serialization import Deserializer, Serializer
1918
from .operations import FluidRelayContainersOperations, FluidRelayOperationsOperations, FluidRelayServersOperations
2019

2120
if TYPE_CHECKING:
2221
# pylint: disable=unused-import,ungrouped-imports
2322
from azure.core.credentials import TokenCredential
2423

25-
class FluidRelayManagementClient:
24+
25+
class FluidRelayManagementClient: # pylint: disable=client-accepts-api-version-keyword
2626
"""FluidRelayManagementClient.
2727
2828
:ivar fluid_relay_operations: FluidRelayOperationsOperations operations
@@ -33,9 +33,9 @@ class FluidRelayManagementClient:
3333
:ivar fluid_relay_containers: FluidRelayContainersOperations operations
3434
:vartype fluid_relay_containers:
3535
azure.mgmt.fluidrelay.operations.FluidRelayContainersOperations
36-
:param credential: Credential needed for the client to connect to Azure.
36+
:param credential: Credential needed for the client to connect to Azure. Required.
3737
:type credential: ~azure.core.credentials.TokenCredential
38-
:param subscription_id: The subscription id (GUID) for this resource.
38+
:param subscription_id: The subscription id (GUID) for this resource. Required.
3939
:type subscription_id: str
4040
:param base_url: Service URL. Default value is "https://management.azure.com".
4141
:type base_url: str
@@ -51,10 +51,12 @@ def __init__(
5151
base_url: str = "https://management.azure.com",
5252
**kwargs: Any
5353
) -> None:
54-
self._config = FluidRelayManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
54+
self._config = FluidRelayManagementClientConfiguration(
55+
credential=credential, subscription_id=subscription_id, **kwargs
56+
)
5557
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5658

57-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
59+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
5860
self._serialize = Serializer(client_models)
5961
self._deserialize = Deserializer(client_models)
6062
self._serialize.client_side_validation = False
@@ -68,12 +70,7 @@ def __init__(
6870
self._client, self._config, self._serialize, self._deserialize
6971
)
7072

71-
72-
def _send_request(
73-
self,
74-
request: HttpRequest,
75-
**kwargs: Any
76-
) -> HttpResponse:
73+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7774
"""Runs the network request through the client's chained policies.
7875
7976
>>> from azure.core.rest import HttpRequest
@@ -82,7 +79,7 @@ def _send_request(
8279
>>> response = client._send_request(request)
8380
<HttpResponse: 200 OK>
8481
85-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
82+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
8683
8784
:param request: The network request you want to make. Required.
8885
:type request: ~azure.core.rest.HttpRequest
@@ -95,15 +92,12 @@ def _send_request(
9592
request_copy.url = self._client.format_url(request_copy.url)
9693
return self._client.send_request(request_copy, **kwargs)
9794

98-
def close(self):
99-
# type: () -> None
95+
def close(self) -> None:
10096
self._client.close()
10197

102-
def __enter__(self):
103-
# type: () -> FluidRelayManagementClient
98+
def __enter__(self) -> "FluidRelayManagementClient":
10499
self._client.__enter__()
105100
return self
106101

107-
def __exit__(self, *exc_details):
108-
# type: (Any) -> None
102+
def __exit__(self, *exc_details) -> None:
109103
self._client.__exit__(*exc_details)

sdk/fluidrelay/azure-mgmt-fluidrelay/azure/mgmt/fluidrelay/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
1212

13+
1314
def patch_sdk():
1415
"""Do not remove from this file.
1516

0 commit comments

Comments
 (0)