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..6bc691a47a72 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._time_series_insights_client import TimeSeriesInsightsClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['TimeSeriesInsightsClient'] try: 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..5f4e4a769d31 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class TimeSeriesInsightsClientConfiguration(Configuration): """Configuration for TimeSeriesInsightsClient. 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..0cae0cf08d85 --- /dev/null +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/_metadata.json @@ -0,0 +1,65 @@ +{ + "chosen_version": "2020-05-15", + "total_api_version_list": ["2020-05-15"], + "client": { + "name": "TimeSeriesInsightsClient", + "filename": "_time_series_insights_client", + "description": "Time Series Insights client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "operations": "Operations", + "environments": "EnvironmentsOperations", + "event_sources": "EventSourcesOperations", + "reference_data_sets": "ReferenceDataSetsOperations", + "access_policies": "AccessPoliciesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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..0f8eca2e7e0d 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 @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class TimeSeriesInsightsClientConfiguration(Configuration): """Configuration for TimeSeriesInsightsClient. 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 a184d23c7387..ff67c1c316a1 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 @@ -5,7 +5,7 @@ # 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, List, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -184,8 +184,7 @@ async def update( resource_group_name: str, environment_name: str, access_policy_name: str, - description: Optional[str] = None, - roles: Optional[List[Union[str, "_models.AccessPolicyRole"]]] = None, + access_policy_update_parameters: "_models.AccessPolicyUpdateParameters", **kwargs ) -> "_models.AccessPolicyResource": """Updates the access policy with the specified name in the specified subscription, resource @@ -199,10 +198,9 @@ async def update( :param access_policy_name: The name of the Time Series Insights access policy associated with the specified environment. :type access_policy_name: 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] + :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 :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 @@ -213,8 +211,6 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _access_policy_update_parameters = _models.AccessPolicyUpdateParameters(description=description, roles=roles) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -239,7 +235,7 @@ async def update( 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 = 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) 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 2220dce9df5d..cea17e2e20e8 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 @@ -240,7 +240,7 @@ async def _update_initial( self, resource_group_name: str, environment_name: str, - tags: Optional[Dict[str, str]] = None, + environment_update_parameters: "_models.EnvironmentUpdateParameters", **kwargs ) -> "_models.EnvironmentResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"] @@ -248,8 +248,6 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _environment_update_parameters = _models.EnvironmentUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -273,7 +271,7 @@ async def _update_initial( 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 = 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) @@ -295,7 +293,7 @@ async def begin_update( self, resource_group_name: str, environment_name: str, - tags: Optional[Dict[str, str]] = None, + environment_update_parameters: "_models.EnvironmentUpdateParameters", **kwargs ) -> AsyncLROPoller["_models.EnvironmentResource"]: """Updates the environment with the specified name in the specified subscription and resource @@ -306,8 +304,9 @@ async def begin_update( :param environment_name: The name of the Time Series Insights environment associated with the specified resource group. :type environment_name: str - :param tags: Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] + :param environment_update_parameters: Request object that contains the updated information for + the environment. + :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 @@ -329,7 +328,7 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, environment_name=environment_name, - tags=tags, + environment_update_parameters=environment_update_parameters, cls=lambda x,y,z: x, **kwargs ) 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 e4b1d9dad7d5..69811dff9248 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 @@ -184,7 +184,7 @@ async def update( resource_group_name: str, environment_name: str, event_source_name: str, - tags: Optional[Dict[str, str]] = None, + event_source_update_parameters: "_models.EventSourceUpdateParameters", **kwargs ) -> "_models.EventSourceResource": """Updates the event source with the specified name in the specified subscription, resource group, @@ -198,8 +198,9 @@ async def update( :param event_source_name: The name of the Time Series Insights event source associated with the specified environment. :type event_source_name: str - :param tags: Key-value pairs of additional properties for the event source. - :type tags: dict[str, 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 :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 @@ -210,8 +211,6 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _event_source_update_parameters = _models.EventSourceUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -236,7 +235,7 @@ async def update( 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 = 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) 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 8ac387246c9a..b6acba43c5b5 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 @@ -184,7 +184,7 @@ async def update( resource_group_name: str, environment_name: str, reference_data_set_name: str, - tags: Optional[Dict[str, str]] = None, + reference_data_set_update_parameters: "_models.ReferenceDataSetUpdateParameters", **kwargs ) -> "_models.ReferenceDataSetResource": """Updates the reference data set with the specified name in the specified subscription, resource @@ -198,8 +198,9 @@ async def update( :param reference_data_set_name: The name of the Time Series Insights reference data set associated with the specified environment. :type reference_data_set_name: str - :param tags: Key-value pairs of additional properties for the reference data set. - :type tags: dict[str, 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 :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 @@ -210,8 +211,6 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _reference_data_set_update_parameters = _models.ReferenceDataSetUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -236,7 +235,7 @@ async def update( 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 = 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) 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 index 99d943a95b68..750c442e7d12 100644 --- a/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py +++ b/sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_models.py @@ -602,19 +602,37 @@ def __init__( 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) @@ -1165,25 +1183,48 @@ def __init__( 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 @@ -1201,7 +1242,12 @@ class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): :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'}, @@ -1213,6 +1259,7 @@ def __init__( **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) @@ -1516,6 +1563,11 @@ 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. + + :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. @@ -1532,7 +1584,12 @@ class Gen1EnvironmentUpdateParameters(EnvironmentUpdateParameters): ~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'}, @@ -1544,6 +1601,7 @@ def __init__( **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) @@ -1782,6 +1840,11 @@ def __init__( 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 @@ -1795,7 +1858,12 @@ class Gen2EnvironmentUpdateParameters(EnvironmentUpdateParameters): ~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'}, @@ -1806,6 +1874,7 @@ def __init__( **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) @@ -2317,6 +2386,11 @@ def __init__( 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 @@ -2334,7 +2408,12 @@ class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): :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'}, @@ -2346,6 +2425,7 @@ def __init__( **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) 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 917b95d5c9bc..2102041f2624 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 @@ -649,14 +649,31 @@ def __init__( 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, *, @@ -664,6 +681,7 @@ def __init__( **kwargs ): super(EnvironmentUpdateParameters, self).__init__(**kwargs) + self.kind = None # type: Optional[str] self.tags = tags @@ -1270,14 +1288,31 @@ def __init__( 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, *, @@ -1285,12 +1320,18 @@ def __init__( **kwargs ): super(EventSourceUpdateParameters, self).__init__(**kwargs) + self.kind = None # type: Optional[str] self.tags = tags 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 @@ -1308,7 +1349,12 @@ class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): :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'}, @@ -1325,6 +1371,7 @@ def __init__( **kwargs ): 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 @@ -1652,6 +1699,11 @@ 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. + + :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. @@ -1668,7 +1720,12 @@ class Gen1EnvironmentUpdateParameters(EnvironmentUpdateParameters): ~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'}, @@ -1685,6 +1742,7 @@ def __init__( **kwargs ): super(Gen1EnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.kind = 'Gen1' # type: str self.sku = sku self.data_retention_time = data_retention_time self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior @@ -1941,6 +1999,11 @@ def __init__( 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 @@ -1954,7 +2017,12 @@ class Gen2EnvironmentUpdateParameters(EnvironmentUpdateParameters): ~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'}, @@ -1969,6 +2037,7 @@ def __init__( **kwargs ): super(Gen2EnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.kind = 'Gen2' # type: str self.storage_configuration = storage_configuration self.warm_store_configuration = warm_store_configuration @@ -2530,6 +2599,11 @@ def __init__( 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 @@ -2547,7 +2621,12 @@ class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): :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'}, @@ -2564,6 +2643,7 @@ def __init__( **kwargs ): 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 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 7fb813276cf0..42ae133ef8ab 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 @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -190,8 +190,7 @@ def update( resource_group_name, # type: str environment_name, # type: str access_policy_name, # type: str - description=None, # type: Optional[str] - roles=None, # type: Optional[List[Union[str, "_models.AccessPolicyRole"]]] + access_policy_update_parameters, # type: "_models.AccessPolicyUpdateParameters" **kwargs # type: Any ): # type: (...) -> "_models.AccessPolicyResource" @@ -206,10 +205,9 @@ def update( :param access_policy_name: The name of the Time Series Insights access policy associated with the specified environment. :type access_policy_name: 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] + :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 :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 @@ -220,8 +218,6 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _access_policy_update_parameters = _models.AccessPolicyUpdateParameters(description=description, roles=roles) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -246,7 +242,7 @@ def update( 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 = 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) 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 b551e828d3f8..5a16cfc34bbd 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 @@ -247,7 +247,7 @@ def _update_initial( self, resource_group_name, # type: str environment_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + environment_update_parameters, # type: "_models.EnvironmentUpdateParameters" **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentResource" @@ -256,8 +256,6 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _environment_update_parameters = _models.EnvironmentUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -281,7 +279,7 @@ def _update_initial( 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 = 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) @@ -303,7 +301,7 @@ def begin_update( self, resource_group_name, # type: str environment_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + environment_update_parameters, # type: "_models.EnvironmentUpdateParameters" **kwargs # type: Any ): # type: (...) -> LROPoller["_models.EnvironmentResource"] @@ -315,8 +313,9 @@ def begin_update( :param environment_name: The name of the Time Series Insights environment associated with the specified resource group. :type environment_name: str - :param tags: Key-value pairs of additional properties for the environment. - :type tags: dict[str, str] + :param environment_update_parameters: Request object that contains the updated information for + the environment. + :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 @@ -338,7 +337,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, environment_name=environment_name, - tags=tags, + environment_update_parameters=environment_update_parameters, cls=lambda x,y,z: x, **kwargs ) 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 2acdaac2e72d..da58993e5842 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 @@ -190,7 +190,7 @@ def update( resource_group_name, # type: str environment_name, # type: str event_source_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + event_source_update_parameters, # type: "_models.EventSourceUpdateParameters" **kwargs # type: Any ): # type: (...) -> "_models.EventSourceResource" @@ -205,8 +205,9 @@ def update( :param event_source_name: The name of the Time Series Insights event source associated with the specified environment. :type event_source_name: str - :param tags: Key-value pairs of additional properties for the event source. - :type tags: dict[str, 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 :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 @@ -217,8 +218,6 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _event_source_update_parameters = _models.EventSourceUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -243,7 +242,7 @@ def update( 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 = 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) 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 9edcde5e9181..9bbb96a9f750 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 @@ -190,7 +190,7 @@ def update( resource_group_name, # type: str environment_name, # type: str reference_data_set_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + reference_data_set_update_parameters, # type: "_models.ReferenceDataSetUpdateParameters" **kwargs # type: Any ): # type: (...) -> "_models.ReferenceDataSetResource" @@ -205,8 +205,9 @@ def update( :param reference_data_set_name: The name of the Time Series Insights reference data set associated with the specified environment. :type reference_data_set_name: str - :param tags: Key-value pairs of additional properties for the reference data set. - :type tags: dict[str, 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 :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 @@ -217,8 +218,6 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _reference_data_set_update_parameters = _models.ReferenceDataSetUpdateParameters(tags=tags) api_version = "2020-05-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -243,7 +242,7 @@ def update( 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 = 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)