<?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_Customer
 * @copyright   Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <api2>
        <resource_groups>
            <customer translate="title" module="api2">
                <title>Customer</title>
                <sort_order>130</sort_order>
            </customer>
        </resource_groups>
        <resources>
            <customer translate="title" module="api2">
                <group>customer</group>
                <sort_order>90</sort_order>
                <model>customer/api2_customer</model>
                <working_model>customer/customer</working_model>
                <title>Customer</title>
                <privileges>
                    <admin>
                        <retrieve>1</retrieve>
                        <update>1</update>
                        <delete>1</delete>
                    </admin>
                    <customer>
                        <retrieve>1</retrieve>
                        <update>1</update>
                    </customer>
                </privileges>
                <attributes translate="entity_id last_logged_in firstname lastname email website_id created_in group_id confirmation disable_auto_group_change" module="api2">
                    <entity_id>Customer ID</entity_id>
                    <last_logged_in>Last Logged In</last_logged_in>
                    <firstname>First Name</firstname>
                    <lastname>Last Name</lastname>
                    <email>Email</email>
                    <website_id>Associate to Website</website_id>
                    <created_in>Created From</created_in>
                    <group_id>Group</group_id>
                    <confirmation>Is Confirmed</confirmation>
                    <disable_auto_group_change>Disable automatic group change based on VAT ID</disable_auto_group_change>
                </attributes>
                <exclude_attributes>
                    <admin>
                        <write>
                            <entity_id>1</entity_id>
                            <created_at>1</created_at>
                            <created_in>1</created_in>
                            <last_logged_in>1</last_logged_in>
                        </write>
                    </admin>
                    <customer>
                        <read>
                            <entity_id>1</entity_id>
                            <last_logged_in>1</last_logged_in>
                            <website_id>1</website_id>
                            <created_in>1</created_in>
                            <group_id>1</group_id>
                            <disable_auto_group_change>1</disable_auto_group_change>
                            <confirmation>1</confirmation>
                            <created_at>1</created_at>
                        </read>
                        <write>
                            <entity_id>1</entity_id>
                            <last_logged_in>1</last_logged_in>
                            <website_id>1</website_id>
                            <created_in>1</created_in>
                            <group_id>1</group_id>
                            <disable_auto_group_change>1</disable_auto_group_change>
                            <confirmation>1</confirmation>
                            <created_at>1</created_at>
                        </write>
                    </customer>
                </exclude_attributes>
                <validators>
                    <eav>
                        <admin>
                            <entity_model>customer/customer</entity_model>
                            <form_model>customer/form</form_model>
                            <form_code>
                                <update>adminhtml_customer</update>
                            </form_code>
                        </admin>
                        <customer>
                            <entity_model>customer/customer</entity_model>
                            <form_model>customer/form</form_model>
                            <form_code>
                                <update>customer_account_edit</update>
                            </form_code>
                        </customer>
                    </eav>
                </validators>
                <routes>
                    <route_entity>
                        <route>/customers/:id</route>
                        <action_type>entity</action_type>
                    </route_entity>
                    <route_collection>
                        <route>/customers</route>
                        <action_type>collection</action_type>
                    </route_collection>
                </routes>
                <versions>1</versions>
            </customer>
            <customer_address translate="title" module="api2">
                <group>customer</group>
                <sort_order>110</sort_order>
                <model>customer/api2_customer_address</model>
                <working_model>customer/address</working_model>
                <title>Customer Address</title>
                <privileges>
                    <admin>
                        <create>1</create>
                        <retrieve>1</retrieve>
                        <update>1</update>
                        <delete>1</delete>
                    </admin>
                    <customer>
                        <create>1</create>
                        <retrieve>1</retrieve>
                        <update>1</update>
                        <delete>1</delete>
                    </customer>
                </privileges>
                <attributes translate="entity_id is_default_billing is_default_shipping" module="api2">
                    <entity_id>Customer Address ID</entity_id>
                    <is_default_billing>Is Default Billing Address</is_default_billing>
                    <is_default_shipping>Is Default Shipping Address</is_default_shipping>
                </attributes>
                <exclude_attributes>
                    <admin>
                        <read>
                            <region_id>1</region_id>
                            <vat_is_valid>1</vat_is_valid>
                            <vat_request_date>1</vat_request_date>
                            <vat_request_id>1</vat_request_id>
                            <vat_request_success>1</vat_request_success>
                        </read>
                        <write>
                            <entity_id>1</entity_id>
                            <region_id>1</region_id>
                            <vat_is_valid>1</vat_is_valid>
                            <vat_request_date>1</vat_request_date>
                            <vat_request_id>1</vat_request_id>
                            <vat_request_success>1</vat_request_success>
                        </write>
                    </admin>
                    <customer>
                        <read>
                            <region_id>1</region_id>
                        </read>
                        <write>
                            <entity_id>1</entity_id>
                            <region_id>1</region_id>
                        </write>
                    </customer>
                </exclude_attributes>
                <validators>
                    <eav>
                        <admin>
                            <entity_model>customer/address</entity_model>
                            <form_model>customer/form</form_model>
                            <form_code>
                                <update>adminhtml_customer_address</update>
                            </form_code>
                        </admin>
                        <customer>
                            <entity_model>customer/address</entity_model>
                            <form_model>customer/form</form_model>
                            <form_code>
                                <update>customer_address_edit</update>
                            </form_code>
                        </customer>
                    </eav>
                </validators>
                <routes>
                    <route_entity>
                        <route>/customers/addresses/:id</route>
                        <action_type>entity</action_type>
                    </route_entity>
                    <route_collection>
                        <route>/customers/:customer_id/addresses</route>
                        <action_type>collection</action_type>
                    </route_collection>
                </routes>
                <versions>1</versions>
            </customer_address>
        </resources>
    </api2>
</config>
