parameters:
    sso_webservice_token_usage.storeTime: 432000
    sso_webservice_token_usage.purgeProbability: 0.25
#    sso_webservice.example.class: Sso\WebserviceBundle\Example

services:

    webservice.feature_toggle.feature_toggle:
        class: Sso\WebserviceBundle\FeatureToggle\FeatureToggle
        arguments: [[], '@router.request_context', '@request_stack']

    webservice.service_command:
        class: Sso\WebserviceBundle\ServiceCommand
    firewall.api.manager:
        class: Sso\WebserviceBundle\Security\Api\Manager
        arguments: ["@service_container", "@webservice.error_handler.manager", "@sso_tools_user_identifier.api_controller", "@webservice.service_command"]
    firewall.authentication.listener:
        class: Sso\WebserviceBundle\Security\Firewall\WsFirewallListener
        arguments: ["@security.token_storage", "@security.authentication.manager", "@firewall.api.manager"]
    firewall.authentication.provider:
        class: Sso\WebserviceBundle\Security\Authentication\Provider\WsFirewallProvider
        arguments: ["", "@firewall.api.manager"]
    api.version.listener:
        class: Sso\WebserviceBundle\EventListener\ApiVersionListener
        arguments: [ "@logger", [1, 2, 3, 4, 5], "@webservice.service_command"] # List of valid api-versions
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest,  priority: 4500 }

    sso_webservice.api_mapper.index:
        class: Sso\WebserviceBundle\Api\Mapper\Index
        public: false

    sso_webservice.api_mapper.user_group_mapper:
        class: Sso\WebserviceBundle\Api\Mapper\UserGroupMapper
        public: true
        arguments:
            - '@sso_webservice.database_webservice.user_group'
            - '@logger'

    sso_webservice.database_webservice.user:
        class: Sso\WebserviceBundle\Database\Webservice\User
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'
            - '@password_crypt_repository'

    sso_webservice.database_webservice.firewall:
        class: Sso\WebserviceBundle\Database\Webservice\Firewall
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.user_application:
        class: Sso\WebserviceBundle\Database\Webservice\UserApplication
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.user_application_attribute:
        class: Sso\WebserviceBundle\Database\Webservice\UserApplicationAttribute
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.user_application_role:
        class: Sso\WebserviceBundle\Database\Webservice\UserApplicationRole
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.user_group:
        class: Sso\WebserviceBundle\Database\Webservice\UserGroup
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'
            - '@webservice.error_handler.handler'

    sso_webservice.database_webservice.application:
        class: Sso\WebserviceBundle\Database\Webservice\Application
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.role:
        class: Sso\WebserviceBundle\Database\Webservice\Role
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.attribute:
        class: Sso\WebserviceBundle\Database\Webservice\Attribute
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.attribute_value:
        class: Sso\WebserviceBundle\Database\Webservice\AttributeValue
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.password_policy:
        class: Sso\WebserviceBundle\Database\Webservice\PasswordPolicy
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.password_history:
        class: Sso\WebserviceBundle\Database\Webservice\PasswordHistory
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@validator'
            - '%database_webservice_readonly%'

    sso_webservice.database_webservice.manager:
        class: Sso\WebserviceBundle\Database\Webservice\Manager
        public: true
        arguments: ['@service_container']

    webservice.error_handler.manager:
        class: Sso\WebserviceBundle\ErrorHandler\Manager
        public: false
        arguments: ['@webservice.services.api_version_inflector','@jms_serializer', '@webservice.performance.listener', "@logger", priority: 7000]
    webservice.error_handler.handler:
        class: Sso\WebserviceBundle\ErrorHandler\ErrorHandler
        arguments: ["@webservice.error_handler.manager", "@jms_serializer", priority: 6000 ]
    webservice.exception.listener:
        class: Sso\WebserviceBundle\EventListener\ExceptionListener
        arguments: ["@webservice.error_handler.handler", "@logger"]
        tags:
            - { name: kernel.event_listener, event: kernel.exception, method: onKernelException, priority: 6000 }
    webservice.request.logger.listener:
        class: Sso\WebserviceBundle\EventListener\RequestLoggerListener
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onControllerRequest }
        arguments: ["@logger"]
    webservice.response.logger.listener:
        class: Sso\WebserviceBundle\EventListener\ResponseLoggerListener
        tags:
            - { name: kernel.event_listener, event: kernel.terminate, method: onControllerResponse }
        arguments: ["@logger", '@webservice.error_handler.handler']
    webservice.request.header.listener:
        class: Sso\WebserviceBundle\EventListener\RequestHeaderListener
        arguments: [ "@logger" ]
        tags:
            - { name: kernel.event_subscriber }
    webservice.performance.listener:
        class: Sso\WebserviceBundle\EventListener\PerformanceListener
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 5000 }
    sso_webservice.api.authorization_manager:
        class: Sso\WebserviceBundle\Api\AuthorizationManager
        public: true
        arguments: ['@security.token_storage']
    service_api_manager:
        class: Sso\WebserviceBundle\Api\Manager
        arguments: ["@service_container", "@logger"]
    service_database_manager:
        class: Sso\WebserviceBundle\Database\Manager
        arguments: ["@service_container", "@doctrine", "@validator", "%database_webservice_readonly%"]
    token_usage_log_rotate:
        class: Sso\WebserviceBundle\Logger\TokenUsage\LogrotateListener
        arguments: ["@service_container", "%database_webservice_readonly%", "%sso_webservice_token_usage.storeTime%", "%sso_webservice_token_usage.purgeProbability%"]
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onController }
    webservice.services.command_inflector:
        class: Sso\WebserviceBundle\Services\CommandInflector
        public: false
    webservice.services.command_handler:
        class: Sso\WebserviceBundle\Services\CommandHandler
        arguments: ['@service_api_manager', '@webservice.services.command_inflector', '@webservice.services.api_version_inflector']
    webservice.services.api_version_inflector:
        class: Sso\WebserviceBundle\Services\ApiVersionInflector
        arguments: ['@api.version.listener']

    sso_webservice.event.factory:
        class: Sso\WebserviceBundle\Event\Factory
        public: false

    sso_webservice.services_user_search_advanced_data_provider_doctrine.handler:
        class: Sso\WebserviceBundle\Services\UserSearch\Advanced\DataProvider\Doctrine\Handler
        public: true
        arguments:
            - '@event_dispatcher'
            - '@sso_webservice.event.factory'
            - '@doctrine.orm.webservice_entity_manager'
            - '@logger'

    sso_webservice.services_user_search_advanced_data_provider_elastica.handler:
        class: Sso\WebserviceBundle\Services\UserSearch\Advanced\DataProvider\Elastica\Handler
        public: true
        arguments:
            - '@doctrine.orm.webservice_entity_manager'
            - '@logger'

    webservice.services_user_search_advanced_data_provider.data_provider:
        class: Sso\WebserviceBundle\Services\UserSearch\Advanced\DataProvider\DataProvider
        arguments:
            - '@service_container'

    sso_webservice.generator_application_attribute.random_integer_generator:
        class: Sso\WebserviceBundle\Generator\ApplicationAttribute\RandomIntegerGenerator
        tags:
            - { name: sso_webservice.application_attribute_generator }

    sso_webservice.generator_application_attribute.uuid_generator:
        class: Sso\WebserviceBundle\Generator\ApplicationAttribute\UuidGenerator
        tags:
            - { name: sso_webservice.application_attribute_generator }

    sso_webservice.logger.process_details:
        class: Sso\WebserviceBundle\Logger\ProcessDetails

    sso_webservice.passwordpolicy.history.service:
        class: Sso\WebserviceBundle\Api\PasswordPolicy\History\Service
        arguments:
            - "@service_database_manager"
            - "@sso_webservice.passwordpolicy.policy.service"
            - "%webservice.password.policy.history.size%"
            - '@password_crypt_repository'

    sso_webservice.passwordpolicy.policy.service:
        class: Sso\WebserviceBundle\Api\PasswordPolicy\Policy\Service
        arguments:
            - "@service_database_manager"

    sso_webservice.passwordpolicy.policy.validator:
        class: Sso\WebserviceBundle\Api\PasswordPolicy\Policy\Validator
        arguments:
            - "@sso_webservice.passwordpolicy.policy.service"
            - "@sso_webservice.passwordpolicy.history.service"
            - "@service_database_manager"
            - "@request_stack"

    sso_webservice.validator_constraints.password_encrypt_type_validator:
        class: Sso\WebserviceBundle\Validator\Constraints\PasswordEncryptTypeValidator
        arguments: ['@password_crypt_repository']
        tags:
            - { name: validator.constraint_validator }

    sso_webservice.password_policy_validator:
        class: Sso\WebserviceBundle\Validator\Constraints\PasswordPolicyValidator
        arguments:
            - "@sso_webservice.passwordpolicy.policy.validator"
        tags:
            - { name: validator.constraint_validator, alias: sso_webservice.password_policy_validator }

    # Overwrite logger service to add real process details for db-logger
    life_style_tools_db_log.processor.process_details:
        alias: sso_webservice.logger.process_details

    sso_webservice.api_password_policy_user.service:
        class: Sso\WebserviceBundle\Api\PasswordPolicy\User\Service
        arguments: ['@service_database_manager']

    # custom jms serializer
    custom_serializer_static_factory:
        class: Sso\WebserviceBundle\Api\Serializer\SerializerManagerStaticFactory

    custom_serializer_datetime_insensitive:
        class:  JMS\Serializer\SerializerInterface
        factory: 'custom_serializer_static_factory:createDateTimeInsensitive'

    # Service Application-All
    sso_webservice.services_application_all_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\Application\All\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_application_all_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_application_all_request_version3.request_parser:
        class: Sso\WebserviceBundle\Services\Application\All\Request\Version3\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_application_all_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_application_all_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\Application\All\Request\RequestParserFactory
        public: false
        arguments: ['@service_container', '@webservice.services.api_version_inflector']

    sso_webservice.services_application_all_request_data.factory:
        class: Sso\WebserviceBundle\Services\Application\All\RequestData\Factory
        public: false

    sso_webservice.services_application_all_response_version2.factory:
        class: Sso\WebserviceBundle\Services\Application\All\Response\Version2\Factory
        public: false

    sso_webservice.services_application_all_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\Application\All\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_application_all_response_version2.factory'
            - '@webservice.error_handler.handler'
            - '@webservice.performance.listener'

    sso_webservice.services_application_all_response_version3.factory:
        class: Sso\WebserviceBundle\Services\Application\All\Response\Version3\Factory
        public: false

    sso_webservice.services_application_all_response_version3.response_builder:
        class: Sso\WebserviceBundle\Services\Application\All\Response\Version3\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_application_all_response_version3.factory'
            - '@webservice.error_handler.handler'
            - '@webservice.performance.listener'

    sso_webservice.services_application_all_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\Application\All\Response\ResponseBuilderFactory
        public: false
        arguments: ['@service_container', '@webservice.services.api_version_inflector']

    sso_webservice.services_application_all_response_data.factory:
        class: Sso\WebserviceBundle\Services\Application\All\ResponseData\Factory
        public: false

    sso_webservice.services_application_all.request_parser:
        class: Sso\WebserviceBundle\Services\Application\All\RequestParserInterface
        factory: 'sso_webservice.services_application_all_request.request_parser_factory:createRequestParser'

    sso_webservice.services_application_all.response_builder:
        class: Sso\WebserviceBundle\Services\Application\All\ResponseBuilderInterface
        factory: 'sso_webservice.services_application_all_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_application_all.handler:
        class: Sso\WebserviceBundle\Services\Application\All\Handler
        public: true
        arguments:
            - '@sso_webservice.services_application_all.request_parser'
            - '@sso_webservice.services_application_all.response_builder'
            - '@sso_webservice.services_application_all_response_data.factory'
            - '@=service("service_database_manager").webservice().application()'
            - '@webservice.error_handler.handler'
            - '@sso_webservice.security_authorisation.application_authorisation'

    # Service ApplicationAttribute Add
    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Request\Version2\RequestParser:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestData\Factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Request\RequestFactory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Request\RequestFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestParserInterface:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestParserInterface
        public: false
        factory: 'Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Request\RequestFactory:create'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestData\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestData\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\ResponseBuilderFactory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\Version2\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\Version2\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\Version2\ResponseBuilder:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@service_api_manager'
            - '@jms_serializer.serializer'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\Version2\Factory'
            - '@webservice.error_handler.handler'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseBuilderInterface:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseBuilderInterface
        public: false
        factory: 'Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Response\ResponseBuilderFactory:create'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseData\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseData\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Handler:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Add\Handler
        public: true
        arguments:
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Add\RequestParserInterface'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseBuilderInterface'
            - '@webservice.error_handler.handler'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Add\ResponseData\Factory'
            - '@sso_webservice.database_webservice.application'
            - '@sso_webservice.database_webservice.attribute'
            - '@validator'

    # Service ApplicationAttribute Show
    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Request\Version2\RequestParser:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestData\Factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Request\RequestFactory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Request\RequestFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestParserInterface:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestParserInterface
        public: false
        factory: 'Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Request\RequestFactory:create'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestData\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestData\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\ResponseBuilderFactory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\Version2\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\Version2\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\Version2\ResponseBuilder:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@service_api_manager'
            - '@jms_serializer.serializer'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\Version2\Factory'
            - '@webservice.error_handler.handler'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseBuilderInterface:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseBuilderInterface
        public: false
        factory: 'Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Response\ResponseBuilderFactory:create'

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseData\Factory:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseData\Factory
        public: false

    Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Handler:
        class: Sso\WebserviceBundle\Services\ApplicationAttribute\Show\Handler
        public: true
        arguments:
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Show\RequestParserInterface'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseBuilderInterface'
            - '@webservice.error_handler.handler'
            - '@Sso\WebserviceBundle\Services\ApplicationAttribute\Show\ResponseData\Factory'
            - '@sso_webservice.database_webservice.application'
            - '@sso_webservice.database_webservice.attribute'
            - '@validator'

    # Service UserApplicationAttribute Add
    sso_webservice.services_user_application_attribute_add_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Request\Version2\RequestParser
        arguments:
        - '@jms_serializer.serializer'
        - '@sso_webservice.services_user_application_attribute_add_request_data.factory'
        - '@webservice.error_handler.handler'
        - '@validator'

    sso_webservice.services_user_application_attribute_add_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Request\RequestParserFactory
        public: true
        arguments:
        - '@service_container'
        - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_application_attribute_add_request_data.factory:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\RequestData\Factory
        public: false

    sso_webservice.services_user_application_attribute_add_response_version2.factory:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Response\Version2\Factory
        public: false

    sso_webservice.services_user_application_attribute_add_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Response\Version2\ResponseBuilder
        public: true
        arguments:
        - '@jms_serializer.serializer'
        - '@sso_webservice.services_user_application_attribute_add_response_version2.factory'
        - '@webservice.error_handler.handler'
        - '@webservice.performance.listener'

    sso_webservice.services_user_application_attribute_add.request_parser:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\RequestParserInterface
        factory: 'sso_webservice.services_user_application_attribute_add_request.request_parser_factory:createRequestParser'

    sso_webservice.services_user_application_attribute_add_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Response\ResponseBuilderFactory
        public: false
        arguments:
        - '@service_container'
        - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_application_attribute_add.response_builder:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\ResponseBuilderInterface
        factory: 'sso_webservice.services_user_application_attribute_add_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_user_application_attribute_add.handler:
        class: Sso\WebserviceBundle\Services\UserApplicationAttribute\Add\Handler
        public: true
        arguments:
            - '@sso_webservice.services_user_application_attribute_add.request_parser'
            - '@sso_webservice.services_user_application_attribute_add.response_builder'
            - '@webservice.error_handler.handler'
            - '@=service("service_database_manager").webservice()'
            - '@sso_webservice.api.authorization_manager'
            - '@validator'

    # UserGroup
    sso_webservice.services_user_group_add_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_add_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_user_group_add_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Request\RequestParserFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_add_request_data.factory:
        public: false
        class: Sso\WebserviceBundle\Services\UserGroup\Add\RequestData\Factory

    sso_webservice.services_user_group_add_response_version2.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Response\Version2\Factory
        public: false
        arguments: ['@service_api_manager']

    sso_webservice.services_user_group_add_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_add_response_version2.factory'
            - '@webservice.error_handler.handler'

    sso_webservice.services_user_group_add_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_add_response_data.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\ResponseData\Factory
        public: false

    sso_webservice.services_user_group_add.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\RequestParserInterface
        public: false
        factory: 'sso_webservice.services_user_group_add_request.request_parser_factory:createRequestParser'

    sso_webservice.services_user_group_add.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\ResponseBuilderInterface
        public: false
        factory: 'sso_webservice.services_user_group_add_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_user_group_add.handler:
        class: Sso\WebserviceBundle\Services\UserGroup\Add\Handler
        arguments:
            - '@sso_webservice.services_user_group_add.request_parser'
            - '@sso_webservice.services_user_group_add.response_builder'
            - '@webservice.error_handler.handler'
            - '@sso_webservice.database_webservice.user_group'
            - '@sso_webservice.services_user_group_add_response_data.factory'
            - '@event_dispatcher'
            - '@sso_webservice.event.factory'


    sso_webservice.services_user_group_delete_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_delete_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_user_group_delete_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Request\RequestParserFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_delete_request_data.factory:
        public: false
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\RequestData\Factory

    sso_webservice.services_user_group_delete_response_version2.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Response\Version2\Factory
        public: false
        arguments: ['@service_api_manager']

    sso_webservice.services_user_group_delete_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_delete_response_version2.factory'
            - '@webservice.error_handler.handler'

    sso_webservice.services_user_group_delete_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_delete_response_data.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\ResponseData\Factory
        public: false

    sso_webservice.services_user_group_delete.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\RequestParserInterface
        public: false
        factory: 'sso_webservice.services_user_group_delete_request.request_parser_factory:createRequestParser'

    sso_webservice.services_user_group_delete.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\ResponseBuilderInterface
        public: false
        factory: 'sso_webservice.services_user_group_delete_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_user_group_delete.handler:
        class: Sso\WebserviceBundle\Services\UserGroup\Delete\Handler
        arguments:
            - '@sso_webservice.services_user_group_delete.request_parser'
            - '@sso_webservice.services_user_group_delete.response_builder'
            - '@webservice.error_handler.handler'
            - '@sso_webservice.database_webservice.user_group'
            - '@sso_webservice.services_user_group_delete_response_data.factory'
            - '@event_dispatcher'
            - '@sso_webservice.event.factory'


    sso_webservice.services_user_group_search_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_search_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_user_group_search_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Request\RequestParserFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_search_request_data.factory:
        public: false
        class: Sso\WebserviceBundle\Services\UserGroup\Search\RequestData\Factory

    sso_webservice.services_user_group_search_response_version2.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Response\Version2\Factory
        public: false
        arguments: ['@service_api_manager']

    sso_webservice.services_user_group_search_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_search_response_version2.factory'
            - '@webservice.error_handler.handler'

    sso_webservice.services_user_group_search_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_search_response_data.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\ResponseData\Factory
        public: false

    sso_webservice.services_user_group_search.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\RequestParserInterface
        public: false
        factory: 'sso_webservice.services_user_group_search_request.request_parser_factory:createRequestParser'

    sso_webservice.services_user_group_search.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\ResponseBuilderInterface
        public: false
        factory: 'sso_webservice.services_user_group_search_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_user_group_search.handler:
        class: Sso\WebserviceBundle\Services\UserGroup\Search\Handler
        arguments:
            - '@sso_webservice.services_user_group_search.request_parser'
            - '@sso_webservice.services_user_group_search.response_builder'
            - '@webservice.error_handler.handler'
            - '@sso_webservice.database_webservice.user_group'
            - '@sso_webservice.services_user_group_search_response_data.factory'
            - '@event_dispatcher'
            - '@sso_webservice.event.factory'


    sso_webservice.services_user_group_update_request_version2.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Request\Version2\RequestParser
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_update_request_data.factory'
            - '@webservice.error_handler.handler'
            - '@validator'

    sso_webservice.services_user_group_update_request.request_parser_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Request\RequestParserFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_update_request_data.factory:
        public: false
        class: Sso\WebserviceBundle\Services\UserGroup\Update\RequestData\Factory

    sso_webservice.services_user_group_update_response_version2.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Response\Version2\Factory
        public: false
        arguments: ['@service_api_manager']

    sso_webservice.services_user_group_update_response_version2.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Response\Version2\ResponseBuilder
        public: true
        arguments:
            - '@jms_serializer.serializer'
            - '@sso_webservice.services_user_group_update_response_version2.factory'
            - '@webservice.error_handler.handler'

    sso_webservice.services_user_group_update_response.response_builder_factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Response\ResponseBuilderFactory
        public: false
        arguments:
            - '@service_container'
            - '@webservice.services.api_version_inflector'

    sso_webservice.services_user_group_update_response_data.factory:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\ResponseData\Factory
        public: false

    sso_webservice.services_user_group_update.request_parser:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\RequestParserInterface
        public: false
        factory: 'sso_webservice.services_user_group_update_request.request_parser_factory:createRequestParser'

    sso_webservice.services_user_group_update.response_builder:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\ResponseBuilderInterface
        public: false
        factory: 'sso_webservice.services_user_group_update_response.response_builder_factory:createResponseBuilder'

    sso_webservice.services_user_group_update.handler:
        class: Sso\WebserviceBundle\Services\UserGroup\Update\Handler
        arguments:
            - '@sso_webservice.services_user_group_update.request_parser'
            - '@sso_webservice.services_user_group_update.response_builder'
            - '@webservice.error_handler.handler'
            - '@sso_webservice.database_webservice.user_group'
            - '@sso_webservice.services_user_group_update_response_data.factory'
            - '@event_dispatcher'
            - '@sso_webservice.event.factory'


    sso_webservice.security_authorisation.application_authorisation:
        class: Sso\WebserviceBundle\Security\Authorisation\ApplicationAuthorisation
        public: false
        arguments: ['@security.token_storage']

    sso_webservice.security_authorisation.user_authorization:
        class: Sso\WebserviceBundle\Security\Authorisation\UserAuthorization
        public: true
        arguments: ['@event_dispatcher', '@sso_webservice.event.factory']

    sso_webservice.security_configuration.access_configuration:
        class: Sso\WebserviceBundle\Security\Configuration\AccessConfiguration
        public: true
        arguments: ['', '']

    sso_webservice.validator_constraints.application_attribute_value_validator:
        class: Sso\WebserviceBundle\Validator\Constraints\ApplicationAttributeValueValidator
        tags:
            - { name: validator.constraint_validator }

    sso_webservice.validator_constraints.unique_user_group_validator:
        class: Sso\WebserviceBundle\Validator\Constraints\UniqueUserGroupValidator
        arguments:
            - '@sso_webservice.database_webservice.user_group'
        tags:
            - { name: validator.constraint_validator }

    # Password encryption
    sso_webservice.password_crypt.password_crypt_base64sha256:
        class: Sso\WebserviceBundle\PasswordCrypt\PasswordCryptBase64Sha256
        public: false
        tags:
            - { name: sso_webservice.password_crypter }

    sso_webservice.password_crypt.password_crypt_default:
        class: Sso\WebserviceBundle\PasswordCrypt\PasswordCryptDefault
        public: false
        tags:
            - { name: sso_webservice.password_crypter }

    sso_webservice.password_crypt.password_crypt_repository:
        public: false
        class: Sso\WebserviceBundle\PasswordCrypt\PasswordCryptRepository
        arguments: ['default']

    password_crypt_repository:
        alias: sso_webservice.password_crypt.password_crypt_repository
        public: true
