diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/CHANGELOG.md b/sdk/changeanalysis/azure-mgmt-changeanalysis/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/MANIFEST.in b/sdk/changeanalysis/azure-mgmt-changeanalysis/MANIFEST.in new file mode 100644 index 000000000000..a3cb07df8765 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/README.md b/sdk/changeanalysis/azure-mgmt-changeanalysis/README.md new file mode 100644 index 000000000000..50b7a4383321 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-changeanalysis%2FREADME.png) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/__init__.py new file mode 100644 index 000000000000..eb4a9e9308ff --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_change_analysis_management_client import AzureChangeAnalysisManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureChangeAnalysisManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_azure_change_analysis_management_client.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_azure_change_analysis_management_client.py new file mode 100644 index 000000000000..59fade86330f --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_azure_change_analysis_management_client.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import AzureChangeAnalysisManagementClientConfiguration +from .operations import Operations +from .operations import ResourceChangesOperations +from .operations import ChangesOperations +from . import models + + +class AzureChangeAnalysisManagementClient(object): + """AzureChangeAnalysisManagementClient. + + :ivar operations: Operations operations + :vartype operations: Microsoft.ChangeAnalysis.operations.Operations + :ivar resource_changes: ResourceChangesOperations operations + :vartype resource_changes: Microsoft.ChangeAnalysis.operations.ResourceChangesOperations + :ivar changes: ChangesOperations operations + :vartype changes: Microsoft.ChangeAnalysis.operations.ChangesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureChangeAnalysisManagementClientConfiguration(credential, subscription_id, **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)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_changes = ResourceChangesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureChangeAnalysisManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_configuration.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_configuration.py new file mode 100644 index 000000000000..8db0f707abf0 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureChangeAnalysisManagementClientConfiguration(Configuration): + """Configuration for AzureChangeAnalysisManagementClient. + + 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 + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureChangeAnalysisManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-04-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-changeanalysis/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_metadata.json b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_metadata.json new file mode 100644 index 000000000000..7fd44a341edd --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_metadata.json @@ -0,0 +1,63 @@ +{ + "chosen_version": "2021-04-01", + "total_api_version_list": ["2021-04-01"], + "client": { + "name": "AzureChangeAnalysisManagementClient", + "filename": "_azure_change_analysis_management_client", + "description": "AzureChangeAnalysisManagementClient.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "operations": "Operations", + "resource_changes": "ResourceChangesOperations", + "changes": "ChangesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_version.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/__init__.py new file mode 100644 index 000000000000..62cc3cf5659c --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_change_analysis_management_client import AzureChangeAnalysisManagementClient +__all__ = ['AzureChangeAnalysisManagementClient'] diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_azure_change_analysis_management_client.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_azure_change_analysis_management_client.py new file mode 100644 index 000000000000..ae4782f4ec1b --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_azure_change_analysis_management_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureChangeAnalysisManagementClientConfiguration +from .operations import Operations +from .operations import ResourceChangesOperations +from .operations import ChangesOperations +from .. import models + + +class AzureChangeAnalysisManagementClient(object): + """AzureChangeAnalysisManagementClient. + + :ivar operations: Operations operations + :vartype operations: Microsoft.ChangeAnalysis.aio.operations.Operations + :ivar resource_changes: ResourceChangesOperations operations + :vartype resource_changes: Microsoft.ChangeAnalysis.aio.operations.ResourceChangesOperations + :ivar changes: ChangesOperations operations + :vartype changes: Microsoft.ChangeAnalysis.aio.operations.ChangesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureChangeAnalysisManagementClientConfiguration(credential, subscription_id, **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)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_changes = ResourceChangesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureChangeAnalysisManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_configuration.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_configuration.py new file mode 100644 index 000000000000..857015f4191c --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureChangeAnalysisManagementClientConfiguration(Configuration): + """Configuration for AzureChangeAnalysisManagementClient. + + 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 + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureChangeAnalysisManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-04-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-changeanalysis/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/__init__.py new file mode 100644 index 000000000000..24cfe7b39cca --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._resource_changes_operations import ResourceChangesOperations +from ._changes_operations import ChangesOperations + +__all__ = [ + 'Operations', + 'ResourceChangesOperations', + 'ChangesOperations', +] diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_changes_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_changes_operations.py new file mode 100644 index 000000000000..3f8f556d0e54 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_changes_operations.py @@ -0,0 +1,219 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ChangesOperations: + """ChangesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_changes_by_resource_group( + self, + resource_group_name: str, + start_time: datetime.datetime, + end_time: datetime.datetime, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ChangeList"]: + """List the changes of a resource group within the specified time range. Customer data will always be masked. + + List the changes of a resource group within the specified time range. Customer data will always + be masked. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_changes_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_changes_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeAnalysis/changes'} # type: ignore + + def list_changes_by_subscription( + self, + start_time: datetime.datetime, + end_time: datetime.datetime, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ChangeList"]: + """List the changes of a subscription within the specified time range. Customer data will always be masked. + + List the changes of a subscription within the specified time range. Customer data will always + be masked. + + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_changes_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_changes_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_operations.py new file mode 100644 index 000000000000..2c46b20f74a6 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ResourceProviderOperationList"]: + """Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions. + + Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with + their descriptions. + + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.ChangeAnalysis.models.ResourceProviderOperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ChangeAnalysis/operations'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_resource_changes_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_resource_changes_operations.py new file mode 100644 index 000000000000..96944ce0b6f0 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_resource_changes_operations.py @@ -0,0 +1,132 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceChangesOperations: + """ResourceChangesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_id: str, + start_time: datetime.datetime, + end_time: datetime.datetime, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ChangeList"]: + """List the changes of a resource within the specified time range. Customer data will be masked if the user doesn't have access. + + List the changes of a resource within the specified time range. Customer data will be masked if + the user doesn't have access. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{resourceId}/providers/Microsoft.ChangeAnalysis/resourceChanges'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/__init__.py new file mode 100644 index 000000000000..057fdce99a1b --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/__init__.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Change + from ._models_py3 import ChangeList + from ._models_py3 import ChangeProperties + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import PropertyChange + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperationDefinition + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList +except (SyntaxError, ImportError): + from ._models import Change # type: ignore + from ._models import ChangeList # type: ignore + from ._models import ChangeProperties # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import PropertyChange # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperationDefinition # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + +from ._azure_change_analysis_management_client_enums import ( + ChangeCategory, + ChangeType, + Level, +) + +__all__ = [ + 'Change', + 'ChangeList', + 'ChangeProperties', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'PropertyChange', + 'ProxyResource', + 'Resource', + 'ResourceProviderOperationDefinition', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', + 'ChangeCategory', + 'ChangeType', + 'Level', +] diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_azure_change_analysis_management_client_enums.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_azure_change_analysis_management_client_enums.py new file mode 100644 index 000000000000..67bd055a51bd --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_azure_change_analysis_management_client_enums.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ChangeCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The change category. + """ + + USER = "User" + SYSTEM = "System" + +class ChangeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the change. + """ + + ADD = "Add" + REMOVE = "Remove" + UPDATE = "Update" + +class Level(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOISY = "Noisy" + NORMAL = "Normal" + IMPORTANT = "Important" diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models.py new file mode 100644 index 000000000000..67a7aa6f19d0 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models.py @@ -0,0 +1,404 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Change(Resource): + """The detected change. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: The properties of a change. + :type properties: ~Microsoft.ChangeAnalysis.models.ChangeProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ChangeProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Change, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ChangeList(msrest.serialization.Model): + """The list of detected changes. + + :param value: The list of changes. + :type value: list[~Microsoft.ChangeAnalysis.models.Change] + :param next_link: The URI that can be used to request the next page of changes. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Change]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ChangeList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ChangeProperties(msrest.serialization.Model): + """The properties of a change. + + :param resource_id: The resource id that the change is attached to. + :type resource_id: str + :param time_stamp: The time when the change is detected. + :type time_stamp: ~datetime.datetime + :param initiated_by_list: The list of identities who might initiated the change. + The identity could be user name (email address) or the object ID of the Service Principal. + :type initiated_by_list: list[str] + :param change_type: The type of the change. Possible values include: "Add", "Remove", "Update". + :type change_type: str or ~Microsoft.ChangeAnalysis.models.ChangeType + :param property_changes: The list of detailed changes at json property level. + :type property_changes: list[~Microsoft.ChangeAnalysis.models.PropertyChange] + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'initiated_by_list': {'key': 'initiatedByList', 'type': '[str]'}, + 'change_type': {'key': 'changeType', 'type': 'str'}, + 'property_changes': {'key': 'propertyChanges', 'type': '[PropertyChange]'}, + } + + def __init__( + self, + **kwargs + ): + super(ChangeProperties, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.time_stamp = kwargs.get('time_stamp', None) + self.initiated_by_list = kwargs.get('initiated_by_list', None) + self.change_type = kwargs.get('change_type', None) + self.property_changes = kwargs.get('property_changes', None) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~Microsoft.ChangeAnalysis.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~Microsoft.ChangeAnalysis.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +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.). + + :param error: The error object. + :type error: ~Microsoft.ChangeAnalysis.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class PropertyChange(msrest.serialization.Model): + """Data of a property change. + + :param change_type: The type of the change. Possible values include: "Add", "Remove", "Update". + :type change_type: str or ~Microsoft.ChangeAnalysis.models.ChangeType + :param change_category: The change category. Possible values include: "User", "System". + :type change_category: str or ~Microsoft.ChangeAnalysis.models.ChangeCategory + :param json_path: The json path of the changed property. + :type json_path: str + :param display_name: The enhanced display name of the json path. E.g., the json path + value[0].properties will be translated to something meaningful like + slots["Staging"].properties. + :type display_name: str + :param level: Possible values include: "Noisy", "Normal", "Important". + :type level: str or ~Microsoft.ChangeAnalysis.models.Level + :param description: The description of the changed property. + :type description: str + :param old_value: The value of the property before the change. + :type old_value: str + :param new_value: The value of the property after the change. + :type new_value: str + :param is_data_masked: The boolean indicating whether the oldValue and newValue are masked. The + values are masked if it contains sensitive information that the user doesn't have access to. + :type is_data_masked: bool + """ + + _attribute_map = { + 'change_type': {'key': 'changeType', 'type': 'str'}, + 'change_category': {'key': 'changeCategory', 'type': 'str'}, + 'json_path': {'key': 'jsonPath', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'old_value': {'key': 'oldValue', 'type': 'str'}, + 'new_value': {'key': 'newValue', 'type': 'str'}, + 'is_data_masked': {'key': 'isDataMasked', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(PropertyChange, self).__init__(**kwargs) + self.change_type = kwargs.get('change_type', None) + self.change_category = kwargs.get('change_category', None) + self.json_path = kwargs.get('json_path', None) + self.display_name = kwargs.get('display_name', None) + self.level = kwargs.get('level', None) + self.description = kwargs.get('description', None) + self.old_value = kwargs.get('old_value', None) + self.new_value = kwargs.get('new_value', None) + self.is_data_masked = kwargs.get('is_data_masked', None) + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperationDefinition(msrest.serialization.Model): + """The resource provider operation definition. + + :param name: The resource provider operation name. + :type name: str + :param display: The resource provider operation details. + :type display: ~Microsoft.ChangeAnalysis.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """The resource provider operation details. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """The resource provider operation list. + + :param value: Resource provider operations list. + :type value: list[~Microsoft.ChangeAnalysis.models.ResourceProviderOperationDefinition] + :param next_link: The URI that can be used to request the next page for list of Azure + operations. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperationDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models_py3.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models_py3.py new file mode 100644 index 000000000000..e472276a1689 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models_py3.py @@ -0,0 +1,443 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_change_analysis_management_client_enums import * + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Change(Resource): + """The detected change. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: The properties of a change. + :type properties: ~Microsoft.ChangeAnalysis.models.ChangeProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ChangeProperties'}, + } + + def __init__( + self, + *, + properties: Optional["ChangeProperties"] = None, + **kwargs + ): + super(Change, self).__init__(**kwargs) + self.properties = properties + + +class ChangeList(msrest.serialization.Model): + """The list of detected changes. + + :param value: The list of changes. + :type value: list[~Microsoft.ChangeAnalysis.models.Change] + :param next_link: The URI that can be used to request the next page of changes. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Change]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Change"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ChangeList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ChangeProperties(msrest.serialization.Model): + """The properties of a change. + + :param resource_id: The resource id that the change is attached to. + :type resource_id: str + :param time_stamp: The time when the change is detected. + :type time_stamp: ~datetime.datetime + :param initiated_by_list: The list of identities who might initiated the change. + The identity could be user name (email address) or the object ID of the Service Principal. + :type initiated_by_list: list[str] + :param change_type: The type of the change. Possible values include: "Add", "Remove", "Update". + :type change_type: str or ~Microsoft.ChangeAnalysis.models.ChangeType + :param property_changes: The list of detailed changes at json property level. + :type property_changes: list[~Microsoft.ChangeAnalysis.models.PropertyChange] + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'initiated_by_list': {'key': 'initiatedByList', 'type': '[str]'}, + 'change_type': {'key': 'changeType', 'type': 'str'}, + 'property_changes': {'key': 'propertyChanges', 'type': '[PropertyChange]'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + time_stamp: Optional[datetime.datetime] = None, + initiated_by_list: Optional[List[str]] = None, + change_type: Optional[Union[str, "ChangeType"]] = None, + property_changes: Optional[List["PropertyChange"]] = None, + **kwargs + ): + super(ChangeProperties, self).__init__(**kwargs) + self.resource_id = resource_id + self.time_stamp = time_stamp + self.initiated_by_list = initiated_by_list + self.change_type = change_type + self.property_changes = property_changes + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~Microsoft.ChangeAnalysis.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~Microsoft.ChangeAnalysis.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +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.). + + :param error: The error object. + :type error: ~Microsoft.ChangeAnalysis.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class PropertyChange(msrest.serialization.Model): + """Data of a property change. + + :param change_type: The type of the change. Possible values include: "Add", "Remove", "Update". + :type change_type: str or ~Microsoft.ChangeAnalysis.models.ChangeType + :param change_category: The change category. Possible values include: "User", "System". + :type change_category: str or ~Microsoft.ChangeAnalysis.models.ChangeCategory + :param json_path: The json path of the changed property. + :type json_path: str + :param display_name: The enhanced display name of the json path. E.g., the json path + value[0].properties will be translated to something meaningful like + slots["Staging"].properties. + :type display_name: str + :param level: Possible values include: "Noisy", "Normal", "Important". + :type level: str or ~Microsoft.ChangeAnalysis.models.Level + :param description: The description of the changed property. + :type description: str + :param old_value: The value of the property before the change. + :type old_value: str + :param new_value: The value of the property after the change. + :type new_value: str + :param is_data_masked: The boolean indicating whether the oldValue and newValue are masked. The + values are masked if it contains sensitive information that the user doesn't have access to. + :type is_data_masked: bool + """ + + _attribute_map = { + 'change_type': {'key': 'changeType', 'type': 'str'}, + 'change_category': {'key': 'changeCategory', 'type': 'str'}, + 'json_path': {'key': 'jsonPath', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'old_value': {'key': 'oldValue', 'type': 'str'}, + 'new_value': {'key': 'newValue', 'type': 'str'}, + 'is_data_masked': {'key': 'isDataMasked', 'type': 'bool'}, + } + + def __init__( + self, + *, + change_type: Optional[Union[str, "ChangeType"]] = None, + change_category: Optional[Union[str, "ChangeCategory"]] = None, + json_path: Optional[str] = None, + display_name: Optional[str] = None, + level: Optional[Union[str, "Level"]] = None, + description: Optional[str] = None, + old_value: Optional[str] = None, + new_value: Optional[str] = None, + is_data_masked: Optional[bool] = None, + **kwargs + ): + super(PropertyChange, self).__init__(**kwargs) + self.change_type = change_type + self.change_category = change_category + self.json_path = json_path + self.display_name = display_name + self.level = level + self.description = description + self.old_value = old_value + self.new_value = new_value + self.is_data_masked = is_data_masked + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperationDefinition(msrest.serialization.Model): + """The resource provider operation definition. + + :param name: The resource provider operation name. + :type name: str + :param display: The resource provider operation details. + :type display: ~Microsoft.ChangeAnalysis.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["ResourceProviderOperationDisplay"] = None, + **kwargs + ): + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """The resource provider operation details. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(msrest.serialization.Model): + """The resource provider operation list. + + :param value: Resource provider operations list. + :type value: list[~Microsoft.ChangeAnalysis.models.ResourceProviderOperationDefinition] + :param next_link: The URI that can be used to request the next page for list of Azure + operations. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperationDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceProviderOperationDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/__init__.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/__init__.py new file mode 100644 index 000000000000..24cfe7b39cca --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._resource_changes_operations import ResourceChangesOperations +from ._changes_operations import ChangesOperations + +__all__ = [ + 'Operations', + 'ResourceChangesOperations', + 'ChangesOperations', +] diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_changes_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_changes_operations.py new file mode 100644 index 000000000000..e68df8044032 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_changes_operations.py @@ -0,0 +1,225 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ChangesOperations(object): + """ChangesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_changes_by_resource_group( + self, + resource_group_name, # type: str + start_time, # type: datetime.datetime + end_time, # type: datetime.datetime + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ChangeList"] + """List the changes of a resource group within the specified time range. Customer data will always be masked. + + List the changes of a resource group within the specified time range. Customer data will always + be masked. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_changes_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_changes_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeAnalysis/changes'} # type: ignore + + def list_changes_by_subscription( + self, + start_time, # type: datetime.datetime + end_time, # type: datetime.datetime + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ChangeList"] + """List the changes of a subscription within the specified time range. Customer data will always be masked. + + List the changes of a subscription within the specified time range. Customer data will always + be masked. + + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_changes_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_changes_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_operations.py new file mode 100644 index 000000000000..119f3e6d2f91 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions. + + Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with + their descriptions. + + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.ChangeAnalysis.models.ResourceProviderOperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ChangeAnalysis/operations'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_resource_changes_operations.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_resource_changes_operations.py new file mode 100644 index 000000000000..357cbe97225a --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/operations/_resource_changes_operations.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceChangesOperations(object): + """ResourceChangesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.ChangeAnalysis.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_id, # type: str + start_time, # type: datetime.datetime + end_time, # type: datetime.datetime + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ChangeList"] + """List the changes of a resource within the specified time range. Customer data will be masked if the user doesn't have access. + + List the changes of a resource within the specified time range. Customer data will be masked if + the user doesn't have access. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param start_time: Specifies the start time of the changes request. + :type start_time: ~datetime.datetime + :param end_time: Specifies the end time of the changes request. + :type end_time: ~datetime.datetime + :param skip_token: A skip token is used to continue retrieving items after an operation returns + a partial result. If a previous response contains a nextLink element, the value of the nextLink + element will include a skipToken parameter that specifies a starting point to use for + subsequent calls. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChangeList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.ChangeAnalysis.models.ChangeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['$endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ChangeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{resourceId}/providers/Microsoft.ChangeAnalysis/resourceChanges'} # type: ignore diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/py.typed b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/sdk_packaging.toml b/sdk/changeanalysis/azure-mgmt-changeanalysis/sdk_packaging.toml new file mode 100644 index 000000000000..0629aeb2b949 --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-changeanalysis" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.cfg b/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.py b/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.py new file mode 100644 index 000000000000..9b1f9f9aff4e --- /dev/null +++ b/sdk/changeanalysis/azure-mgmt-changeanalysis/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-changeanalysis" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/changeanalysis/ci.yml b/sdk/changeanalysis/ci.yml new file mode 100644 index 000000000000..8a8d00720671 --- /dev/null +++ b/sdk/changeanalysis/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/changeanalysis/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/changeanalysis/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: changeanalysis + Artifacts: + - name: azure-mgmt-changeanalysis + safeName: azuremgmtchangeanalysis