text: # coding=utf-8
  # --------------------------------------------------------------------------
  # Copyright (c) Microsoft Corporation. All rights reserved.
  # Licensed under the MIT License. See License.txt in the project root for license information.
  # Code generated by Microsoft (R) AutoRest Code Generator.
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
  # --------------------------------------------------------------------------
  from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
  import warnings
  
  from azure.core.async_paging import AsyncItemPaged, AsyncList
  from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
  from azure.core.pipeline import PipelineResponse
  from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
  from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller
  from azure.mgmt.core.exceptions import ARMErrorFormat
  from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
  
  from ... import models
  
  T = TypeVar('T')
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
  
  class IntegrationRuntimeOperations:
      """IntegrationRuntimeOperations 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: ~dfaz_management_client.models
      :param client: Client for service requests.
      :param config: Configuration of service client.
      :param serializer: An object model serializer.
      :param deserializer: An object model deserializer.
      """
  
      models = models
  
      def __init__(self, client, config, serializer, deserializer) -> None:
          self._client = client
          self._serialize = serializer
          self._deserialize = deserializer
          self._config = config
  
      def list_by_factory(
          self,
          resource_group_name: str,
          factory_name: str,
          **kwargs
      ) -> AsyncIterable["models.IntegrationRuntimeListResponse"]:
          """Lists integration runtimes.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either IntegrationRuntimeListResponse or the result of cls(response)
          :rtype: ~azure.core.async_paging.AsyncItemPaged[~dfaz_management_client.models.IntegrationRuntimeListResponse]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeListResponse"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          def prepare_request(next_link=None):
              if not next_link:
                  # Construct URL
                  url = self.list_by_factory.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
                      'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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')
  
              else:
                  url = next_link
                  query_parameters = {}  # type: Dict[str, Any]
              # Construct headers
              header_parameters = {}  # type: Dict[str, Any]
              header_parameters['Accept'] = 'application/json'
  
              # Construct and send request
              request = self._client.get(url, query_parameters, header_parameters)
              return request
  
          async def extract_data(pipeline_response):
              deserialized = self._deserialize('IntegrationRuntimeListResponse', pipeline_response)
              list_of_elem = deserialized.value
              if cls:
                  list_of_elem = cls(list_of_elem)
              return deserialized.next_link or None, AsyncList(list_of_elem)
  
          async def get_next(next_link=None):
              request = prepare_request(next_link)
  
              pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
              response = pipeline_response.http_response
  
              if response.status_code not in [200]:
                  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_by_factory.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes'}  # type: ignore
  
      async def create_or_update(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          properties: "models.IntegrationRuntime",
          if_match: Optional[str] = None,
          **kwargs
      ) -> "models.IntegrationRuntimeResource":
          """Creates or updates an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param properties: Integration runtime properties.
          :type properties: ~dfaz_management_client.models.IntegrationRuntime
          :param if_match: ETag of the integration runtime entity. Should only be specified for update,
           for which it should match existing entity or can be * for unconditional update.
          :type if_match: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeResource, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeResource
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeResource"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
  
          _integration_runtime = models.IntegrationRuntimeResource(properties=properties)
          api_version = "2018-06-01"
          content_type = kwargs.pop("content_type", "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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
          if if_match is not None:
              header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
          header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
          header_parameters['Accept'] = 'application/json'
  
          # Construct and send request
          body_content_kwargs = {}  # type: Dict[str, Any]
          body_content = self._serialize.body(_integration_runtime, 'IntegrationRuntimeResource')
          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)
          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('IntegrationRuntimeResource', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}'}  # type: ignore
  
      async def get(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          if_none_match: Optional[str] = None,
          **kwargs
      ) -> "models.IntegrationRuntimeResource":
          """Gets an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param if_none_match: ETag of the integration runtime entity. Should only be specified for get.
           If the ETag matches the existing entity tag, or if * was provided, then no content will be
           returned.
          :type if_none_match: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeResource, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeResource or None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeResource"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
          if if_none_match is not None:
              header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str')
          header_parameters['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.get(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 304]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              raise HttpResponseError(response=response, error_format=ARMErrorFormat)
  
          deserialized = None
          if response.status_code == 200:
              deserialized = self._deserialize('IntegrationRuntimeResource', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}'}  # type: ignore
  
      async def update(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          auto_update: Optional[Union[str, "models.IntegrationRuntimeAutoUpdate"]] = None,
          update_delay_offset: Optional[str] = None,
          **kwargs
      ) -> "models.IntegrationRuntimeResource":
          """Updates an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param auto_update: Enables or disables the auto-update feature of the self-hosted integration
           runtime. See https://go.microsoft.com/fwlink/?linkid=854189.
          :type auto_update: str or ~dfaz_management_client.models.IntegrationRuntimeAutoUpdate
          :param update_delay_offset: The time offset (in hours) in the day, e.g., PT03H is 3 hours. The
           integration runtime auto update will happen on that time.
          :type update_delay_offset: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeResource, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeResource
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeResource"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
  
          _update_integration_runtime_request = models.UpdateIntegrationRuntimeRequest(auto_update=auto_update, update_delay_offset=update_delay_offset)
          api_version = "2018-06-01"
          content_type = kwargs.pop("content_type", "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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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'] = 'application/json'
  
          # Construct and send request
          body_content_kwargs = {}  # type: Dict[str, Any]
          body_content = self._serialize.body(_update_integration_runtime_request, 'UpdateIntegrationRuntimeRequest')
          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)
          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('IntegrationRuntimeResource', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}'}  # type: ignore
  
      async def delete(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> None:
          """Deletes an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_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 = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
  
          # Construct and send request
          request = self._client.delete(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}'}  # type: ignore
  
      async def get_status(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeStatusResponse":
          """Gets detailed status information for an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeStatusResponse, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeStatusResponse
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeStatusResponse"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.get_status.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeStatusResponse', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/getStatus'}  # type: ignore
  
      async def get_connection_info(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeConnectionInfo":
          """Gets the on-premises integration runtime connection information for encrypting the on-premises data source credentials.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeConnectionInfo, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeConnectionInfo
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeConnectionInfo"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.get_connection_info.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeConnectionInfo', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_connection_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/getConnectionInfo'}  # type: ignore
  
      async def regenerate_auth_key(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          key_name: Optional[Union[str, "models.IntegrationRuntimeAuthKeyName"]] = None,
          **kwargs
      ) -> "models.IntegrationRuntimeAuthKeys":
          """Regenerates the authentication key for an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param key_name: The name of the authentication key to regenerate.
          :type key_name: str or ~dfaz_management_client.models.IntegrationRuntimeAuthKeyName
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeAuthKeys, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeAuthKeys
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeAuthKeys"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
  
          _regenerate_key_parameters = models.IntegrationRuntimeRegenerateKeyParameters(key_name=key_name)
          api_version = "2018-06-01"
          content_type = kwargs.pop("content_type", "application/json")
  
          # Construct URL
          url = self.regenerate_auth_key.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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'] = 'application/json'
  
          # Construct and send request
          body_content_kwargs = {}  # type: Dict[str, Any]
          body_content = self._serialize.body(_regenerate_key_parameters, 'IntegrationRuntimeRegenerateKeyParameters')
          body_content_kwargs['content'] = body_content
          request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
  
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeAuthKeys', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      regenerate_auth_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/regenerateAuthKey'}  # type: ignore
  
      async def list_auth_key(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeAuthKeys":
          """Retrieves the authentication keys for an integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeAuthKeys, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeAuthKeys
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeAuthKeys"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.list_auth_key.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeAuthKeys', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      list_auth_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/listAuthKeys'}  # type: ignore
  
      async def _start_initial(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeStatusResponse":
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeStatusResponse"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self._start_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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              raise HttpResponseError(response=response, error_format=ARMErrorFormat)
  
          deserialized = None
          if response.status_code == 200:
              deserialized = self._deserialize('IntegrationRuntimeStatusResponse', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/start'}  # type: ignore
  
      async def start(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeStatusResponse":
          """Starts a ManagedReserved type integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :keyword polling: True for ARMPolling, False for no polling, or a
           polling object for 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: IntegrationRuntimeStatusResponse, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeStatusResponse
          :raises ~azure.core.exceptions.HttpResponseError:
          """
          polling = kwargs.pop('polling', True)  # type: Union[bool, AsyncPollingMethod]
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeStatusResponse"]
          lro_delay = kwargs.pop(
              'polling_interval',
              self._config.polling_interval
          )
          raw_result = await self._start_initial(
              resource_group_name=resource_group_name,
              factory_name=factory_name,
              integration_runtime_name=integration_runtime_name,
              cls=lambda x,y,z: x,
              **kwargs
          )
  
          kwargs.pop('error_map', None)
          kwargs.pop('content_type', None)
  
          def get_long_running_output(pipeline_response):
              deserialized = self._deserialize('IntegrationRuntimeStatusResponse', pipeline_response)
  
              if cls:
                  return cls(pipeline_response, deserialized, {})
              return deserialized
  
          if polling is True: polling_method = AsyncARMPolling(lro_delay,  **kwargs)
          elif polling is False: polling_method = AsyncNoPolling()
          else: polling_method = polling
          return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
      start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/start'}  # type: ignore
  
      async def _stop_initial(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> None:
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self._stop_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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 202]:
              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, {})
  
      _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/stop'}  # type: ignore
  
      async def stop(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> None:
          """Stops a ManagedReserved type integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :keyword polling: True for ARMPolling, False for no polling, or a
           polling object for 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: None, or the result of cls(response)
          :rtype: None
          :raises ~azure.core.exceptions.HttpResponseError:
          """
          polling = kwargs.pop('polling', True)  # type: Union[bool, AsyncPollingMethod]
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
          lro_delay = kwargs.pop(
              'polling_interval',
              self._config.polling_interval
          )
          raw_result = await self._stop_initial(
              resource_group_name=resource_group_name,
              factory_name=factory_name,
              integration_runtime_name=integration_runtime_name,
              cls=lambda x,y,z: x,
              **kwargs
          )
  
          kwargs.pop('error_map', None)
          kwargs.pop('content_type', None)
  
          def get_long_running_output(pipeline_response):
              if cls:
                  return cls(pipeline_response, None, {})
  
          if polling is True: polling_method = AsyncARMPolling(lro_delay,  **kwargs)
          elif polling is False: polling_method = AsyncNoPolling()
          else: polling_method = polling
          return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
      stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/stop'}  # type: ignore
  
      async def sync_credentials(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> None:
          """Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_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 = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.sync_credentials.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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)
  
          if cls:
              return cls(pipeline_response, None, {})
  
      sync_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/syncCredentials'}  # type: ignore
  
      async def get_monitoring_data(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> "models.IntegrationRuntimeMonitoringData":
          """Get the integration runtime monitoring data, which includes the monitor data for all the nodes under this integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeMonitoringData, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeMonitoringData
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeMonitoringData"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.get_monitoring_data.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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['Accept'] = 'application/json'
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeMonitoringData', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_monitoring_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/monitoringData'}  # type: ignore
  
      async def upgrade(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          **kwargs
      ) -> None:
          """Upgrade self-hosted integration runtime to latest version if availability.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_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 = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2018-06-01"
  
          # Construct URL
          url = self.upgrade.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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]
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters)
          pipeline_response = await self._client._pipeline.run(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)
  
          if cls:
              return cls(pipeline_response, None, {})
  
      upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/upgrade'}  # type: ignore
  
      async def remove_link(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          linked_factory_name: str,
          **kwargs
      ) -> None:
          """Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param linked_factory_name: The data factory name for linked integration runtime.
          :type linked_factory_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 = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
  
          _linked_integration_runtime_request = models.LinkedIntegrationRuntimeRequest(linked_factory_name=linked_factory_name)
          api_version = "2018-06-01"
          content_type = kwargs.pop("content_type", "application/json")
  
          # Construct URL
          url = self.remove_link.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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')
  
          # Construct and send request
          body_content_kwargs = {}  # type: Dict[str, Any]
          body_content = self._serialize.body(_linked_integration_runtime_request, 'LinkedIntegrationRuntimeRequest')
          body_content_kwargs['content'] = body_content
          request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
  
          pipeline_response = await self._client._pipeline.run(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)
  
          if cls:
              return cls(pipeline_response, None, {})
  
      remove_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/removeLinks'}  # type: ignore
  
      async def create_linked_integration_runtime(
          self,
          resource_group_name: str,
          factory_name: str,
          integration_runtime_name: str,
          name: Optional[str] = None,
          subscription_id: Optional[str] = None,
          data_factory_name: Optional[str] = None,
          data_factory_location: Optional[str] = None,
          **kwargs
      ) -> "models.IntegrationRuntimeStatusResponse":
          """Create a linked integration runtime entry in a shared integration runtime.
  
          :param resource_group_name: The resource group name.
          :type resource_group_name: str
          :param factory_name: The factory name.
          :type factory_name: str
          :param integration_runtime_name: The integration runtime name.
          :type integration_runtime_name: str
          :param name: The name of the linked integration runtime.
          :type name: str
          :param subscription_id: The ID of the subscription that the linked integration runtime belongs
           to.
          :type subscription_id: str
          :param data_factory_name: The name of the data factory that the linked integration runtime
           belongs to.
          :type data_factory_name: str
          :param data_factory_location: The location of the data factory that the linked integration
           runtime belongs to.
          :type data_factory_location: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IntegrationRuntimeStatusResponse, or the result of cls(response)
          :rtype: ~dfaz_management_client.models.IntegrationRuntimeStatusResponse
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.IntegrationRuntimeStatusResponse"]
          error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
          error_map.update(kwargs.pop('error_map', {}))
  
          _create_linked_integration_runtime_request = models.CreateLinkedIntegrationRuntimeRequest(name=name, subscription_id=subscription_id, data_factory_name=data_factory_name, data_factory_location=data_factory_location)
          api_version = "2018-06-01"
          content_type = kwargs.pop("content_type", "application/json")
  
          # Construct URL
          url = self.create_linked_integration_runtime.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'),
              'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[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'] = 'application/json'
  
          # Construct and send request
          body_content_kwargs = {}  # type: Dict[str, Any]
          body_content = self._serialize.body(_create_linked_integration_runtime_request, 'CreateLinkedIntegrationRuntimeRequest')
          body_content_kwargs['content'] = body_content
          request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
  
          pipeline_response = await self._client._pipeline.run(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('IntegrationRuntimeStatusResponse', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_linked_integration_runtime.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/linkedIntegrationRuntime'}  # type: ignore
  