<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- AU logger configuration -->
    <virtualType name="CyberSourceAccountUpdaterLog" type="CyberSource\Core\Model\Logger">
        <arguments>
            <argument name="handlers"  xsi:type="array">
                <item name="cybs" xsi:type="object">CyberSourceAccountUpdaterLogHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="CyberSourceAccountUpdaterLogHandler" type="Magento\Framework\Logger\Handler\Base">
        <arguments>
            <argument name="fileName" xsi:type="string">/var/log/cybs.au.log</argument>
        </arguments>
    </virtualType>

    <!-- Injecting logger -->
    <type name="CyberSource\AccountUpdater\Cron\Updater">
        <arguments>
            <argument name="logger" xsi:type="object">CyberSourceAccountUpdaterLog</argument>
        </arguments>
    </type>
    <type name="CyberSource\AccountUpdater\Model\Report\Downloader">
        <arguments>
            <argument name="logger" xsi:type="object">CyberSourceAccountUpdaterLog</argument>
        </arguments>
    </type>
    <type name="CyberSource\AccountUpdater\Model\Report\Processor">
        <arguments>
            <argument name="logger" xsi:type="object">CyberSourceAccountUpdaterLog</argument>
        </arguments>
    </type>

    <preference for="CyberSource\AccountUpdater\Model\Report\DownloaderInterface" type="CyberSource\AccountUpdater\Model\Report\DownloaderSfs"/>

    <type name="CyberSource\AccountUpdater\Model\Report\DownloaderSfs">
        <arguments>
            <argument name="getFileListCommand" xsi:type="object">CyberSourceAuSecureFileShareGetListCommand</argument>
            <argument name="getFileCommand" xsi:type="object">CyberSourceAuSecureFileShareGetFileCommand</argument>
        </arguments>
    </type>

    <virtualType name="CyberSourceAuSecureFileShareGetFileClient" type="CyberSourceCoreSecureFileShareGetFileClient">
        <arguments>
            <argument name="logger" xsi:type="object">CyberSourceAccountUpdaterLog</argument>
        </arguments>
    </virtualType>

    <virtualType name="CyberSourceAuSecureFileShareGetListClient" type="CyberSourceCoreSecureFileShareGetListClient">
        <arguments>
            <argument name="logger" xsi:type="object">CyberSourceAccountUpdaterLog</argument>
        </arguments>
    </virtualType>

    <virtualType name="CyberSourceAuSecureFileShareGetFileCommand" type="CyberSourceCoreSecureFileShareGetFileCommand">
        <arguments>
            <argument name="client" xsi:type="object">CyberSourceAuSecureFileShareGetFileClient</argument>
        </arguments>
    </virtualType>

    <virtualType name="CyberSourceAuSecureFileShareGetListCommand" type="CyberSourceCoreSecureFileShareGetListCommand">
        <arguments>
            <argument name="client" xsi:type="object">CyberSourceAuSecureFileShareGetListClient</argument>
        </arguments>
    </virtualType>

</config>
