services:

  modeler_api.service:
    class: Drupal\modeler_api\Api
    arguments:
      - '@plugin.manager.modeler_api.model_owner'
      - '@plugin.manager.modeler_api.modeler'
      - '@config.factory'
      - '@config.storage.export'
      - '@file_system'
      - '@entity_type.manager'
      - '@router.route_provider'
      - '@plugin.manager.menu.link'

  logger.channel.modeler_api:
    parent: logger.channel_base
    arguments:
      - 'modeler_api'

  modeler_api.export.recipe:
    class: Drupal\modeler_api\ExportRecipe
    arguments:
      - '@config.storage.export'
      - '@file_system'
      - '@extension.list.module'
      - '@messenger'
      - '@modeler_api.service'

  modeler_api.update:
    class: Drupal\modeler_api\Update
    arguments:
      - '@entity_type.manager'
      - '@messenger'
      - '@plugin.manager.modeler_api.model_owner'

  plugin.manager.modeler_api.model_owner:
    class: Drupal\modeler_api\Plugin\ModelOwnerPluginManager
    parent: default_plugin_manager

  plugin.manager.modeler_api.modeler:
    class: Drupal\modeler_api\Plugin\ModelerPluginManager
    parent: default_plugin_manager

  modeler_api.param_converter:
    class: Drupal\modeler_api\ModelerApiConverter
    tags:
      - { name: paramconverter }

  # Fix autowiring for Hooks\EntityHooks.
  Drupal\modeler_api\Api: '@modeler_api.service'
  Drupal\modeler_api\Plugin\ModelOwnerPluginManager: '@plugin.manager.modeler_api.model_owner'
  Drupal\modeler_api\Plugin\ModelerPluginManager: '@plugin.manager.modeler_api.modeler'

  # @deprecated in modeler_api:1.0.0 and is removed in modeler_api:2.0.0 which will then only
  # support Drupal 11.2 and later, so that no BC layer like this will be required any more.
  # @see https://www.drupal.org/project/modeler_api/issues/3532644
  Drupal\modeler_api\Hook\EntityHooks:
    class: Drupal\modeler_api\Hook\EntityHooks
    autowire: true
