marketo_ma-8.x-2.x-dev/marketo_ma.services.yml
marketo_ma.services.yml
services:
# The Marketo MA default service (Worker/Core).
marketo_ma:
class: Drupal\marketo_ma\Service\MarketoMaService
arguments: ['@config.factory', '@marketo_ma.api_client', '@queue', '@module_handler']
# Marketo client secrets.
marketo_ma.secrets:
class: Drupal\marketo_ma\Secrets\SecretsInterface
# the first argument is the class and the second argument is the static method
factory: ['@marketo_ma.secrets_factory', 'createSecrets']
marketo_ma.secrets_factory:
class: Drupal\marketo_ma\Secrets\SecretsFactory
arguments: ['@module_handler']
# The Marketo MA API Client service.
# @todo It would be nice to have some from of cached client, which caches for
# example the field mapping along the way.
marketo_ma.api_client:
class: Drupal\marketo_ma\Service\MarketoMaApiClient
arguments: ['@marketo_ma.rest.lead.leads', '@marketo_ma.rest.lead.activities', '@logger.channel.marketo_ma']
# The Marketo MA munchkin service
marketo_ma.munchkin:
class: Drupal\marketo_ma\Service\MarketoMaMunchkin
arguments: ['@config.factory', '@marketo_ma.secrets']
# The Marketo MA logger.
logger.channel.marketo_ma:
parent: logger.channel_base
arguments: ['marketo_ma']
# Page attachment service.
marketo_ma.page_attachment:
class: Drupal\marketo_ma\PageAttachment
arguments: ['@config.factory', '@current_user', '@path.matcher', '@marketo_ma.munchkin', '@tempstore.private', '@path.current', '@request_stack']
calls:
- [setAliasManager, ['@?path_alias.manager']]
# Generic rest configuration for the client.
marketo_ma.rest.config:
class: Drupal\marketo_ma\Rest\Config
arguments: ['@config.factory', '@marketo_ma.secrets']
marketo_ma.rest.client:
class: GuzzleHttp\Client
factory: ['NecLimDul\MarketoRest\ClientFactory', 'createOauthClient']
arguments: ['@marketo_ma.rest.config']
# Lead API Configuration.
marketo_ma.rest.lead.config:
class: Drupal\marketo_ma\Rest\LeadConfig
arguments: ['@config.factory']
marketo_ma.rest.lead.leads:
class: NecLimDul\MarketoRest\Hacks\API\LeadsApi
arguments: ['@marketo_ma.rest.client', '@marketo_ma.rest.lead.config']
marketo_ma.rest.lead.activities:
class: NecLimDul\MarketoRest\Hacks\API\ActivitiesApi
arguments: ['@marketo_ma.rest.client', '@marketo_ma.rest.lead.config']
