Skip to content

[AutoPR track2_azure-mgmt-msi] [Hub Generated] Publish private branch 'dev-msi-Microsoft.ManagedIdentity-2022-01-31-preview-federated-identities' #648

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

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
6 changes: 3 additions & 3 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",
"use": [
"@autorest/python@5.13.0",
"@autorest/python@5.16.0",
"@autorest/[email protected]"
],
"commit": "9722d269ce8ad6bf8de7e8083f0409e8bcb0569f",
"commit": "d6caf3b9f717b65d650fa772a1ec1986f2ad6887",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/msi/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/[email protected] --version=3.7.2",
"autorest_command": "autorest specification/msi/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/msi/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['ManagedServiceIdentityClient']
__all__.extend([p for p in _patch_all if p not in __all__])

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.system_assigned_identities = SystemAssignedIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.user_assigned_identities = UserAssignedIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.system_assigned_identities = SystemAssignedIdentitiesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.user_assigned_identities = UserAssignedIdentitiesOperations(
self._client, self._config, self._serialize, self._deserialize
)


def _send_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "6.0.1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
# --------------------------------------------------------------------------

from ._managed_service_identity_client import ManagedServiceIdentityClient

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['ManagedServiceIdentityClient']
__all__.extend([p for p in _patch_all if p not in __all__])

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.system_assigned_identities = SystemAssignedIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.user_assigned_identities = UserAssignedIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.system_assigned_identities = SystemAssignedIdentitiesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.user_assigned_identities = UserAssignedIdentitiesOperations(
self._client, self._config, self._serialize, self._deserialize
)


def _send_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
from ._operations import Operations
from ._user_assigned_identities_operations import UserAssignedIdentitiesOperations

from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'SystemAssignedIdentitiesOperations',
'Operations',
'UserAssignedIdentitiesOperations',
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
Expand All @@ -23,32 +24,30 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class Operations:
"""Operations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
"""
.. warning::
**DO NOT** instantiate this class directly.

:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.msi.v2018_11_30.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
Instead, you should access the following operations through
:class:`~azure.mgmt.msi.v2018_11_30.aio.ManagedServiceIdentityClient`'s
:attr:`operations` attribute.
"""

models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")


@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable["_models.OperationListResult"]:
) -> AsyncIterable[_models.OperationListResult]:
"""Lists available operations for the Microsoft.ManagedIdentity provider.

:keyword callable cls: A custom type or function that will be passed the direct response
Expand All @@ -57,31 +56,38 @@ def list(
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.msi.v2018_11_30.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2018-11-30") # type: str
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop('api_version', _params.pop('api-version', "2018-11-30")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult]

cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:

request = build_list_request(
api_version=api_version,
template_url=self.list.metadata['url'],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.url = self._client.format_url(request.url) # type: ignore

else:

request = build_list_request(
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List

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

def patch_sdk():
"""Do not remove from this file.

`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
Expand All @@ -22,33 +23,31 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class SystemAssignedIdentitiesOperations:
"""SystemAssignedIdentitiesOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
"""
.. warning::
**DO NOT** instantiate this class directly.

:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.msi.v2018_11_30.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
Instead, you should access the following operations through
:class:`~azure.mgmt.msi.v2018_11_30.aio.ManagedServiceIdentityClient`'s
:attr:`system_assigned_identities` attribute.
"""

models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")


@distributed_trace_async
async def get_by_scope(
self,
scope: str,
**kwargs: Any
) -> "_models.SystemAssignedIdentity":
) -> _models.SystemAssignedIdentity:
"""Gets the systemAssignedIdentity available under the specified RP scope.

:param scope: The resource provider scope of the resource. Parent resource being extended by
Expand All @@ -59,24 +58,29 @@ async def get_by_scope(
:rtype: ~azure.mgmt.msi.v2018_11_30.models.SystemAssignedIdentity
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SystemAssignedIdentity"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
error_map.update(kwargs.pop('error_map', {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop('api_version', "2018-11-30") # type: str
api_version = kwargs.pop('api_version', _params.pop('api-version', "2018-11-30")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.SystemAssignedIdentity]


request = build_get_by_scope_request(
scope=scope,
api_version=api_version,
template_url=self.get_by_scope.metadata['url'],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.url = self._client.format_url(request.url) # type: ignore

pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
Expand Down
Loading