<?php

// function includeFolder($folder){
//     $files = glob($folder."*");    
//     foreach ($files as $file) {
//         if(is_dir($file)){
//             includeFolder($file);
//         }
//         else{
//             $ext = pathinfo($file, PATHINFO_EXTENSION);
//             if($ext == 'php'){
//                 echo "<pre>";
//                 echo $file; 
//                 //include($file);
//             }
            
//         }
//     }
// }
// includeFolder(__DIR__."/lib/");

// include __DIR__ . '/lib/Configuration.php';
// include __DIR__ . '/lib/Endpoint.php';
// include __DIR__ . '/lib/Authentication.php';
// include __DIR__ . '/lib/ApiException.php';
// include __DIR__ . '/lib/ContentType.php';
// include __DIR__ . '/lib/Credentials.php';
// include __DIR__ . '/lib/Document.php';
// include __DIR__ . '/lib/FeedType.php';
// include __DIR__ . '/lib/HeaderSelector.php';
// include __DIR__ . '/lib/ObjectSerializer.php';
// include __DIR__ . '/lib/ReportType.php';

require_once getcwd() . '/app/Dependencies/aws/aws-autoloader.php';

class Autoloader
{
    public static function register()
    {
        spl_autoload_register(function ($class) {
            $file = str_replace('SellingPartnerApi\\', "", $class).'.php';
            $file = __DIR__. '/lib/'.$file;
            if (file_exists($file)) {
                require $file;
                return true;
            }
            return false;
        }); 
        spl_autoload_register(function ($classes) {  
            $file = str_replace('SellingPartnerApi\\', "/", $classes).'.php';
            $file = str_replace('Api\\', "", $file);
            $filePath = __DIR__."/lib/Api".$file; 
            include_once($filePath);
         });      
     
    }
}
Autoloader::register();
include __DIR__ . '/lib/Model/ModelInterface.php';

include __DIR__ . '/lib/Model/ProductTypeDefinitions/ProductType.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/ProductTypeDefinition.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/ProductTypeList.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/ProductTypeVersion.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/PropertyGroup.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/SchemaLink.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/SchemaLinkLink.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/ErrorList.php';
include __DIR__ . '/lib/Model/ProductTypeDefinitions/Error.php';

include __DIR__ . '/lib/Model/Listings/FulfillmentAvailability.php';
include __DIR__ . '/lib/Model/Listings/Item.php';
include __DIR__ . '/lib/Model/Listings/ItemImage.php';
include __DIR__ . '/lib/Model/Listings/ItemOfferByMarketplace.php';
include __DIR__ . '/lib/Model/Listings/ItemProcurement.php';
include __DIR__ . '/lib/Model/Listings/ItemSummaryByMarketplace.php';
include __DIR__ . '/lib/Model/Listings/ListingsItemPatchRequest.php';
include __DIR__ . '/lib/Model/Listings/ListingsItemPutRequest.php';
include __DIR__ . '/lib/Model/Listings/ListingsItemSubmissionResponse.php';
include __DIR__ . '/lib/Model/Listings/Money.php';
include __DIR__ . '/lib/Model/Listings/PatchOperation.php';
include __DIR__ . '/lib/Model/Listings/Points.php';
include __DIR__ . '/lib/Model/Listings/ErrorList.php';
include __DIR__ . '/lib/Model/Listings/Error.php';
include __DIR__ . '/lib/Model/Listings/Issue.php';

include __DIR__ . '/lib/Model/Orders/Order.php';
include __DIR__ . '/lib/Model/Orders/GetOrdersResponse.php';
include __DIR__ . '/lib/Model/Orders/Error.php';
include __DIR__ . '/lib/Model/Orders/OrdersList.php';
include __DIR__ . '/lib/Model/Orders/BuyerInfo.php';
include __DIR__ . '/lib/Model/Orders/AutomatedShippingSettings.php';
include __DIR__ . '/lib/Model/Orders/Money.php';

include __DIR__ . '/lib/Model/Orders/GetOrderResponse.php';
include __DIR__ . '/lib/Model/Orders/GetOrderItemsResponse.php';
include __DIR__ . '/lib/Model/Orders/OrderItemsList.php';
include __DIR__ . '/lib/Model/Orders/OrderItem.php';
include __DIR__ . '/lib/Model/Orders/ProductInfoDetail.php';
include __DIR__ . '/lib/Model/Orders/ItemBuyerInfo.php';
include __DIR__ . '/lib/Model/Orders/Address.php';
include __DIR__ . '/lib/Model/Orders/GetOrderBuyerInfoResponse.php';
include __DIR__ . '/lib/Model/Orders/OrderBuyerInfo.php';
include __DIR__ . '/lib/Model/Orders/TaxCollection.php';

include __DIR__ . '/lib/Model/Orders/GetOrderItemsBuyerInfoResponse.php';
include __DIR__ . '/lib/Model/Orders/OrderItemsBuyerInfoList.php';
include __DIR__ . '/lib/Model/Orders/OrderItemBuyerInfo.php';

include __DIR__ . '/lib/Model/Tokens/RestrictedResource.php';
include __DIR__ . '/lib/Model/Tokens/CreateRestrictedDataTokenRequest.php';
include __DIR__ . '/lib/Model/Tokens/ErrorList.php';
include __DIR__ . '/lib/Model/Tokens/Error.php';


include __DIR__ . '/lib/Model/Catalog/CatalogApi.php';
include __DIR__ . '/lib/Model/Catalog/Item.php';
include __DIR__ . '/lib/Model/Catalog/ItemSummaryByMarketplace.php';
include __DIR__ . '/lib/Model/Catalog/ItemImagesByMarketplace.php';
include __DIR__ . '/lib/Model/Catalog/ItemImage.php';
include __DIR__ . '/lib/Model/Catalog/ErrorList.php';
include __DIR__ . '/lib/Model/Catalog/Error.php';

include __DIR__ . '/lib/Model/Messaging/MessagingAction.php';
include __DIR__ . '/lib/Model/Messaging/CreateConfirmCustomizationDetailsResponse.php';
include __DIR__ . '/lib/Model/Messaging/Error.php';
include __DIR__ . '/lib/Model/Messaging/CreateConfirmCustomizationDetailsRequest.php';

include __DIR__ . '/lib/Model/Messaging/GetMessagingActionsForOrderResponse.php';