From c2b38b6adef7b20bb3394b1bc922cecac81897ec Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Jun 2022 23:55:44 +0000 Subject: [PATCH] CodeGen from PR 19010 in Azure/azure-rest-api-specs Corect duplicate parent references in timeseriesinsights@2018-08-15-preview (#19010) * Corect duplicate parent references in timeseriesinsights@2018-08-15-preview * Remove invalid x-ms-discriminator-value extensions --- .../azure-mgmt-timeseriesinsights/_meta.json | 11 + .../azure/mgmt/timeseriesinsights/__init__.py | 9 +- .../mgmt/timeseriesinsights/_configuration.py | 28 +- .../mgmt/timeseriesinsights/_metadata.json | 108 + .../azure/mgmt/timeseriesinsights/_patch.py | 31 + .../_time_series_insights_client.py | 102 +- .../azure/mgmt/timeseriesinsights/_vendor.py | 27 + .../azure/mgmt/timeseriesinsights/_version.py | 2 +- .../mgmt/timeseriesinsights/aio/__init__.py | 5 + .../timeseriesinsights/aio/_configuration.py | 15 +- .../mgmt/timeseriesinsights/aio/_patch.py | 31 + .../aio/_time_series_insights_client.py | 91 +- .../aio/operations/__init__.py | 4 + .../operations/_access_policies_operations.py | 275 +- .../operations/_environments_operations.py | 374 +-- .../operations/_event_sources_operations.py | 275 +- .../aio/operations/_operations.py | 61 +- ...private_endpoint_connections_operations.py | 301 ++ .../_private_link_resources_operations.py | 129 + .../_reference_data_sets_operations.py | 278 +- .../timeseriesinsights/models/__init__.py | 231 +- .../mgmt/timeseriesinsights/models/_models.py | 2947 ----------------- .../timeseriesinsights/models/_models_py3.py | 2721 ++++++++++++--- .../_time_series_insights_client_enums.py | 82 +- .../timeseriesinsights/operations/__init__.py | 4 + .../operations/_access_policies_operations.py | 538 ++- .../operations/_environments_operations.py | 676 ++-- .../operations/_event_sources_operations.py | 538 ++- .../operations/_operations.py | 98 +- ...private_endpoint_connections_operations.py | 463 +++ .../_private_link_resources_operations.py | 168 + .../_reference_data_sets_operations.py | 541 ++- 32 files changed, 6032 insertions(+), 5132 deletions(-) create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/_meta.json create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_metadata.json create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_patch.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_vendor.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_patch.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_link_resources_operations.py diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/_meta.json b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/_meta.json new file mode 100644 index 000000000000..f5b0a8dfbab0 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.7.2", + "use": [ + "@autorest/python@5.13.0", + "@autorest/modelerfour@4.19.3" + ], + "commit": "27a778f98e46bb598b126d34bde8e96e8e4c96a6", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/timeseriesinsights/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "readme": "specification/timeseriesinsights/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py index 174cc7dd9759..aa5a912842ac 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['TimeSeriesInsightsClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py index cc2eb5ce8b7d..fdf868021b4d 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py @@ -6,22 +6,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, 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 TimeSeriesInsightsClientConfiguration(Configuration): +class TimeSeriesInsightsClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for TimeSeriesInsightsClient. Note that all parameters used to create this instance are saved as instance @@ -31,24 +29,28 @@ class TimeSeriesInsightsClientConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-03-31-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(TimeSeriesInsightsClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + 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(TimeSeriesInsightsClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-05-15" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-timeseriesinsights/{}'.format(VERSION)) self._configure(**kwargs) @@ -68,4 +70,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_metadata.json b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_metadata.json new file mode 100644 index 000000000000..bedd10262464 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_metadata.json @@ -0,0 +1,108 @@ +{ + "chosen_version": "2021-03-31-preview", + "total_api_version_list": ["2021-03-31-preview"], + "client": { + "name": "TimeSeriesInsightsClient", + "filename": "_time_series_insights_client", + "description": "Time Series Insights client.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TimeSeriesInsightsClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TimeSeriesInsightsClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "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": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"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: str,", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "environments": "EnvironmentsOperations", + "event_sources": "EventSourcesOperations", + "reference_data_sets": "ReferenceDataSetsOperations", + "access_policies": "AccessPoliciesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations" + } +} \ No newline at end of file diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_patch.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_time_series_insights_client.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_time_series_insights_client.py index bcfab6141c58..906414da85b2 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_time_series_insights_client.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_time_series_insights_client.py @@ -6,27 +6,23 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, 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 azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient -from ._configuration import TimeSeriesInsightsClientConfiguration -from .operations import Operations -from .operations import EnvironmentsOperations -from .operations import EventSourcesOperations -from .operations import ReferenceDataSetsOperations -from .operations import AccessPoliciesOperations from . import models +from ._configuration import TimeSeriesInsightsClientConfiguration +from .operations import AccessPoliciesOperations, EnvironmentsOperations, EventSourcesOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ReferenceDataSetsOperations +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class TimeSeriesInsightsClient(object): +class TimeSeriesInsightsClient: # pylint: disable=too-many-instance-attributes """Time Series Insights client. :ivar operations: Operations operations @@ -36,45 +32,77 @@ class TimeSeriesInsightsClient(object): :ivar event_sources: EventSourcesOperations operations :vartype event_sources: azure.mgmt.timeseriesinsights.operations.EventSourcesOperations :ivar reference_data_sets: ReferenceDataSetsOperations operations - :vartype reference_data_sets: azure.mgmt.timeseriesinsights.operations.ReferenceDataSetsOperations + :vartype reference_data_sets: + azure.mgmt.timeseriesinsights.operations.ReferenceDataSetsOperations :ivar access_policies: AccessPoliciesOperations operations :vartype access_policies: azure.mgmt.timeseriesinsights.operations.AccessPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.timeseriesinsights.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.timeseriesinsights.operations.PrivateLinkResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2021-03-31-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ 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 = TimeSeriesInsightsClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = TimeSeriesInsightsClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.environments = EnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.event_sources = EventSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.reference_data_sets = ReferenceDataSetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.environments = EnvironmentsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.event_sources = EventSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.reference_data_sets = ReferenceDataSetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.access_policies = AccessPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_vendor.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_version.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_version.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/__init__.py index c3a8fd0f3ee8..208603b8e741 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/__init__.py @@ -8,3 +8,8 @@ from ._time_series_insights_client import TimeSeriesInsightsClient __all__ = ['TimeSeriesInsightsClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_configuration.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_configuration.py index e422397c643e..59fbd9566db0 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_configuration.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class TimeSeriesInsightsClientConfiguration(Configuration): +class TimeSeriesInsightsClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for TimeSeriesInsightsClient. Note that all parameters used to create this instance are saved as instance @@ -29,6 +29,9 @@ class TimeSeriesInsightsClientConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-03-31-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -37,15 +40,17 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(TimeSeriesInsightsClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + 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(TimeSeriesInsightsClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-05-15" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-timeseriesinsights/{}'.format(VERSION)) self._configure(**kwargs) @@ -64,4 +69,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_patch.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_time_series_insights_client.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_time_series_insights_client.py index ce1a71bbaa5a..8770b8e9fab6 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_time_series_insights_client.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/_time_series_insights_client.py @@ -6,25 +6,23 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, 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 azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient -from ._configuration import TimeSeriesInsightsClientConfiguration -from .operations import Operations -from .operations import EnvironmentsOperations -from .operations import EventSourcesOperations -from .operations import ReferenceDataSetsOperations -from .operations import AccessPoliciesOperations from .. import models +from ._configuration import TimeSeriesInsightsClientConfiguration +from .operations import AccessPoliciesOperations, EnvironmentsOperations, EventSourcesOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ReferenceDataSetsOperations +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class TimeSeriesInsightsClient(object): +class TimeSeriesInsightsClient: # pylint: disable=too-many-instance-attributes """Time Series Insights client. :ivar operations: Operations operations @@ -34,44 +32,77 @@ class TimeSeriesInsightsClient(object): :ivar event_sources: EventSourcesOperations operations :vartype event_sources: azure.mgmt.timeseriesinsights.aio.operations.EventSourcesOperations :ivar reference_data_sets: ReferenceDataSetsOperations operations - :vartype reference_data_sets: azure.mgmt.timeseriesinsights.aio.operations.ReferenceDataSetsOperations + :vartype reference_data_sets: + azure.mgmt.timeseriesinsights.aio.operations.ReferenceDataSetsOperations :ivar access_policies: AccessPoliciesOperations operations :vartype access_policies: azure.mgmt.timeseriesinsights.aio.operations.AccessPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.timeseriesinsights.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.timeseriesinsights.aio.operations.PrivateLinkResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2021-03-31-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = TimeSeriesInsightsClientConfiguration(credential, subscription_id, **kwargs) + self._config = TimeSeriesInsightsClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.environments = EnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.event_sources = EventSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.reference_data_sets = ReferenceDataSetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.environments = EnvironmentsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.event_sources = EventSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.reference_data_sets = ReferenceDataSetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.access_policies = AccessPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/__init__.py index 0d700190757b..ddc9440f5ab4 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/__init__.py @@ -11,6 +11,8 @@ from ._event_sources_operations import EventSourcesOperations from ._reference_data_sets_operations import ReferenceDataSetsOperations from ._access_policies_operations import AccessPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'Operations', @@ -18,4 +20,6 @@ 'EventSourcesOperations', 'ReferenceDataSetsOperations', 'AccessPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_access_policies_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_access_policies_operations.py index ff67c1c316a1..7351c8567e01 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_access_policies_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_access_policies_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # 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, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._access_policies_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_environment_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,13 +43,14 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, resource_group_name: str, environment_name: str, access_policy_name: str, parameters: "_models.AccessPolicyCreateOrUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyResource": """Create or update an access policy in the specified environment. @@ -69,34 +73,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AccessPolicyCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AccessPolicyCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -113,14 +113,17 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace_async async def get( self, resource_group_name: str, environment_name: str, access_policy_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyResource": """Gets the access policy with the specified name in the specified environment. @@ -142,29 +145,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -177,15 +177,18 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace_async async def update( self, resource_group_name: str, environment_name: str, access_policy_name: str, access_policy_update_parameters: "_models.AccessPolicyUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyResource": """Updates the access policy with the specified name in the specified subscription, resource group, and environment. @@ -200,7 +203,8 @@ async def update( :type access_policy_name: str :param access_policy_update_parameters: Request object that contains the updated information for the access policy. - :type access_policy_update_parameters: ~azure.mgmt.timeseriesinsights.models.AccessPolicyUpdateParameters + :type access_policy_update_parameters: + ~azure.mgmt.timeseriesinsights.models.AccessPolicyUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessPolicyResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource @@ -211,34 +215,30 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(access_policy_update_parameters, 'AccessPolicyUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(access_policy_update_parameters, 'AccessPolicyUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -251,14 +251,17 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore - async def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, environment_name: str, access_policy_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the access policy with the specified name in the specified subscription, resource group, and environment. @@ -281,29 +284,26 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -313,13 +313,15 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + @distributed_trace_async async def list_by_environment( self, resource_group_name: str, environment_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyListResponse": """Lists all the available access policies associated with the environment. @@ -338,28 +340,25 @@ async def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -372,4 +371,6 @@ async def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_environments_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_environments_operations.py index cea17e2e20e8..682e6b3f946d 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_environments_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_environments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,18 +6,20 @@ # 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, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union 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.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._environments_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -47,40 +50,36 @@ async def _create_or_update_initial( resource_group_name: str, environment_name: str, parameters: "_models.EnvironmentCreateOrUpdateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.EnvironmentResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EnvironmentResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'EnvironmentCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'EnvironmentCreateOrUpdateParameters') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 404]: @@ -98,14 +97,17 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, environment_name: str, parameters: "_models.EnvironmentCreateOrUpdateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.EnvironmentResource"]: """Create or update an environment in the specified subscription and resource group. @@ -117,14 +119,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentCreateOrUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] lro_delay = kwargs.pop( @@ -137,27 +145,22 @@ async def begin_create_or_update( resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters, + api_version=api_version, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('EnvironmentResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -167,16 +170,17 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, environment_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.EnvironmentResource": """Gets the environment with the specified name in the specified subscription and resource group. @@ -186,7 +190,7 @@ async def get( specified resource group. :type environment_name: str :param expand: Setting $expand=status will include the status of the internal services of the - environment in the Time Series Insights service. + environment in the Time Series Insights service. Default value is None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentResource, or the result of cls(response) @@ -198,30 +202,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -234,47 +234,45 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + async def _update_initial( self, resource_group_name: str, environment_name: str, environment_update_parameters: "_models.EnvironmentUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.EnvironmentResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(environment_update_parameters, 'EnvironmentUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(environment_update_parameters, 'EnvironmentUpdateParameters') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -287,14 +285,17 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + + @distributed_trace_async async def begin_update( self, resource_group_name: str, environment_name: str, environment_update_parameters: "_models.EnvironmentUpdateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.EnvironmentResource"]: """Updates the environment with the specified name in the specified subscription and resource group. @@ -306,17 +307,24 @@ async def begin_update( :type environment_name: str :param environment_update_parameters: Request object that contains the updated information for the environment. - :type environment_update_parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentUpdateParameters + :type environment_update_parameters: + ~azure.mgmt.timeseriesinsights.models.EnvironmentUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] lro_delay = kwargs.pop( @@ -329,27 +337,22 @@ async def begin_update( resource_group_name=resource_group_name, environment_name=environment_name, environment_update_parameters=environment_update_parameters, + api_version=api_version, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('EnvironmentResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -359,15 +362,16 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore - async def delete( + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, environment_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the environment with the specified name in the specified subscription and resource group. @@ -387,28 +391,25 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -418,12 +419,14 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + @distributed_trace_async async def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> "_models.EnvironmentListResponse": """Lists all the available environments associated with the subscription and within the specified resource group. @@ -440,27 +443,24 @@ async def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, '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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -473,11 +473,14 @@ async def list_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments"} # type: ignore + + + @distributed_trace_async async def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> "_models.EnvironmentListResponse": """Lists all the available environments within a subscription, irrespective of the resource groups. @@ -492,26 +495,23 @@ async def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -524,4 +524,6 @@ async def list_by_subscription( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments'} # type: ignore + + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_event_sources_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_event_sources_operations.py index 69811dff9248..e0a984390ffb 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_event_sources_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_event_sources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # 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, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._event_sources_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_environment_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,13 +43,14 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, resource_group_name: str, environment_name: str, event_source_name: str, parameters: "_models.EventSourceCreateOrUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.EventSourceResource": """Create or update an event source under the specified environment. @@ -69,34 +73,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'EventSourceCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'EventSourceCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -113,14 +113,17 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace_async async def get( self, resource_group_name: str, environment_name: str, event_source_name: str, - **kwargs + **kwargs: Any ) -> "_models.EventSourceResource": """Gets the event source with the specified name in the specified environment. @@ -142,29 +145,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -177,15 +177,18 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace_async async def update( self, resource_group_name: str, environment_name: str, event_source_name: str, event_source_update_parameters: "_models.EventSourceUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.EventSourceResource": """Updates the event source with the specified name in the specified subscription, resource group, and environment. @@ -200,7 +203,8 @@ async def update( :type event_source_name: str :param event_source_update_parameters: Request object that contains the updated information for the event source. - :type event_source_update_parameters: ~azure.mgmt.timeseriesinsights.models.EventSourceUpdateParameters + :type event_source_update_parameters: + ~azure.mgmt.timeseriesinsights.models.EventSourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: EventSourceResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource @@ -211,34 +215,30 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(event_source_update_parameters, 'EventSourceUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(event_source_update_parameters, 'EventSourceUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -251,14 +251,17 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore - async def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, environment_name: str, event_source_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the event source with the specified name in the specified subscription, resource group, and environment. @@ -281,29 +284,26 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -313,13 +313,15 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + @distributed_trace_async async def list_by_environment( self, resource_group_name: str, environment_name: str, - **kwargs + **kwargs: Any ) -> "_models.EventSourceListResponse": """Lists all the available event sources associated with the subscription and within the specified resource group and environment. @@ -339,28 +341,25 @@ async def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -373,4 +372,6 @@ async def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_operations.py index 20d9b14b9586..b4f20915cf0d 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,17 +6,19 @@ # 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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,46 +44,49 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Time Series Insights related operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.timeseriesinsights.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.timeseriesinsights.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - 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') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,7 +95,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,7 +108,8 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.TimeSeriesInsights/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.TimeSeriesInsights/operations"} # type: ignore diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_endpoint_connections_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..98ec6cc1c7fd --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,301 @@ +# pylint: disable=too-many-lines +# 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, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_environment_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations 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: ~azure.mgmt.timeseriesinsights.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 + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a Private Endpoint connection of the environment in the given resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The definition of the private endpoint connection to + update. + :type private_endpoint_connection: + ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the details of the private endpoint connection of the environment in the given resource + group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + """Disconnects the private endpoint connection and deletes it from the environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace_async + async def list_by_environment( + self, + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of all private endpoint connections in the given environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_link_resources_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..d3c8d3dcc094 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,129 @@ +# pylint: disable=too-many-lines +# 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, Optional, TypeVar + +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_supported_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations 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: ~azure.mgmt.timeseriesinsights.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 + + @distributed_trace + def list_supported( + self, + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: + """Gets a list of all supported private link resource types for the given environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.timeseriesinsights.models.PrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_supported_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_supported.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_supported_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_supported.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateLinkResources"} # type: ignore diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_reference_data_sets_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_reference_data_sets_operations.py index b6acba43c5b5..d071e198c56d 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_reference_data_sets_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/aio/operations/_reference_data_sets_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # 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, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._reference_data_sets_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_environment_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,13 +43,14 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, resource_group_name: str, environment_name: str, reference_data_set_name: str, parameters: "_models.ReferenceDataSetCreateOrUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.ReferenceDataSetResource": """Create or update a reference data set in the specified environment. @@ -58,7 +62,8 @@ async def create_or_update( :param reference_data_set_name: Name of the reference data set. :type reference_data_set_name: str :param parameters: Parameters for creating a reference data set. - :type parameters: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters + :type parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ReferenceDataSetResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource @@ -69,34 +74,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]'), - } - 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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ReferenceDataSetCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ReferenceDataSetCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -113,14 +114,17 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace_async async def get( self, resource_group_name: str, environment_name: str, reference_data_set_name: str, - **kwargs + **kwargs: Any ) -> "_models.ReferenceDataSetResource": """Gets the reference data set with the specified name in the specified environment. @@ -142,29 +146,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -177,15 +178,18 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace_async async def update( self, resource_group_name: str, environment_name: str, reference_data_set_name: str, reference_data_set_update_parameters: "_models.ReferenceDataSetUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.ReferenceDataSetResource": """Updates the reference data set with the specified name in the specified subscription, resource group, and environment. @@ -200,7 +204,8 @@ async def update( :type reference_data_set_name: str :param reference_data_set_update_parameters: Request object that contains the updated information for the reference data set. - :type reference_data_set_update_parameters: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetUpdateParameters + :type reference_data_set_update_parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ReferenceDataSetResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource @@ -211,34 +216,30 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -251,14 +252,17 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore - async def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, environment_name: str, reference_data_set_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the reference data set with the specified name in the specified subscription, resource group, and environment. @@ -281,29 +285,26 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -313,13 +314,15 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + @distributed_trace_async async def list_by_environment( self, resource_group_name: str, environment_name: str, - **kwargs + **kwargs: Any ) -> "_models.ReferenceDataSetListResponse": """Lists all the available reference data sets associated with the subscription and within the specified resource group and environment. @@ -339,28 +342,25 @@ async def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -373,4 +373,6 @@ async def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py index 4b1a011e490b..912245e611a3 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/__init__.py @@ -6,140 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AccessPolicyCreateOrUpdateParameters - from ._models_py3 import AccessPolicyListResponse - from ._models_py3 import AccessPolicyResource - from ._models_py3 import AccessPolicyUpdateParameters - from ._models_py3 import AzureEventSourceProperties - from ._models_py3 import CloudErrorBody - from ._models_py3 import CreateOrUpdateTrackedResourceProperties - from ._models_py3 import EnvironmentCreateOrUpdateParameters - from ._models_py3 import EnvironmentListResponse - from ._models_py3 import EnvironmentResource - from ._models_py3 import EnvironmentResourceProperties - from ._models_py3 import EnvironmentStateDetails - from ._models_py3 import EnvironmentStatus - from ._models_py3 import EnvironmentUpdateParameters - from ._models_py3 import EventHubEventSourceCommonProperties - from ._models_py3 import EventHubEventSourceCreateOrUpdateParameters - from ._models_py3 import EventHubEventSourceCreationProperties - from ._models_py3 import EventHubEventSourceMutableProperties - from ._models_py3 import EventHubEventSourceResource - from ._models_py3 import EventHubEventSourceResourceProperties - from ._models_py3 import EventHubEventSourceUpdateParameters - from ._models_py3 import EventSourceCommonProperties - from ._models_py3 import EventSourceCreateOrUpdateParameters - from ._models_py3 import EventSourceListResponse - from ._models_py3 import EventSourceMutableProperties - from ._models_py3 import EventSourceResource - from ._models_py3 import EventSourceUpdateParameters - from ._models_py3 import Gen1EnvironmentCreateOrUpdateParameters - from ._models_py3 import Gen1EnvironmentCreationProperties - from ._models_py3 import Gen1EnvironmentResource - from ._models_py3 import Gen1EnvironmentResourceProperties - from ._models_py3 import Gen1EnvironmentUpdateParameters - from ._models_py3 import Gen2EnvironmentCreateOrUpdateParameters - from ._models_py3 import Gen2EnvironmentResource - from ._models_py3 import Gen2EnvironmentResourceProperties - from ._models_py3 import Gen2EnvironmentUpdateParameters - from ._models_py3 import Gen2StorageConfigurationInput - from ._models_py3 import Gen2StorageConfigurationMutableProperties - from ._models_py3 import Gen2StorageConfigurationOutput - from ._models_py3 import IngressEnvironmentStatus - from ._models_py3 import IoTHubEventSourceCommonProperties - from ._models_py3 import IoTHubEventSourceCreateOrUpdateParameters - from ._models_py3 import IoTHubEventSourceCreationProperties - from ._models_py3 import IoTHubEventSourceMutableProperties - from ._models_py3 import IoTHubEventSourceResource - from ._models_py3 import IoTHubEventSourceResourceProperties - from ._models_py3 import IoTHubEventSourceUpdateParameters - from ._models_py3 import LocalTimestamp - from ._models_py3 import LocalTimestampTimeZoneOffset - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import ReferenceDataSetCreateOrUpdateParameters - from ._models_py3 import ReferenceDataSetCreationProperties - from ._models_py3 import ReferenceDataSetKeyProperty - from ._models_py3 import ReferenceDataSetListResponse - from ._models_py3 import ReferenceDataSetResource - from ._models_py3 import ReferenceDataSetResourceProperties - from ._models_py3 import ReferenceDataSetUpdateParameters - from ._models_py3 import Resource - from ._models_py3 import ResourceProperties - from ._models_py3 import Sku - from ._models_py3 import TimeSeriesIdProperty - from ._models_py3 import TrackedResource - from ._models_py3 import WarmStorageEnvironmentStatus - from ._models_py3 import WarmStoreConfigurationProperties -except (SyntaxError, ImportError): - from ._models import AccessPolicyCreateOrUpdateParameters # type: ignore - from ._models import AccessPolicyListResponse # type: ignore - from ._models import AccessPolicyResource # type: ignore - from ._models import AccessPolicyUpdateParameters # type: ignore - from ._models import AzureEventSourceProperties # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import CreateOrUpdateTrackedResourceProperties # type: ignore - from ._models import EnvironmentCreateOrUpdateParameters # type: ignore - from ._models import EnvironmentListResponse # type: ignore - from ._models import EnvironmentResource # type: ignore - from ._models import EnvironmentResourceProperties # type: ignore - from ._models import EnvironmentStateDetails # type: ignore - from ._models import EnvironmentStatus # type: ignore - from ._models import EnvironmentUpdateParameters # type: ignore - from ._models import EventHubEventSourceCommonProperties # type: ignore - from ._models import EventHubEventSourceCreateOrUpdateParameters # type: ignore - from ._models import EventHubEventSourceCreationProperties # type: ignore - from ._models import EventHubEventSourceMutableProperties # type: ignore - from ._models import EventHubEventSourceResource # type: ignore - from ._models import EventHubEventSourceResourceProperties # type: ignore - from ._models import EventHubEventSourceUpdateParameters # type: ignore - from ._models import EventSourceCommonProperties # type: ignore - from ._models import EventSourceCreateOrUpdateParameters # type: ignore - from ._models import EventSourceListResponse # type: ignore - from ._models import EventSourceMutableProperties # type: ignore - from ._models import EventSourceResource # type: ignore - from ._models import EventSourceUpdateParameters # type: ignore - from ._models import Gen1EnvironmentCreateOrUpdateParameters # type: ignore - from ._models import Gen1EnvironmentCreationProperties # type: ignore - from ._models import Gen1EnvironmentResource # type: ignore - from ._models import Gen1EnvironmentResourceProperties # type: ignore - from ._models import Gen1EnvironmentUpdateParameters # type: ignore - from ._models import Gen2EnvironmentCreateOrUpdateParameters # type: ignore - from ._models import Gen2EnvironmentResource # type: ignore - from ._models import Gen2EnvironmentResourceProperties # type: ignore - from ._models import Gen2EnvironmentUpdateParameters # type: ignore - from ._models import Gen2StorageConfigurationInput # type: ignore - from ._models import Gen2StorageConfigurationMutableProperties # type: ignore - from ._models import Gen2StorageConfigurationOutput # type: ignore - from ._models import IngressEnvironmentStatus # type: ignore - from ._models import IoTHubEventSourceCommonProperties # type: ignore - from ._models import IoTHubEventSourceCreateOrUpdateParameters # type: ignore - from ._models import IoTHubEventSourceCreationProperties # type: ignore - from ._models import IoTHubEventSourceMutableProperties # type: ignore - from ._models import IoTHubEventSourceResource # type: ignore - from ._models import IoTHubEventSourceResourceProperties # type: ignore - from ._models import IoTHubEventSourceUpdateParameters # type: ignore - from ._models import LocalTimestamp # type: ignore - from ._models import LocalTimestampTimeZoneOffset # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import ReferenceDataSetCreateOrUpdateParameters # type: ignore - from ._models import ReferenceDataSetCreationProperties # type: ignore - from ._models import ReferenceDataSetKeyProperty # type: ignore - from ._models import ReferenceDataSetListResponse # type: ignore - from ._models import ReferenceDataSetResource # type: ignore - from ._models import ReferenceDataSetResourceProperties # type: ignore - from ._models import ReferenceDataSetUpdateParameters # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProperties # type: ignore - from ._models import Sku # type: ignore - from ._models import TimeSeriesIdProperty # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import WarmStorageEnvironmentStatus # type: ignore - from ._models import WarmStoreConfigurationProperties # type: ignore +from ._models_py3 import AccessPolicyCreateOrUpdateParameters +from ._models_py3 import AccessPolicyListResponse +from ._models_py3 import AccessPolicyResource +from ._models_py3 import AccessPolicyUpdateParameters +from ._models_py3 import AzureEventSourceProperties +from ._models_py3 import CloudErrorBody +from ._models_py3 import CreateOrUpdateTrackedResourceProperties +from ._models_py3 import Dimension +from ._models_py3 import EnvironmentCreateOrUpdateParameters +from ._models_py3 import EnvironmentListResponse +from ._models_py3 import EnvironmentResource +from ._models_py3 import EnvironmentResourceProperties +from ._models_py3 import EnvironmentStateDetails +from ._models_py3 import EnvironmentStatus +from ._models_py3 import EnvironmentUpdateParameters +from ._models_py3 import EventHubEventSourceCommonProperties +from ._models_py3 import EventHubEventSourceCreateOrUpdateParameters +from ._models_py3 import EventHubEventSourceCreationProperties +from ._models_py3 import EventHubEventSourceMutableProperties +from ._models_py3 import EventHubEventSourceResource +from ._models_py3 import EventHubEventSourceResourceProperties +from ._models_py3 import EventHubEventSourceUpdateParameters +from ._models_py3 import EventSourceCommonProperties +from ._models_py3 import EventSourceCreateOrUpdateParameters +from ._models_py3 import EventSourceListResponse +from ._models_py3 import EventSourceMutableProperties +from ._models_py3 import EventSourceResource +from ._models_py3 import EventSourceUpdateParameters +from ._models_py3 import Gen1EnvironmentCreateOrUpdateParameters +from ._models_py3 import Gen1EnvironmentCreationProperties +from ._models_py3 import Gen1EnvironmentResource +from ._models_py3 import Gen1EnvironmentResourceProperties +from ._models_py3 import Gen1EnvironmentUpdateParameters +from ._models_py3 import Gen2EnvironmentCreateOrUpdateParameters +from ._models_py3 import Gen2EnvironmentResource +from ._models_py3 import Gen2EnvironmentResourceProperties +from ._models_py3 import Gen2EnvironmentUpdateParameters +from ._models_py3 import Gen2StorageConfigurationInput +from ._models_py3 import Gen2StorageConfigurationMutableProperties +from ._models_py3 import Gen2StorageConfigurationOutput +from ._models_py3 import IngressEnvironmentStatus +from ._models_py3 import IoTHubEventSourceCommonProperties +from ._models_py3 import IoTHubEventSourceCreateOrUpdateParameters +from ._models_py3 import IoTHubEventSourceCreationProperties +from ._models_py3 import IoTHubEventSourceMutableProperties +from ._models_py3 import IoTHubEventSourceResource +from ._models_py3 import IoTHubEventSourceResourceProperties +from ._models_py3 import IoTHubEventSourceUpdateParameters +from ._models_py3 import LocalTimestamp +from ._models_py3 import LocalTimestampTimeZoneOffset +from ._models_py3 import LogSpecification +from ._models_py3 import MetricAvailability +from ._models_py3 import MetricSpecification +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourceListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import ReferenceDataSetCreateOrUpdateParameters +from ._models_py3 import ReferenceDataSetCreationProperties +from ._models_py3 import ReferenceDataSetKeyProperty +from ._models_py3 import ReferenceDataSetListResponse +from ._models_py3 import ReferenceDataSetResource +from ._models_py3 import ReferenceDataSetResourceProperties +from ._models_py3 import ReferenceDataSetUpdateParameters +from ._models_py3 import Resource +from ._models_py3 import ResourceProperties +from ._models_py3 import ServiceSpecification +from ._models_py3 import Sku +from ._models_py3 import TimeSeriesIdProperty +from ._models_py3 import TrackedResource +from ._models_py3 import WarmStorageEnvironmentStatus +from ._models_py3 import WarmStoreConfigurationProperties + from ._time_series_insights_client_enums import ( AccessPolicyRole, @@ -148,10 +92,14 @@ EnvironmentResourceKind, EventSourceKind, EventSourceResourceKind, + IngressStartAtType, IngressState, LocalTimestampFormat, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, PropertyType, ProvisioningState, + PublicNetworkAccess, ReferenceDataKeyPropertyType, SkuName, StorageLimitExceededBehavior, @@ -166,6 +114,7 @@ 'AzureEventSourceProperties', 'CloudErrorBody', 'CreateOrUpdateTrackedResourceProperties', + 'Dimension', 'EnvironmentCreateOrUpdateParameters', 'EnvironmentListResponse', 'EnvironmentResource', @@ -208,9 +157,18 @@ 'IoTHubEventSourceUpdateParameters', 'LocalTimestamp', 'LocalTimestampTimeZoneOffset', + 'LogSpecification', + 'MetricAvailability', + 'MetricSpecification', 'Operation', 'OperationDisplay', 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', 'ReferenceDataSetCreateOrUpdateParameters', 'ReferenceDataSetCreationProperties', 'ReferenceDataSetKeyProperty', @@ -220,6 +178,7 @@ 'ReferenceDataSetUpdateParameters', 'Resource', 'ResourceProperties', + 'ServiceSpecification', 'Sku', 'TimeSeriesIdProperty', 'TrackedResource', @@ -231,10 +190,14 @@ 'EnvironmentResourceKind', 'EventSourceKind', 'EventSourceResourceKind', + 'IngressStartAtType', 'IngressState', 'LocalTimestampFormat', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', 'PropertyType', 'ProvisioningState', + 'PublicNetworkAccess', 'ReferenceDataKeyPropertyType', 'SkuName', 'StorageLimitExceededBehavior', diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py deleted file mode 100644 index 750c442e7d12..000000000000 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py +++ /dev/null @@ -1,2947 +0,0 @@ -# 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 msrest.serialization - - -class AccessPolicyCreateOrUpdateParameters(msrest.serialization.Model): - """AccessPolicyCreateOrUpdateParameters. - - :param principal_object_id: The objectId of the principal in Azure Active Directory. - :type principal_object_id: str - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] - """ - - _attribute_map = { - 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) - self.principal_object_id = kwargs.get('principal_object_id', None) - self.description = kwargs.get('description', None) - self.roles = kwargs.get('roles', None) - - -class AccessPolicyListResponse(msrest.serialization.Model): - """The response of the List access policies operation. - - :param value: Result of the List access policies operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AccessPolicyResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccessPolicyListResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Resource(msrest.serialization.Model): - """Time Series Insights resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :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 AccessPolicyResource(Resource): - """An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param principal_object_id: The objectId of the principal in Azure Active Directory. - :type principal_object_id: str - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] - """ - - _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'}, - 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccessPolicyResource, self).__init__(**kwargs) - self.principal_object_id = kwargs.get('principal_object_id', None) - self.description = kwargs.get('description', None) - self.roles = kwargs.get('roles', None) - - -class AccessPolicyUpdateParameters(msrest.serialization.Model): - """AccessPolicyUpdateParameters. - - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] - """ - - _attribute_map = { - 'description': {'key': 'properties.description', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccessPolicyUpdateParameters, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.roles = kwargs.get('roles', None) - - -class ResourceProperties(msrest.serialization.Model): - """Properties that are common to all tracked resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.creation_time = None - - -class EventSourceCommonProperties(ResourceProperties): - """Properties of the event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventSourceCommonProperties, self).__init__(**kwargs) - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - - -class AzureEventSourceProperties(EventSourceCommonProperties): - """Properties of an event source that reads events from an event broker in Azure. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureEventSourceProperties, self).__init__(**kwargs) - self.event_source_resource_id = kwargs['event_source_resource_id'] - - -class CloudErrorBody(msrest.serialization.Model): - """Describes a particular API error with an error code and a message. - - :param code: An error code that describes the error condition more precisely than an HTTP - status code. Can be used to programmatically handle specific error cases. - :type code: str - :param message: A message that describes the error in detail and provides debugging - information. - :type message: str - :param target: The target of the particular error (for example, the name of the property in - error). - :type target: str - :param details: Contains nested errors that are related to this error. - :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class CreateOrUpdateTrackedResourceProperties(msrest.serialization.Model): - """Properties required to create any resource tracked by Azure Resource Manager. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - """ - - _validation = { - 'location': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): - """Parameters supplied to the CreateOrUpdate Environment operation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Gen1EnvironmentCreateOrUpdateParameters, Gen2EnvironmentCreateOrUpdateParameters. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - _subtype_map = { - 'kind': {'Gen1': 'Gen1EnvironmentCreateOrUpdateParameters', 'Gen2': 'Gen2EnvironmentCreateOrUpdateParameters'} - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'EnvironmentCreateOrUpdateParameters' # type: str - self.sku = kwargs['sku'] - - -class EnvironmentListResponse(msrest.serialization.Model): - """The response of the List Environments operation. - - :param value: Result of the List Environments operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EnvironmentResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentListResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class TrackedResource(Resource): - """Time Series Insights resource that is tracked by Azure Resource Manager. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class EnvironmentResource(TrackedResource): - """An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Gen1EnvironmentResource, Gen2EnvironmentResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Gen1': 'Gen1EnvironmentResource', 'Gen2': 'Gen2EnvironmentResource'} - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentResource, self).__init__(**kwargs) - self.sku = kwargs['sku'] - self.kind = 'EnvironmentResource' # type: str - - -class EnvironmentResourceProperties(ResourceProperties): - """Properties of the environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :ivar data_access_id: An id used to access the environment data, e.g. to query the - environment's events or upload reference data for the environment. - :vartype data_access_id: str - :ivar data_access_fqdn: The fully qualified domain name used to access the environment data, - e.g. to query the environment's events or upload reference data for the environment. - :vartype data_access_fqdn: str - :ivar status: An object that represents the status of the environment, and its internal state - in the Time Series Insights service. - :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'data_access_id': {'readonly': True}, - 'data_access_fqdn': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, - 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentResourceProperties, self).__init__(**kwargs) - self.data_access_id = None - self.data_access_fqdn = None - self.status = None - - -class EnvironmentStateDetails(msrest.serialization.Model): - """An object that contains the details about an environment's state. - - :param code: Contains the code that represents the reason of an environment being in a - particular state. Can be used to programmatically handle specific cases. - :type code: str - :param message: A message that describes the state in detail. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentStateDetails, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class EnvironmentStatus(msrest.serialization.Model): - """An object that represents the status of the environment, and its internal state in the Time Series Insights service. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ingress: An object that represents the status of ingress on an environment. - :vartype ingress: ~azure.mgmt.timeseriesinsights.models.IngressEnvironmentStatus - :ivar warm_storage: An object that represents the status of warm storage on an environment. - :vartype warm_storage: ~azure.mgmt.timeseriesinsights.models.WarmStorageEnvironmentStatus - """ - - _validation = { - 'ingress': {'readonly': True}, - 'warm_storage': {'readonly': True}, - } - - _attribute_map = { - 'ingress': {'key': 'ingress', 'type': 'IngressEnvironmentStatus'}, - 'warm_storage': {'key': 'warmStorage', 'type': 'WarmStorageEnvironmentStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentStatus, self).__init__(**kwargs) - self.ingress = None - self.warm_storage = None - - -class EnvironmentUpdateParameters(msrest.serialization.Model): - """Parameters supplied to the Update Environment operation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Gen1EnvironmentUpdateParameters, Gen2EnvironmentUpdateParameters. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - _subtype_map = { - 'kind': {'Gen1': 'Gen1EnvironmentUpdateParameters', 'Gen2': 'Gen2EnvironmentUpdateParameters'} - } - - def __init__( - self, - **kwargs - ): - super(EnvironmentUpdateParameters, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - self.tags = kwargs.get('tags', None) - - -class EventHubEventSourceCommonProperties(AzureEventSourceProperties): - """Properties of the EventHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service - access to the event hub. The shared access policies for this key must grant 'Listen' - permissions to the event hub. - :type key_name: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'service_bus_namespace': {'required': True}, - 'event_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, - 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceCommonProperties, self).__init__(**kwargs) - self.service_bus_namespace = kwargs['service_bus_namespace'] - self.event_hub_name = kwargs['event_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - - -class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): - """Parameters supplied to the Create or Update Event Source operation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: EventHubEventSourceCreateOrUpdateParameters, IoTHubEventSourceCreateOrUpdateParameters. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - } - - _subtype_map = { - 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} - } - - def __init__( - self, - **kwargs - ): - super(EventSourceCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'EventSourceCreateOrUpdateParameters' # type: str - self.local_timestamp = kwargs.get('local_timestamp', None) - - -class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): - """Parameters supplied to the Create or Update Event Source operation for an EventHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service - access to the event hub. The shared access policies for this key must grant 'Listen' - permissions to the event hub. - :type key_name: str - :param shared_access_key: Required. The value of the shared access key that grants the Time - Series Insights service read access to the event hub. This property is not shown in event - source responses. - :type shared_access_key: str - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'service_bus_namespace': {'required': True}, - 'event_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - 'shared_access_key': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, - 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, - 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'properties.keyName', 'type': 'str'}, - 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'Microsoft.EventHub' # type: str - self.provisioning_state = None - self.creation_time = None - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.event_source_resource_id = kwargs['event_source_resource_id'] - self.service_bus_namespace = kwargs['service_bus_namespace'] - self.event_hub_name = kwargs['event_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - self.shared_access_key = kwargs['shared_access_key'] - - -class EventHubEventSourceCreationProperties(EventHubEventSourceCommonProperties): - """Properties of the EventHub event source that are required on create or update requests. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service - access to the event hub. The shared access policies for this key must grant 'Listen' - permissions to the event hub. - :type key_name: str - :param shared_access_key: Required. The value of the shared access key that grants the Time - Series Insights service read access to the event hub. This property is not shown in event - source responses. - :type shared_access_key: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'service_bus_namespace': {'required': True}, - 'event_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - 'shared_access_key': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, - 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceCreationProperties, self).__init__(**kwargs) - self.shared_access_key = kwargs['shared_access_key'] - - -class EventSourceMutableProperties(msrest.serialization.Model): - """An object that represents a set of mutable event source resource properties. - - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - """ - - _attribute_map = { - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - } - - def __init__( - self, - **kwargs - ): - super(EventSourceMutableProperties, self).__init__(**kwargs) - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.local_timestamp = kwargs.get('local_timestamp', None) - - -class EventHubEventSourceMutableProperties(EventSourceMutableProperties): - """An object that represents a set of mutable EventHub event source resource properties. - - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series - Insights service read access to the event hub. This property is not shown in event source - responses. - :type shared_access_key: str - """ - - _attribute_map = { - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceMutableProperties, self).__init__(**kwargs) - self.shared_access_key = kwargs.get('shared_access_key', None) - - -class EventSourceResource(TrackedResource): - """An environment receives data from one or more event sources. Each event source has associated connection info that allows the Time Series Insights ingress pipeline to connect to and pull data from the event source. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: EventHubEventSourceResource, IoTHubEventSourceResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IoTHub': 'IoTHubEventSourceResource'} - } - - def __init__( - self, - **kwargs - ): - super(EventSourceResource, self).__init__(**kwargs) - self.kind = 'EventSourceResource' # type: str - - -class EventHubEventSourceResource(EventSourceResource): - """An event source that receives its data from an Azure EventHub. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service - access to the event hub. The shared access policies for this key must grant 'Listen' - permissions to the event hub. - :type key_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'service_bus_namespace': {'required': True}, - 'event_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, - 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, - 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'properties.keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceResource, self).__init__(**kwargs) - self.kind = 'Microsoft.EventHub' # type: str - self.provisioning_state = None - self.creation_time = None - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.event_source_resource_id = kwargs['event_source_resource_id'] - self.service_bus_namespace = kwargs['service_bus_namespace'] - self.event_hub_name = kwargs['event_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - - -class EventHubEventSourceResourceProperties(EventHubEventSourceCommonProperties): - """Properties of the EventHub event source resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service - access to the event hub. The shared access policies for this key must grant 'Listen' - permissions to the event hub. - :type key_name: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'service_bus_namespace': {'required': True}, - 'event_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, - 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceResourceProperties, self).__init__(**kwargs) - - -class EventSourceUpdateParameters(msrest.serialization.Model): - """Parameters supplied to the Update Event Source operation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: EventHubEventSourceUpdateParameters, IoTHubEventSourceUpdateParameters. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - _subtype_map = { - 'kind': {'Microsoft.EventHub': 'EventHubEventSourceUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceUpdateParameters'} - } - - def __init__( - self, - **kwargs - ): - super(EventSourceUpdateParameters, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - self.tags = kwargs.get('tags', None) - - -class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): - """Parameters supplied to the Update Event Source operation to update an EventHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series - Insights service read access to the event hub. This property is not shown in event source - responses. - :type shared_access_key: str - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, - 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventHubEventSourceUpdateParameters, self).__init__(**kwargs) - self.kind = 'Microsoft.EventHub' # type: str - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.local_timestamp = kwargs.get('local_timestamp', None) - self.shared_access_key = kwargs.get('shared_access_key', None) - - -class EventSourceListResponse(msrest.serialization.Model): - """The response of the List EventSources operation. - - :param value: Result of the List EventSources operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EventSourceResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(EventSourceListResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Gen1EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): - """Parameters supplied to the Create or Update Environment operation for a Gen1 environment. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should - take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new - events will not be read from the event source. If "PurgeOldData" is specified, new events will - continue to be read and old events will be deleted from the environment. The default behavior - is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or - ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition - data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - 'sku': {'required': True}, - 'data_retention_time': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, - 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen1EnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'Gen1' # type: str - self.data_retention_time = kwargs['data_retention_time'] - self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - self.partition_key_properties = kwargs.get('partition_key_properties', None) - - -class Gen1EnvironmentCreationProperties(msrest.serialization.Model): - """Properties used to create a Gen1 environment. - - All required parameters must be populated in order to send to Azure. - - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should - take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new - events will not be read from the event source. If "PurgeOldData" is specified, new events will - continue to be read and old events will be deleted from the environment. The default behavior - is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or - ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition - data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - """ - - _validation = { - 'data_retention_time': {'required': True}, - } - - _attribute_map = { - 'data_retention_time': {'key': 'dataRetentionTime', 'type': 'duration'}, - 'storage_limit_exceeded_behavior': {'key': 'storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen1EnvironmentCreationProperties, self).__init__(**kwargs) - self.data_retention_time = kwargs['data_retention_time'] - self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - self.partition_key_properties = kwargs.get('partition_key_properties', None) - - -class Gen1EnvironmentResource(EnvironmentResource): - """An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen1 environments have data retention limits. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should - take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new - events will not be read from the event source. If "PurgeOldData" is specified, new events will - continue to be read and old events will be deleted from the environment. The default behavior - is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or - ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition - data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :ivar data_access_id: An id used to access the environment data, e.g. to query the - environment's events or upload reference data for the environment. - :vartype data_access_id: str - :ivar data_access_fqdn: The fully qualified domain name used to access the environment data, - e.g. to query the environment's events or upload reference data for the environment. - :vartype data_access_fqdn: str - :ivar status: An object that represents the status of the environment, and its internal state - in the Time Series Insights service. - :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - 'kind': {'required': True}, - 'data_retention_time': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'data_access_id': {'readonly': True}, - 'data_access_fqdn': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, - 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, - 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen1EnvironmentResource, self).__init__(**kwargs) - self.kind = 'Gen1' # type: str - self.data_retention_time = kwargs['data_retention_time'] - self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - self.partition_key_properties = kwargs.get('partition_key_properties', None) - self.provisioning_state = None - self.creation_time = None - self.data_access_id = None - self.data_access_fqdn = None - self.status = None - - -class Gen1EnvironmentResourceProperties(Gen1EnvironmentCreationProperties, EnvironmentResourceProperties): - """Properties of the Gen1 environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :ivar data_access_id: An id used to access the environment data, e.g. to query the - environment's events or upload reference data for the environment. - :vartype data_access_id: str - :ivar data_access_fqdn: The fully qualified domain name used to access the environment data, - e.g. to query the environment's events or upload reference data for the environment. - :vartype data_access_fqdn: str - :ivar status: An object that represents the status of the environment, and its internal state - in the Time Series Insights service. - :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should - take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new - events will not be read from the event source. If "PurgeOldData" is specified, new events will - continue to be read and old events will be deleted from the environment. The default behavior - is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or - ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition - data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'data_access_id': {'readonly': True}, - 'data_access_fqdn': {'readonly': True}, - 'status': {'readonly': True}, - 'data_retention_time': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, - 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, - 'data_retention_time': {'key': 'dataRetentionTime', 'type': 'duration'}, - 'storage_limit_exceeded_behavior': {'key': 'storageLimitExceededBehavior', 'type': 'str'}, - 'partition_key_properties': {'key': 'partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen1EnvironmentResourceProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.creation_time = None - self.data_access_id = None - self.data_access_fqdn = None - self.status = None - self.data_retention_time = kwargs['data_retention_time'] - self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - self.partition_key_properties = kwargs.get('partition_key_properties', None) - - -class Gen1EnvironmentUpdateParameters(EnvironmentUpdateParameters): - """Parameters supplied to the Update Environment operation to update a Gen1 environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] - :param sku: The sku of the environment. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param data_retention_time: ISO8601 timespan specifying the minimum number of days the - environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should - take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new - events will not be read from the event source. If "PurgeOldData" is specified, new events will - continue to be read and old events will be deleted from the environment. The default behavior - is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or - ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, - 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen1EnvironmentUpdateParameters, self).__init__(**kwargs) - self.kind = 'Gen1' # type: str - self.sku = kwargs.get('sku', None) - self.data_retention_time = kwargs.get('data_retention_time', None) - self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) - - -class Gen2EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): - """Parameters supplied to the Create or Update Environment operation for a Gen2 environment. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param time_series_id_properties: Required. The list of event properties which will be used to - define the environment's time series id. - :type time_series_id_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection - details that allows the Time Series Insights service to connect to the customer storage account - that is used to store the environment's data. - :type storage_configuration: - ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationInput - :param warm_store_configuration: The warm store configuration provides the details to create a - warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: - ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - 'sku': {'required': True}, - 'time_series_id_properties': {'required': True}, - 'storage_configuration': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, - 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'Gen2StorageConfigurationInput'}, - 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2EnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'Gen2' # type: str - self.time_series_id_properties = kwargs['time_series_id_properties'] - self.storage_configuration = kwargs['storage_configuration'] - self.warm_store_configuration = kwargs.get('warm_store_configuration', None) - - -class Gen2EnvironmentResource(EnvironmentResource): - """An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen2 environments do not have set data retention limits. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values - include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :ivar data_access_id: An id used to access the environment data, e.g. to query the - environment's events or upload reference data for the environment. - :vartype data_access_id: str - :ivar data_access_fqdn: The fully qualified domain name used to access the environment data, - e.g. to query the environment's events or upload reference data for the environment. - :vartype data_access_fqdn: str - :ivar status: An object that represents the status of the environment, and its internal state - in the Time Series Insights service. - :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param time_series_id_properties: Required. The list of event properties which will be used to - define the environment's time series id. - :type time_series_id_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection - details that allows the Time Series Insights service to connect to the customer storage account - that is used to store the environment's data. - :type storage_configuration: - ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput - :param warm_store_configuration: The warm store configuration provides the details to create a - warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: - ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - 'kind': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'data_access_id': {'readonly': True}, - 'data_access_fqdn': {'readonly': True}, - 'status': {'readonly': True}, - 'time_series_id_properties': {'required': True}, - 'storage_configuration': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, - 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, - 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, - 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'Gen2StorageConfigurationOutput'}, - 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2EnvironmentResource, self).__init__(**kwargs) - self.kind = 'Gen2' # type: str - self.provisioning_state = None - self.creation_time = None - self.data_access_id = None - self.data_access_fqdn = None - self.status = None - self.time_series_id_properties = kwargs['time_series_id_properties'] - self.storage_configuration = kwargs['storage_configuration'] - self.warm_store_configuration = kwargs.get('warm_store_configuration', None) - - -class Gen2EnvironmentResourceProperties(EnvironmentResourceProperties): - """Properties of the Gen2 environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :ivar data_access_id: An id used to access the environment data, e.g. to query the - environment's events or upload reference data for the environment. - :vartype data_access_id: str - :ivar data_access_fqdn: The fully qualified domain name used to access the environment data, - e.g. to query the environment's events or upload reference data for the environment. - :vartype data_access_fqdn: str - :ivar status: An object that represents the status of the environment, and its internal state - in the Time Series Insights service. - :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param time_series_id_properties: Required. The list of event properties which will be used to - define the environment's time series id. - :type time_series_id_properties: - list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection - details that allows the Time Series Insights service to connect to the customer storage account - that is used to store the environment's data. - :type storage_configuration: - ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput - :param warm_store_configuration: The warm store configuration provides the details to create a - warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: - ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'data_access_id': {'readonly': True}, - 'data_access_fqdn': {'readonly': True}, - 'status': {'readonly': True}, - 'time_series_id_properties': {'required': True}, - 'storage_configuration': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, - 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, - 'time_series_id_properties': {'key': 'timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, - 'storage_configuration': {'key': 'storageConfiguration', 'type': 'Gen2StorageConfigurationOutput'}, - 'warm_store_configuration': {'key': 'warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2EnvironmentResourceProperties, self).__init__(**kwargs) - self.time_series_id_properties = kwargs['time_series_id_properties'] - self.storage_configuration = kwargs['storage_configuration'] - self.warm_store_configuration = kwargs.get('warm_store_configuration', None) - - -class Gen2EnvironmentUpdateParameters(EnvironmentUpdateParameters): - """Parameters supplied to the Update Environment operation to update a Gen2 environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] - :param storage_configuration: The storage configuration provides the connection details that - allows the Time Series Insights service to connect to the customer storage account that is used - to store the environment's data. - :type storage_configuration: - ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationMutableProperties - :param warm_store_configuration: The warm store configuration provides the details to create a - warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: - ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'Gen2StorageConfigurationMutableProperties'}, - 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2EnvironmentUpdateParameters, self).__init__(**kwargs) - self.kind = 'Gen2' # type: str - self.storage_configuration = kwargs.get('storage_configuration', None) - self.warm_store_configuration = kwargs.get('warm_store_configuration', None) - - -class Gen2StorageConfigurationInput(msrest.serialization.Model): - """The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - - All required parameters must be populated in order to send to Azure. - - :param account_name: Required. The name of the storage account that will hold the environment's - Gen2 data. - :type account_name: str - :param management_key: Required. The value of the management key that grants the Time Series - Insights service write access to the storage account. This property is not shown in environment - responses. - :type management_key: str - """ - - _validation = { - 'account_name': {'required': True}, - 'management_key': {'required': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'management_key': {'key': 'managementKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2StorageConfigurationInput, self).__init__(**kwargs) - self.account_name = kwargs['account_name'] - self.management_key = kwargs['management_key'] - - -class Gen2StorageConfigurationMutableProperties(msrest.serialization.Model): - """The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - - All required parameters must be populated in order to send to Azure. - - :param management_key: Required. The value of the management key that grants the Time Series - Insights service write access to the storage account. This property is not shown in environment - responses. - :type management_key: str - """ - - _validation = { - 'management_key': {'required': True}, - } - - _attribute_map = { - 'management_key': {'key': 'managementKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2StorageConfigurationMutableProperties, self).__init__(**kwargs) - self.management_key = kwargs['management_key'] - - -class Gen2StorageConfigurationOutput(msrest.serialization.Model): - """The storage configuration provides the non-secret connection details about the customer storage account that is used to store the environment's data. - - All required parameters must be populated in order to send to Azure. - - :param account_name: Required. The name of the storage account that will hold the environment's - Gen2 data. - :type account_name: str - """ - - _validation = { - 'account_name': {'required': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Gen2StorageConfigurationOutput, self).__init__(**kwargs) - self.account_name = kwargs['account_name'] - - -class IngressEnvironmentStatus(msrest.serialization.Model): - """An object that represents the status of ingress on an environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param state: This string represents the state of ingress operations on an environment. It can - be "Disabled", "Ready", "Running", "Paused" or "Unknown". Possible values include: "Disabled", - "Ready", "Running", "Paused", "Unknown". - :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState - :ivar state_details: An object that contains the details about an environment's state. - :vartype state_details: ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails - """ - - _validation = { - 'state_details': {'readonly': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'state_details': {'key': 'stateDetails', 'type': 'EnvironmentStateDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(IngressEnvironmentStatus, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.state_details = None - - -class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): - """Properties of the IoTHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series - Insights service access to the iot hub. This shared access policy key must grant 'service - connect' permissions to the iot hub. - :type key_name: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'iot_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceCommonProperties, self).__init__(**kwargs) - self.iot_hub_name = kwargs['iot_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - - -class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): - """Parameters supplied to the Create or Update Event Source operation for an IoTHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series - Insights service access to the iot hub. This shared access policy key must grant 'service - connect' permissions to the iot hub. - :type key_name: str - :param shared_access_key: Required. The value of the Shared Access Policy key that grants the - Time Series Insights service read access to the iot hub. This property is not shown in event - source responses. - :type shared_access_key: str - """ - - _validation = { - 'location': {'required': True}, - 'kind': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'iot_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - 'shared_access_key': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, - 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'properties.keyName', 'type': 'str'}, - 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) - self.kind = 'Microsoft.IoTHub' # type: str - self.provisioning_state = None - self.creation_time = None - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.event_source_resource_id = kwargs['event_source_resource_id'] - self.iot_hub_name = kwargs['iot_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - self.shared_access_key = kwargs['shared_access_key'] - - -class IoTHubEventSourceCreationProperties(IoTHubEventSourceCommonProperties): - """Properties of the IoTHub event source that are required on create or update requests. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series - Insights service access to the iot hub. This shared access policy key must grant 'service - connect' permissions to the iot hub. - :type key_name: str - :param shared_access_key: Required. The value of the Shared Access Policy key that grants the - Time Series Insights service read access to the iot hub. This property is not shown in event - source responses. - :type shared_access_key: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'iot_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - 'shared_access_key': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceCreationProperties, self).__init__(**kwargs) - self.shared_access_key = kwargs['shared_access_key'] - - -class IoTHubEventSourceMutableProperties(EventSourceMutableProperties): - """An object that represents a set of mutable IoTHub event source resource properties. - - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series - Insights service read access to the iot hub. This property is not shown in event source - responses. - :type shared_access_key: str - """ - - _attribute_map = { - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, - 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceMutableProperties, self).__init__(**kwargs) - self.shared_access_key = kwargs.get('shared_access_key', None) - - -class IoTHubEventSourceResource(EventSourceResource): - """An event source that receives its data from an Azure IoTHub. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values - include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series - Insights service access to the iot hub. This shared access policy key must grant 'service - connect' permissions to the iot hub. - :type key_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'iot_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, - 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'properties.keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceResource, self).__init__(**kwargs) - self.kind = 'Microsoft.IoTHub' # type: str - self.provisioning_state = None - self.creation_time = None - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.event_source_resource_id = kwargs['event_source_resource_id'] - self.iot_hub_name = kwargs['iot_hub_name'] - self.consumer_group_name = kwargs['consumer_group_name'] - self.key_name = kwargs['key_name'] - - -class IoTHubEventSourceResourceProperties(IoTHubEventSourceCommonProperties): - """Properties of the IoTHub event source resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the - partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series - Insights service access to the iot hub. This shared access policy key must grant 'service - connect' permissions to the iot hub. - :type key_name: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'event_source_resource_id': {'required': True}, - 'iot_hub_name': {'required': True}, - 'consumer_group_name': {'required': True}, - 'key_name': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, - 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, - 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceResourceProperties, self).__init__(**kwargs) - - -class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): - """Parameters supplied to the Update Event Source operation to update an IoTHub event source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". - :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] - :param timestamp_property_name: The event property that will be used as the event source's - timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is - specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series - Insights service read access to the iot hub. This property is not shown in event source - responses. - :type shared_access_key: str - """ - - _validation = { - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, - 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IoTHubEventSourceUpdateParameters, self).__init__(**kwargs) - self.kind = 'Microsoft.IoTHub' # type: str - self.timestamp_property_name = kwargs.get('timestamp_property_name', None) - self.local_timestamp = kwargs.get('local_timestamp', None) - self.shared_access_key = kwargs.get('shared_access_key', None) - - -class LocalTimestamp(msrest.serialization.Model): - """An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - - :param format: An enum that represents the format of the local timestamp property that needs to - be set. Possible values include: "Embedded". - :type format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat - :param time_zone_offset: An object that represents the offset information for the local - timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. - :type time_zone_offset: ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'time_zone_offset': {'key': 'timeZoneOffset', 'type': 'LocalTimestampTimeZoneOffset'}, - } - - def __init__( - self, - **kwargs - ): - super(LocalTimestamp, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.time_zone_offset = kwargs.get('time_zone_offset', None) - - -class LocalTimestampTimeZoneOffset(msrest.serialization.Model): - """An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. - - :param property_name: The event property that will be contain the offset information to - calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will - contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). - When LocalTimestampFormat is Timespan, it contains the name of property which contains values - representing the offset (eg: P1D or 1.00:00:00). - :type property_name: str - """ - - _attribute_map = { - 'property_name': {'key': 'propertyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) - self.property_name = kwargs.get('property_name', None) - - -class Operation(msrest.serialization.Model): - """A Time Series Insights REST API operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation being performed on this particular object. - :vartype name: str - :ivar display: Contains the localized display information for this particular operation / - action. - :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - - -class OperationDisplay(msrest.serialization.Model): - """Contains the localized display information for this particular operation / action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name. - :vartype provider: str - :ivar resource: The localized friendly form of the resource type related to this - action/operation. - :vartype resource: str - :ivar operation: The localized friendly name for the operation. - :vartype operation: str - :ivar description: The localized friendly description for the operation. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _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(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """Result of the request to list Time Series Insights operations. It contains a list of operations and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Time Series Insights operations supported by the - Microsoft.TimeSeriesInsights resource provider. - :vartype value: list[~azure.mgmt.timeseriesinsights.models.Operation] - :ivar next_link: URL to get the next set of operation list results if there are any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): - """ReferenceDataSetCreateOrUpdateParameters. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be - set using this property. By default, the value is 'Ordinal' - which means case sensitive key - comparison will be performed while joining reference data with events or while adding new - reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. - Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or - ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior - """ - - _validation = { - 'location': {'required': True}, - 'key_properties': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, - 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(**kwargs) - self.key_properties = kwargs['key_properties'] - self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) - - -class ReferenceDataSetCreationProperties(msrest.serialization.Model): - """Properties used to create a reference data set. - - All required parameters must be populated in order to send to Azure. - - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be - set using this property. By default, the value is 'Ordinal' - which means case sensitive key - comparison will be performed while joining reference data with events or while adding new - reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. - Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or - ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior - """ - - _validation = { - 'key_properties': {'required': True}, - } - - _attribute_map = { - 'key_properties': {'key': 'keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, - 'data_string_comparison_behavior': {'key': 'dataStringComparisonBehavior', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetCreationProperties, self).__init__(**kwargs) - self.key_properties = kwargs['key_properties'] - self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) - - -class ReferenceDataSetKeyProperty(msrest.serialization.Model): - """A key property for the reference data set. A reference data set can have multiple key properties. - - :param name: The name of the key property. - :type name: str - :param type: The type of the key property. Possible values include: "String", "Double", "Bool", - "DateTime". - :type type: str or ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class ReferenceDataSetListResponse(msrest.serialization.Model): - """The response of the List Reference Data Sets operation. - - :param value: Result of the List Reference Data Sets operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReferenceDataSetResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetListResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class ReferenceDataSetResource(TrackedResource): - """A reference data set provides metadata about the events in an environment. Metadata in the reference data set will be joined with events as they are read from event sources. The metadata that makes up the reference data set is uploaded or modified through the Time Series Insights data plane APIs. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param key_properties: The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be - set using this property. By default, the value is 'Ordinal' - which means case sensitive key - comparison will be performed while joining reference data with events or while adding new - reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. - Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or - ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, - 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetResource, self).__init__(**kwargs) - self.key_properties = kwargs.get('key_properties', None) - self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) - self.provisioning_state = None - self.creation_time = None - - -class ReferenceDataSetResourceProperties(ReferenceDataSetCreationProperties, ResourceProperties): - """Properties of the reference data set. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: Provisioning state of the resource. Possible values include: - "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState - :ivar creation_time: The time the resource was created. - :vartype creation_time: ~datetime.datetime - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be - set using this property. By default, the value is 'Ordinal' - which means case sensitive key - comparison will be performed while joining reference data with events or while adding new - reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. - Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or - ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'key_properties': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'key_properties': {'key': 'keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, - 'data_string_comparison_behavior': {'key': 'dataStringComparisonBehavior', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetResourceProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.creation_time = None - self.key_properties = kwargs['key_properties'] - self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) - - -class ReferenceDataSetUpdateParameters(msrest.serialization.Model): - """Parameters supplied to the Update Reference Data Set operation. - - :param tags: A set of tags. Key-value pairs of additional properties for the reference data - set. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class Sku(msrest.serialization.Model): - """The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of this SKU. Possible values include: "S1", "S2", "P1", "L1". - :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName - :param capacity: Required. The capacity of the sku. For Gen1 environments, this value can be - changed to support scale out of environments after they have been created. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - 'capacity': {'required': True, 'maximum': 10, 'minimum': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.capacity = kwargs['capacity'] - - -class TimeSeriesIdProperty(msrest.serialization.Model): - """The structure of the property that a time series id can have. An environment can have multiple such properties. - - :param name: The name of the property. - :type name: str - :param type: The type of the property. Possible values include: "String". - :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSeriesIdProperty, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class WarmStorageEnvironmentStatus(msrest.serialization.Model): - """An object that represents the status of warm storage on an environment. - - :param state: This string represents the state of warm storage properties usage. It can be - "Ok", "Error", "Unknown". Possible values include: "Ok", "Error", "Unknown". - :type state: str or ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState - :param current_count: A value that represents the number of properties used by the environment - for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU. - :type current_count: int - :param max_count: A value that represents the maximum number of properties used allowed by the - environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU. - :type max_count: int - """ - - _validation = { - 'current_count': {'maximum': 10, 'minimum': 1}, - 'max_count': {'maximum': 10, 'minimum': 1}, - } - - _attribute_map = { - 'state': {'key': 'propertiesUsage.state', 'type': 'str'}, - 'current_count': {'key': 'propertiesUsage.stateDetails.currentCount', 'type': 'int'}, - 'max_count': {'key': 'propertiesUsage.stateDetails.maxCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.current_count = kwargs.get('current_count', None) - self.max_count = kwargs.get('max_count', None) - - -class WarmStoreConfigurationProperties(msrest.serialization.Model): - """The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - - All required parameters must be populated in order to send to Azure. - - :param data_retention: Required. ISO8601 timespan specifying the number of days the - environment's events will be available for query from the warm store. - :type data_retention: ~datetime.timedelta - """ - - _validation = { - 'data_retention': {'required': True}, - } - - _attribute_map = { - 'data_retention': {'key': 'dataRetention', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - super(WarmStoreConfigurationProperties, self).__init__(**kwargs) - self.data_retention = kwargs['data_retention'] diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py index 2102041f2624..c3d5df922c9c 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models_py3.py @@ -17,12 +17,12 @@ class AccessPolicyCreateOrUpdateParameters(msrest.serialization.Model): """AccessPolicyCreateOrUpdateParameters. - :param principal_object_id: The objectId of the principal in Azure Active Directory. - :type principal_object_id: str - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + :ivar principal_object_id: The objectId of the principal in Azure Active Directory. + :vartype principal_object_id: str + :ivar description: An description of the access policy. + :vartype description: str + :ivar roles: The list of roles the principal is assigned on the environment. + :vartype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] """ _attribute_map = { @@ -39,6 +39,14 @@ def __init__( roles: Optional[List[Union[str, "AccessPolicyRole"]]] = None, **kwargs ): + """ + :keyword principal_object_id: The objectId of the principal in Azure Active Directory. + :paramtype principal_object_id: str + :keyword description: An description of the access policy. + :paramtype description: str + :keyword roles: The list of roles the principal is assigned on the environment. + :paramtype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) self.principal_object_id = principal_object_id self.description = description @@ -48,8 +56,8 @@ def __init__( class AccessPolicyListResponse(msrest.serialization.Model): """The response of the List access policies operation. - :param value: Result of the List access policies operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + :ivar value: Result of the List access policies operation. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] """ _attribute_map = { @@ -62,20 +70,26 @@ def __init__( value: Optional[List["AccessPolicyResource"]] = None, **kwargs ): + """ + :keyword value: Result of the List access policies operation. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + """ super(AccessPolicyListResponse, self).__init__(**kwargs) self.value = value class Resource(msrest.serialization.Model): - """Time Series Insights resource. + """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: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -95,6 +109,8 @@ def __init__( self, **kwargs ): + """ + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -106,18 +122,20 @@ class AccessPolicyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param principal_object_id: The objectId of the principal in Azure Active Directory. - :type principal_object_id: str - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + :ivar principal_object_id: The objectId of the principal in Azure Active Directory. + :vartype principal_object_id: str + :ivar description: An description of the access policy. + :vartype description: str + :ivar roles: The list of roles the principal is assigned on the environment. + :vartype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] """ _validation = { @@ -143,6 +161,14 @@ def __init__( roles: Optional[List[Union[str, "AccessPolicyRole"]]] = None, **kwargs ): + """ + :keyword principal_object_id: The objectId of the principal in Azure Active Directory. + :paramtype principal_object_id: str + :keyword description: An description of the access policy. + :paramtype description: str + :keyword roles: The list of roles the principal is assigned on the environment. + :paramtype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ super(AccessPolicyResource, self).__init__(**kwargs) self.principal_object_id = principal_object_id self.description = description @@ -152,10 +178,10 @@ def __init__( class AccessPolicyUpdateParameters(msrest.serialization.Model): """AccessPolicyUpdateParameters. - :param description: An description of the access policy. - :type description: str - :param roles: The list of roles the principal is assigned on the environment. - :type roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + :ivar description: An description of the access policy. + :vartype description: str + :ivar roles: The list of roles the principal is assigned on the environment. + :vartype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] """ _attribute_map = { @@ -170,6 +196,12 @@ def __init__( roles: Optional[List[Union[str, "AccessPolicyRole"]]] = None, **kwargs ): + """ + :keyword description: An description of the access policy. + :paramtype description: str + :keyword roles: The list of roles the principal is assigned on the environment. + :paramtype roles: list[str or ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ super(AccessPolicyUpdateParameters, self).__init__(**kwargs) self.description = description self.roles = roles @@ -201,6 +233,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceProperties, self).__init__(**kwargs) self.provisioning_state = None self.creation_time = None @@ -216,10 +250,22 @@ class EventSourceCommonProperties(ResourceProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str """ _validation = { @@ -231,16 +277,43 @@ class EventSourceCommonProperties(ResourceProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, } def __init__( self, *, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + """ super(EventSourceCommonProperties, self).__init__(**kwargs) self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.type = type + self.time = time class AzureEventSourceProperties(EventSourceCommonProperties): @@ -255,13 +328,25 @@ class AzureEventSourceProperties(EventSourceCommonProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str """ _validation = { @@ -274,6 +359,9 @@ class AzureEventSourceProperties(EventSourceCommonProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, } @@ -282,26 +370,49 @@ def __init__( *, event_source_resource_id: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(AzureEventSourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + """ + super(AzureEventSourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, **kwargs) self.event_source_resource_id = event_source_resource_id class CloudErrorBody(msrest.serialization.Model): """Describes a particular API error with an error code and a message. - :param code: An error code that describes the error condition more precisely than an HTTP - status code. Can be used to programmatically handle specific error cases. - :type code: str - :param message: A message that describes the error in detail and provides debugging - information. - :type message: str - :param target: The target of the particular error (for example, the name of the property in + :ivar code: An error code that describes the error condition more precisely than an HTTP status + code. Can be used to programmatically handle specific error cases. + :vartype code: str + :ivar message: A message that describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in error). - :type target: str - :param details: Contains nested errors that are related to this error. - :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + :vartype target: str + :ivar details: Contains nested errors that are related to this error. + :vartype details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] """ _attribute_map = { @@ -320,6 +431,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An error code that describes the error condition more precisely than an HTTP + status code. Can be used to programmatically handle specific error cases. + :paramtype code: str + :keyword message: A message that describes the error in detail and provides debugging + information. + :paramtype message: str + :keyword target: The target of the particular error (for example, the name of the property in + error). + :paramtype target: str + :keyword details: Contains nested errors that are related to this error. + :paramtype details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -332,10 +456,10 @@ class CreateOrUpdateTrackedResourceProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] """ _validation = { @@ -354,11 +478,49 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + """ super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) self.location = location self.tags = tags +class Dimension(msrest.serialization.Model): + """Dimension of blobs, possibly be blob type or access tier. + + :ivar name: Display name of dimension. + :vartype name: str + :ivar display_name: Display name of dimension. + :vartype display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Display name of dimension. + :paramtype name: str + :keyword display_name: Display name of dimension. + :paramtype display_name: str + """ + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): """Parameters supplied to the CreateOrUpdate Environment operation. @@ -367,17 +529,17 @@ class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku """ _validation = { @@ -405,6 +567,16 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + """ super(EnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.kind = 'EnvironmentCreateOrUpdateParameters' # type: str self.sku = sku @@ -413,8 +585,8 @@ def __init__( class EnvironmentListResponse(msrest.serialization.Model): """The response of the List Environments operation. - :param value: Result of the List Environments operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + :ivar value: Result of the List Environments operation. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] """ _attribute_map = { @@ -427,6 +599,10 @@ def __init__( value: Optional[List["EnvironmentResource"]] = None, **kwargs ): + """ + :keyword value: Result of the List Environments operation. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + """ super(EnvironmentListResponse, self).__init__(**kwargs) self.value = value @@ -438,16 +614,18 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -472,6 +650,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TrackedResource, self).__init__(**kwargs) self.location = location self.tags = tags @@ -487,23 +671,25 @@ class EnvironmentResource(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind """ _validation = { @@ -537,6 +723,16 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + """ super(EnvironmentResource, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.kind = 'EnvironmentResource' # type: str @@ -583,6 +779,8 @@ def __init__( self, **kwargs ): + """ + """ super(EnvironmentResourceProperties, self).__init__(**kwargs) self.data_access_id = None self.data_access_fqdn = None @@ -592,11 +790,11 @@ def __init__( class EnvironmentStateDetails(msrest.serialization.Model): """An object that contains the details about an environment's state. - :param code: Contains the code that represents the reason of an environment being in a + :ivar code: Contains the code that represents the reason of an environment being in a particular state. Can be used to programmatically handle specific cases. - :type code: str - :param message: A message that describes the state in detail. - :type message: str + :vartype code: str + :ivar message: A message that describes the state in detail. + :vartype message: str """ _attribute_map = { @@ -611,6 +809,13 @@ def __init__( message: Optional[str] = None, **kwargs ): + """ + :keyword code: Contains the code that represents the reason of an environment being in a + particular state. Can be used to programmatically handle specific cases. + :paramtype code: str + :keyword message: A message that describes the state in detail. + :paramtype message: str + """ super(EnvironmentStateDetails, self).__init__(**kwargs) self.code = code self.message = message @@ -641,6 +846,8 @@ def __init__( self, **kwargs ): + """ + """ super(EnvironmentStatus, self).__init__(**kwargs) self.ingress = None self.warm_storage = None @@ -652,17 +859,17 @@ class EnvironmentUpdateParameters(msrest.serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Gen1EnvironmentUpdateParameters, Gen2EnvironmentUpdateParameters. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values + include: "Gen1", "Gen2". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] + :ivar tags: A set of tags. Key-value pairs of additional properties for the environment. + :vartype tags: dict[str, str] """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -680,6 +887,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the environment. + :paramtype tags: dict[str, str] + """ super(EnvironmentUpdateParameters, self).__init__(**kwargs) self.kind = None # type: Optional[str] self.tags = tags @@ -697,25 +908,36 @@ class EventHubEventSourceCommonProperties(AzureEventSourceProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar service_bus_namespace: Required. The name of the service bus that contains the event hub. + :vartype service_bus_namespace: str + :ivar event_hub_name: Required. The name of the event hub. + :vartype event_hub_name: str + :ivar consumer_group_name: Required. The name of the event hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -732,6 +954,9 @@ class EventHubEventSourceCommonProperties(AzureEventSourceProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, @@ -748,9 +973,45 @@ def __init__( consumer_group_name: str, key_name: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(EventHubEventSourceCommonProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword service_bus_namespace: Required. The name of the service bus that contains the event + hub. + :paramtype service_bus_namespace: str + :keyword event_hub_name: Required. The name of the event hub. + :paramtype event_hub_name: str + :keyword consumer_group_name: Required. The name of the event hub's consumer group that holds + the partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the SAS key that grants the Time Series Insights + service access to the event hub. The shared access policies for this key must grant 'Listen' + permissions to the event hub. + :paramtype key_name: str + """ + super(EventHubEventSourceCommonProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, **kwargs) self.service_bus_namespace = service_bus_namespace self.event_hub_name = event_hub_name self.consumer_group_name = consumer_group_name @@ -765,18 +1026,18 @@ class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourcePropertie All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind + :ivar local_timestamp: An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp """ _validation = { @@ -803,6 +1064,17 @@ def __init__( local_timestamp: Optional["LocalTimestamp"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + """ super(EventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.kind = 'EventSourceCreateOrUpdateParameters' # type: str self.local_timestamp = local_timestamp @@ -815,46 +1087,58 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind + :ivar local_timestamp: An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp_properties_local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, or if null, then + the local timestamp will not be ingressed with the events. + :vartype local_timestamp_properties_local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar service_bus_namespace: Required. The name of the service bus that contains the event hub. + :vartype service_bus_namespace: str + :ivar event_hub_name: Required. The name of the event hub. + :vartype event_hub_name: str + :ivar consumer_group_name: Required. The name of the event hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. - :type key_name: str - :param shared_access_key: Required. The value of the shared access key that grants the Time + :vartype key_name: str + :ivar shared_access_key: Required. The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { @@ -878,6 +1162,9 @@ class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParam 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp_properties_local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'properties.ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'properties.ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, @@ -899,13 +1186,66 @@ def __init__( tags: Optional[Dict[str, str]] = None, local_timestamp: Optional["LocalTimestamp"] = None, timestamp_property_name: Optional[str] = None, + local_timestamp_properties_local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp_properties_local_timestamp: An object that represents the local + timestamp property. It contains the format of local timestamp that needs to be used and the + corresponding timezone offset information. If a value isn't specified for localTimestamp, or if + null, then the local timestamp will not be ingressed with the events. + :paramtype local_timestamp_properties_local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword service_bus_namespace: Required. The name of the service bus that contains the event + hub. + :paramtype service_bus_namespace: str + :keyword event_hub_name: Required. The name of the event hub. + :paramtype event_hub_name: str + :keyword consumer_group_name: Required. The name of the event hub's consumer group that holds + the partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the SAS key that grants the Time Series Insights + service access to the event hub. The shared access policies for this key must grant 'Listen' + permissions to the event hub. + :paramtype key_name: str + :keyword shared_access_key: Required. The value of the shared access key that grants the Time + Series Insights service read access to the event hub. This property is not shown in event + source responses. + :paramtype shared_access_key: str + """ super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, local_timestamp=local_timestamp, **kwargs) self.kind = 'Microsoft.EventHub' # type: str self.provisioning_state = None self.creation_time = None self.timestamp_property_name = timestamp_property_name + self.local_timestamp_properties_local_timestamp = local_timestamp_properties_local_timestamp + self.type = type + self.time = time self.event_source_resource_id = event_source_resource_id self.service_bus_namespace = service_bus_namespace self.event_hub_name = event_hub_name @@ -926,29 +1266,40 @@ class EventHubEventSourceCreationProperties(EventHubEventSourceCommonProperties) :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar service_bus_namespace: Required. The name of the service bus that contains the event hub. + :vartype service_bus_namespace: str + :ivar event_hub_name: Required. The name of the event hub. + :vartype event_hub_name: str + :ivar consumer_group_name: Required. The name of the event hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. - :type key_name: str - :param shared_access_key: Required. The value of the shared access key that grants the Time + :vartype key_name: str + :ivar shared_access_key: Required. The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { @@ -966,6 +1317,9 @@ class EventHubEventSourceCreationProperties(EventHubEventSourceCommonProperties) 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, @@ -984,64 +1338,96 @@ def __init__( key_name: str, shared_access_key: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(EventHubEventSourceCreationProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, service_bus_namespace=service_bus_namespace, event_hub_name=event_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword service_bus_namespace: Required. The name of the service bus that contains the event + hub. + :paramtype service_bus_namespace: str + :keyword event_hub_name: Required. The name of the event hub. + :paramtype event_hub_name: str + :keyword consumer_group_name: Required. The name of the event hub's consumer group that holds + the partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the SAS key that grants the Time Series Insights + service access to the event hub. The shared access policies for this key must grant 'Listen' + permissions to the event hub. + :paramtype key_name: str + :keyword shared_access_key: Required. The value of the shared access key that grants the Time + Series Insights service read access to the event hub. This property is not shown in event + source responses. + :paramtype shared_access_key: str + """ + super(EventHubEventSourceCreationProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, service_bus_namespace=service_bus_namespace, event_hub_name=event_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) self.shared_access_key = shared_access_key class EventSourceMutableProperties(msrest.serialization.Model): """An object that represents a set of mutable event source resource properties. - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :vartype timestamp_property_name: str """ _attribute_map = { 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, } def __init__( self, *, timestamp_property_name: Optional[str] = None, - local_timestamp: Optional["LocalTimestamp"] = None, **kwargs ): + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + """ super(EventSourceMutableProperties, self).__init__(**kwargs) self.timestamp_property_name = timestamp_property_name - self.local_timestamp = local_timestamp class EventHubEventSourceMutableProperties(EventSourceMutableProperties): """An object that represents a set of mutable EventHub event source resource properties. - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series + :vartype timestamp_property_name: str + :ivar shared_access_key: The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _attribute_map = { 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, } @@ -1049,11 +1435,20 @@ def __init__( self, *, timestamp_property_name: Optional[str] = None, - local_timestamp: Optional["LocalTimestamp"] = None, shared_access_key: Optional[str] = None, **kwargs ): - super(EventHubEventSourceMutableProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword shared_access_key: The value of the shared access key that grants the Time Series + Insights service read access to the event hub. This property is not shown in event source + responses. + :paramtype shared_access_key: str + """ + super(EventHubEventSourceMutableProperties, self).__init__(timestamp_property_name=timestamp_property_name, **kwargs) self.shared_access_key = shared_access_key @@ -1067,19 +1462,21 @@ class EventSourceResource(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind """ _validation = { @@ -1110,6 +1507,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(EventSourceResource, self).__init__(location=location, tags=tags, **kwargs) self.kind = 'EventSourceResource' # type: str @@ -1121,43 +1524,57 @@ class EventHubEventSourceResource(EventSourceResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type_properties_ingress_start_at_type: The type of the ingressStartAt, It can be + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type_properties_ingress_start_at_type: str or + ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar service_bus_namespace: Required. The name of the service bus that contains the event hub. + :vartype service_bus_namespace: str + :ivar event_hub_name: Required. The name of the event hub. + :vartype event_hub_name: str + :ivar consumer_group_name: Required. The name of the event hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -1185,6 +1602,9 @@ class EventHubEventSourceResource(EventSourceResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'type_properties_ingress_start_at_type': {'key': 'properties.ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'properties.ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, @@ -1203,13 +1623,57 @@ def __init__( key_name: str, tags: Optional[Dict[str, str]] = None, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type_properties_ingress_start_at_type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type_properties_ingress_start_at_type: The type of the ingressStartAt, It can be + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type_properties_ingress_start_at_type: str or + ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword service_bus_namespace: Required. The name of the service bus that contains the event + hub. + :paramtype service_bus_namespace: str + :keyword event_hub_name: Required. The name of the event hub. + :paramtype event_hub_name: str + :keyword consumer_group_name: Required. The name of the event hub's consumer group that holds + the partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the SAS key that grants the Time Series Insights + service access to the event hub. The shared access policies for this key must grant 'Listen' + permissions to the event hub. + :paramtype key_name: str + """ super(EventHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) self.kind = 'Microsoft.EventHub' # type: str self.provisioning_state = None self.creation_time = None self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.type_properties_ingress_start_at_type = type_properties_ingress_start_at_type + self.time = time self.event_source_resource_id = event_source_resource_id self.service_bus_namespace = service_bus_namespace self.event_hub_name = event_hub_name @@ -1229,25 +1693,36 @@ class EventHubEventSourceResourceProperties(EventHubEventSourceCommonProperties) :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param service_bus_namespace: Required. The name of the service bus that contains the event - hub. - :type service_bus_namespace: str - :param event_hub_name: Required. The name of the event hub. - :type event_hub_name: str - :param consumer_group_name: Required. The name of the event hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar service_bus_namespace: Required. The name of the service bus that contains the event hub. + :vartype service_bus_namespace: str + :ivar event_hub_name: Required. The name of the event hub. + :vartype event_hub_name: str + :ivar consumer_group_name: Required. The name of the event hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the SAS key that grants the Time Series Insights service + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -1264,6 +1739,9 @@ class EventHubEventSourceResourceProperties(EventHubEventSourceCommonProperties) 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, @@ -1280,9 +1758,45 @@ def __init__( consumer_group_name: str, key_name: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(EventHubEventSourceResourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, service_bus_namespace=service_bus_namespace, event_hub_name=event_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword service_bus_namespace: Required. The name of the service bus that contains the event + hub. + :paramtype service_bus_namespace: str + :keyword event_hub_name: Required. The name of the event hub. + :paramtype event_hub_name: str + :keyword consumer_group_name: Required. The name of the event hub's consumer group that holds + the partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the SAS key that grants the Time Series Insights + service access to the event hub. The shared access policies for this key must grant 'Listen' + permissions to the event hub. + :paramtype key_name: str + """ + super(EventHubEventSourceResourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, service_bus_namespace=service_bus_namespace, event_hub_name=event_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) class EventSourceUpdateParameters(msrest.serialization.Model): @@ -1291,17 +1805,17 @@ class EventSourceUpdateParameters(msrest.serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: EventHubEventSourceUpdateParameters, IoTHubEventSourceUpdateParameters. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values + include: "Microsoft.EventHub", "Microsoft.IoTHub". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] + :ivar tags: A set of tags. Key-value pairs of additional properties for the event source. + :vartype tags: dict[str, str] """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -1319,6 +1833,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the event source. + :paramtype tags: dict[str, str] + """ super(EventSourceUpdateParameters, self).__init__(**kwargs) self.kind = None # type: Optional[str] self.tags = tags @@ -1327,37 +1845,31 @@ def __init__( class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): """Parameters supplied to the Update Event Source operation to update an EventHub event source. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values + include: "Microsoft.EventHub", "Microsoft.IoTHub". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] - :param timestamp_property_name: The event property that will be used as the event source's + :ivar tags: A set of tags. Key-value pairs of additional properties for the event source. + :vartype tags: dict[str, str] + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series + :vartype timestamp_property_name: str + :ivar shared_access_key: The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { 'kind': {'key': 'kind', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, } @@ -1366,22 +1878,32 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, timestamp_property_name: Optional[str] = None, - local_timestamp: Optional["LocalTimestamp"] = None, shared_access_key: Optional[str] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the event source. + :paramtype tags: dict[str, str] + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword shared_access_key: The value of the shared access key that grants the Time Series + Insights service read access to the event hub. This property is not shown in event source + responses. + :paramtype shared_access_key: str + """ super(EventHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) self.kind = 'Microsoft.EventHub' # type: str self.timestamp_property_name = timestamp_property_name - self.local_timestamp = local_timestamp self.shared_access_key = shared_access_key class EventSourceListResponse(msrest.serialization.Model): """The response of the List EventSources operation. - :param value: Result of the List EventSources operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + :ivar value: Result of the List EventSources operation. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] """ _attribute_map = { @@ -1394,6 +1916,10 @@ def __init__( value: Optional[List["EventSourceResource"]] = None, **kwargs ): + """ + :keyword value: Result of the List EventSources operation. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + """ super(EventSourceListResponse, self).__init__(**kwargs) self.value = value @@ -1403,30 +1929,30 @@ class Gen1EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameter All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar data_retention_time: Required. ISO8601 timespan specifying the minimum number of days the + environment's events will be available for query. + :vartype data_retention_time: ~datetime.timedelta + :ivar storage_limit_exceeded_behavior: The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or + :vartype storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition + :ivar partition_key_properties: The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: + :vartype partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ @@ -1458,6 +1984,30 @@ def __init__( partition_key_properties: Optional[List["TimeSeriesIdProperty"]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :keyword data_retention_time: Required. ISO8601 timespan specifying the minimum number of days + the environment's events will be available for query. + :paramtype data_retention_time: ~datetime.timedelta + :keyword storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new + events will not be read from the event source. If "PurgeOldData" is specified, new events will + continue to be read and old events will be deleted from the environment. The default behavior + is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". + :paramtype storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :keyword partition_key_properties: The list of event properties which will be used to partition + data in the environment. Currently, only a single partition key property is supported. + :paramtype partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ super(Gen1EnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.kind = 'Gen1' # type: str self.data_retention_time = data_retention_time @@ -1470,19 +2020,19 @@ class Gen1EnvironmentCreationProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + :ivar data_retention_time: Required. ISO8601 timespan specifying the minimum number of days the + environment's events will be available for query. + :vartype data_retention_time: ~datetime.timedelta + :ivar storage_limit_exceeded_behavior: The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or + :vartype storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition + :ivar partition_key_properties: The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: + :vartype partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ @@ -1504,6 +2054,22 @@ def __init__( partition_key_properties: Optional[List["TimeSeriesIdProperty"]] = None, **kwargs ): + """ + :keyword data_retention_time: Required. ISO8601 timespan specifying the minimum number of days + the environment's events will be available for query. + :paramtype data_retention_time: ~datetime.timedelta + :keyword storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new + events will not be read from the event source. If "PurgeOldData" is specified, new events will + continue to be read and old events will be deleted from the environment. The default behavior + is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". + :paramtype storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :keyword partition_key_properties: The list of event properties which will be used to partition + data in the environment. Currently, only a single partition key property is supported. + :paramtype partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ super(Gen1EnvironmentCreationProperties, self).__init__(**kwargs) self.data_retention_time = data_retention_time self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior @@ -1517,36 +2083,38 @@ class Gen1EnvironmentResource(EnvironmentResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind + :ivar data_retention_time: Required. ISO8601 timespan specifying the minimum number of days the + environment's events will be available for query. + :vartype data_retention_time: ~datetime.timedelta + :ivar storage_limit_exceeded_behavior: The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or + :vartype storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition + :ivar partition_key_properties: The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: + :vartype partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". @@ -1608,6 +2176,30 @@ def __init__( partition_key_properties: Optional[List["TimeSeriesIdProperty"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :keyword data_retention_time: Required. ISO8601 timespan specifying the minimum number of days + the environment's events will be available for query. + :paramtype data_retention_time: ~datetime.timedelta + :keyword storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new + events will not be read from the event source. If "PurgeOldData" is specified, new events will + continue to be read and old events will be deleted from the environment. The default behavior + is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". + :paramtype storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :keyword partition_key_properties: The list of event properties which will be used to partition + data in the environment. Currently, only a single partition key property is supported. + :paramtype partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ super(Gen1EnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.kind = 'Gen1' # type: str self.data_retention_time = data_retention_time @@ -1641,19 +2233,19 @@ class Gen1EnvironmentResourceProperties(Gen1EnvironmentCreationProperties, Envir :ivar status: An object that represents the status of the environment, and its internal state in the Time Series Insights service. :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param data_retention_time: Required. ISO8601 timespan specifying the minimum number of days - the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + :ivar data_retention_time: Required. ISO8601 timespan specifying the minimum number of days the + environment's events will be available for query. + :vartype data_retention_time: ~datetime.timedelta + :ivar storage_limit_exceeded_behavior: The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or + :vartype storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior - :param partition_key_properties: The list of event properties which will be used to partition + :ivar partition_key_properties: The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. - :type partition_key_properties: + :vartype partition_key_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] """ @@ -1685,6 +2277,22 @@ def __init__( partition_key_properties: Optional[List["TimeSeriesIdProperty"]] = None, **kwargs ): + """ + :keyword data_retention_time: Required. ISO8601 timespan specifying the minimum number of days + the environment's events will be available for query. + :paramtype data_retention_time: ~datetime.timedelta + :keyword storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new + events will not be read from the event source. If "PurgeOldData" is specified, new events will + continue to be read and old events will be deleted from the environment. The default behavior + is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". + :paramtype storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :keyword partition_key_properties: The list of event properties which will be used to partition + data in the environment. Currently, only a single partition key property is supported. + :paramtype partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ super(Gen1EnvironmentResourceProperties, self).__init__(data_retention_time=data_retention_time, storage_limit_exceeded_behavior=storage_limit_exceeded_behavior, partition_key_properties=partition_key_properties, **kwargs) self.provisioning_state = None self.creation_time = None @@ -1699,29 +2307,29 @@ def __init__( class Gen1EnvironmentUpdateParameters(EnvironmentUpdateParameters): """Parameters supplied to the Update Environment operation to update a Gen1 environment. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values + include: "Gen1", "Gen2". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] - :param sku: The sku of the environment. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param data_retention_time: ISO8601 timespan specifying the minimum number of days the + :ivar tags: A set of tags. Key-value pairs of additional properties for the environment. + :vartype tags: dict[str, str] + :ivar sku: The sku of the environment. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar data_retention_time: ISO8601 timespan specifying the minimum number of days the environment's events will be available for query. - :type data_retention_time: ~datetime.timedelta - :param storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + :vartype data_retention_time: ~datetime.timedelta + :ivar storage_limit_exceeded_behavior: The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". - :type storage_limit_exceeded_behavior: str or + :vartype storage_limit_exceeded_behavior: str or ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -1741,6 +2349,22 @@ def __init__( storage_limit_exceeded_behavior: Optional[Union[str, "StorageLimitExceededBehavior"]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the environment. + :paramtype tags: dict[str, str] + :keyword sku: The sku of the environment. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :keyword data_retention_time: ISO8601 timespan specifying the minimum number of days the + environment's events will be available for query. + :paramtype data_retention_time: ~datetime.timedelta + :keyword storage_limit_exceeded_behavior: The behavior the Time Series Insights service should + take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new + events will not be read from the event source. If "PurgeOldData" is specified, new events will + continue to be read and old events will be deleted from the environment. The default behavior + is PurgeOldData. Possible values include: "PurgeOldData", "PauseIngress". + :paramtype storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + """ super(Gen1EnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) self.kind = 'Gen1' # type: str self.sku = sku @@ -1751,32 +2375,44 @@ def __init__( class Gen2EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): """Parameters supplied to the Create or Update Environment operation for a Gen2 environment. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param time_series_id_properties: Required. The list of event properties which will be used to + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar time_series_id_properties: Required. The list of event properties which will be used to define the environment's time series id. - :type time_series_id_properties: + :vartype time_series_id_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection + :ivar storage_configuration: Required. The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - :type storage_configuration: + :vartype storage_configuration: ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationInput - :param warm_store_configuration: The warm store configuration provides the details to create a + :ivar warm_store_configuration: The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: + :vartype warm_store_configuration: ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :ivar public_network_access: This value can be set to 'enabled' to avoid breaking changes on + existing customer resources and templates. If set to 'disabled', traffic over public interface + is not allowed, and private endpoint connections would be the exclusive access method. Possible + values include: "enabled", "disabled". + :vartype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + :ivar private_endpoint_connections: The list of private endpoint connections to the + environment. + :vartype private_endpoint_connections: + list[~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection] """ _validation = { @@ -1785,6 +2421,7 @@ class Gen2EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameter 'sku': {'required': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1795,6 +2432,8 @@ class Gen2EnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameter 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'Gen2StorageConfigurationInput'}, 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1806,13 +2445,46 @@ def __init__( storage_configuration: "Gen2StorageConfigurationInput", tags: Optional[Dict[str, str]] = None, warm_store_configuration: Optional["WarmStoreConfigurationProperties"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :keyword time_series_id_properties: Required. The list of event properties which will be used + to define the environment's time series id. + :paramtype time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :keyword storage_configuration: Required. The storage configuration provides the connection + details that allows the Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + :paramtype storage_configuration: + ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationInput + :keyword warm_store_configuration: The warm store configuration provides the details to create + a warm store cache that will retain a copy of the environment's data available for faster + query. + :paramtype warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :keyword public_network_access: This value can be set to 'enabled' to avoid breaking changes on + existing customer resources and templates. If set to 'disabled', traffic over public interface + is not allowed, and private endpoint connections would be the exclusive access method. Possible + values include: "enabled", "disabled". + :paramtype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + """ super(Gen2EnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.kind = 'Gen2' # type: str self.time_series_id_properties = time_series_id_properties self.storage_configuration = storage_configuration self.warm_store_configuration = warm_store_configuration + self.public_network_access = public_network_access + self.private_endpoint_connections = None class Gen2EnvironmentResource(EnvironmentResource): @@ -1822,23 +2494,25 @@ class Gen2EnvironmentResource(EnvironmentResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or - Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the - ingress rate, and the billing rate. - :type sku: ~azure.mgmt.timeseriesinsights.models.Sku - :param kind: Required. The kind of the environment.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 + (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress + rate, and the billing rate. + :vartype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values include: "Gen1", "Gen2". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentResourceKind :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState @@ -1853,19 +2527,28 @@ class Gen2EnvironmentResource(EnvironmentResource): :ivar status: An object that represents the status of the environment, and its internal state in the Time Series Insights service. :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param time_series_id_properties: Required. The list of event properties which will be used to + :ivar time_series_id_properties: Required. The list of event properties which will be used to define the environment's time series id. - :type time_series_id_properties: + :vartype time_series_id_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection + :ivar storage_configuration: Required. The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - :type storage_configuration: + :vartype storage_configuration: ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput - :param warm_store_configuration: The warm store configuration provides the details to create a + :ivar warm_store_configuration: The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: + :vartype warm_store_configuration: ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :ivar public_network_access: If 'enabled', public network access is allowed. If 'disabled', + traffic over public interface is not allowed, and private endpoint connections would be the + exclusive access method. Possible values include: "enabled", "disabled". + :vartype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + :ivar private_endpoint_connections: The list of private endpoint connections to the + environment. + :vartype private_endpoint_connections: + list[~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection] """ _validation = { @@ -1882,6 +2565,7 @@ class Gen2EnvironmentResource(EnvironmentResource): 'status': {'readonly': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1900,6 +2584,8 @@ class Gen2EnvironmentResource(EnvironmentResource): 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'Gen2StorageConfigurationOutput'}, 'warm_store_configuration': {'key': 'properties.warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1911,8 +2597,38 @@ def __init__( storage_configuration: "Gen2StorageConfigurationOutput", tags: Optional[Dict[str, str]] = None, warm_store_configuration: Optional["WarmStoreConfigurationProperties"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku determines the type of environment, either Gen1 (S1 or S2) or + Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the + ingress rate, and the billing rate. + :paramtype sku: ~azure.mgmt.timeseriesinsights.models.Sku + :keyword time_series_id_properties: Required. The list of event properties which will be used + to define the environment's time series id. + :paramtype time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :keyword storage_configuration: Required. The storage configuration provides the connection + details that allows the Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + :paramtype storage_configuration: + ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput + :keyword warm_store_configuration: The warm store configuration provides the details to create + a warm store cache that will retain a copy of the environment's data available for faster + query. + :paramtype warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :keyword public_network_access: If 'enabled', public network access is allowed. If 'disabled', + traffic over public interface is not allowed, and private endpoint connections would be the + exclusive access method. Possible values include: "enabled", "disabled". + :paramtype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + """ super(Gen2EnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.kind = 'Gen2' # type: str self.provisioning_state = None @@ -1923,6 +2639,8 @@ def __init__( self.time_series_id_properties = time_series_id_properties self.storage_configuration = storage_configuration self.warm_store_configuration = warm_store_configuration + self.public_network_access = public_network_access + self.private_endpoint_connections = None class Gen2EnvironmentResourceProperties(EnvironmentResourceProperties): @@ -1946,19 +2664,28 @@ class Gen2EnvironmentResourceProperties(EnvironmentResourceProperties): :ivar status: An object that represents the status of the environment, and its internal state in the Time Series Insights service. :vartype status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus - :param time_series_id_properties: Required. The list of event properties which will be used to + :ivar time_series_id_properties: Required. The list of event properties which will be used to define the environment's time series id. - :type time_series_id_properties: + :vartype time_series_id_properties: list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] - :param storage_configuration: Required. The storage configuration provides the connection + :ivar storage_configuration: Required. The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - :type storage_configuration: + :vartype storage_configuration: ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput - :param warm_store_configuration: The warm store configuration provides the details to create a + :ivar warm_store_configuration: The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: + :vartype warm_store_configuration: ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :ivar public_network_access: If 'enabled', public network access is allowed. If 'disabled', + traffic over public interface is not allowed, and private endpoint connections would be the + exclusive access method. Possible values include: "enabled", "disabled". + :vartype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + :ivar private_endpoint_connections: The list of private endpoint connections to the + environment. + :vartype private_endpoint_connections: + list[~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection] """ _validation = { @@ -1969,6 +2696,7 @@ class Gen2EnvironmentResourceProperties(EnvironmentResourceProperties): 'status': {'readonly': True}, 'time_series_id_properties': {'required': True}, 'storage_configuration': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1980,6 +2708,8 @@ class Gen2EnvironmentResourceProperties(EnvironmentResourceProperties): 'time_series_id_properties': {'key': 'timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, 'storage_configuration': {'key': 'storageConfiguration', 'type': 'Gen2StorageConfigurationOutput'}, 'warm_store_configuration': {'key': 'warmStoreConfiguration', 'type': 'WarmStoreConfigurationProperties'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1988,37 +2718,61 @@ def __init__( time_series_id_properties: List["TimeSeriesIdProperty"], storage_configuration: "Gen2StorageConfigurationOutput", warm_store_configuration: Optional["WarmStoreConfigurationProperties"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword time_series_id_properties: Required. The list of event properties which will be used + to define the environment's time series id. + :paramtype time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :keyword storage_configuration: Required. The storage configuration provides the connection + details that allows the Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + :paramtype storage_configuration: + ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationOutput + :keyword warm_store_configuration: The warm store configuration provides the details to create + a warm store cache that will retain a copy of the environment's data available for faster + query. + :paramtype warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + :keyword public_network_access: If 'enabled', public network access is allowed. If 'disabled', + traffic over public interface is not allowed, and private endpoint connections would be the + exclusive access method. Possible values include: "enabled", "disabled". + :paramtype public_network_access: str or + ~azure.mgmt.timeseriesinsights.models.PublicNetworkAccess + """ super(Gen2EnvironmentResourceProperties, self).__init__(**kwargs) self.time_series_id_properties = time_series_id_properties self.storage_configuration = storage_configuration self.warm_store_configuration = warm_store_configuration + self.public_network_access = public_network_access + self.private_endpoint_connections = None class Gen2EnvironmentUpdateParameters(EnvironmentUpdateParameters): """Parameters supplied to the Update Environment operation to update a Gen2 environment. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the environment.Constant filled by server. Possible values include: - "Gen1", "Gen2". + :ivar kind: Required. The kind of the environment.Constant filled by server. Possible values + include: "Gen1", "Gen2". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EnvironmentKind - :param tags: A set of tags. Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] - :param storage_configuration: The storage configuration provides the connection details that + :ivar tags: A set of tags. Key-value pairs of additional properties for the environment. + :vartype tags: dict[str, str] + :ivar storage_configuration: The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - :type storage_configuration: + :vartype storage_configuration: ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationMutableProperties - :param warm_store_configuration: The warm store configuration provides the details to create a + :ivar warm_store_configuration: The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - :type warm_store_configuration: + :vartype warm_store_configuration: ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -2036,6 +2790,20 @@ def __init__( warm_store_configuration: Optional["WarmStoreConfigurationProperties"] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the environment. + :paramtype tags: dict[str, str] + :keyword storage_configuration: The storage configuration provides the connection details that + allows the Time Series Insights service to connect to the customer storage account that is used + to store the environment's data. + :paramtype storage_configuration: + ~azure.mgmt.timeseriesinsights.models.Gen2StorageConfigurationMutableProperties + :keyword warm_store_configuration: The warm store configuration provides the details to create + a warm store cache that will retain a copy of the environment's data available for faster + query. + :paramtype warm_store_configuration: + ~azure.mgmt.timeseriesinsights.models.WarmStoreConfigurationProperties + """ super(Gen2EnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) self.kind = 'Gen2' # type: str self.storage_configuration = storage_configuration @@ -2047,13 +2815,13 @@ class Gen2StorageConfigurationInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_name: Required. The name of the storage account that will hold the environment's + :ivar account_name: Required. The name of the storage account that will hold the environment's Gen2 data. - :type account_name: str - :param management_key: Required. The value of the management key that grants the Time Series + :vartype account_name: str + :ivar management_key: Required. The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses. - :type management_key: str + :vartype management_key: str """ _validation = { @@ -2073,6 +2841,15 @@ def __init__( management_key: str, **kwargs ): + """ + :keyword account_name: Required. The name of the storage account that will hold the + environment's Gen2 data. + :paramtype account_name: str + :keyword management_key: Required. The value of the management key that grants the Time Series + Insights service write access to the storage account. This property is not shown in environment + responses. + :paramtype management_key: str + """ super(Gen2StorageConfigurationInput, self).__init__(**kwargs) self.account_name = account_name self.management_key = management_key @@ -2083,10 +2860,10 @@ class Gen2StorageConfigurationMutableProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param management_key: Required. The value of the management key that grants the Time Series + :ivar management_key: Required. The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses. - :type management_key: str + :vartype management_key: str """ _validation = { @@ -2103,6 +2880,12 @@ def __init__( management_key: str, **kwargs ): + """ + :keyword management_key: Required. The value of the management key that grants the Time Series + Insights service write access to the storage account. This property is not shown in environment + responses. + :paramtype management_key: str + """ super(Gen2StorageConfigurationMutableProperties, self).__init__(**kwargs) self.management_key = management_key @@ -2112,9 +2895,9 @@ class Gen2StorageConfigurationOutput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_name: Required. The name of the storage account that will hold the environment's + :ivar account_name: Required. The name of the storage account that will hold the environment's Gen2 data. - :type account_name: str + :vartype account_name: str """ _validation = { @@ -2131,6 +2914,11 @@ def __init__( account_name: str, **kwargs ): + """ + :keyword account_name: Required. The name of the storage account that will hold the + environment's Gen2 data. + :paramtype account_name: str + """ super(Gen2StorageConfigurationOutput, self).__init__(**kwargs) self.account_name = account_name @@ -2140,10 +2928,10 @@ class IngressEnvironmentStatus(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param state: This string represents the state of ingress operations on an environment. It can + :ivar state: This string represents the state of ingress operations on an environment. It can be "Disabled", "Ready", "Running", "Paused" or "Unknown". Possible values include: "Disabled", "Ready", "Running", "Paused", "Unknown". - :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + :vartype state: str or ~azure.mgmt.timeseriesinsights.models.IngressState :ivar state_details: An object that contains the details about an environment's state. :vartype state_details: ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails """ @@ -2163,6 +2951,12 @@ def __init__( state: Optional[Union[str, "IngressState"]] = None, **kwargs ): + """ + :keyword state: This string represents the state of ingress operations on an environment. It + can be "Disabled", "Ready", "Running", "Paused" or "Unknown". Possible values include: + "Disabled", "Ready", "Running", "Paused", "Unknown". + :paramtype state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + """ super(IngressEnvironmentStatus, self).__init__(**kwargs) self.state = state self.state_details = None @@ -2180,22 +2974,34 @@ class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar iot_hub_name: Required. The name of the iot hub. + :vartype iot_hub_name: str + :ivar consumer_group_name: Required. The name of the iot hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -2211,6 +3017,9 @@ class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, @@ -2225,9 +3034,42 @@ def __init__( consumer_group_name: str, key_name: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(IoTHubEventSourceCommonProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword iot_hub_name: Required. The name of the iot hub. + :paramtype iot_hub_name: str + :keyword consumer_group_name: Required. The name of the iot hub's consumer group that holds the + partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the Shared Access Policy key that grants the Time + Series Insights service access to the iot hub. This shared access policy key must grant + 'service connect' permissions to the iot hub. + :paramtype key_name: str + """ + super(IoTHubEventSourceCommonProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, **kwargs) self.iot_hub_name = iot_hub_name self.consumer_group_name = consumer_group_name self.key_name = key_name @@ -2240,43 +3082,56 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param local_timestamp: An object that represents the local timestamp property. It contains the + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind + :ivar local_timestamp: An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp_properties_local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, or if null, then + the local timestamp will not be ingressed with the events. + :vartype local_timestamp_properties_local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar iot_hub_name: Required. The name of the iot hub. + :vartype iot_hub_name: str + :ivar consumer_group_name: Required. The name of the iot hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. - :type key_name: str - :param shared_access_key: Required. The value of the Shared Access Policy key that grants the + :vartype key_name: str + :ivar shared_access_key: Required. The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { @@ -2299,6 +3154,9 @@ class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParamet 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp_properties_local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'properties.ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'properties.ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, @@ -2318,13 +3176,63 @@ def __init__( tags: Optional[Dict[str, str]] = None, local_timestamp: Optional["LocalTimestamp"] = None, timestamp_property_name: Optional[str] = None, + local_timestamp_properties_local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp_properties_local_timestamp: An object that represents the local + timestamp property. It contains the format of local timestamp that needs to be used and the + corresponding timezone offset information. If a value isn't specified for localTimestamp, or if + null, then the local timestamp will not be ingressed with the events. + :paramtype local_timestamp_properties_local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword iot_hub_name: Required. The name of the iot hub. + :paramtype iot_hub_name: str + :keyword consumer_group_name: Required. The name of the iot hub's consumer group that holds the + partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the Shared Access Policy key that grants the Time + Series Insights service access to the iot hub. This shared access policy key must grant + 'service connect' permissions to the iot hub. + :paramtype key_name: str + :keyword shared_access_key: Required. The value of the Shared Access Policy key that grants the + Time Series Insights service read access to the iot hub. This property is not shown in event + source responses. + :paramtype shared_access_key: str + """ super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, local_timestamp=local_timestamp, **kwargs) self.kind = 'Microsoft.IoTHub' # type: str self.provisioning_state = None self.creation_time = None self.timestamp_property_name = timestamp_property_name + self.local_timestamp_properties_local_timestamp = local_timestamp_properties_local_timestamp + self.type = type + self.time = time self.event_source_resource_id = event_source_resource_id self.iot_hub_name = iot_hub_name self.consumer_group_name = consumer_group_name @@ -2344,26 +3252,38 @@ class IoTHubEventSourceCreationProperties(IoTHubEventSourceCommonProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar iot_hub_name: Required. The name of the iot hub. + :vartype iot_hub_name: str + :ivar consumer_group_name: Required. The name of the iot hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. - :type key_name: str - :param shared_access_key: Required. The value of the Shared Access Policy key that grants the + :vartype key_name: str + :ivar shared_access_key: Required. The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { @@ -2380,6 +3300,9 @@ class IoTHubEventSourceCreationProperties(IoTHubEventSourceCommonProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, @@ -2396,33 +3319,64 @@ def __init__( key_name: str, shared_access_key: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(IoTHubEventSourceCreationProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, iot_hub_name=iot_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword iot_hub_name: Required. The name of the iot hub. + :paramtype iot_hub_name: str + :keyword consumer_group_name: Required. The name of the iot hub's consumer group that holds the + partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the Shared Access Policy key that grants the Time + Series Insights service access to the iot hub. This shared access policy key must grant + 'service connect' permissions to the iot hub. + :paramtype key_name: str + :keyword shared_access_key: Required. The value of the Shared Access Policy key that grants the + Time Series Insights service read access to the iot hub. This property is not shown in event + source responses. + :paramtype shared_access_key: str + """ + super(IoTHubEventSourceCreationProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, iot_hub_name=iot_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) self.shared_access_key = shared_access_key class IoTHubEventSourceMutableProperties(EventSourceMutableProperties): """An object that represents a set of mutable IoTHub event source resource properties. - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series + :vartype timestamp_property_name: str + :ivar shared_access_key: The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _attribute_map = { 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, 'shared_access_key': {'key': 'sharedAccessKey', 'type': 'str'}, } @@ -2430,11 +3384,20 @@ def __init__( self, *, timestamp_property_name: Optional[str] = None, - local_timestamp: Optional["LocalTimestamp"] = None, shared_access_key: Optional[str] = None, **kwargs ): - super(IoTHubEventSourceMutableProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword shared_access_key: The value of the shared access key that grants the Time Series + Insights service read access to the iot hub. This property is not shown in event source + responses. + :paramtype shared_access_key: str + """ + super(IoTHubEventSourceMutableProperties, self).__init__(timestamp_property_name=timestamp_property_name, **kwargs) self.shared_access_key = shared_access_key @@ -2445,40 +3408,55 @@ class IoTHubEventSourceResource(EventSourceResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kind: Required. The kind of the event source.Constant filled by server. Possible values + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values include: "Microsoft.EventHub", "Microsoft.IoTHub". - :type kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind + :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceResourceKind :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type_properties_ingress_start_at_type: The type of the ingressStartAt, It can be + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type_properties_ingress_start_at_type: str or + ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar iot_hub_name: Required. The name of the iot hub. + :vartype iot_hub_name: str + :ivar consumer_group_name: Required. The name of the iot hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -2505,6 +3483,9 @@ class IoTHubEventSourceResource(EventSourceResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'type_properties_ingress_start_at_type': {'key': 'properties.ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'properties.ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, @@ -2521,13 +3502,54 @@ def __init__( key_name: str, tags: Optional[Dict[str, str]] = None, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type_properties_ingress_start_at_type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type_properties_ingress_start_at_type: The type of the ingressStartAt, It can be + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: + "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type_properties_ingress_start_at_type: str or + ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword iot_hub_name: Required. The name of the iot hub. + :paramtype iot_hub_name: str + :keyword consumer_group_name: Required. The name of the iot hub's consumer group that holds the + partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the Shared Access Policy key that grants the Time + Series Insights service access to the iot hub. This shared access policy key must grant + 'service connect' permissions to the iot hub. + :paramtype key_name: str + """ super(IoTHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) self.kind = 'Microsoft.IoTHub' # type: str self.provisioning_state = None self.creation_time = None self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.type_properties_ingress_start_at_type = type_properties_ingress_start_at_type + self.time = time self.event_source_resource_id = event_source_resource_id self.iot_hub_name = iot_hub_name self.consumer_group_name = consumer_group_name @@ -2546,22 +3568,34 @@ class IoTHubEventSourceResourceProperties(IoTHubEventSourceCommonProperties): :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param timestamp_property_name: The event property that will be used as the event source's + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param event_source_resource_id: Required. The resource id of the event source in Azure - Resource Manager. - :type event_source_resource_id: str - :param iot_hub_name: Required. The name of the iot hub. - :type iot_hub_name: str - :param consumer_group_name: Required. The name of the iot hub's consumer group that holds the + :vartype timestamp_property_name: str + :ivar local_timestamp: An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :vartype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :ivar type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :ivar time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying + the date and time that will be the starting point for Events to be consumed. + :vartype time: str + :ivar event_source_resource_id: Required. The resource id of the event source in Azure Resource + Manager. + :vartype event_source_resource_id: str + :ivar iot_hub_name: Required. The name of the iot hub. + :vartype iot_hub_name: str + :ivar consumer_group_name: Required. The name of the iot hub's consumer group that holds the partitions from which events will be read. - :type consumer_group_name: str - :param key_name: Required. The name of the Shared Access Policy key that grants the Time Series + :vartype consumer_group_name: str + :ivar key_name: Required. The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. - :type key_name: str + :vartype key_name: str """ _validation = { @@ -2577,6 +3611,9 @@ class IoTHubEventSourceResourceProperties(IoTHubEventSourceCommonProperties): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + 'type': {'key': 'ingressStartAt.type', 'type': 'str'}, + 'time': {'key': 'ingressStartAt.time', 'type': 'str'}, 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, @@ -2591,45 +3628,72 @@ def __init__( consumer_group_name: str, key_name: str, timestamp_property_name: Optional[str] = None, + local_timestamp: Optional["LocalTimestamp"] = None, + type: Optional[Union[str, "IngressStartAtType"]] = None, + time: Optional[str] = None, **kwargs ): - super(IoTHubEventSourceResourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, iot_hub_name=iot_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) + """ + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword local_timestamp: An object that represents the local timestamp property. It contains + the format of local timestamp that needs to be used and the corresponding timezone offset + information. If a value isn't specified for localTimestamp, or if null, then the local + timestamp will not be ingressed with the events. + :paramtype local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :keyword type: The type of the ingressStartAt, It can be "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: "EarliestAvailable", + "EventSourceCreationTime", "CustomEnqueuedTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.IngressStartAtType + :keyword time: ISO8601 UTC datetime with seconds precision (milliseconds are optional), + specifying the date and time that will be the starting point for Events to be consumed. + :paramtype time: str + :keyword event_source_resource_id: Required. The resource id of the event source in Azure + Resource Manager. + :paramtype event_source_resource_id: str + :keyword iot_hub_name: Required. The name of the iot hub. + :paramtype iot_hub_name: str + :keyword consumer_group_name: Required. The name of the iot hub's consumer group that holds the + partitions from which events will be read. + :paramtype consumer_group_name: str + :keyword key_name: Required. The name of the Shared Access Policy key that grants the Time + Series Insights service access to the iot hub. This shared access policy key must grant + 'service connect' permissions to the iot hub. + :paramtype key_name: str + """ + super(IoTHubEventSourceResourceProperties, self).__init__(timestamp_property_name=timestamp_property_name, local_timestamp=local_timestamp, type=type, time=time, event_source_resource_id=event_source_resource_id, iot_hub_name=iot_hub_name, consumer_group_name=consumer_group_name, key_name=key_name, **kwargs) class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): """Parameters supplied to the Update Event Source operation to update an IoTHub event source. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar kind: The kind of the event source.Constant filled by server. Possible values include: - "Microsoft.EventHub", "Microsoft.IoTHub". + :ivar kind: Required. The kind of the event source.Constant filled by server. Possible values + include: "Microsoft.EventHub", "Microsoft.IoTHub". :vartype kind: str or ~azure.mgmt.timeseriesinsights.models.EventSourceKind - :param tags: A set of tags. Key-value pairs of additional properties for the event source. - :type tags: dict[str, str] - :param timestamp_property_name: The event property that will be used as the event source's + :ivar tags: A set of tags. Key-value pairs of additional properties for the event source. + :vartype tags: dict[str, str] + :ivar timestamp_property_name: The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. - :type timestamp_property_name: str - :param local_timestamp: An object that represents the local timestamp property. It contains the - format of local timestamp that needs to be used and the corresponding timezone offset - information. If a value isn't specified for localTimestamp, or if null, then the local - timestamp will not be ingressed with the events. - :type local_timestamp: ~azure.mgmt.timeseriesinsights.models.LocalTimestamp - :param shared_access_key: The value of the shared access key that grants the Time Series + :vartype timestamp_property_name: str + :ivar shared_access_key: The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. - :type shared_access_key: str + :vartype shared_access_key: str """ _validation = { - 'kind': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { 'kind': {'key': 'kind', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, - 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, } @@ -2638,26 +3702,36 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, timestamp_property_name: Optional[str] = None, - local_timestamp: Optional["LocalTimestamp"] = None, shared_access_key: Optional[str] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the event source. + :paramtype tags: dict[str, str] + :keyword timestamp_property_name: The event property that will be used as the event source's + timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is + specified, the event creation time will be used. + :paramtype timestamp_property_name: str + :keyword shared_access_key: The value of the shared access key that grants the Time Series + Insights service read access to the iot hub. This property is not shown in event source + responses. + :paramtype shared_access_key: str + """ super(IoTHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) self.kind = 'Microsoft.IoTHub' # type: str self.timestamp_property_name = timestamp_property_name - self.local_timestamp = local_timestamp self.shared_access_key = shared_access_key class LocalTimestamp(msrest.serialization.Model): """An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - :param format: An enum that represents the format of the local timestamp property that needs to + :ivar format: An enum that represents the format of the local timestamp property that needs to be set. Possible values include: "Embedded". - :type format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat - :param time_zone_offset: An object that represents the offset information for the local + :vartype format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :ivar time_zone_offset: An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. - :type time_zone_offset: ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + :vartype time_zone_offset: ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset """ _attribute_map = { @@ -2672,6 +3746,14 @@ def __init__( time_zone_offset: Optional["LocalTimestampTimeZoneOffset"] = None, **kwargs ): + """ + :keyword format: An enum that represents the format of the local timestamp property that needs + to be set. Possible values include: "Embedded". + :paramtype format: str or ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :keyword time_zone_offset: An object that represents the offset information for the local + timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. + :paramtype time_zone_offset: ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + """ super(LocalTimestamp, self).__init__(**kwargs) self.format = format self.time_zone_offset = time_zone_offset @@ -2680,12 +3762,12 @@ def __init__( class LocalTimestampTimeZoneOffset(msrest.serialization.Model): """An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. - :param property_name: The event property that will be contain the offset information to + :ivar property_name: The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00). - :type property_name: str + :vartype property_name: str """ _attribute_map = { @@ -2698,10 +3780,163 @@ def __init__( property_name: Optional[str] = None, **kwargs ): + """ + :keyword property_name: The event property that will be contain the offset information to + calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will + contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + When LocalTimestampFormat is Timespan, it contains the name of property which contains values + representing the offset (eg: P1D or 1.00:00:00). + :paramtype property_name: str + """ super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) self.property_name = property_name +class LogSpecification(msrest.serialization.Model): + """The specification of an Azure Monitoring log. + + :ivar name: Log name. + :vartype name: str + :ivar display_name: Log display name. + :vartype display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Log name. + :paramtype name: str + :keyword display_name: Log display name. + :paramtype display_name: str + """ + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :ivar time_grain: + :vartype time_grain: str + :ivar blob_duration: + :vartype blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + """ + :keyword time_grain: + :paramtype time_grain: str + :keyword blob_duration: + :paramtype blob_duration: str + """ + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.blob_duration = blob_duration + + +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. + + :ivar name: Name of metric specification. + :vartype name: str + :ivar display_name: Display name of metric specification. + :vartype display_name: str + :ivar display_description: Display description of metric specification. + :vartype display_description: str + :ivar unit: Unit could be Bytes or Count. + :vartype unit: str + :ivar dimensions: Dimensions of blobs, including blob type and access tier. + :vartype dimensions: list[~azure.mgmt.timeseriesinsights.models.Dimension] + :ivar aggregation_type: Aggregation type could be Average. + :vartype aggregation_type: str + :ivar availabilities: Retention policies of a resource metric. + :vartype availabilities: list[~azure.mgmt.timeseriesinsights.models.MetricAvailability] + :ivar category: The category this metric specification belong to, could be Capacity. + :vartype category: str + :ivar resource_id_dimension_name_override: Account Resource Id. + :vartype resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + aggregation_type: Optional[str] = None, + availabilities: Optional[List["MetricAvailability"]] = None, + category: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of metric specification. + :paramtype name: str + :keyword display_name: Display name of metric specification. + :paramtype display_name: str + :keyword display_description: Display description of metric specification. + :paramtype display_description: str + :keyword unit: Unit could be Bytes or Count. + :paramtype unit: str + :keyword dimensions: Dimensions of blobs, including blob type and access tier. + :paramtype dimensions: list[~azure.mgmt.timeseriesinsights.models.Dimension] + :keyword aggregation_type: Aggregation type could be Average. + :paramtype aggregation_type: str + :keyword availabilities: Retention policies of a resource metric. + :paramtype availabilities: list[~azure.mgmt.timeseriesinsights.models.MetricAvailability] + :keyword category: The category this metric specification belong to, could be Capacity. + :paramtype category: str + :keyword resource_id_dimension_name_override: Account Resource Id. + :paramtype resource_id_dimension_name_override: str + """ + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + class Operation(msrest.serialization.Model): """A Time Series Insights REST API operation. @@ -2712,6 +3947,10 @@ class Operation(msrest.serialization.Model): :ivar display: Contains the localized display information for this particular operation / action. :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay + :ivar origin: The intended executor of the operation. + :vartype origin: str + :ivar service_specification: One property of operation, include metric specifications. + :vartype service_specification: ~azure.mgmt.timeseriesinsights.models.ServiceSpecification """ _validation = { @@ -2722,15 +3961,28 @@ class Operation(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, + *, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, **kwargs ): + """ + :keyword origin: The intended executor of the operation. + :paramtype origin: str + :keyword service_specification: One property of operation, include metric specifications. + :paramtype service_specification: ~azure.mgmt.timeseriesinsights.models.ServiceSpecification + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None + self.origin = origin + self.service_specification = service_specification class OperationDisplay(msrest.serialization.Model): @@ -2767,6 +4019,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None @@ -2800,28 +4054,276 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None self.next_link = None +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + 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 + :ivar provisioning_state: Provisioning state of the private endpoint connection. Possible + values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.timeseriesinsights.models.PrivateEndpoint + :ivar group_ids: The provisioning state of the private endpoint connection resource. + :vartype group_ids: list[str] + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.timeseriesinsights.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + group_ids: Optional[List[str]] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + """ + :keyword private_endpoint: The resource of private end point. + :paramtype private_endpoint: ~azure.mgmt.timeseriesinsights.models.PrivateEndpoint + :keyword group_ids: The provisioning state of the private endpoint connection resource. + :paramtype group_ids: list[str] + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.timeseriesinsights.models.PrivateLinkServiceConnectionState + """ + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.group_ids = group_ids + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :ivar value: Array of private endpoint connections. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + """ + :keyword value: Array of private endpoint connections. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection] + """ + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(Resource): + """A private link resource. + + 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource Private link DNS zone name. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword required_zone_names: The private link resource Private link DNS zone name. + :paramtype required_zone_names: list[str] + """ + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :ivar value: Array of private link resources. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + """ + :keyword value: Array of private link resources. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.PrivateLinkResource] + """ + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :vartype status: str or + ~azure.mgmt.timeseriesinsights.models.PrivateEndpointServiceConnectionStatus + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + """ + :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the + owner of the service. Possible values include: "Pending", "Approved", "Rejected". + :paramtype status: str or + ~azure.mgmt.timeseriesinsights.models.PrivateEndpointServiceConnectionStatus + :keyword description: The reason for approval/rejection of the connection. + :paramtype description: str + :keyword actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :paramtype actions_required: str + """ + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): """ReferenceDataSetCreateOrUpdateParameters. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Key-value pairs of additional properties for the resource. - :type tags: dict[str, str] - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be + :ivar location: Required. The location of the resource. + :vartype location: str + :ivar tags: A set of tags. Key-value pairs of additional properties for the resource. + :vartype tags: dict[str, str] + :ivar key_properties: Required. The list of key properties for the reference data set. + :vartype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :ivar data_string_comparison_behavior: The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or + :vartype data_string_comparison_behavior: str or ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior """ @@ -2846,6 +4348,22 @@ def __init__( data_string_comparison_behavior: Optional[Union[str, "DataStringComparisonBehavior"]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. + :paramtype location: str + :keyword tags: A set of tags. Key-value pairs of additional properties for the resource. + :paramtype tags: dict[str, str] + :keyword key_properties: Required. The list of key properties for the reference data set. + :paramtype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :keyword data_string_comparison_behavior: The reference data set key comparison behavior can be + set using this property. By default, the value is 'Ordinal' - which means case sensitive key + comparison will be performed while joining reference data with events or while adding new + reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. + Possible values include: "Ordinal", "OrdinalIgnoreCase". + :paramtype data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.key_properties = key_properties self.data_string_comparison_behavior = data_string_comparison_behavior @@ -2856,14 +4374,15 @@ class ReferenceDataSetCreationProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be + :ivar key_properties: Required. The list of key properties for the reference data set. + :vartype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :ivar data_string_comparison_behavior: The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or + :vartype data_string_comparison_behavior: str or ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior """ @@ -2883,6 +4402,18 @@ def __init__( data_string_comparison_behavior: Optional[Union[str, "DataStringComparisonBehavior"]] = None, **kwargs ): + """ + :keyword key_properties: Required. The list of key properties for the reference data set. + :paramtype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :keyword data_string_comparison_behavior: The reference data set key comparison behavior can be + set using this property. By default, the value is 'Ordinal' - which means case sensitive key + comparison will be performed while joining reference data with events or while adding new + reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. + Possible values include: "Ordinal", "OrdinalIgnoreCase". + :paramtype data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ super(ReferenceDataSetCreationProperties, self).__init__(**kwargs) self.key_properties = key_properties self.data_string_comparison_behavior = data_string_comparison_behavior @@ -2891,11 +4422,11 @@ def __init__( class ReferenceDataSetKeyProperty(msrest.serialization.Model): """A key property for the reference data set. A reference data set can have multiple key properties. - :param name: The name of the key property. - :type name: str - :param type: The type of the key property. Possible values include: "String", "Double", "Bool", + :ivar name: The name of the key property. + :vartype name: str + :ivar type: The type of the key property. Possible values include: "String", "Double", "Bool", "DateTime". - :type type: str or ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType """ _attribute_map = { @@ -2910,6 +4441,13 @@ def __init__( type: Optional[Union[str, "ReferenceDataKeyPropertyType"]] = None, **kwargs ): + """ + :keyword name: The name of the key property. + :paramtype name: str + :keyword type: The type of the key property. Possible values include: "String", "Double", + "Bool", "DateTime". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + """ super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) self.name = name self.type = type @@ -2918,8 +4456,8 @@ def __init__( class ReferenceDataSetListResponse(msrest.serialization.Model): """The response of the List Reference Data Sets operation. - :param value: Result of the List Reference Data Sets operation. - :type value: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + :ivar value: Result of the List Reference Data Sets operation. + :vartype value: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] """ _attribute_map = { @@ -2932,6 +4470,10 @@ def __init__( value: Optional[List["ReferenceDataSetResource"]] = None, **kwargs ): + """ + :keyword value: Result of the List Reference Data Sets operation. + :paramtype value: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + """ super(ReferenceDataSetListResponse, self).__init__(**kwargs) self.value = value @@ -2943,24 +4485,27 @@ class ReferenceDataSetResource(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param key_properties: The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar key_properties: The list of key properties for the reference data set. + :vartype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :ivar data_string_comparison_behavior: The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or + :vartype data_string_comparison_behavior: str or ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior :ivar provisioning_state: Provisioning state of the resource. Possible values include: "Accepted", "Creating", "Updating", "Succeeded", "Failed", "Deleting". @@ -2999,6 +4544,22 @@ def __init__( data_string_comparison_behavior: Optional[Union[str, "DataStringComparisonBehavior"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword key_properties: The list of key properties for the reference data set. + :paramtype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :keyword data_string_comparison_behavior: The reference data set key comparison behavior can be + set using this property. By default, the value is 'Ordinal' - which means case sensitive key + comparison will be performed while joining reference data with events or while adding new + reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. + Possible values include: "Ordinal", "OrdinalIgnoreCase". + :paramtype data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ super(ReferenceDataSetResource, self).__init__(location=location, tags=tags, **kwargs) self.key_properties = key_properties self.data_string_comparison_behavior = data_string_comparison_behavior @@ -3018,14 +4579,15 @@ class ReferenceDataSetResourceProperties(ReferenceDataSetCreationProperties, Res :vartype provisioning_state: str or ~azure.mgmt.timeseriesinsights.models.ProvisioningState :ivar creation_time: The time the resource was created. :vartype creation_time: ~datetime.datetime - :param key_properties: Required. The list of key properties for the reference data set. - :type key_properties: list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] - :param data_string_comparison_behavior: The reference data set key comparison behavior can be + :ivar key_properties: Required. The list of key properties for the reference data set. + :vartype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :ivar data_string_comparison_behavior: The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. Possible values include: "Ordinal", "OrdinalIgnoreCase". - :type data_string_comparison_behavior: str or + :vartype data_string_comparison_behavior: str or ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior """ @@ -3049,6 +4611,18 @@ def __init__( data_string_comparison_behavior: Optional[Union[str, "DataStringComparisonBehavior"]] = None, **kwargs ): + """ + :keyword key_properties: Required. The list of key properties for the reference data set. + :paramtype key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :keyword data_string_comparison_behavior: The reference data set key comparison behavior can be + set using this property. By default, the value is 'Ordinal' - which means case sensitive key + comparison will be performed while joining reference data with events or while adding new + reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. + Possible values include: "Ordinal", "OrdinalIgnoreCase". + :paramtype data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ super(ReferenceDataSetResourceProperties, self).__init__(key_properties=key_properties, data_string_comparison_behavior=data_string_comparison_behavior, **kwargs) self.provisioning_state = None self.creation_time = None @@ -3059,9 +4633,8 @@ def __init__( class ReferenceDataSetUpdateParameters(msrest.serialization.Model): """Parameters supplied to the Update Reference Data Set operation. - :param tags: A set of tags. Key-value pairs of additional properties for the reference data - set. - :type tags: dict[str, str] + :ivar tags: A set of tags. Key-value pairs of additional properties for the reference data set. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3074,20 +4647,58 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Key-value pairs of additional properties for the reference data + set. + :paramtype tags: dict[str, str] + """ super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) self.tags = tags +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. + + :ivar metric_specifications: Metric specifications of operation. + :vartype metric_specifications: list[~azure.mgmt.timeseriesinsights.models.MetricSpecification] + :ivar log_specifications: A list of Azure Monitoring log definitions. + :vartype log_specifications: list[~azure.mgmt.timeseriesinsights.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + log_specifications: Optional[List["LogSpecification"]] = None, + **kwargs + ): + """ + :keyword metric_specifications: Metric specifications of operation. + :paramtype metric_specifications: + list[~azure.mgmt.timeseriesinsights.models.MetricSpecification] + :keyword log_specifications: A list of Azure Monitoring log definitions. + :paramtype log_specifications: list[~azure.mgmt.timeseriesinsights.models.LogSpecification] + """ + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + class Sku(msrest.serialization.Model): """The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of this SKU. Possible values include: "S1", "S2", "P1", "L1". - :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName - :param capacity: Required. The capacity of the sku. For Gen1 environments, this value can be + :ivar name: Required. The name of this SKU. Possible values include: "S1", "S2", "P1", "L1". + :vartype name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :ivar capacity: Required. The capacity of the sku. For Gen1 environments, this value can be changed to support scale out of environments after they have been created. - :type capacity: int + :vartype capacity: int """ _validation = { @@ -3107,6 +4718,13 @@ def __init__( capacity: int, **kwargs ): + """ + :keyword name: Required. The name of this SKU. Possible values include: "S1", "S2", "P1", "L1". + :paramtype name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :keyword capacity: Required. The capacity of the sku. For Gen1 environments, this value can be + changed to support scale out of environments after they have been created. + :paramtype capacity: int + """ super(Sku, self).__init__(**kwargs) self.name = name self.capacity = capacity @@ -3115,10 +4733,10 @@ def __init__( class TimeSeriesIdProperty(msrest.serialization.Model): """The structure of the property that a time series id can have. An environment can have multiple such properties. - :param name: The name of the property. - :type name: str - :param type: The type of the property. Possible values include: "String". - :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + :ivar name: The name of the property. + :vartype name: str + :ivar type: The type of the property. Possible values include: "String". + :vartype type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType """ _attribute_map = { @@ -3133,6 +4751,12 @@ def __init__( type: Optional[Union[str, "PropertyType"]] = None, **kwargs ): + """ + :keyword name: The name of the property. + :paramtype name: str + :keyword type: The type of the property. Possible values include: "String". + :paramtype type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + """ super(TimeSeriesIdProperty, self).__init__(**kwargs) self.name = name self.type = type @@ -3141,15 +4765,15 @@ def __init__( class WarmStorageEnvironmentStatus(msrest.serialization.Model): """An object that represents the status of warm storage on an environment. - :param state: This string represents the state of warm storage properties usage. It can be - "Ok", "Error", "Unknown". Possible values include: "Ok", "Error", "Unknown". - :type state: str or ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState - :param current_count: A value that represents the number of properties used by the environment + :ivar state: This string represents the state of warm storage properties usage. It can be "Ok", + "Error", "Unknown". Possible values include: "Ok", "Error", "Unknown". + :vartype state: str or ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :ivar current_count: A value that represents the number of properties used by the environment for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU. - :type current_count: int - :param max_count: A value that represents the maximum number of properties used allowed by the + :vartype current_count: int + :ivar max_count: A value that represents the maximum number of properties used allowed by the environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU. - :type max_count: int + :vartype max_count: int """ _validation = { @@ -3171,6 +4795,18 @@ def __init__( max_count: Optional[int] = None, **kwargs ): + """ + :keyword state: This string represents the state of warm storage properties usage. It can be + "Ok", "Error", "Unknown". Possible values include: "Ok", "Error", "Unknown". + :paramtype state: str or ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :keyword current_count: A value that represents the number of properties used by the + environment for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU. + :paramtype current_count: int + :keyword max_count: A value that represents the maximum number of properties used allowed by + the environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG + SKU. + :paramtype max_count: int + """ super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) self.state = state self.current_count = current_count @@ -3182,9 +4818,9 @@ class WarmStoreConfigurationProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_retention: Required. ISO8601 timespan specifying the number of days the + :ivar data_retention: Required. ISO8601 timespan specifying the number of days the environment's events will be available for query from the warm store. - :type data_retention: ~datetime.timedelta + :vartype data_retention: ~datetime.timedelta """ _validation = { @@ -3201,5 +4837,10 @@ def __init__( data_retention: datetime.timedelta, **kwargs ): + """ + :keyword data_retention: Required. ISO8601 timespan specifying the number of days the + environment's events will be available for query from the warm store. + :paramtype data_retention: ~datetime.timedelta + """ super(WarmStoreConfigurationProperties, self).__init__(**kwargs) self.data_retention = data_retention diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py index 4b445d9f3e40..b2a978b01d90 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AccessPolicyRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AccessPolicyRole(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A role defining the data plane operations that a principal can perform on a Time Series Insights client. """ @@ -34,7 +19,7 @@ class AccessPolicyRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): READER = "Reader" CONTRIBUTOR = "Contributor" -class DataStringComparisonBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DataStringComparisonBehavior(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, @@ -44,35 +29,44 @@ class DataStringComparisonBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, ORDINAL = "Ordinal" ORDINAL_IGNORE_CASE = "OrdinalIgnoreCase" -class EnvironmentKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EnvironmentKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The kind of the environment. """ GEN1 = "Gen1" GEN2 = "Gen2" -class EnvironmentResourceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EnvironmentResourceKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The kind of the environment. """ GEN1 = "Gen1" GEN2 = "Gen2" -class EventSourceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EventSourceKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The kind of the event source. """ MICROSOFT_EVENT_HUB = "Microsoft.EventHub" MICROSOFT_IO_T_HUB = "Microsoft.IoTHub" -class EventSourceResourceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EventSourceResourceKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The kind of the event source. """ MICROSOFT_EVENT_HUB = "Microsoft.EventHub" MICROSOFT_IO_T_HUB = "Microsoft.IoTHub" -class IngressState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IngressStartAtType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", + "CustomEnqueuedTime". + """ + + EARLIEST_AVAILABLE = "EarliestAvailable" + EVENT_SOURCE_CREATION_TIME = "EventSourceCreationTime" + CUSTOM_ENQUEUED_TIME = "CustomEnqueuedTime" + +class IngressState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This string represents the state of ingress operations on an environment. It can be "Disabled", "Ready", "Running", "Paused" or "Unknown" """ @@ -83,19 +77,36 @@ class IngressState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PAUSED = "Paused" UNKNOWN = "Unknown" -class LocalTimestampFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LocalTimestampFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enum that represents the format of the local timestamp property that needs to be set. """ EMBEDDED = "Embedded" -class PropertyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + +class PropertyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the property. """ STRING = "String" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the resource. """ @@ -106,7 +117,16 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FAILED = "Failed" DELETING = "Deleting" -class ReferenceDataKeyPropertyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PublicNetworkAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """This value can be set to 'enabled' to avoid breaking changes on existing customer resources and + templates. If set to 'disabled', traffic over public interface is not allowed, and private + endpoint connections would be the exclusive access method. + """ + + ENABLED = "enabled" + DISABLED = "disabled" + +class ReferenceDataKeyPropertyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the key property. """ @@ -115,7 +135,7 @@ class ReferenceDataKeyPropertyType(with_metaclass(_CaseInsensitiveEnumMeta, str, BOOL = "Bool" DATE_TIME = "DateTime" -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of this SKU. """ @@ -124,7 +144,7 @@ class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): P1 = "P1" L1 = "L1" -class StorageLimitExceededBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class StorageLimitExceededBehavior(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will @@ -134,7 +154,7 @@ class StorageLimitExceededBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, PURGE_OLD_DATA = "PurgeOldData" PAUSE_INGRESS = "PauseIngress" -class WarmStoragePropertiesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WarmStoragePropertiesState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This string represents the state of warm storage properties usage. It can be "Ok", "Error", "Unknown". """ diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/__init__.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/__init__.py index 0d700190757b..ddc9440f5ab4 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/__init__.py @@ -11,6 +11,8 @@ from ._event_sources_operations import EventSourcesOperations from ._reference_data_sets_operations import ReferenceDataSetsOperations from ._access_policies_operations import AccessPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'Operations', @@ -18,4 +20,6 @@ 'EventSourcesOperations', 'ReferenceDataSetsOperations', 'AccessPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_access_policies_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_access_policies_operations.py index 42ae133ef8ab..980d81b86acb 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_access_policies_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_access_policies_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,228 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace 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, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + access_policy_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "accessPolicyName": _SERIALIZER.url("access_policy_name", access_policy_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + access_policy_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "accessPolicyName": _SERIALIZER.url("access_policy_name", access_policy_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + access_policy_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "accessPolicyName": _SERIALIZER.url("access_policy_name", access_policy_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + access_policy_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "accessPolicyName": _SERIALIZER.url("access_policy_name", access_policy_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_environment_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class AccessPoliciesOperations(object): """AccessPoliciesOperations operations. @@ -44,15 +251,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - environment_name, # type: str - access_policy_name, # type: str - parameters, # type: "_models.AccessPolicyCreateOrUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessPolicyResource" + resource_group_name: str, + environment_name: str, + access_policy_name: str, + parameters: "_models.AccessPolicyCreateOrUpdateParameters", + **kwargs: Any + ) -> "_models.AccessPolicyResource": """Create or update an access policy in the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -74,34 +281,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AccessPolicyCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AccessPolicyCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -118,16 +321,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace def get( self, - resource_group_name, # type: str - environment_name, # type: str - access_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessPolicyResource" + resource_group_name: str, + environment_name: str, + access_policy_name: str, + **kwargs: Any + ) -> "_models.AccessPolicyResource": """Gets the access policy with the specified name in the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -148,29 +353,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -183,17 +385,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace def update( self, - resource_group_name, # type: str - environment_name, # type: str - access_policy_name, # type: str - access_policy_update_parameters, # type: "_models.AccessPolicyUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessPolicyResource" + resource_group_name: str, + environment_name: str, + access_policy_name: str, + access_policy_update_parameters: "_models.AccessPolicyUpdateParameters", + **kwargs: Any + ) -> "_models.AccessPolicyResource": """Updates the access policy with the specified name in the specified subscription, resource group, and environment. @@ -207,7 +411,8 @@ def update( :type access_policy_name: str :param access_policy_update_parameters: Request object that contains the updated information for the access policy. - :type access_policy_update_parameters: ~azure.mgmt.timeseriesinsights.models.AccessPolicyUpdateParameters + :type access_policy_update_parameters: + ~azure.mgmt.timeseriesinsights.models.AccessPolicyUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessPolicyResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource @@ -218,34 +423,30 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(access_policy_update_parameters, 'AccessPolicyUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(access_policy_update_parameters, 'AccessPolicyUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -258,16 +459,18 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore - def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - resource_group_name, # type: str - environment_name, # type: str - access_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + environment_name: str, + access_policy_name: str, + **kwargs: Any + ) -> None: """Deletes the access policy with the specified name in the specified subscription, resource group, and environment. @@ -289,29 +492,26 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + access_policy_name=access_policy_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -321,15 +521,16 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}"} # type: ignore + + @distributed_trace def list_by_environment( self, - resource_group_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessPolicyListResponse" + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.AccessPolicyListResponse": """Lists all the available access policies associated with the environment. :param resource_group_name: Name of an Azure Resource group. @@ -347,28 +548,25 @@ def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -381,4 +579,6 @@ def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py index 5a16cfc34bbd..5cc13c9e1648 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_environments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,24 +6,256 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + environment_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + environment_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class EnvironmentsOperations(object): """EnvironmentsOperations operations. @@ -48,44 +281,39 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, - resource_group_name, # type: str - environment_name, # type: str - parameters, # type: "_models.EnvironmentCreateOrUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EnvironmentResource"] + resource_group_name: str, + environment_name: str, + parameters: "_models.EnvironmentCreateOrUpdateParameters", + **kwargs: Any + ) -> Optional["_models.EnvironmentResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EnvironmentResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'EnvironmentCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'EnvironmentCreateOrUpdateParameters') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 404]: @@ -103,16 +331,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - environment_name, # type: str - parameters, # type: "_models.EnvironmentCreateOrUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentResource"] + resource_group_name: str, + environment_name: str, + parameters: "_models.EnvironmentCreateOrUpdateParameters", + **kwargs: Any + ) -> LROPoller["_models.EnvironmentResource"]: """Create or update an environment in the specified subscription and resource group. :param resource_group_name: Name of an Azure Resource group. @@ -123,14 +353,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentCreateOrUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either EnvironmentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] lro_delay = kwargs.pop( @@ -143,27 +379,22 @@ def begin_create_or_update( resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters, + api_version=api_version, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('EnvironmentResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -173,18 +404,18 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - environment_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentResource" + resource_group_name: str, + environment_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.EnvironmentResource": """Gets the environment with the specified name in the specified subscription and resource group. :param resource_group_name: Name of an Azure Resource group. @@ -193,7 +424,7 @@ def get( specified resource group. :type environment_name: str :param expand: Setting $expand=status will include the status of the internal services of the - environment in the Time Series Insights service. + environment in the Time Series Insights service. Default value is None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentResource, or the result of cls(response) @@ -205,30 +436,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -241,48 +468,45 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + def _update_initial( self, - resource_group_name, # type: str - environment_name, # type: str - environment_update_parameters, # type: "_models.EnvironmentUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentResource" + resource_group_name: str, + environment_name: str, + environment_update_parameters: "_models.EnvironmentUpdateParameters", + **kwargs: Any + ) -> "_models.EnvironmentResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(environment_update_parameters, 'EnvironmentUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(environment_update_parameters, 'EnvironmentUpdateParameters') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -295,16 +519,18 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - environment_name, # type: str - environment_update_parameters, # type: "_models.EnvironmentUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentResource"] + resource_group_name: str, + environment_name: str, + environment_update_parameters: "_models.EnvironmentUpdateParameters", + **kwargs: Any + ) -> LROPoller["_models.EnvironmentResource"]: """Updates the environment with the specified name in the specified subscription and resource group. @@ -315,17 +541,24 @@ def begin_update( :type environment_name: str :param environment_update_parameters: Request object that contains the updated information for the environment. - :type environment_update_parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentUpdateParameters + :type environment_update_parameters: + ~azure.mgmt.timeseriesinsights.models.EnvironmentUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either EnvironmentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] lro_delay = kwargs.pop( @@ -338,27 +571,22 @@ def begin_update( resource_group_name=resource_group_name, environment_name=environment_name, environment_update_parameters=environment_update_parameters, + api_version=api_version, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('EnvironmentResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -368,17 +596,17 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore - def delete( + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - resource_group_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> None: """Deletes the environment with the specified name in the specified subscription and resource group. @@ -397,28 +625,25 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -428,14 +653,15 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}"} # type: ignore + + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentListResponse" + resource_group_name: str, + **kwargs: Any + ) -> "_models.EnvironmentListResponse": """Lists all the available environments associated with the subscription and within the specified resource group. @@ -451,27 +677,24 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, '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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -484,13 +707,15 @@ def list_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments"} # type: ignore + + + @distributed_trace def list_by_subscription( self, - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentListResponse" + **kwargs: Any + ) -> "_models.EnvironmentListResponse": """Lists all the available environments within a subscription, irrespective of the resource groups. @@ -504,26 +729,23 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_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') + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -536,4 +758,6 @@ def list_by_subscription( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments'} # type: ignore + + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_event_sources_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_event_sources_operations.py index da58993e5842..68939765e6f2 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_event_sources_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_event_sources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,228 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace 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, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + event_source_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "eventSourceName": _SERIALIZER.url("event_source_name", event_source_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + event_source_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "eventSourceName": _SERIALIZER.url("event_source_name", event_source_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + event_source_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "eventSourceName": _SERIALIZER.url("event_source_name", event_source_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + event_source_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "eventSourceName": _SERIALIZER.url("event_source_name", event_source_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_environment_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class EventSourcesOperations(object): """EventSourcesOperations operations. @@ -44,15 +251,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - environment_name, # type: str - event_source_name, # type: str - parameters, # type: "_models.EventSourceCreateOrUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.EventSourceResource" + resource_group_name: str, + environment_name: str, + event_source_name: str, + parameters: "_models.EventSourceCreateOrUpdateParameters", + **kwargs: Any + ) -> "_models.EventSourceResource": """Create or update an event source under the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -74,34 +281,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'EventSourceCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'EventSourceCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -118,16 +321,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace def get( self, - resource_group_name, # type: str - environment_name, # type: str - event_source_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EventSourceResource" + resource_group_name: str, + environment_name: str, + event_source_name: str, + **kwargs: Any + ) -> "_models.EventSourceResource": """Gets the event source with the specified name in the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -148,29 +353,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -183,17 +385,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace def update( self, - resource_group_name, # type: str - environment_name, # type: str - event_source_name, # type: str - event_source_update_parameters, # type: "_models.EventSourceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.EventSourceResource" + resource_group_name: str, + environment_name: str, + event_source_name: str, + event_source_update_parameters: "_models.EventSourceUpdateParameters", + **kwargs: Any + ) -> "_models.EventSourceResource": """Updates the event source with the specified name in the specified subscription, resource group, and environment. @@ -207,7 +411,8 @@ def update( :type event_source_name: str :param event_source_update_parameters: Request object that contains the updated information for the event source. - :type event_source_update_parameters: ~azure.mgmt.timeseriesinsights.models.EventSourceUpdateParameters + :type event_source_update_parameters: + ~azure.mgmt.timeseriesinsights.models.EventSourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: EventSourceResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource @@ -218,34 +423,30 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(event_source_update_parameters, 'EventSourceUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(event_source_update_parameters, 'EventSourceUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -258,16 +459,18 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore - def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - resource_group_name, # type: str - environment_name, # type: str - event_source_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + environment_name: str, + event_source_name: str, + **kwargs: Any + ) -> None: """Deletes the event source with the specified name in the specified subscription, resource group, and environment. @@ -289,29 +492,26 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'eventSourceName': self._serialize.url("event_source_name", event_source_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + event_source_name=event_source_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -321,15 +521,16 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}"} # type: ignore + + @distributed_trace def list_by_environment( self, - resource_group_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EventSourceListResponse" + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.EventSourceListResponse": """Lists all the available event sources associated with the subscription and within the specified resource group and environment. @@ -348,28 +549,25 @@ def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -382,4 +580,6 @@ def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_operations.py index 64ef3e704292..2b44f690f01f 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,23 +6,50 @@ # 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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.TimeSeriesInsights/operations") + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,11 +73,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Lists all of the available Time Series Insights related operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,35 +85,36 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.timeseriesinsights.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - 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') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,7 +123,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,7 +136,8 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.TimeSeriesInsights/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.TimeSeriesInsights/operations"} # type: ignore diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_endpoint_connections_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..27052a4f7017 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,463 @@ +# pylint: disable=too-many-lines +# 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, Callable, Dict, Optional, TypeVar + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_environment_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: ~azure.mgmt.timeseriesinsights.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 + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a Private Endpoint connection of the environment in the given resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The definition of the private endpoint connection to + update. + :type private_endpoint_connection: + ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the details of the private endpoint connection of the environment in the given resource + group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + environment_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + """Disconnects the private endpoint connection and deletes it from the environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + + + @distributed_trace + def list_by_environment( + self, + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of all private endpoint connections in the given environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.timeseriesinsights.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateEndpointConnections"} # type: ignore + diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_link_resources_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..4bd83bd677df --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_private_link_resources_operations.py @@ -0,0 +1,168 @@ +# pylint: disable=too-many-lines +# 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, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_supported_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateLinkResources") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: ~azure.mgmt.timeseriesinsights.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 + + @distributed_trace + def list_supported( + self, + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> Iterable["_models.PrivateLinkResourceListResult"]: + """Gets a list of all supported private link resource types for the given environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights environment associated with the + specified resource group. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.timeseriesinsights.models.PrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_supported_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_supported.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_supported_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_supported.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/privateLinkResources"} # type: ignore diff --git a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_reference_data_sets_operations.py b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_reference_data_sets_operations.py index 9bbb96a9f750..0a1bdd5acc94 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_reference_data_sets_operations.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/operations/_reference_data_sets_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,228 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace 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, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "referenceDataSetName": _SERIALIZER.url("reference_data_set_name", reference_data_set_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "referenceDataSetName": _SERIALIZER.url("reference_data_set_name", reference_data_set_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "referenceDataSetName": _SERIALIZER.url("reference_data_set_name", reference_data_set_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + "referenceDataSetName": _SERIALIZER.url("reference_data_set_name", reference_data_set_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_environment_request( + subscription_id: str, + resource_group_name: str, + environment_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class ReferenceDataSetsOperations(object): """ReferenceDataSetsOperations operations. @@ -44,15 +251,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - environment_name, # type: str - reference_data_set_name, # type: str - parameters, # type: "_models.ReferenceDataSetCreateOrUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ReferenceDataSetResource" + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + parameters: "_models.ReferenceDataSetCreateOrUpdateParameters", + **kwargs: Any + ) -> "_models.ReferenceDataSetResource": """Create or update a reference data set in the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -63,7 +270,8 @@ def create_or_update( :param reference_data_set_name: Name of the reference data set. :type reference_data_set_name: str :param parameters: Parameters for creating a reference data set. - :type parameters: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters + :type parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ReferenceDataSetResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource @@ -74,34 +282,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]'), - } - 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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ReferenceDataSetCreateOrUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ReferenceDataSetCreateOrUpdateParameters') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -118,16 +322,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace def get( self, - resource_group_name, # type: str - environment_name, # type: str - reference_data_set_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReferenceDataSetResource" + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + **kwargs: Any + ) -> "_models.ReferenceDataSetResource": """Gets the reference data set with the specified name in the specified environment. :param resource_group_name: Name of an Azure Resource group. @@ -148,29 +354,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -183,17 +386,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace def update( self, - resource_group_name, # type: str - environment_name, # type: str - reference_data_set_name, # type: str - reference_data_set_update_parameters, # type: "_models.ReferenceDataSetUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ReferenceDataSetResource" + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + reference_data_set_update_parameters: "_models.ReferenceDataSetUpdateParameters", + **kwargs: Any + ) -> "_models.ReferenceDataSetResource": """Updates the reference data set with the specified name in the specified subscription, resource group, and environment. @@ -207,7 +412,8 @@ def update( :type reference_data_set_name: str :param reference_data_set_update_parameters: Request object that contains the updated information for the reference data set. - :type reference_data_set_update_parameters: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetUpdateParameters + :type reference_data_set_update_parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ReferenceDataSetResource, or the result of cls(response) :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource @@ -218,34 +424,30 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -258,16 +460,18 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore - def delete( + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - resource_group_name, # type: str - environment_name, # type: str - reference_data_set_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + environment_name: str, + reference_data_set_name: str, + **kwargs: Any + ) -> None: """Deletes the reference data set with the specified name in the specified subscription, resource group, and environment. @@ -289,29 +493,26 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), - 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + reference_data_set_name=reference_data_set_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -321,15 +522,16 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}"} # type: ignore + + @distributed_trace def list_by_environment( self, - resource_group_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReferenceDataSetListResponse" + resource_group_name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.ReferenceDataSetListResponse": """Lists all the available reference data sets associated with the subscription and within the specified resource group and environment. @@ -348,28 +550,25 @@ def list_by_environment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-15" - accept = "application/json" - - # Construct URL - url = self.list_by_environment.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'environmentName': self._serialize.url("environment_name", environment_name, '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') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-03-31-preview") # type: str + + + request = build_list_by_environment_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + environment_name=environment_name, + api_version=api_version, + template_url=self.list_by_environment.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -382,4 +581,6 @@ def list_by_environment( return cls(pipeline_response, deserialized, {}) return deserialized - list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets'} # type: ignore + + list_by_environment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets"} # type: ignore +