Skip to content

Commit d0c1370

Browse files
author
SDKAuto
committed
CodeGen from PR 20610 in Azure/azure-rest-api-specs
Merge 67f59ab9c6ebc6d4a609e2b2d0acfb5f229239cc into dad16c71bfaabfc7e06b0e8d71b6f62f0435f84e
1 parent c939421 commit d0c1370

31 files changed

+5155
-2735
lines changed

sdk/chaos/azure-mgmt-chaos/_meta.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.9.2",
33
"use": [
4-
"@autorest/python@5.16.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.1.6",
5+
"@autorest/modelerfour@4.24.3"
66
],
7-
"commit": "8c3029730778c35b597aa6d1afe69e78872bf03c",
7+
"commit": "c58b64139e084890c93c35afbb2b8d8e9309098f",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/chaos/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/chaos/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/chaos/resource-manager/readme.md"
1111
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
20-
__all__ = ['ChaosManagementClient']
20+
21+
__all__ = ["ChaosManagementClient"]
2122
__all__.extend([p for p in _patch_all if p not in __all__])
2223

2324
_patch_sdk()

sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_chaos_management_client.py

+28-34
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,48 @@
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

1715
from . import models
1816
from ._configuration import ChaosManagementClientConfiguration
19-
from .operations import CapabilitiesOperations, CapabilityTypesOperations, ExperimentsOperations, Operations, TargetTypesOperations, TargetsOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
CapabilitiesOperations,
20+
CapabilityTypesOperations,
21+
ExperimentsOperations,
22+
Operations,
23+
TargetTypesOperations,
24+
TargetsOperations,
25+
)
2026

2127
if TYPE_CHECKING:
2228
# pylint: disable=unused-import,ungrouped-imports
2329
from azure.core.credentials import TokenCredential
2430

25-
class ChaosManagementClient:
31+
32+
class ChaosManagementClient: # pylint: disable=client-accepts-api-version-keyword
2633
"""Chaos Management Client.
2734
2835
:ivar capabilities: CapabilitiesOperations operations
2936
:vartype capabilities: azure.mgmt.chaos.operations.CapabilitiesOperations
37+
:ivar capability_types: CapabilityTypesOperations operations
38+
:vartype capability_types: azure.mgmt.chaos.operations.CapabilityTypesOperations
3039
:ivar experiments: ExperimentsOperations operations
3140
:vartype experiments: azure.mgmt.chaos.operations.ExperimentsOperations
3241
:ivar operations: Operations operations
3342
:vartype operations: azure.mgmt.chaos.operations.Operations
34-
:ivar targets: TargetsOperations operations
35-
:vartype targets: azure.mgmt.chaos.operations.TargetsOperations
3643
:ivar target_types: TargetTypesOperations operations
3744
:vartype target_types: azure.mgmt.chaos.operations.TargetTypesOperations
38-
:ivar capability_types: CapabilityTypesOperations operations
39-
:vartype capability_types: azure.mgmt.chaos.operations.CapabilityTypesOperations
40-
:param credential: Credential needed for the client to connect to Azure.
45+
:ivar targets: TargetsOperations operations
46+
:vartype targets: azure.mgmt.chaos.operations.TargetsOperations
47+
:param credential: Credential needed for the client to connect to Azure. Required.
4148
:type credential: ~azure.core.credentials.TokenCredential
42-
:param subscription_id: GUID that represents an Azure subscription ID.
49+
:param subscription_id: GUID that represents an Azure subscription ID. Required.
4350
:type subscription_id: str
4451
:param base_url: Service URL. Default value is "https://management.azure.com".
4552
:type base_url: str
46-
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
53+
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
4754
this default value may result in unsupported behavior.
4855
:paramtype api_version: str
4956
"""
@@ -55,38 +62,25 @@ def __init__(
5562
base_url: str = "https://management.azure.com",
5663
**kwargs: Any
5764
) -> None:
58-
self._config = ChaosManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
65+
self._config = ChaosManagementClientConfiguration(
66+
credential=credential, subscription_id=subscription_id, **kwargs
67+
)
5968
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6069

6170
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
6271
self._serialize = Serializer(client_models)
6372
self._deserialize = Deserializer(client_models)
6473
self._serialize.client_side_validation = False
65-
self.capabilities = CapabilitiesOperations(
66-
self._client, self._config, self._serialize, self._deserialize
67-
)
68-
self.experiments = ExperimentsOperations(
69-
self._client, self._config, self._serialize, self._deserialize
70-
)
71-
self.operations = Operations(
72-
self._client, self._config, self._serialize, self._deserialize
73-
)
74-
self.targets = TargetsOperations(
75-
self._client, self._config, self._serialize, self._deserialize
76-
)
77-
self.target_types = TargetTypesOperations(
78-
self._client, self._config, self._serialize, self._deserialize
79-
)
74+
self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize)
8075
self.capability_types = CapabilityTypesOperations(
8176
self._client, self._config, self._serialize, self._deserialize
8277
)
78+
self.experiments = ExperimentsOperations(self._client, self._config, self._serialize, self._deserialize)
79+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
80+
self.target_types = TargetTypesOperations(self._client, self._config, self._serialize, self._deserialize)
81+
self.targets = TargetsOperations(self._client, self._config, self._serialize, self._deserialize)
8382

84-
85-
def _send_request(
86-
self,
87-
request: HttpRequest,
88-
**kwargs: Any
89-
) -> HttpResponse:
83+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
9084
"""Runs the network request through the client's chained policies.
9185
9286
>>> from azure.core.rest import HttpRequest
@@ -95,7 +89,7 @@ def _send_request(
9589
>>> response = client._send_request(request)
9690
<HttpResponse: 200 OK>
9791
98-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
92+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
9993
10094
:param request: The network request you want to make. Required.
10195
:type request: ~azure.core.rest.HttpRequest

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

+20-24
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,18 @@ class ChaosManagementClientConfiguration(Configuration): # pylint: disable=too-
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: GUID that represents an Azure subscription ID.
30+
:param subscription_id: GUID that represents an Azure subscription ID. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
3333
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

37-
def __init__(
38-
self,
39-
credential: "TokenCredential",
40-
subscription_id: str,
41-
**kwargs: Any
42-
) -> None:
37+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4338
super(ChaosManagementClientConfiguration, self).__init__(**kwargs)
44-
api_version = kwargs.pop('api_version', "2022-07-01-preview") # type: str
39+
api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str
4540

4641
if credential is None:
4742
raise ValueError("Parameter 'credential' must not be None.")
@@ -51,23 +46,24 @@ def __init__(
5146
self.credential = credential
5247
self.subscription_id = subscription_id
5348
self.api_version = api_version
54-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
55-
kwargs.setdefault('sdk_moniker', 'mgmt-chaos/{}'.format(VERSION))
49+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
50+
kwargs.setdefault("sdk_moniker", "mgmt-chaos/{}".format(VERSION))
5651
self._configure(**kwargs)
5752

5853
def _configure(
59-
self,
60-
**kwargs # type: Any
54+
self, **kwargs # type: Any
6155
):
6256
# 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')
57+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
58+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
59+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
60+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
61+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
62+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
63+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
64+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
65+
self.authentication_policy = kwargs.get("authentication_policy")
7266
if self.credential and not self.authentication_policy:
73-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
68+
self.credential, *self.credential_scopes, **kwargs
69+
)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)