<?php

/**
 * Lifestyle Webconsulting GmbH
 *
 * LICENSE: This Software is the property of Lifestyle Webconsulting GmbH (Aschaffenburg, Germany)
 * and is private by copyright law - it is NOT Freeware.
 *
 * Any unauthorized use of this software without a valid license
 * is a violation of the license agreement and will be prosecuted by
 * civil and criminal law.
 *
 * @copyright  2016 Lifestyle Webconsulting GmbH
 * @link       http://www.life-style.de
 */

namespace Sso\WebserviceBundle\Services\UserSearch\FindByApplicationRole\Response\Version2;

use Sso\WebserviceBundle\Api\ApiManagerInterface;

/**
 * Class Factory
 *
 * @copyright  2016 Lifestyle Webconsulting GmbH
 * @link       http://www.life-style.de
 * @package Sso\WebserviceBundle\Services\UserSearch\FindByApplicationRole\Response\Version2
 */
final class Factory
{
    /**
     * @var ApiManagerInterface
     */
    private $apiM;

    /**
     * Factory constructor.
     * @param ApiManagerInterface $apiM
     */
    public function __construct(ApiManagerInterface $apiM)
    {
        $this->apiM = $apiM;
    }

    /**
     * @return ResponseBuilder
     */
    public function responseBuilder()
    {
        return new ResponseBuilder($this->apiM->serializer(), $this, $this->apiM->errorHandler());
    }

    /**
     * @return Response
     */
    public function response()
    {
        return new Response();
    }

    /**
     * @return FindByApplicationRole
     */
    public function findByApplicationRole()
    {
        return new FindByApplicationRole();
    }

    /**
     * @return UserSearch
     */
    public function userSearch()
    {
        return new UserSearch();
    }

    /**
     * @return UserType
     */
    public function userType()
    {
        return new UserType();
    }


    /**
     * @return double
     */
    public function scriptTimeSeconds(){
        return $this->apiM->scriptTimeSeconds();
    }

    /**
     * @return ApiManagerInterface
     */
    public function apiM(){
        return $this->apiM;
    }
}
