<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Api
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <api>
        <adapter_aliases>
            <v2_soap>
                <suggest_class>Mage_Api_Helper_Data</suggest_class>
                <suggest_method>getV2AdapterCode</suggest_method>
            </v2_soap>
        </adapter_aliases>
        <adapters>
            <soap>
                <model>api/server_adapter_soap</model>
                <handler>default</handler>
                <active>1</active>
                <required>
                    <extensions>
                        <soap />
                    </extensions>
                </required>
            </soap>
            <soap_v2>
                <model>api/server_v2_adapter_soap</model>
                <handler>soap_v2</handler>
                <active>1</active>
                <required>
                    <extensions>
                        <soap />
                    </extensions>
                </required>
            </soap_v2>
            <soap_wsi>
                <model>api/server_wsi_adapter_soap</model>
                <handler>soap_wsi</handler>
                <active>1</active>
                <required>
                    <extensions>
                        <soap />
                    </extensions>
                </required>
            </soap_wsi>
            <xmlrpc>
                <model>api/server_adapter_xmlrpc</model>
                <handler>default</handler>
                <active>1</active>
            </xmlrpc>
            <default>
                <use>soap</use>
            </default>
        </adapters>
        <handlers>
            <default>
                <model>api/server_handler</model>
            </default>
            <soap_v2>
                <model>api/server_v2_handler</model>
            </soap_v2>
            <soap_wsi>
                <model>api/server_wsi_handler</model>
            </soap_wsi>
        </handlers>
        <resources>
        </resources>
        <resources_alias>
        </resources_alias>
        <v2>
            <wsdl>
                <prefix>
                    <wsdl>http://schemas.xmlsoap.org/wsdl/</wsdl>
                </prefix>
            </wsdl>
        </v2>
        <faults>
            <unknown>
                <code>0</code>
                <message>Unknown Error</message>
            </unknown>
            <internal>
                <code>1</code>
                <message>Internal Error. Please see log for details.</message>
            </internal>
            <access_denied>
                <code>2</code>
                <message>Access denied.</message>
            </access_denied>
            <resource_path_invalid>
                <code>3</code>
                <message>Invalid api path.</message>
            </resource_path_invalid>
            <resource_path_not_callable>
                <code>4</code>
                <message>Resource path is not callable.</message>
            </resource_path_not_callable>
            <session_expired>
                <code>5</code>
                <message>Session expired. Try to relogin.</message>
            </session_expired>
            <invalid_request_param>
                <code>6</code>
                <message>Required parameter is missing, for more details see "exception.log".</message>
            </invalid_request_param>
        </faults>
        <acl>
            <asserts>
                <ip><class>Mage_Api_Model_Acl_Assert_Ip</class></ip>
                <time><class>Mage_Api_Model_Acl_Assert_Time</class></time>
            </asserts>

            <resources>
                <all>
                </all>
            </resources>

            <privilegeSets>
                <default>
                    <view descr="View entity"/>
                    <edit descr="Edit entity"/>
                    <delete descr="Delete entity"/>
                    <create descr="Create entity"/>
                </default>
            </privilegeSets>
        </acl>

        <domain_messages>
            <!-- module name -->
            <core>
                <!-- 200 -->
                <success>
                    <ok>Request is executed.</ok>
                </success>
                <!-- 201 -->
                <created>
                    <created>Request is executed. Created new resource.</created>
                </created>
                <!-- 202 -->
                <processing>
                    <processing>Request is carried out.</processing>
                </processing>
                <!-- 400 -->
                <validation>
                    <invalid_param>Parameter "%s" is not valid.</invalid_param>
                </validation>
                <!-- 400 -->
                <request_error>
                    <!-- Client sent wrong API version -->
                    <invalid_api_version>API version "%s" not found.</invalid_api_version>
                </request_error>
                <!-- 401 -->
                <authentication>
                    <protect_resource>You must provide an authenticated user for this method.</protect_resource>
                    <invalid_token>Token in request is not valid.</invalid_token>
                </authentication>
                <!-- 403 -->
                <forbidden>
                    <api_key_invalid>Invalid API key</api_key_invalid>
                </forbidden>
                <!-- 404 -->
                <not_found>
                    <item_not_found>Requested item %s not found.</item_not_found>
                    <resource_not_found>Requested resource %s not found.</resource_not_found>
                </not_found>
                <!-- 405 -->
                <not_allowed>
                    <method_not_allowed>Method "%s" is not allowed.</method_not_allowed>
                </not_allowed>
                <!-- 406 -->
                <not_acceptable>
                    <api_version_required>Api version is required.</api_version_required>
                </not_acceptable>
                <!-- 410 -->
                <gone>
                    <!-- Message when client trying sent the API version which no longer maintained -->
                    <api_deprecated>API version "%s" is deprecated.</api_deprecated>
                    <!-- Message when client trying request the resource which no longer maintained -->
                    <deprecated>Resource "%s" is deprecated.</deprecated>
                </gone>

                <!-- 500 -->
                <internal_error>
                    <!-- Code error message not found or not exist -->
                    <unknown_error>There was unknown error while processing your request.</unknown_error>
                    <!-- Internal error when server catch some exception or language error -->
                    <internal_error>There was internal error while processing your request.</internal_error>
                    <!-- Developer mode message about error -->
                    <code_error>Server has internal error. %s: %s</code_error>
                </internal_error>
                <!-- 501 -->
                <not_implemented>
                    <resource_not_implemented>This resource is not implemented so far.</resource_not_implemented>
                    <method_not_implemented>This method is not implemented so far.</method_not_implemented>
                </not_implemented>
            </core>
        </domain_messages>

        <!-- Message Domains with relation to HTTP codes -->
        <!-- The priority for domains is the HTTP code -->
        <domain_codes>
            <!-- All success messages except "entry_created", "processing" -->
            <success>
                <http_code>200</http_code>
                <type>notification</type>
            </success>
            <!-- Messages when created new entry -->
            <created>
                <http_code>201</http_code>
                <type>notification</type>
            </created>
            <!-- Processing messages -->
            <processing>
                <http_code>202</http_code>
                <type>notification</type>
            </processing>

            <!-- Validation messages -->
            <validation>
                <http_code>400</http_code>
                <type>error</type>
            </validation>
            <!-- Messages when the request from a client has an error -->
            <request_error>
                <http_code>400</http_code>
                <type>error</type>
            </request_error>
            <!-- Authentication error messages -->
            <authentication>
                <http_code>401</http_code>
                <type>error</type>
            </authentication>
            <!-- Messages when post request is accepted but cannot performed -->
            <forbidden>
                <http_code>403</http_code>
                <type>error</type>
            </forbidden>
            <!-- Messages when some data not found -->
            <not_found>
                <http_code>404</http_code>
                <type>error</type>
            </not_found>
            <!-- Messages when some method is not allowed -->
            <not_allowed>
                <http_code>405</http_code>
                <type>error</type>
            </not_allowed>
            <!-- Messages when some is not acceptable -->
            <not_acceptable>
                <http_code>406</http_code>
                <type>error</type>
            </not_acceptable>
            <!-- Messages when some resource are gone -->
            <gone>
                <http_code>410</http_code>
                <type>error</type>
            </gone>
            <!-- All messages related with internal errors -->
            <internal_error>
                <http_code>500</http_code>
                <type>error</type>
            </internal_error>
            <!-- Messages when something not implemented -->
            <not_implemented>
                <http_code>501</http_code>
                <type>error</type>
            </not_implemented>
        </domain_codes>

    </api>
</config>
