Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-msi] Update readme.python.md #2664

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sdk/resources/azure-mgmt-msi/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"commit": "1f5f271fa98e45e515c7078f0ae9d64c3674c5cc",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@5.16.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.2.16",
"@autorest/modelerfour@4.24.3"
],
"commit": "fda2db441da3f1fab31bb235e97da3e33c8e3903",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/msi/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",
"autorest_command": "autorest specification/msi/resource-manager/readme.md --generate-sample=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.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/msi/resource-manager/readme.md"
}
4 changes: 4 additions & 0 deletions sdk/resources/azure-mgmt-msi/azure/mgmt/msi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
patch_sdk()
except ImportError:
pass

from ._version import VERSION

__version__ = VERSION
18 changes: 7 additions & 11 deletions sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class ManagedServiceIdentityClientConfiguration(Configuration):
Expand All @@ -28,19 +26,18 @@ class ManagedServiceIdentityClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Id of the Subscription to which the identity belongs.
:param subscription_id: The Id of the Subscription to which the identity belongs. Required.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand All @@ -55,9 +52,8 @@ def __init__(

def _configure(
self,
**kwargs # type: Any
**kwargs: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer
from typing import Any, Optional, TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin

from ._configuration import ManagedServiceIdentityClientConfiguration
from ._serialization import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

class _SDKClient(object):
Expand All @@ -43,9 +40,9 @@ class ManagedServiceIdentityClient(MultiApiClientMixin, _SDKClient):
The api-version parameter sets the default API version if the operation
group is not described in the profile.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Id of the Subscription to which the identity belongs.
:param subscription_id: The Id of the Subscription to which the identity belongs. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
Expand All @@ -55,7 +52,7 @@ class ManagedServiceIdentityClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2018-11-30'
DEFAULT_API_VERSION = '2023-01-31'
_PROFILE_TAG = "azure.mgmt.msi.ManagedServiceIdentityClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -66,12 +63,12 @@ class ManagedServiceIdentityClient(MultiApiClientMixin, _SDKClient):

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
credential: "TokenCredential",
subscription_id: str,
api_version: Optional[str]=None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles=KnownProfiles.default,
**kwargs: Any
):
self._config = ManagedServiceIdentityClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
Expand All @@ -91,6 +88,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-11-30: :mod:`v2018_11_30.models<azure.mgmt.msi.v2018_11_30.models>`
* 2021-09-30-preview: :mod:`v2021_09_30_preview.models<azure.mgmt.msi.v2021_09_30_preview.models>`
* 2022-01-31-preview: :mod:`v2022_01_31_preview.models<azure.mgmt.msi.v2022_01_31_preview.models>`
* 2023-01-31: :mod:`v2023_01_31.models<azure.mgmt.msi.v2023_01_31.models>`
"""
if api_version == '2018-11-30':
from .v2018_11_30 import models
Expand All @@ -101,19 +99,26 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2022-01-31-preview':
from .v2022_01_31_preview import models
return models
elif api_version == '2023-01-31':
from .v2023_01_31 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def federated_identity_credentials(self):
"""Instance depends on the API version:

* 2022-01-31-preview: :class:`FederatedIdentityCredentialsOperations<azure.mgmt.msi.v2022_01_31_preview.operations.FederatedIdentityCredentialsOperations>`
* 2023-01-31: :class:`FederatedIdentityCredentialsOperations<azure.mgmt.msi.v2023_01_31.operations.FederatedIdentityCredentialsOperations>`
"""
api_version = self._get_api_version('federated_identity_credentials')
if api_version == '2022-01-31-preview':
from .v2022_01_31_preview.operations import FederatedIdentityCredentialsOperations as OperationClass
elif api_version == '2023-01-31':
from .v2023_01_31.operations import FederatedIdentityCredentialsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'federated_identity_credentials'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
Expand All @@ -123,6 +128,7 @@ def operations(self):
* 2018-11-30: :class:`Operations<azure.mgmt.msi.v2018_11_30.operations.Operations>`
* 2021-09-30-preview: :class:`Operations<azure.mgmt.msi.v2021_09_30_preview.operations.Operations>`
* 2022-01-31-preview: :class:`Operations<azure.mgmt.msi.v2022_01_31_preview.operations.Operations>`
* 2023-01-31: :class:`Operations<azure.mgmt.msi.v2023_01_31.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-11-30':
Expand All @@ -131,8 +137,11 @@ def operations(self):
from .v2021_09_30_preview.operations import Operations as OperationClass
elif api_version == '2022-01-31-preview':
from .v2022_01_31_preview.operations import Operations as OperationClass
elif api_version == '2023-01-31':
from .v2023_01_31.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
Expand All @@ -142,6 +151,7 @@ def system_assigned_identities(self):
* 2018-11-30: :class:`SystemAssignedIdentitiesOperations<azure.mgmt.msi.v2018_11_30.operations.SystemAssignedIdentitiesOperations>`
* 2021-09-30-preview: :class:`SystemAssignedIdentitiesOperations<azure.mgmt.msi.v2021_09_30_preview.operations.SystemAssignedIdentitiesOperations>`
* 2022-01-31-preview: :class:`SystemAssignedIdentitiesOperations<azure.mgmt.msi.v2022_01_31_preview.operations.SystemAssignedIdentitiesOperations>`
* 2023-01-31: :class:`SystemAssignedIdentitiesOperations<azure.mgmt.msi.v2023_01_31.operations.SystemAssignedIdentitiesOperations>`
"""
api_version = self._get_api_version('system_assigned_identities')
if api_version == '2018-11-30':
Expand All @@ -150,8 +160,11 @@ def system_assigned_identities(self):
from .v2021_09_30_preview.operations import SystemAssignedIdentitiesOperations as OperationClass
elif api_version == '2022-01-31-preview':
from .v2022_01_31_preview.operations import SystemAssignedIdentitiesOperations as OperationClass
elif api_version == '2023-01-31':
from .v2023_01_31.operations import SystemAssignedIdentitiesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'system_assigned_identities'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
Expand All @@ -161,6 +174,7 @@ def user_assigned_identities(self):
* 2018-11-30: :class:`UserAssignedIdentitiesOperations<azure.mgmt.msi.v2018_11_30.operations.UserAssignedIdentitiesOperations>`
* 2021-09-30-preview: :class:`UserAssignedIdentitiesOperations<azure.mgmt.msi.v2021_09_30_preview.operations.UserAssignedIdentitiesOperations>`
* 2022-01-31-preview: :class:`UserAssignedIdentitiesOperations<azure.mgmt.msi.v2022_01_31_preview.operations.UserAssignedIdentitiesOperations>`
* 2023-01-31: :class:`UserAssignedIdentitiesOperations<azure.mgmt.msi.v2023_01_31.operations.UserAssignedIdentitiesOperations>`
"""
api_version = self._get_api_version('user_assigned_identities')
if api_version == '2018-11-30':
Expand All @@ -169,8 +183,11 @@ def user_assigned_identities(self):
from .v2021_09_30_preview.operations import UserAssignedIdentitiesOperations as OperationClass
elif api_version == '2022-01-31-preview':
from .v2022_01_31_preview.operations import UserAssignedIdentitiesOperations as OperationClass
elif api_version == '2023-01-31':
from .v2023_01_31.operations import UserAssignedIdentitiesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'user_assigned_identities'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

def close(self):
Expand Down
Loading