code: def restore_webhooks(self, trigger_types, project, provider_name, service_endpoint_id=None, repository=None):
          
          route_values = {}
          if project is not None:
              route_values['project'] = self._serialize.url('project', project, 'str')
          if provider_name is not None:
              route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str')
          query_parameters = {}
          if service_endpoint_id is not None:
              query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str')
          if repository is not None:
              query_parameters['repository'] = self._serialize.query('repository', repository, 'str')
          content = self._serialize.body(trigger_types, '[DefinitionTriggerType]')
          self._send(http_method='POST',
                     location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478',
                     version='5.0-preview.1',
                     route_values=route_values,
                     query_parameters=query_parameters,
                     content=content)
docs: RestoreWebhooks.
          [Preview API] Recreates the webhooks for the specified triggers in the given source code repository.
          :param [DefinitionTriggerType] trigger_types: The types of triggers to restore webhooks for.
          :param str project: Project ID or project name
          :param str provider_name: The name of the source provider.
          :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
          :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.