Skip to content

Commit 2790003

Browse files
author
SDKAuto
committed
CodeGen from PR 31443 in Azure/azure-rest-api-specs
Merge b05a493eb90b4a3966d781a71640e576ba69e197 into 4ae5cdc221660762336d5a899495b2b4941ea486
1 parent 9202986 commit 2790003

File tree

113 files changed

+2937
-2805
lines changed

Some content is hidden

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

113 files changed

+2937
-2805
lines changed

sdk/resources/azure-mgmt-msi/README.md

Lines changed: 5 additions & 7 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 Msi Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
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,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -45,8 +45,9 @@ client = ManagedServiceIdentityClient(credential=DefaultAzureCredential(), subsc
4545

4646
## Examples
4747

48-
49-
Code samples for this package can be found at [Msi Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
48+
Code samples for this package can be found at:
49+
- [Search Msi Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
5051

5152

5253
## Troubleshooting
@@ -58,6 +59,3 @@ Code samples for this package can be found at [Msi Management](https://docs.micr
5859
If you encounter any bugs or have suggestions, please file an issue in the
5960
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6061
section of the project.
61-
62-
63-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-msi%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "51d4c24a011e300b9713179e0515fef35bf3f678",
2+
"commit": "4870675d82e27d794acb3436d05ca93053a6487b",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.4.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.27.4",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/msi/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/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/msi/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/msi/resource-manager/readme.md"
1111
}

sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_configuration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# --------------------------------------------------------------------------
1111
from typing import Any, TYPE_CHECKING
1212

13-
from azure.core.configuration import Configuration
1413
from azure.core.pipeline import policies
1514
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1615

@@ -20,7 +19,7 @@
2019
# pylint: disable=unused-import,ungrouped-imports
2120
from azure.core.credentials import TokenCredential
2221

23-
class ManagedServiceIdentityClientConfiguration(Configuration):
22+
class ManagedServiceIdentityClientConfiguration:
2423
"""Configuration for ManagedServiceIdentityClient.
2524
2625
Note that all parameters used to create this instance are saved as instance
@@ -42,12 +41,12 @@ def __init__(
4241
raise ValueError("Parameter 'credential' must not be None.")
4342
if subscription_id is None:
4443
raise ValueError("Parameter 'subscription_id' must not be None.")
45-
super(ManagedServiceIdentityClientConfiguration, self).__init__(**kwargs)
4644

4745
self.credential = credential
4846
self.subscription_id = subscription_id
4947
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5048
kwargs.setdefault('sdk_moniker', 'azure-mgmt-msi/{}'.format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(

sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_managed_service_identity_client.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
# --------------------------------------------------------------------------
1111

1212
from typing import Any, Optional, TYPE_CHECKING
13+
from typing_extensions import Self
1314

15+
from azure.core.pipeline import policies
1416
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1518
from azure.profiles import KnownProfiles, ProfileDefinition
1619
from azure.profiles.multiapiclient import MultiApiClientMixin
1720

@@ -70,8 +73,28 @@ def __init__(
7073
profile: KnownProfiles=KnownProfiles.default,
7174
**kwargs: Any
7275
):
76+
if api_version:
77+
kwargs.setdefault('api_version', api_version)
7378
self._config = ManagedServiceIdentityClientConfiguration(credential, subscription_id, **kwargs)
74-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
79+
_policies = kwargs.pop("policies", None)
80+
if _policies is None:
81+
_policies = [
82+
policies.RequestIdPolicy(**kwargs),
83+
self._config.headers_policy,
84+
self._config.user_agent_policy,
85+
self._config.proxy_policy,
86+
policies.ContentDecodePolicy(**kwargs),
87+
ARMAutoResourceProviderRegistrationPolicy(),
88+
self._config.redirect_policy,
89+
self._config.retry_policy,
90+
self._config.authentication_policy,
91+
self._config.custom_hook_policy,
92+
self._config.logging_policy,
93+
policies.DistributedTracingPolicy(**kwargs),
94+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
95+
self._config.http_logging_policy,
96+
]
97+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
7598
super(ManagedServiceIdentityClient, self).__init__(
7699
api_version=api_version,
77100
profile=profile
@@ -119,7 +142,7 @@ def federated_identity_credentials(self):
119142
else:
120143
raise ValueError("API version {} does not have operation group 'federated_identity_credentials'".format(api_version))
121144
self._config.api_version = api_version
122-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
145+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
123146

124147
@property
125148
def operations(self):
@@ -142,7 +165,7 @@ def operations(self):
142165
else:
143166
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
144167
self._config.api_version = api_version
145-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
168+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
146169

147170
@property
148171
def system_assigned_identities(self):
@@ -165,7 +188,7 @@ def system_assigned_identities(self):
165188
else:
166189
raise ValueError("API version {} does not have operation group 'system_assigned_identities'".format(api_version))
167190
self._config.api_version = api_version
168-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
191+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
169192

170193
@property
171194
def user_assigned_identities(self):
@@ -188,7 +211,7 @@ def user_assigned_identities(self):
188211
else:
189212
raise ValueError("API version {} does not have operation group 'user_assigned_identities'".format(api_version))
190213
self._config.api_version = api_version
191-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
214+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
192215

193216
def close(self):
194217
self._client.close()

0 commit comments

Comments
 (0)