diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json index 63a7d0f57edd..40e1c420f43d 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json +++ b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.7.2", "use": [ - "@autorest/python@5.12.0", + "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "429a7ea873cc1bbd4df133f71427162e15e258b1", + "commit": "36a52abbdbce53f3981f55db06b2ba36b71dfca4", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/servicelinker/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/servicelinker/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/servicelinker/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/__init__.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/__init__.py index f44afd12a1c7..6da438165f25 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/__init__.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/__init__.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_service_linker import MicrosoftServiceLinker +from ._service_linker_management_client import ServiceLinkerManagementClient from ._version import VERSION __version__ = VERSION -__all__ = ['MicrosoftServiceLinker'] +__all__ = ['ServiceLinkerManagementClient'] # `._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 diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py index 2e8d17ebe877..3001ed6a9b0d 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py @@ -19,14 +19,17 @@ from azure.core.credentials import TokenCredential -class MicrosoftServiceLinkerConfiguration(Configuration): - """Configuration for MicrosoftServiceLinker. +class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for ServiceLinkerManagementClient. 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. :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -34,12 +37,14 @@ def __init__( credential: "TokenCredential", **kwargs: Any ) -> None: - super(MicrosoftServiceLinkerConfiguration, self).__init__(**kwargs) + super(ServiceLinkerManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.api_version = "2021-11-01-preview" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-servicelinker/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_metadata.json b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_metadata.json index 8924f4b63eb2..3f32c380b3c7 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_metadata.json +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-11-01-preview", - "total_api_version_list": ["2021-11-01-preview"], + "chosen_version": "2022-05-01", + "total_api_version_list": ["2022-05-01"], "client": { - "name": "MicrosoftServiceLinker", - "filename": "_microsoft_service_linker", + "name": "ServiceLinkerManagementClient", + "filename": "_service_linker_management_client", "description": "Microsoft.ServiceLinker provider.", "host_value": "\"https://management.azure.com\"", "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MicrosoftServiceLinkerConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MicrosoftServiceLinkerConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ServiceLinkerManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ServiceLinkerManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_microsoft_service_linker.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py similarity index 82% rename from sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_microsoft_service_linker.py rename to sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py index f932ef30082f..604e2a53fb74 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_microsoft_service_linker.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py @@ -7,31 +7,35 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer from . import models -from ._configuration import MicrosoftServiceLinkerConfiguration +from ._configuration import ServiceLinkerManagementClientConfiguration from .operations import LinkerOperations, Operations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class MicrosoftServiceLinker: +class ServiceLinkerManagementClient: """Microsoft.ServiceLinker provider. :ivar linker: LinkerOperations operations - :vartype linker: microsoft_service_linker.operations.LinkerOperations + :vartype linker: azure.mgmt.servicelinker.operations.LinkerOperations :ivar operations: Operations operations - :vartype operations: microsoft_service_linker.operations.Operations + :vartype operations: azure.mgmt.servicelinker.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -42,7 +46,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = MicrosoftServiceLinkerConfiguration(credential=credential, **kwargs) + self._config = ServiceLinkerManagementClientConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -55,7 +59,7 @@ def __init__( def _send_request( self, - request, # type: HttpRequest + request: HttpRequest, **kwargs: Any ) -> HttpResponse: """Runs the network request through the client's chained policies. @@ -84,7 +88,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MicrosoftServiceLinker + # type: () -> ServiceLinkerManagementClient self._client.__enter__() return self diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py index dfa6ee022f15..e5754a47ce68 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/__init__.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/__init__.py index 853922ac9ee0..4f468be67bfc 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/__init__.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_service_linker import MicrosoftServiceLinker -__all__ = ['MicrosoftServiceLinker'] +from ._service_linker_management_client import ServiceLinkerManagementClient +__all__ = ['ServiceLinkerManagementClient'] # `._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 diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py index ac4924edb15a..c11e651ede93 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py @@ -19,14 +19,17 @@ from azure.core.credentials_async import AsyncTokenCredential -class MicrosoftServiceLinkerConfiguration(Configuration): - """Configuration for MicrosoftServiceLinker. +class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for ServiceLinkerManagementClient. 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. :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -34,12 +37,14 @@ def __init__( credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - super(MicrosoftServiceLinkerConfiguration, self).__init__(**kwargs) + super(ServiceLinkerManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.api_version = "2021-11-01-preview" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-servicelinker/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_microsoft_service_linker.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py similarity index 82% rename from sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_microsoft_service_linker.py rename to sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py index ef2247fd1ab1..72d35739e43c 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_microsoft_service_linker.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py @@ -7,31 +7,35 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer from .. import models -from ._configuration import MicrosoftServiceLinkerConfiguration +from ._configuration import ServiceLinkerManagementClientConfiguration from .operations import LinkerOperations, Operations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class MicrosoftServiceLinker: +class ServiceLinkerManagementClient: """Microsoft.ServiceLinker provider. :ivar linker: LinkerOperations operations - :vartype linker: microsoft_service_linker.aio.operations.LinkerOperations + :vartype linker: azure.mgmt.servicelinker.aio.operations.LinkerOperations :ivar operations: Operations operations - :vartype operations: microsoft_service_linker.aio.operations.Operations + :vartype operations: azure.mgmt.servicelinker.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -42,7 +46,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = MicrosoftServiceLinkerConfiguration(credential=credential, **kwargs) + self._config = ServiceLinkerManagementClientConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -82,7 +86,7 @@ def _send_request( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MicrosoftServiceLinker": + async def __aenter__(self) -> "ServiceLinkerManagementClient": await self._client.__aenter__() return self diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py index a3ff51cedba9..064568598f3d 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class LinkerOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~microsoft_service_linker.models + :type models: ~azure.mgmt.servicelinker.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,9 +60,11 @@ def list( :type resource_uri: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkerList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_service_linker.models.LinkerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicelinker.models.LinkerList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -74,6 +75,7 @@ def prepare_request(next_link=None): request = build_list_request( resource_uri=resource_uri, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -83,6 +85,7 @@ def prepare_request(next_link=None): request = build_list_request( resource_uri=resource_uri, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -100,7 +103,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -114,7 +121,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers'} # type: ignore + list.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers"} # type: ignore @distributed_trace_async async def get( @@ -132,7 +139,7 @@ async def get( :type linker_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkerResource, or the result of cls(response) - :rtype: ~microsoft_service_linker.models.LinkerResource + :rtype: ~azure.mgmt.servicelinker.models.LinkerResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] @@ -141,16 +148,23 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -165,7 +179,7 @@ async def get( return deserialized - get.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + get.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore async def _create_or_update_initial( @@ -181,6 +195,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LinkerResource') @@ -188,6 +203,7 @@ async def _create_or_update_initial( request = build_create_or_update_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -195,7 +211,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -213,7 +233,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace_async @@ -232,7 +252,7 @@ async def begin_create_or_update( :param linker_name: The name Linker resource. :type linker_name: str :param parameters: Linker details. - :type parameters: ~microsoft_service_linker.models.LinkerResource + :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -243,11 +263,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either LinkerResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_service_linker.models.LinkerResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicelinker.models.LinkerResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -259,6 +280,7 @@ async def begin_create_or_update( resource_uri=resource_uri, linker_name=linker_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -283,12 +305,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_uri: str, linker_name: str, @@ -300,16 +321,23 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -319,11 +347,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _delete_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_uri: str, linker_name: str, @@ -348,7 +376,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -359,6 +388,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -379,10 +409,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_delete.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore async def _update_initial( self, @@ -397,6 +426,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LinkerPatch') @@ -404,6 +434,7 @@ async def _update_initial( request = build_update_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -411,7 +442,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -429,7 +464,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _update_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace_async @@ -448,7 +483,7 @@ async def begin_update( :param linker_name: The name Linker resource. :type linker_name: str :param parameters: Linker details. - :type parameters: ~microsoft_service_linker.models.LinkerPatch + :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -459,11 +494,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either LinkerResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_service_linker.models.LinkerResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicelinker.models.LinkerResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -475,6 +511,7 @@ async def begin_update( resource_uri=resource_uri, linker_name=linker_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -499,10 +536,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_update.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore async def _validate_initial( self, @@ -516,16 +552,23 @@ async def _validate_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_validate_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self._validate_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -541,7 +584,7 @@ async def _validate_initial( return deserialized - _validate_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker'} # type: ignore + _validate_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker"} # type: ignore @distributed_trace_async @@ -568,10 +611,11 @@ async def begin_validate( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ValidateResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_service_linker.models.ValidateResult] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicelinker.models.ValidateResult] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -582,6 +626,7 @@ async def begin_validate( raw_result = await self._validate_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -605,10 +650,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_validate.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker'} # type: ignore + begin_validate.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker"} # type: ignore @distributed_trace_async async def list_configurations( @@ -626,7 +670,7 @@ async def list_configurations( :type linker_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceConfigurationResult, or the result of cls(response) - :rtype: ~microsoft_service_linker.models.SourceConfigurationResult + :rtype: ~azure.mgmt.servicelinker.models.SourceConfigurationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceConfigurationResult"] @@ -635,16 +679,23 @@ async def list_configurations( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_list_configurations_request( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self.list_configurations.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -659,5 +710,5 @@ async def list_configurations( return deserialized - list_configurations.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations'} # type: ignore + list_configurations.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations"} # type: ignore diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py index 3887e2c97f10..3cf8e89b9021 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~microsoft_service_linker.models + :type models: ~azure.mgmt.servicelinker.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,9 +54,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~microsoft_service_linker.models.OperationListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicelinker.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -68,6 +68,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -76,6 +77,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -93,7 +95,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -107,4 +113,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.ServiceLinker/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.ServiceLinker/operations"} # type: ignore diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py index 6ddcccaa9932..7687e259e629 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py @@ -7,9 +7,16 @@ # -------------------------------------------------------------------------- from ._models_py3 import AuthInfoBase +from ._models_py3 import AzureKeyVaultProperties +from ._models_py3 import AzureResource +from ._models_py3 import AzureResourcePropertiesBase +from ._models_py3 import ConfluentBootstrapServer +from ._models_py3 import ConfluentSchemaRegistry from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse +from ._models_py3 import KeyVaultSecretReferenceSecretInfo +from ._models_py3 import KeyVaultSecretUriSecretInfo from ._models_py3 import LinkerList from ._models_py3 import LinkerPatch from ._models_py3 import LinkerResource @@ -19,6 +26,7 @@ from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import SecretAuthInfo +from ._models_py3 import SecretInfoBase from ._models_py3 import SecretStore from ._models_py3 import ServicePrincipalCertificateAuthInfo from ._models_py3 import ServicePrincipalSecretAuthInfo @@ -26,26 +34,38 @@ from ._models_py3 import SourceConfigurationResult from ._models_py3 import SystemAssignedIdentityAuthInfo from ._models_py3 import SystemData +from ._models_py3 import TargetServiceBase from ._models_py3 import UserAssignedIdentityAuthInfo from ._models_py3 import VNetSolution from ._models_py3 import ValidateResult +from ._models_py3 import ValidationResultItem +from ._models_py3 import ValueSecretInfo -from ._microsoft_service_linker_enums import ( +from ._service_linker_management_client_enums import ( ActionType, AuthType, ClientType, CreatedByType, - LinkerStatus, Origin, + SecretType, + Type, VNetSolutionType, + ValidationResultStatus, ) __all__ = [ 'AuthInfoBase', + 'AzureKeyVaultProperties', + 'AzureResource', + 'AzureResourcePropertiesBase', + 'ConfluentBootstrapServer', + 'ConfluentSchemaRegistry', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'KeyVaultSecretReferenceSecretInfo', + 'KeyVaultSecretUriSecretInfo', 'LinkerList', 'LinkerPatch', 'LinkerResource', @@ -55,6 +75,7 @@ 'ProxyResource', 'Resource', 'SecretAuthInfo', + 'SecretInfoBase', 'SecretStore', 'ServicePrincipalCertificateAuthInfo', 'ServicePrincipalSecretAuthInfo', @@ -62,14 +83,19 @@ 'SourceConfigurationResult', 'SystemAssignedIdentityAuthInfo', 'SystemData', + 'TargetServiceBase', 'UserAssignedIdentityAuthInfo', 'VNetSolution', 'ValidateResult', + 'ValidationResultItem', + 'ValueSecretInfo', 'ActionType', 'AuthType', 'ClientType', 'CreatedByType', - 'LinkerStatus', 'Origin', + 'SecretType', + 'Type', 'VNetSolutionType', + 'ValidationResultStatus', ] diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py index 4e9dfc4dd864..e66f6d614f84 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._microsoft_service_linker_enums import * +from ._service_linker_management_client_enums import * class AuthInfoBase(msrest.serialization.Model): @@ -26,7 +26,7 @@ class AuthInfoBase(msrest.serialization.Model): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType """ _validation = { @@ -51,6 +51,227 @@ def __init__( self.auth_type = None # type: Optional[str] +class AzureResourcePropertiesBase(msrest.serialization.Model): + """The azure resource properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureKeyVaultProperties. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The azure resource type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'KeyVault': 'AzureKeyVaultProperties'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(AzureResourcePropertiesBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class AzureKeyVaultProperties(AzureResourcePropertiesBase): + """The resource properties when type is Azure Key Vault. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The azure resource type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + :ivar connect_as_kubernetes_csi_driver: True if connect via Kubernetes CSI Driver. + :vartype connect_as_kubernetes_csi_driver: bool + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'connect_as_kubernetes_csi_driver': {'key': 'connectAsKubernetesCsiDriver', 'type': 'bool'}, + } + + def __init__( + self, + *, + connect_as_kubernetes_csi_driver: Optional[bool] = None, + **kwargs + ): + """ + :keyword connect_as_kubernetes_csi_driver: True if connect via Kubernetes CSI Driver. + :paramtype connect_as_kubernetes_csi_driver: bool + """ + super(AzureKeyVaultProperties, self).__init__(**kwargs) + self.type = 'KeyVault' # type: str + self.connect_as_kubernetes_csi_driver = connect_as_kubernetes_csi_driver + + +class TargetServiceBase(msrest.serialization.Model): + """The target service properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureResource, ConfluentBootstrapServer, ConfluentSchemaRegistry. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The target service type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'AzureResource': 'AzureResource', 'ConfluentBootstrapServer': 'ConfluentBootstrapServer', 'ConfluentSchemaRegistry': 'ConfluentSchemaRegistry'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(TargetServiceBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class AzureResource(TargetServiceBase): + """The azure resource info when target service type is AzureResource. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The target service type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + :ivar id: The Id of azure resource. + :vartype id: str + :ivar resource_properties: The azure resource connection related properties. + :vartype resource_properties: ~azure.mgmt.servicelinker.models.AzureResourcePropertiesBase + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_properties': {'key': 'resourceProperties', 'type': 'AzureResourcePropertiesBase'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + resource_properties: Optional["AzureResourcePropertiesBase"] = None, + **kwargs + ): + """ + :keyword id: The Id of azure resource. + :paramtype id: str + :keyword resource_properties: The azure resource connection related properties. + :paramtype resource_properties: ~azure.mgmt.servicelinker.models.AzureResourcePropertiesBase + """ + super(AzureResource, self).__init__(**kwargs) + self.type = 'AzureResource' # type: str + self.id = id + self.resource_properties = resource_properties + + +class ConfluentBootstrapServer(TargetServiceBase): + """The service properties when target service type is ConfluentBootstrapServer. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The target service type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + :ivar endpoint: The endpoint of service. + :vartype endpoint: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + endpoint: Optional[str] = None, + **kwargs + ): + """ + :keyword endpoint: The endpoint of service. + :paramtype endpoint: str + """ + super(ConfluentBootstrapServer, self).__init__(**kwargs) + self.type = 'ConfluentBootstrapServer' # type: str + self.endpoint = endpoint + + +class ConfluentSchemaRegistry(TargetServiceBase): + """The service properties when target service type is ConfluentSchemaRegistry. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The target service type.Constant filled by server. Possible values + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.Type + :ivar endpoint: The endpoint of service. + :vartype endpoint: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + endpoint: Optional[str] = None, + **kwargs + ): + """ + :keyword endpoint: The endpoint of service. + :paramtype endpoint: str + """ + super(ConfluentSchemaRegistry, self).__init__(**kwargs) + self.type = 'ConfluentSchemaRegistry' # type: str + self.endpoint = endpoint + + class ErrorAdditionalInfo(msrest.serialization.Model): """The resource management error additional info. @@ -95,9 +316,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~microsoft_service_linker.models.ErrorDetail] + :vartype details: list[~azure.mgmt.servicelinker.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~microsoft_service_linker.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.servicelinker.models.ErrorAdditionalInfo] """ _validation = { @@ -134,7 +355,7 @@ class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :ivar error: The error object. - :vartype error: ~microsoft_service_linker.models.ErrorDetail + :vartype error: ~azure.mgmt.servicelinker.models.ErrorDetail """ _attribute_map = { @@ -149,19 +370,133 @@ def __init__( ): """ :keyword error: The error object. - :paramtype error: ~microsoft_service_linker.models.ErrorDetail + :paramtype error: ~azure.mgmt.servicelinker.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) self.error = error +class SecretInfoBase(msrest.serialization.Model): + """The secret info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: KeyVaultSecretReferenceSecretInfo, KeyVaultSecretUriSecretInfo, ValueSecretInfo. + + All required parameters must be populated in order to send to Azure. + + :ivar secret_type: Required. The secret type.Constant filled by server. Possible values + include: "rawValue", "keyVaultSecretUri", "keyVaultSecretReference". + :vartype secret_type: str or ~azure.mgmt.servicelinker.models.SecretType + """ + + _validation = { + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_type': {'key': 'secretType', 'type': 'str'}, + } + + _subtype_map = { + 'secret_type': {'keyVaultSecretReference': 'KeyVaultSecretReferenceSecretInfo', 'keyVaultSecretUri': 'KeyVaultSecretUriSecretInfo', 'rawValue': 'ValueSecretInfo'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SecretInfoBase, self).__init__(**kwargs) + self.secret_type = None # type: Optional[str] + + +class KeyVaultSecretReferenceSecretInfo(SecretInfoBase): + """The secret info when type is keyVaultSecretReference. It's for scenario that user provides a secret stored in user's keyvault and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. + + All required parameters must be populated in order to send to Azure. + + :ivar secret_type: Required. The secret type.Constant filled by server. Possible values + include: "rawValue", "keyVaultSecretUri", "keyVaultSecretReference". + :vartype secret_type: str or ~azure.mgmt.servicelinker.models.SecretType + :ivar name: Name of the Key Vault secret. + :vartype name: str + :ivar version: Version of the Key Vault secret. + :vartype version: str + """ + + _validation = { + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_type': {'key': 'secretType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of the Key Vault secret. + :paramtype name: str + :keyword version: Version of the Key Vault secret. + :paramtype version: str + """ + super(KeyVaultSecretReferenceSecretInfo, self).__init__(**kwargs) + self.secret_type = 'keyVaultSecretReference' # type: str + self.name = name + self.version = version + + +class KeyVaultSecretUriSecretInfo(SecretInfoBase): + """The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret stored in user's keyvault and source is Web App, Spring Cloud or Container App. + + All required parameters must be populated in order to send to Azure. + + :ivar secret_type: Required. The secret type.Constant filled by server. Possible values + include: "rawValue", "keyVaultSecretUri", "keyVaultSecretReference". + :vartype secret_type: str or ~azure.mgmt.servicelinker.models.SecretType + :ivar value: URI to the keyvault secret. + :vartype value: str + """ + + _validation = { + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_type': {'key': 'secretType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + **kwargs + ): + """ + :keyword value: URI to the keyvault secret. + :paramtype value: str + """ + super(KeyVaultSecretUriSecretInfo, self).__init__(**kwargs) + self.secret_type = 'keyVaultSecretUri' # type: str + self.value = value + + class LinkerList(msrest.serialization.Model): """The list of Linker. :ivar next_link: The link used to get the next page of Linker list. :vartype next_link: str :ivar value: The list of Linkers. - :vartype value: list[~microsoft_service_linker.models.LinkerResource] + :vartype value: list[~azure.mgmt.servicelinker.models.LinkerResource] """ _attribute_map = { @@ -180,7 +515,7 @@ def __init__( :keyword next_link: The link used to get the next page of Linker list. :paramtype next_link: str :keyword value: The list of Linkers. - :paramtype value: list[~microsoft_service_linker.models.LinkerResource] + :paramtype value: list[~azure.mgmt.servicelinker.models.LinkerResource] """ super(LinkerList, self).__init__(**kwargs) self.next_link = next_link @@ -192,19 +527,21 @@ class LinkerPatch(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar target_id: The resource Id of target service. - :vartype target_id: str + :ivar target_service: The target service properties. + :vartype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :ivar auth_info: The authentication type. - :vartype auth_info: ~microsoft_service_linker.models.AuthInfoBase + :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Possible values include: "none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot". - :vartype client_type: str or ~microsoft_service_linker.models.ClientType + :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str :ivar v_net_solution: The VNet solution. - :vartype v_net_solution: ~microsoft_service_linker.models.VNetSolution + :vartype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution :ivar secret_store: An option to store secret value in secure place. - :vartype secret_store: ~microsoft_service_linker.models.SecretStore + :vartype secret_store: ~azure.mgmt.servicelinker.models.SecretStore + :ivar scope: connection scope in source service. + :vartype scope: str """ _validation = { @@ -212,44 +549,49 @@ class LinkerPatch(msrest.serialization.Model): } _attribute_map = { - 'target_id': {'key': 'properties.targetId', 'type': 'str'}, + 'target_service': {'key': 'properties.targetService', 'type': 'TargetServiceBase'}, 'auth_info': {'key': 'properties.authInfo', 'type': 'AuthInfoBase'}, 'client_type': {'key': 'properties.clientType', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'v_net_solution': {'key': 'properties.vNetSolution', 'type': 'VNetSolution'}, 'secret_store': {'key': 'properties.secretStore', 'type': 'SecretStore'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, } def __init__( self, *, - target_id: Optional[str] = None, + target_service: Optional["TargetServiceBase"] = None, auth_info: Optional["AuthInfoBase"] = None, client_type: Optional[Union[str, "ClientType"]] = None, v_net_solution: Optional["VNetSolution"] = None, secret_store: Optional["SecretStore"] = None, + scope: Optional[str] = None, **kwargs ): """ - :keyword target_id: The resource Id of target service. - :paramtype target_id: str + :keyword target_service: The target service properties. + :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. - :paramtype auth_info: ~microsoft_service_linker.models.AuthInfoBase + :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Possible values include: "none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot". - :paramtype client_type: str or ~microsoft_service_linker.models.ClientType + :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. - :paramtype v_net_solution: ~microsoft_service_linker.models.VNetSolution + :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution :keyword secret_store: An option to store secret value in secure place. - :paramtype secret_store: ~microsoft_service_linker.models.SecretStore + :paramtype secret_store: ~azure.mgmt.servicelinker.models.SecretStore + :keyword scope: connection scope in source service. + :paramtype scope: str """ super(LinkerPatch, self).__init__(**kwargs) - self.target_id = target_id + self.target_service = target_service self.auth_info = auth_info self.client_type = client_type self.provisioning_state = None self.v_net_solution = v_net_solution self.secret_store = secret_store + self.scope = scope class Resource(msrest.serialization.Model): @@ -341,20 +683,22 @@ class LinkerResource(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: The system data. - :vartype system_data: ~microsoft_service_linker.models.SystemData - :ivar target_id: The resource Id of target service. - :vartype target_id: str + :vartype system_data: ~azure.mgmt.servicelinker.models.SystemData + :ivar target_service: The target service properties. + :vartype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :ivar auth_info: The authentication type. - :vartype auth_info: ~microsoft_service_linker.models.AuthInfoBase + :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Possible values include: "none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot". - :vartype client_type: str or ~microsoft_service_linker.models.ClientType + :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str :ivar v_net_solution: The VNet solution. - :vartype v_net_solution: ~microsoft_service_linker.models.VNetSolution + :vartype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution :ivar secret_store: An option to store secret value in secure place. - :vartype secret_store: ~microsoft_service_linker.models.SecretStore + :vartype secret_store: ~azure.mgmt.servicelinker.models.SecretStore + :ivar scope: connection scope in source service. + :vartype scope: str """ _validation = { @@ -370,45 +714,50 @@ class LinkerResource(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'target_id': {'key': 'properties.targetId', 'type': 'str'}, + 'target_service': {'key': 'properties.targetService', 'type': 'TargetServiceBase'}, 'auth_info': {'key': 'properties.authInfo', 'type': 'AuthInfoBase'}, 'client_type': {'key': 'properties.clientType', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'v_net_solution': {'key': 'properties.vNetSolution', 'type': 'VNetSolution'}, 'secret_store': {'key': 'properties.secretStore', 'type': 'SecretStore'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, } def __init__( self, *, - target_id: Optional[str] = None, + target_service: Optional["TargetServiceBase"] = None, auth_info: Optional["AuthInfoBase"] = None, client_type: Optional[Union[str, "ClientType"]] = None, v_net_solution: Optional["VNetSolution"] = None, secret_store: Optional["SecretStore"] = None, + scope: Optional[str] = None, **kwargs ): """ - :keyword target_id: The resource Id of target service. - :paramtype target_id: str + :keyword target_service: The target service properties. + :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. - :paramtype auth_info: ~microsoft_service_linker.models.AuthInfoBase + :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Possible values include: "none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot". - :paramtype client_type: str or ~microsoft_service_linker.models.ClientType + :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. - :paramtype v_net_solution: ~microsoft_service_linker.models.VNetSolution + :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution :keyword secret_store: An option to store secret value in secure place. - :paramtype secret_store: ~microsoft_service_linker.models.SecretStore + :paramtype secret_store: ~azure.mgmt.servicelinker.models.SecretStore + :keyword scope: connection scope in source service. + :paramtype scope: str """ super(LinkerResource, self).__init__(**kwargs) self.system_data = None - self.target_id = target_id + self.target_service = target_service self.auth_info = auth_info self.client_type = client_type self.provisioning_state = None self.v_net_solution = v_net_solution self.secret_store = secret_store + self.scope = scope class Operation(msrest.serialization.Model): @@ -423,14 +772,14 @@ class Operation(msrest.serialization.Model): data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool :ivar display: Localized display information for this particular operation. - :vartype display: ~microsoft_service_linker.models.OperationDisplay + :vartype display: ~azure.mgmt.servicelinker.models.OperationDisplay :ivar origin: The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", "system", "user,system". - :vartype origin: str or ~microsoft_service_linker.models.Origin + :vartype origin: str or ~azure.mgmt.servicelinker.models.Origin :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~microsoft_service_linker.models.ActionType + :vartype action_type: str or ~azure.mgmt.servicelinker.models.ActionType """ _validation = { @@ -456,7 +805,7 @@ def __init__( ): """ :keyword display: Localized display information for this particular operation. - :paramtype display: ~microsoft_service_linker.models.OperationDisplay + :paramtype display: ~azure.mgmt.servicelinker.models.OperationDisplay """ super(Operation, self).__init__(**kwargs) self.name = None @@ -518,7 +867,7 @@ class OperationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations supported by the resource provider. - :vartype value: list[~microsoft_service_linker.models.Operation] + :vartype value: list[~azure.mgmt.servicelinker.models.Operation] :ivar next_link: URL to get the next set of operation list results (if there are any). :vartype next_link: str """ @@ -552,11 +901,11 @@ class SecretAuthInfo(AuthInfoBase): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType :ivar name: Username or account name for secret auth. :vartype name: str - :ivar secret: Password or account key for secret auth. - :vartype secret: str + :ivar secret_info: Password or key vault secret for secret auth. + :vartype secret_info: ~azure.mgmt.servicelinker.models.SecretInfoBase """ _validation = { @@ -566,26 +915,26 @@ class SecretAuthInfo(AuthInfoBase): _attribute_map = { 'auth_type': {'key': 'authType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, + 'secret_info': {'key': 'secretInfo', 'type': 'SecretInfoBase'}, } def __init__( self, *, name: Optional[str] = None, - secret: Optional[str] = None, + secret_info: Optional["SecretInfoBase"] = None, **kwargs ): """ :keyword name: Username or account name for secret auth. :paramtype name: str - :keyword secret: Password or account key for secret auth. - :paramtype secret: str + :keyword secret_info: Password or key vault secret for secret auth. + :paramtype secret_info: ~azure.mgmt.servicelinker.models.SecretInfoBase """ super(SecretAuthInfo, self).__init__(**kwargs) self.auth_type = 'secret' # type: str self.name = name - self.secret = secret + self.secret_info = secret_info class SecretStore(msrest.serialization.Model): @@ -621,7 +970,7 @@ class ServicePrincipalCertificateAuthInfo(AuthInfoBase): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType :ivar client_id: Required. Application clientId for servicePrincipal auth. :vartype client_id: str :ivar principal_id: Required. Principal Id for servicePrincipal auth. @@ -675,7 +1024,7 @@ class ServicePrincipalSecretAuthInfo(AuthInfoBase): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType :ivar client_id: Required. ServicePrincipal application clientId for servicePrincipal auth. :vartype client_id: str :ivar principal_id: Required. Principal Id for servicePrincipal auth. @@ -757,7 +1106,7 @@ class SourceConfigurationResult(msrest.serialization.Model): """Configurations for source resource, include appSettings, connectionString and serviceBindings. :ivar configurations: The configuration properties for source resource. - :vartype configurations: list[~microsoft_service_linker.models.SourceConfiguration] + :vartype configurations: list[~azure.mgmt.servicelinker.models.SourceConfiguration] """ _attribute_map = { @@ -772,7 +1121,7 @@ def __init__( ): """ :keyword configurations: The configuration properties for source resource. - :paramtype configurations: list[~microsoft_service_linker.models.SourceConfiguration] + :paramtype configurations: list[~azure.mgmt.servicelinker.models.SourceConfiguration] """ super(SourceConfigurationResult, self).__init__(**kwargs) self.configurations = configurations @@ -786,7 +1135,7 @@ class SystemAssignedIdentityAuthInfo(AuthInfoBase): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType """ _validation = { @@ -814,14 +1163,14 @@ class SystemData(msrest.serialization.Model): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~microsoft_service_linker.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.servicelinker.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~microsoft_service_linker.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.servicelinker.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -851,14 +1200,14 @@ def __init__( :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~microsoft_service_linker.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.servicelinker.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~microsoft_service_linker.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.servicelinker.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -879,17 +1228,15 @@ class UserAssignedIdentityAuthInfo(AuthInfoBase): :ivar auth_type: Required. The authentication type.Constant filled by server. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType - :ivar client_id: Required. Client Id for userAssignedIdentity. + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType + :ivar client_id: Client Id for userAssignedIdentity. :vartype client_id: str - :ivar subscription_id: Required. Subscription id for userAssignedIdentity. + :ivar subscription_id: Subscription id for userAssignedIdentity. :vartype subscription_id: str """ _validation = { 'auth_type': {'required': True}, - 'client_id': {'required': True}, - 'subscription_id': {'required': True}, } _attribute_map = { @@ -901,14 +1248,14 @@ class UserAssignedIdentityAuthInfo(AuthInfoBase): def __init__( self, *, - client_id: str, - subscription_id: str, + client_id: Optional[str] = None, + subscription_id: Optional[str] = None, **kwargs ): """ - :keyword client_id: Required. Client Id for userAssignedIdentity. + :keyword client_id: Client Id for userAssignedIdentity. :paramtype client_id: str - :keyword subscription_id: Required. Subscription id for userAssignedIdentity. + :keyword subscription_id: Subscription id for userAssignedIdentity. :paramtype subscription_id: str """ super(UserAssignedIdentityAuthInfo, self).__init__(**kwargs) @@ -920,79 +1267,177 @@ def __init__( class ValidateResult(msrest.serialization.Model): """The validation result for a linker. - :ivar name: The linker name. - :vartype name: str - :ivar linker_status: Specifies if the linker is healthy. Possible values include: "Healthy", - "Not healthy". - :vartype linker_status: str or ~microsoft_service_linker.models.LinkerStatus - :ivar reason: The reason of the error. - :vartype reason: str + :ivar linker_name: The linker name. + :vartype linker_name: str + :ivar is_connection_available: A boolean value indicating whether the connection is available + or not. + :vartype is_connection_available: bool :ivar report_start_time_utc: The start time of the validation report. :vartype report_start_time_utc: ~datetime.datetime :ivar report_end_time_utc: The end time of the validation report. :vartype report_end_time_utc: ~datetime.datetime + :ivar source_id: The resource id of the linker source application. + :vartype source_id: str :ivar target_id: The resource Id of target service. :vartype target_id: str :ivar auth_type: The authentication type. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :vartype auth_type: str or ~microsoft_service_linker.models.AuthType + :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType + :ivar validation_detail: The detail of validation result. + :vartype validation_detail: list[~azure.mgmt.servicelinker.models.ValidationResultItem] """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'linker_status': {'key': 'linkerStatus', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, + 'linker_name': {'key': 'linkerName', 'type': 'str'}, + 'is_connection_available': {'key': 'isConnectionAvailable', 'type': 'bool'}, 'report_start_time_utc': {'key': 'reportStartTimeUtc', 'type': 'iso-8601'}, 'report_end_time_utc': {'key': 'reportEndTimeUtc', 'type': 'iso-8601'}, + 'source_id': {'key': 'sourceId', 'type': 'str'}, 'target_id': {'key': 'targetId', 'type': 'str'}, 'auth_type': {'key': 'authType', 'type': 'str'}, + 'validation_detail': {'key': 'validationDetail', 'type': '[ValidationResultItem]'}, } def __init__( self, *, - name: Optional[str] = None, - linker_status: Optional[Union[str, "LinkerStatus"]] = None, - reason: Optional[str] = None, + linker_name: Optional[str] = None, + is_connection_available: Optional[bool] = None, report_start_time_utc: Optional[datetime.datetime] = None, report_end_time_utc: Optional[datetime.datetime] = None, + source_id: Optional[str] = None, target_id: Optional[str] = None, auth_type: Optional[Union[str, "AuthType"]] = None, + validation_detail: Optional[List["ValidationResultItem"]] = None, **kwargs ): """ - :keyword name: The linker name. - :paramtype name: str - :keyword linker_status: Specifies if the linker is healthy. Possible values include: "Healthy", - "Not healthy". - :paramtype linker_status: str or ~microsoft_service_linker.models.LinkerStatus - :keyword reason: The reason of the error. - :paramtype reason: str + :keyword linker_name: The linker name. + :paramtype linker_name: str + :keyword is_connection_available: A boolean value indicating whether the connection is + available or not. + :paramtype is_connection_available: bool :keyword report_start_time_utc: The start time of the validation report. :paramtype report_start_time_utc: ~datetime.datetime :keyword report_end_time_utc: The end time of the validation report. :paramtype report_end_time_utc: ~datetime.datetime + :keyword source_id: The resource id of the linker source application. + :paramtype source_id: str :keyword target_id: The resource Id of target service. :paramtype target_id: str :keyword auth_type: The authentication type. Possible values include: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret". - :paramtype auth_type: str or ~microsoft_service_linker.models.AuthType + :paramtype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType + :keyword validation_detail: The detail of validation result. + :paramtype validation_detail: list[~azure.mgmt.servicelinker.models.ValidationResultItem] """ super(ValidateResult, self).__init__(**kwargs) - self.name = name - self.linker_status = linker_status - self.reason = reason + self.linker_name = linker_name + self.is_connection_available = is_connection_available self.report_start_time_utc = report_start_time_utc self.report_end_time_utc = report_end_time_utc + self.source_id = source_id self.target_id = target_id self.auth_type = auth_type + self.validation_detail = validation_detail + + +class ValidationResultItem(msrest.serialization.Model): + """The validation item for a linker. + + :ivar name: The validation item name. + :vartype name: str + :ivar description: The display name of validation item. + :vartype description: str + :ivar result: The result of validation. Possible values include: "success", "failed", + "warning". + :vartype result: str or ~azure.mgmt.servicelinker.models.ValidationResultStatus + :ivar error_message: The error message of validation result. + :vartype error_message: str + :ivar error_code: The error code of validation result. + :vartype error_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + result: Optional[Union[str, "ValidationResultStatus"]] = None, + error_message: Optional[str] = None, + error_code: Optional[str] = None, + **kwargs + ): + """ + :keyword name: The validation item name. + :paramtype name: str + :keyword description: The display name of validation item. + :paramtype description: str + :keyword result: The result of validation. Possible values include: "success", "failed", + "warning". + :paramtype result: str or ~azure.mgmt.servicelinker.models.ValidationResultStatus + :keyword error_message: The error message of validation result. + :paramtype error_message: str + :keyword error_code: The error code of validation result. + :paramtype error_code: str + """ + super(ValidationResultItem, self).__init__(**kwargs) + self.name = name + self.description = description + self.result = result + self.error_message = error_message + self.error_code = error_code + + +class ValueSecretInfo(SecretInfoBase): + """The secret info when type is rawValue. It's for scenarios that user input the secret. + + All required parameters must be populated in order to send to Azure. + + :ivar secret_type: Required. The secret type.Constant filled by server. Possible values + include: "rawValue", "keyVaultSecretUri", "keyVaultSecretReference". + :vartype secret_type: str or ~azure.mgmt.servicelinker.models.SecretType + :ivar value: The actual value of the secret. + :vartype value: str + """ + + _validation = { + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_type': {'key': 'secretType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The actual value of the secret. + :paramtype value: str + """ + super(ValueSecretInfo, self).__init__(**kwargs) + self.secret_type = 'rawValue' # type: str + self.value = value class VNetSolution(msrest.serialization.Model): """The VNet solution for linker. :ivar type: Type of VNet solution. Possible values include: "serviceEndpoint", "privateLink". - :vartype type: str or ~microsoft_service_linker.models.VNetSolutionType + :vartype type: str or ~azure.mgmt.servicelinker.models.VNetSolutionType """ _attribute_map = { @@ -1008,7 +1453,7 @@ def __init__( """ :keyword type: Type of VNet solution. Possible values include: "serviceEndpoint", "privateLink". - :paramtype type: str or ~microsoft_service_linker.models.VNetSolutionType + :paramtype type: str or ~azure.mgmt.servicelinker.models.VNetSolutionType """ super(VNetSolution, self).__init__(**kwargs) self.type = type diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_microsoft_service_linker_enums.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py similarity index 75% rename from sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_microsoft_service_linker_enums.py rename to sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py index b424fb9377bf..750fc75831e1 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_microsoft_service_linker_enums.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py @@ -51,13 +51,6 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class LinkerStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Specifies if the linker is healthy. - """ - - HEALTHY = "Healthy" - NOT_HEALTHY = "Not healthy" - class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" @@ -67,6 +60,31 @@ class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SYSTEM = "system" USER_SYSTEM = "user,system" +class SecretType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The secret type. + """ + + RAW_VALUE = "rawValue" + KEY_VAULT_SECRET_URI = "keyVaultSecretUri" + KEY_VAULT_SECRET_REFERENCE = "keyVaultSecretReference" + +class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The target service type. + """ + + AZURE_RESOURCE = "AzureResource" + CONFLUENT_BOOTSTRAP_SERVER = "ConfluentBootstrapServer" + CONFLUENT_SCHEMA_REGISTRY = "ConfluentSchemaRegistry" + KEY_VAULT = "KeyVault" + +class ValidationResultStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The result of validation + """ + + SUCCESS = "success" + FAILED = "failed" + WARNING = "warning" + class VNetSolutionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of VNet solution. """ diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py index 1157a6655c15..6f3e8a3b3322 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,29 +33,30 @@ def build_list_request( resource_uri: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -65,30 +66,31 @@ def build_get_request( linker_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -101,34 +103,34 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-11-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -140,30 +142,31 @@ def build_delete_request_initial( linker_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -176,34 +179,34 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-11-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -215,30 +218,31 @@ def build_validate_request_initial( linker_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker") path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -248,30 +252,31 @@ def build_list_configurations_request( linker_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations') + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations") # pylint: disable=line-too-long path_format_arguments = { "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, 'str', skip_quote=True), "linkerName": _SERIALIZER.url("linker_name", linker_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -282,7 +287,7 @@ class LinkerOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~microsoft_service_linker.models + :type models: ~azure.mgmt.servicelinker.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -310,9 +315,11 @@ def list( :type resource_uri: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkerList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~microsoft_service_linker.models.LinkerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicelinker.models.LinkerList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -323,6 +330,7 @@ def prepare_request(next_link=None): request = build_list_request( resource_uri=resource_uri, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -332,6 +340,7 @@ def prepare_request(next_link=None): request = build_list_request( resource_uri=resource_uri, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -349,7 +358,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -363,7 +376,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers'} # type: ignore + list.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers"} # type: ignore @distributed_trace def get( @@ -381,7 +394,7 @@ def get( :type linker_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkerResource, or the result of cls(response) - :rtype: ~microsoft_service_linker.models.LinkerResource + :rtype: ~azure.mgmt.servicelinker.models.LinkerResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] @@ -390,16 +403,23 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -414,7 +434,7 @@ def get( return deserialized - get.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + get.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore def _create_or_update_initial( @@ -430,6 +450,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LinkerResource') @@ -437,6 +458,7 @@ def _create_or_update_initial( request = build_create_or_update_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -444,7 +466,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -462,7 +488,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace @@ -481,7 +507,7 @@ def begin_create_or_update( :param linker_name: The name Linker resource. :type linker_name: str :param parameters: Linker details. - :type parameters: ~microsoft_service_linker.models.LinkerResource + :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -492,11 +518,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either LinkerResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~microsoft_service_linker.models.LinkerResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicelinker.models.LinkerResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -508,6 +535,7 @@ def begin_create_or_update( resource_uri=resource_uri, linker_name=linker_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -532,12 +560,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_uri: str, linker_name: str, @@ -549,16 +576,23 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -568,11 +602,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _delete_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_uri: str, linker_name: str, @@ -597,7 +631,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -608,6 +643,7 @@ def begin_delete( raw_result = self._delete_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -628,10 +664,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_delete.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore def _update_initial( self, @@ -646,6 +681,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LinkerPatch') @@ -653,6 +689,7 @@ def _update_initial( request = build_update_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -660,7 +697,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -678,7 +719,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + _update_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore @distributed_trace @@ -697,7 +738,7 @@ def begin_update( :param linker_name: The name Linker resource. :type linker_name: str :param parameters: Linker details. - :type parameters: ~microsoft_service_linker.models.LinkerPatch + :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -708,11 +749,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either LinkerResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~microsoft_service_linker.models.LinkerResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicelinker.models.LinkerResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkerResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -724,6 +766,7 @@ def begin_update( resource_uri=resource_uri, linker_name=linker_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -748,10 +791,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'} # type: ignore + begin_update.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"} # type: ignore def _validate_initial( self, @@ -765,16 +807,23 @@ def _validate_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_validate_request_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self._validate_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -790,7 +839,7 @@ def _validate_initial( return deserialized - _validate_initial.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker'} # type: ignore + _validate_initial.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker"} # type: ignore @distributed_trace @@ -817,10 +866,11 @@ def begin_validate( Retry-After header is present. :return: An instance of LROPoller that returns either ValidateResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~microsoft_service_linker.models.ValidateResult] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicelinker.models.ValidateResult] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -831,6 +881,7 @@ def begin_validate( raw_result = self._validate_initial( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -854,10 +905,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_validate.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker'} # type: ignore + begin_validate.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker"} # type: ignore @distributed_trace def list_configurations( @@ -875,7 +925,7 @@ def list_configurations( :type linker_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceConfigurationResult, or the result of cls(response) - :rtype: ~microsoft_service_linker.models.SourceConfigurationResult + :rtype: ~azure.mgmt.servicelinker.models.SourceConfigurationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceConfigurationResult"] @@ -884,16 +934,23 @@ def list_configurations( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_list_configurations_request( resource_uri=resource_uri, linker_name=linker_name, + api_version=api_version, template_url=self.list_configurations.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -908,5 +965,5 @@ def list_configurations( return deserialized - list_configurations.metadata = {'url': '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations'} # type: ignore + list_configurations.metadata = {'url': "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations"} # type: ignore diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py index de165643cc81..827c3ee343c7 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request @@ -29,24 +29,25 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2021-11-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.ServiceLinker/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.ServiceLinker/operations") # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -57,7 +58,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~microsoft_service_linker.models + :type models: ~azure.mgmt.servicelinker.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -81,9 +82,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~microsoft_service_linker.models.OperationListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicelinker.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +96,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -101,6 +105,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -118,7 +123,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -132,4 +141,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.ServiceLinker/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.ServiceLinker/operations"} # type: ignore