<?php
/*******************************************************************************
 * Copyright 2009-2015 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  MWS Recommendations Section Service
 * @version  2013-04-01
 * Library Version: 2015-06-18
 * Generated: Thu Jun 18 19:29:34 GMT 2015
 */

/**
 *  @see MWSRecommendationsSectionService_Model
 */

require_once (dirname(__FILE__) . '/../Model.php');

/**
 * MWSRecommendationsSectionService_Model_ListRecommendationsByNextTokenResult
 *
 * Properties:
 *

 *
 *
InventoryRecommendations: array

 *
SelectionRecommendations: array

 *
PricingRecommendations: array

 *
FulfillmentRecommendations: array

 *
ListingQualityRecommendations: array

 *
GlobalSellingRecommendations: array

 *
AdvertisingRecommendations: array

 *
NextToken: string

 *
 *

 */

 class MWSRecommendationsSectionService_Model_ListRecommendationsByNextTokenResult extends MWSRecommendationsSectionService_Model {

    public function __construct($data = null)
    {
    $this->_fields = array (
    'InventoryRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_InventoryRecommendation'), 'ListMemberName' => 'member'),
    'SelectionRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_SelectionRecommendation'), 'ListMemberName' => 'member'),
    'PricingRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_PricingRecommendation'), 'ListMemberName' => 'member'),
    'FulfillmentRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_FulfillmentRecommendation'), 'ListMemberName' => 'member'),
    'ListingQualityRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_ListingQualityRecommendation'), 'ListMemberName' => 'member'),
    'GlobalSellingRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_GlobalSellingRecommendation'), 'ListMemberName' => 'member'),
    'AdvertisingRecommendations' => array('FieldValue' => array(), 'FieldType' => array('MWSRecommendationsSectionService_Model_AdvertisingRecommendation'), 'ListMemberName' => 'member'),
    'NextToken' => array('FieldValue' => null, 'FieldType' => 'string'),
    );
    parent::__construct($data);
    }

    /**
     * Get the value of the InventoryRecommendations property.
     *
     * @return List<InventoryRecommendation> InventoryRecommendations.
     */
    public function getInventoryRecommendations()
    {
        if ($this->_fields['InventoryRecommendations']['FieldValue'] == null)
        {
            $this->_fields['InventoryRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['InventoryRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the InventoryRecommendations property.
     *
     * @param array inventoryRecommendations
     * @return this instance
     */
    public function setInventoryRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['InventoryRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear InventoryRecommendations.
     */
    public function unsetInventoryRecommendations()
    {
        $this->_fields['InventoryRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if InventoryRecommendations is set.
     *
     * @return true if InventoryRecommendations is set.
     */
    public function isSetInventoryRecommendations()
    {
                return !empty($this->_fields['InventoryRecommendations']['FieldValue']);
            }

    /**
     * Add values for InventoryRecommendations, return this.
     *
     * @param inventoryRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withInventoryRecommendations()
    {
        foreach (func_get_args() as $InventoryRecommendations)
        {
            $this->_fields['InventoryRecommendations']['FieldValue'][] = $InventoryRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the SelectionRecommendations property.
     *
     * @return List<SelectionRecommendation> SelectionRecommendations.
     */
    public function getSelectionRecommendations()
    {
        if ($this->_fields['SelectionRecommendations']['FieldValue'] == null)
        {
            $this->_fields['SelectionRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['SelectionRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the SelectionRecommendations property.
     *
     * @param array selectionRecommendations
     * @return this instance
     */
    public function setSelectionRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['SelectionRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear SelectionRecommendations.
     */
    public function unsetSelectionRecommendations()
    {
        $this->_fields['SelectionRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if SelectionRecommendations is set.
     *
     * @return true if SelectionRecommendations is set.
     */
    public function isSetSelectionRecommendations()
    {
                return !empty($this->_fields['SelectionRecommendations']['FieldValue']);
            }

    /**
     * Add values for SelectionRecommendations, return this.
     *
     * @param selectionRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withSelectionRecommendations()
    {
        foreach (func_get_args() as $SelectionRecommendations)
        {
            $this->_fields['SelectionRecommendations']['FieldValue'][] = $SelectionRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the PricingRecommendations property.
     *
     * @return List<PricingRecommendation> PricingRecommendations.
     */
    public function getPricingRecommendations()
    {
        if ($this->_fields['PricingRecommendations']['FieldValue'] == null)
        {
            $this->_fields['PricingRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['PricingRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the PricingRecommendations property.
     *
     * @param array pricingRecommendations
     * @return this instance
     */
    public function setPricingRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['PricingRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear PricingRecommendations.
     */
    public function unsetPricingRecommendations()
    {
        $this->_fields['PricingRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if PricingRecommendations is set.
     *
     * @return true if PricingRecommendations is set.
     */
    public function isSetPricingRecommendations()
    {
                return !empty($this->_fields['PricingRecommendations']['FieldValue']);
            }

    /**
     * Add values for PricingRecommendations, return this.
     *
     * @param pricingRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withPricingRecommendations()
    {
        foreach (func_get_args() as $PricingRecommendations)
        {
            $this->_fields['PricingRecommendations']['FieldValue'][] = $PricingRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the FulfillmentRecommendations property.
     *
     * @return List<FulfillmentRecommendation> FulfillmentRecommendations.
     */
    public function getFulfillmentRecommendations()
    {
        if ($this->_fields['FulfillmentRecommendations']['FieldValue'] == null)
        {
            $this->_fields['FulfillmentRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['FulfillmentRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the FulfillmentRecommendations property.
     *
     * @param array fulfillmentRecommendations
     * @return this instance
     */
    public function setFulfillmentRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['FulfillmentRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear FulfillmentRecommendations.
     */
    public function unsetFulfillmentRecommendations()
    {
        $this->_fields['FulfillmentRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if FulfillmentRecommendations is set.
     *
     * @return true if FulfillmentRecommendations is set.
     */
    public function isSetFulfillmentRecommendations()
    {
                return !empty($this->_fields['FulfillmentRecommendations']['FieldValue']);
            }

    /**
     * Add values for FulfillmentRecommendations, return this.
     *
     * @param fulfillmentRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withFulfillmentRecommendations()
    {
        foreach (func_get_args() as $FulfillmentRecommendations)
        {
            $this->_fields['FulfillmentRecommendations']['FieldValue'][] = $FulfillmentRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the ListingQualityRecommendations property.
     *
     * @return List<ListingQualityRecommendation> ListingQualityRecommendations.
     */
    public function getListingQualityRecommendations()
    {
        if ($this->_fields['ListingQualityRecommendations']['FieldValue'] == null)
        {
            $this->_fields['ListingQualityRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['ListingQualityRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the ListingQualityRecommendations property.
     *
     * @param array listingQualityRecommendations
     * @return this instance
     */
    public function setListingQualityRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['ListingQualityRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear ListingQualityRecommendations.
     */
    public function unsetListingQualityRecommendations()
    {
        $this->_fields['ListingQualityRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if ListingQualityRecommendations is set.
     *
     * @return true if ListingQualityRecommendations is set.
     */
    public function isSetListingQualityRecommendations()
    {
                return !empty($this->_fields['ListingQualityRecommendations']['FieldValue']);
            }

    /**
     * Add values for ListingQualityRecommendations, return this.
     *
     * @param listingQualityRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withListingQualityRecommendations()
    {
        foreach (func_get_args() as $ListingQualityRecommendations)
        {
            $this->_fields['ListingQualityRecommendations']['FieldValue'][] = $ListingQualityRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the GlobalSellingRecommendations property.
     *
     * @return List<GlobalSellingRecommendation> GlobalSellingRecommendations.
     */
    public function getGlobalSellingRecommendations()
    {
        if ($this->_fields['GlobalSellingRecommendations']['FieldValue'] == null)
        {
            $this->_fields['GlobalSellingRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['GlobalSellingRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the GlobalSellingRecommendations property.
     *
     * @param array globalSellingRecommendations
     * @return this instance
     */
    public function setGlobalSellingRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['GlobalSellingRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear GlobalSellingRecommendations.
     */
    public function unsetGlobalSellingRecommendations()
    {
        $this->_fields['GlobalSellingRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if GlobalSellingRecommendations is set.
     *
     * @return true if GlobalSellingRecommendations is set.
     */
    public function isSetGlobalSellingRecommendations()
    {
                return !empty($this->_fields['GlobalSellingRecommendations']['FieldValue']);
            }

    /**
     * Add values for GlobalSellingRecommendations, return this.
     *
     * @param globalSellingRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withGlobalSellingRecommendations()
    {
        foreach (func_get_args() as $GlobalSellingRecommendations)
        {
            $this->_fields['GlobalSellingRecommendations']['FieldValue'][] = $GlobalSellingRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the AdvertisingRecommendations property.
     *
     * @return List<AdvertisingRecommendation> AdvertisingRecommendations.
     */
    public function getAdvertisingRecommendations()
    {
        if ($this->_fields['AdvertisingRecommendations']['FieldValue'] == null)
        {
            $this->_fields['AdvertisingRecommendations']['FieldValue'] = array();
        }
        return $this->_fields['AdvertisingRecommendations']['FieldValue'];
    }

    /**
     * Set the value of the AdvertisingRecommendations property.
     *
     * @param array advertisingRecommendations
     * @return this instance
     */
    public function setAdvertisingRecommendations($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['AdvertisingRecommendations']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear AdvertisingRecommendations.
     */
    public function unsetAdvertisingRecommendations()
    {
        $this->_fields['AdvertisingRecommendations']['FieldValue'] = array();
    }

    /**
     * Check to see if AdvertisingRecommendations is set.
     *
     * @return true if AdvertisingRecommendations is set.
     */
    public function isSetAdvertisingRecommendations()
    {
                return !empty($this->_fields['AdvertisingRecommendations']['FieldValue']);
            }

    /**
     * Add values for AdvertisingRecommendations, return this.
     *
     * @param advertisingRecommendations
     *             New values to add.
     *
     * @return This instance.
     */
    public function withAdvertisingRecommendations()
    {
        foreach (func_get_args() as $AdvertisingRecommendations)
        {
            $this->_fields['AdvertisingRecommendations']['FieldValue'][] = $AdvertisingRecommendations;
        }
        return $this;
    }

    /**
     * Get the value of the NextToken property.
     *
     * @return String NextToken.
     */
    public function getNextToken()
    {
        return $this->_fields['NextToken']['FieldValue'];
    }

    /**
     * Set the value of the NextToken property.
     *
     * @param string nextToken
     * @return this instance
     */
    public function setNextToken($value)
    {
        $this->_fields['NextToken']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if NextToken is set.
     *
     * @return true if NextToken is set.
     */
    public function isSetNextToken()
    {
                return !is_null($this->_fields['NextToken']['FieldValue']);
            }

    /**
     * Set the value of NextToken, return this.
     *
     * @param nextToken
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withNextToken($value)
    {
        $this->setNextToken($value);
        return $this;
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2016 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  MWS Merchant Fulfillment Service
 * @version  2015-06-01
 * Library Version: 2016-03-30
 * Generated: Tue Mar 29 19:00:01 UTC 2016
 */

/**
 *  @see MWSMerchantFulfillmentService_Model
 */

require_once (dirname(__FILE__) . '/../Model.php');

/**
 * MWSMerchantFulfillmentService_Model_ShipmentRequestDetails
 *
 * Properties:
 *

 *
 *
AmazonOrderId: string

 *
SellerOrderId: string

 *
ItemList: array

 *
ShipFromAddress: MWSMerchantFulfillmentService_Model_Address

 *
PackageDimensions: MWSMerchantFulfillmentService_Model_PackageDimensions

 *
Weight: MWSMerchantFulfillmentService_Model_Weight

 *
MustArriveByDate: string

 *
ShipDate: string

 *
ShippingServiceOptions: MWSMerchantFulfillmentService_Model_ShippingServiceOptions

 *
 *

 */

 class MWSMerchantFulfillmentService_Model_ShipmentRequestDetails extends MWSMerchantFulfillmentService_Model {

    public function __construct($data = null)
    {
    $this->_fields = array (
    'AmazonOrderId' => array('FieldValue' => null, 'FieldType' => 'string'),
    'SellerOrderId' => array('FieldValue' => null, 'FieldType' => 'string'),
    'ItemList' => array('FieldValue' => array(), 'FieldType' => array('MWSMerchantFulfillmentService_Model_Item'), 'ListMemberName' => 'Item'),
    'ShipFromAddress' => array('FieldValue' => null, 'FieldType' => 'MWSMerchantFulfillmentService_Model_Address'),
    'PackageDimensions' => array('FieldValue' => null, 'FieldType' => 'MWSMerchantFulfillmentService_Model_PackageDimensions'),
    'Weight' => array('FieldValue' => null, 'FieldType' => 'MWSMerchantFulfillmentService_Model_Weight'),
    'MustArriveByDate' => array('FieldValue' => null, 'FieldType' => 'string'),
    'ShipDate' => array('FieldValue' => null, 'FieldType' => 'string'),
    'ShippingServiceOptions' => array('FieldValue' => null, 'FieldType' => 'MWSMerchantFulfillmentService_Model_ShippingServiceOptions'),
    );
    parent::__construct($data);
    }

    /**
     * Get the value of the AmazonOrderId property.
     *
     * @return String AmazonOrderId.
     */
    public function getAmazonOrderId()
    {
        return $this->_fields['AmazonOrderId']['FieldValue'];
    }

    /**
     * Set the value of the AmazonOrderId property.
     *
     * @param string amazonOrderId
     * @return this instance
     */
    public function setAmazonOrderId($value)
    {
        $this->_fields['AmazonOrderId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if AmazonOrderId is set.
     *
     * @return true if AmazonOrderId is set.
     */
    public function isSetAmazonOrderId()
    {
                return !is_null($this->_fields['AmazonOrderId']['FieldValue']);
            }

    /**
     * Set the value of AmazonOrderId, return this.
     *
     * @param amazonOrderId
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withAmazonOrderId($value)
    {
        $this->setAmazonOrderId($value);
        return $this;
    }

    /**
     * Get the value of the SellerOrderId property.
     *
     * @return String SellerOrderId.
     */
    public function getSellerOrderId()
    {
        return $this->_fields['SellerOrderId']['FieldValue'];
    }

    /**
     * Set the value of the SellerOrderId property.
     *
     * @param string sellerOrderId
     * @return this instance
     */
    public function setSellerOrderId($value)
    {
        $this->_fields['SellerOrderId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if SellerOrderId is set.
     *
     * @return true if SellerOrderId is set.
     */
    public function isSetSellerOrderId()
    {
                return !is_null($this->_fields['SellerOrderId']['FieldValue']);
            }

    /**
     * Set the value of SellerOrderId, return this.
     *
     * @param sellerOrderId
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withSellerOrderId($value)
    {
        $this->setSellerOrderId($value);
        return $this;
    }

    /**
     * Get the value of the ItemList property.
     *
     * @return List<Item> ItemList.
     */
    public function getItemList()
    {
        if ($this->_fields['ItemList']['FieldValue'] == null)
        {
            $this->_fields['ItemList']['FieldValue'] = array();
        }
        return $this->_fields['ItemList']['FieldValue'];
    }

    /**
     * Set the value of the ItemList property.
     *
     * @param array itemList
     * @return this instance
     */
    public function setItemList($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['ItemList']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear ItemList.
     */
    public function unsetItemList()
    {
        $this->_fields['ItemList']['FieldValue'] = array();
    }

    /**
     * Check to see if ItemList is set.
     *
     * @return true if ItemList is set.
     */
    public function isSetItemList()
    {
                return !empty($this->_fields['ItemList']['FieldValue']);
            }

    /**
     * Add values for ItemList, return this.
     *
     * @param itemList
     *             New values to add.
     *
     * @return This instance.
     */
    public function withItemList()
    {
        foreach (func_get_args() as $ItemList)
        {
            $this->_fields['ItemList']['FieldValue'][] = $ItemList;
        }
        return $this;
    }

    /**
     * Get the value of the ShipFromAddress property.
     *
     * @return Address ShipFromAddress.
     */
    public function getShipFromAddress()
    {
        return $this->_fields['ShipFromAddress']['FieldValue'];
    }

    /**
     * Set the value of the ShipFromAddress property.
     *
     * @param MWSMerchantFulfillmentService_Model_Address shipFromAddress
     * @return this instance
     */
    public function setShipFromAddress($value)
    {
        $this->_fields['ShipFromAddress']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if ShipFromAddress is set.
     *
     * @return true if ShipFromAddress is set.
     */
    public function isSetShipFromAddress()
    {
                return !is_null($this->_fields['ShipFromAddress']['FieldValue']);
            }

    /**
     * Set the value of ShipFromAddress, return this.
     *
     * @param shipFromAddress
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withShipFromAddress($value)
    {
        $this->setShipFromAddress($value);
        return $this;
    }

    /**
     * Get the value of the PackageDimensions property.
     *
     * @return PackageDimensions PackageDimensions.
     */
    public function getPackageDimensions()
    {
        return $this->_fields['PackageDimensions']['FieldValue'];
    }

    /**
     * Set the value of the PackageDimensions property.
     *
     * @param MWSMerchantFulfillmentService_Model_PackageDimensions packageDimensions
     * @return this instance
     */
    public function setPackageDimensions($value)
    {
        $this->_fields['PackageDimensions']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if PackageDimensions is set.
     *
     * @return true if PackageDimensions is set.
     */
    public function isSetPackageDimensions()
    {
                return !is_null($this->_fields['PackageDimensions']['FieldValue']);
            }

    /**
     * Set the value of PackageDimensions, return this.
     *
     * @param packageDimensions
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withPackageDimensions($value)
    {
        $this->setPackageDimensions($value);
        return $this;
    }

    /**
     * Get the value of the Weight property.
     *
     * @return Weight Weight.
     */
    public function getWeight()
    {
        return $this->_fields['Weight']['FieldValue'];
    }

    /**
     * Set the value of the Weight property.
     *
     * @param MWSMerchantFulfillmentService_Model_Weight weight
     * @return this instance
     */
    public function setWeight($value)
    {
        $this->_fields['Weight']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if Weight is set.
     *
     * @return true if Weight is set.
     */
    public function isSetWeight()
    {
                return !is_null($this->_fields['Weight']['FieldValue']);
            }

    /**
     * Set the value of Weight, return this.
     *
     * @param weight
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withWeight($value)
    {
        $this->setWeight($value);
        return $this;
    }

    /**
     * Get the value of the MustArriveByDate property.
     *
     * @return XMLGregorianCalendar MustArriveByDate.
     */
    public function getMustArriveByDate()
    {
        return $this->_fields['MustArriveByDate']['FieldValue'];
    }

    /**
     * Set the value of the MustArriveByDate property.
     *
     * @param string mustArriveByDate
     * @return this instance
     */
    public function setMustArriveByDate($value)
    {
        $this->_fields['MustArriveByDate']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if MustArriveByDate is set.
     *
     * @return true if MustArriveByDate is set.
     */
    public function isSetMustArriveByDate()
    {
                return !is_null($this->_fields['MustArriveByDate']['FieldValue']);
            }

    /**
     * Set the value of MustArriveByDate, return this.
     *
     * @param mustArriveByDate
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withMustArriveByDate($value)
    {
        $this->setMustArriveByDate($value);
        return $this;
    }

    /**
     * Get the value of the ShipDate property.
     *
     * @return XMLGregorianCalendar ShipDate.
     */
    public function getShipDate()
    {
        return $this->_fields['ShipDate']['FieldValue'];
    }

    /**
     * Set the value of the ShipDate property.
     *
     * @param string shipDate
     * @return this instance
     */
    public function setShipDate($value)
    {
        $this->_fields['ShipDate']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if ShipDate is set.
     *
     * @return true if ShipDate is set.
     */
    public function isSetShipDate()
    {
                return !is_null($this->_fields['ShipDate']['FieldValue']);
            }

    /**
     * Set the value of ShipDate, return this.
     *
     * @param shipDate
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withShipDate($value)
    {
        $this->setShipDate($value);
        return $this;
    }

    /**
     * Get the value of the ShippingServiceOptions property.
     *
     * @return ShippingServiceOptions ShippingServiceOptions.
     */
    public function getShippingServiceOptions()
    {
        return $this->_fields['ShippingServiceOptions']['FieldValue'];
    }

    /**
     * Set the value of the ShippingServiceOptions property.
     *
     * @param MWSMerchantFulfillmentService_Model_ShippingServiceOptions shippingServiceOptions
     * @return this instance
     */
    public function setShippingServiceOptions($value)
    {
        $this->_fields['ShippingServiceOptions']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if ShippingServiceOptions is set.
     *
     * @return true if ShippingServiceOptions is set.
     */
    public function isSetShippingServiceOptions()
    {
                return !is_null($this->_fields['ShippingServiceOptions']['FieldValue']);
            }

    /**
     * Set the value of ShippingServiceOptions, return this.
     *
     * @param shippingServiceOptions
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withShippingServiceOptions($value)
    {
        $this->setShippingServiceOptions($value);
        return $this;
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2014 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  Marketplace Web Service Products
 * @version  2011-10-01
 * Library Version: 2014-10-20
 * Generated: Fri Oct 17 17:59:56 GMT 2014
 */

/**
 * MarketplaceWebServiceProducts_Model_SellerSKUListType
 *
 * Properties:
 *

 *
 *
SellerSKU: array

 *
 *

 */
class MarketplaceWebServiceProducts_Model_SellerSKUListType extends MarketplaceWebServiceProducts_Model
{

    public function __construct($data = null)
    {
        $this->_fields = array(
            'SellerSKU' => array('FieldValue' => array(), 'FieldType' => array('string')),
        );
        parent::__construct($data);
    }

    /**
     * Get the value of the SellerSKU property.
     *
     * @return String[] SellerSKU.
     */
    public function getSellerSKU()
    {
        if ($this->_fields['SellerSKU']['FieldValue'] == null) {
            $this->_fields['SellerSKU']['FieldValue'] = array();
        }
        return $this->_fields['SellerSKU']['FieldValue'];
    }

    /**
     * Set the value of the SellerSKU property.
     *
     * @param array|string sellerSKU
     * @return $this This instance
     */
    public function setSellerSKU($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array($value);
        }
        $this->_fields['SellerSKU']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear SellerSKU.
     */
    public function unsetSellerSKU()
    {
        $this->_fields['SellerSKU']['FieldValue'] = array();
    }

    /**
     * Check to see if SellerSKU is set.
     *
     * @return true if SellerSKU is set.
     */
    public function isSetSellerSKU()
    {
        return !empty($this->_fields['SellerSKU']['FieldValue']);
    }

    /**
     * Add values for SellerSKU, return this.
     *
     * @param sellerSKU
     *             New values to add.
     *
     * @return $this This instance.
     */
    public function withSellerSKU()
    {
        foreach (func_get_args() as $SellerSKU) {
            $this->_fields['SellerSKU']['FieldValue'][] = $SellerSKU;
        }
        return $this;
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2015 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  MWS Finances Service
 * @version  2015-05-01
 * Library Version: 2015-09-03
 * Generated: Thu Sep 03 17:55:25 GMT 2015
 */

/**
 *  @see MWSFinancesService_Interface
 */
require_once (dirname(__FILE__) . '/Interface.php');

/**
 * MWSFinancesService_Client is an implementation of MWSFinancesService
 *
 */
class MWSFinancesService_Client implements MWSFinancesService_Interface
{

    const SERVICE_VERSION = '2015-05-01';
    const MWS_CLIENT_VERSION = '2015-09-03';

    /** @var string */
    private  $_awsAccessKeyId = null;

    /** @var string */
    private  $_awsSecretAccessKey = null;

    /** @var array */
    private  $_config = array ('ServiceURL' => null,
                               'UserAgent' => 'MWSFinancesService PHP5 Library',
                               'SignatureVersion' => 2,
                               'SignatureMethod' => 'HmacSHA256',
                               'ProxyHost' => null,
                               'ProxyPort' => -1,
                               'ProxyUsername' => null,
                               'ProxyPassword' => null,
                               'MaxErrorRetry' => 3,
                               'Headers' => array()
                               );

    /**
     * List Financial Event Groups
     * ListFinancialEventGroups can be used to find financial event groups that meet filter criteria.
     *
     * @param mixed $request array of parameters for MWSFinancesService_Model_ListFinancialEventGroups request or MWSFinancesService_Model_ListFinancialEventGroups object itself
     * @see MWSFinancesService_Model_ListFinancialEventGroupsRequest
     * @return MWSFinancesService_Model_ListFinancialEventGroupsResponse
     *
     * @throws MWSFinancesService_Exception
     */
    public function listFinancialEventGroups($request)
    {
        if (!($request instanceof MWSFinancesService_Model_ListFinancialEventGroupsRequest)) {
            require_once (dirname(__FILE__) . '/Model/ListFinancialEventGroupsRequest.php');
            $request = new MWSFinancesService_Model_ListFinancialEventGroupsRequest($request);
        }
        $parameters = $request->toQueryParameterArray();
        $parameters['Action'] = 'ListFinancialEventGroups';
        $httpResponse = $this->_invoke($parameters);

        require_once (dirname(__FILE__) . '/Model/ListFinancialEventGroupsResponse.php');
        $response = MWSFinancesService_Model_ListFinancialEventGroupsResponse::fromXML($httpResponse['ResponseBody']);
        $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
        return $response;
    }

    /**
     * Convert ListFinancialEventGroupsRequest to name value pairs
     */
    private function _convertListFinancialEventGroups($request) {

        $parameters = array();
        $parameters['Action'] = 'ListFinancialEventGroups';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }
        if ($request->isSetMaxResultsPerPage()) {
            $parameters['MaxResultsPerPage'] =  $request->getMaxResultsPerPage();
        }
        if ($request->isSetFinancialEventGroupStartedAfter()) {
            $parameters['FinancialEventGroupStartedAfter'] =  $request->getFinancialEventGroupStartedAfter();
        }
        if ($request->isSetFinancialEventGroupStartedBefore()) {
            $parameters['FinancialEventGroupStartedBefore'] =  $request->getFinancialEventGroupStartedBefore();
        }

        return $parameters;
    }

    /**
     * List Financial Event Groups By Next Token
     * If ListFinancialEventGroups returns a nextToken, thus indicating that there are more groups
     *         than returned that matched the given filter criteria, ListFinancialEventGroupsByNextToken
     *         can be used to retrieve those groups using that nextToken.
     *
     * @param mixed $request array of parameters for MWSFinancesService_Model_ListFinancialEventGroupsByNextToken request or MWSFinancesService_Model_ListFinancialEventGroupsByNextToken object itself
     * @see MWSFinancesService_Model_ListFinancialEventGroupsByNextTokenRequest
     * @return MWSFinancesService_Model_ListFinancialEventGroupsByNextTokenResponse
     *
     * @throws MWSFinancesService_Exception
     */
    public function listFinancialEventGroupsByNextToken($request)
    {
        if (!($request instanceof MWSFinancesService_Model_ListFinancialEventGroupsByNextTokenRequest)) {
            require_once (dirname(__FILE__) . '/Model/ListFinancialEventGroupsByNextTokenRequest.php');
            $request = new MWSFinancesService_Model_ListFinancialEventGroupsByNextTokenRequest($request);
        }
        $parameters = $request->toQueryParameterArray();
        $parameters['Action'] = 'ListFinancialEventGroupsByNextToken';
        $httpResponse = $this->_invoke($parameters);

        require_once (dirname(__FILE__) . '/Model/ListFinancialEventGroupsByNextTokenResponse.php');
        $response = MWSFinancesService_Model_ListFinancialEventGroupsByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
        $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
        return $response;
    }

    /**
     * Convert ListFinancialEventGroupsByNextTokenRequest to name value pairs
     */
    private function _convertListFinancialEventGroupsByNextToken($request) {

        $parameters = array();
        $parameters['Action'] = 'ListFinancialEventGroupsByNextToken';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }
        if ($request->isSetNextToken()) {
            $parameters['NextToken'] =  $request->getNextToken();
        }

        return $parameters;
    }

    /**
     * List Financial Events
     * ListFinancialEvents can be used to find financial events that meet the specified criteria.
     *
     * @param mixed $request array of parameters for MWSFinancesService_Model_ListFinancialEvents request or MWSFinancesService_Model_ListFinancialEvents object itself
     * @see MWSFinancesService_Model_ListFinancialEventsRequest
     * @return MWSFinancesService_Model_ListFinancialEventsResponse
     *
     * @throws MWSFinancesService_Exception
     */
    public function listFinancialEvents($request)
    {
        if (!($request instanceof MWSFinancesService_Model_ListFinancialEventsRequest)) {
            require_once (dirname(__FILE__) . '/Model/ListFinancialEventsRequest.php');
            $request = new MWSFinancesService_Model_ListFinancialEventsRequest($request);
        }
        $parameters = $request->toQueryParameterArray();
        $parameters['Action'] = 'ListFinancialEvents';
        $httpResponse = $this->_invoke($parameters);

        require_once (dirname(__FILE__) . '/Model/ListFinancialEventsResponse.php');
        $response = MWSFinancesService_Model_ListFinancialEventsResponse::fromXML($httpResponse['ResponseBody']);
        $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
        return $response;
    }

    /**
     * Convert ListFinancialEventsRequest to name value pairs
     */
    private function _convertListFinancialEvents($request) {

        $parameters = array();
        $parameters['Action'] = 'ListFinancialEvents';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }
        if ($request->isSetMaxResultsPerPage()) {
            $parameters['MaxResultsPerPage'] =  $request->getMaxResultsPerPage();
        }
        if ($request->isSetAmazonOrderId()) {
            $parameters['AmazonOrderId'] =  $request->getAmazonOrderId();
        }
        if ($request->isSetFinancialEventGroupId()) {
            $parameters['FinancialEventGroupId'] =  $request->getFinancialEventGroupId();
        }
        if ($request->isSetPostedAfter()) {
            $parameters['PostedAfter'] =  $request->getPostedAfter();
        }
        if ($request->isSetPostedBefore()) {
            $parameters['PostedBefore'] =  $request->getPostedBefore();
        }

        return $parameters;
    }

    /**
     * List Financial Events By Next Token
     * If ListFinancialEvents returns a nextToken, thus indicating that there are more financial events
     *         than returned that matched the given filter criteria, ListFinancialEventsByNextToken
     *         can be used to retrieve those events using that nextToken.
     *
     * @param mixed $request array of parameters for MWSFinancesService_Model_ListFinancialEventsByNextToken request or MWSFinancesService_Model_ListFinancialEventsByNextToken object itself
     * @see MWSFinancesService_Model_ListFinancialEventsByNextTokenRequest
     * @return MWSFinancesService_Model_ListFinancialEventsByNextTokenResponse
     *
     * @throws MWSFinancesService_Exception
     */
    public function listFinancialEventsByNextToken($request)
    {
        if (!($request instanceof MWSFinancesService_Model_ListFinancialEventsByNextTokenRequest)) {
            require_once (dirname(__FILE__) . '/Model/ListFinancialEventsByNextTokenRequest.php');
            $request = new MWSFinancesService_Model_ListFinancialEventsByNextTokenRequest($request);
        }
        $parameters = $request->toQueryParameterArray();
        $parameters['Action'] = 'ListFinancialEventsByNextToken';
        $httpResponse = $this->_invoke($parameters);

        require_once (dirname(__FILE__) . '/Model/ListFinancialEventsByNextTokenResponse.php');
        $response = MWSFinancesService_Model_ListFinancialEventsByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
        $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
        return $response;
    }

    /**
     * Convert ListFinancialEventsByNextTokenRequest to name value pairs
     */
    private function _convertListFinancialEventsByNextToken($request) {

        $parameters = array();
        $parameters['Action'] = 'ListFinancialEventsByNextToken';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }
        if ($request->isSetNextToken()) {
            $parameters['NextToken'] =  $request->getNextToken();
        }

        return $parameters;
    }

    /**
     * Get Service Status
     *
     *
     * @param mixed $request array of parameters for MWSFinancesService_Model_GetServiceStatus request or MWSFinancesService_Model_GetServiceStatus object itself
     * @see MWSFinancesService_Model_GetServiceStatusRequest
     * @return MWSFinancesService_Model_GetServiceStatusResponse
     *
     * @throws MWSFinancesService_Exception
     */
    public function getServiceStatus($request)
    {
        if (!($request instanceof MWSFinancesService_Model_GetServiceStatusRequest)) {
            require_once (dirname(__FILE__) . '/Model/GetServiceStatusRequest.php');
            $request = new MWSFinancesService_Model_GetServiceStatusRequest($request);
        }
        $parameters = $request->toQueryParameterArray();
        $parameters['Action'] = 'GetServiceStatus';
        $httpResponse = $this->_invoke($parameters);

        require_once (dirname(__FILE__) . '/Model/GetServiceStatusResponse.php');
        $response = MWSFinancesService_Model_GetServiceStatusResponse::fromXML($httpResponse['ResponseBody']);
        $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
        return $response;
    }

    /**
     * Convert GetServiceStatusRequest to name value pairs
     */
    private function _convertGetServiceStatus($request) {

        $parameters = array();
        $parameters['Action'] = 'GetServiceStatus';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }

        return $parameters;
    }

    /**
     * Construct new Client
     *
     * @param string $awsAccessKeyId AWS Access Key ID
     * @param string $awsSecretAccessKey AWS Secret Access Key
     * @param array $config configuration options.
     * Valid configuration options are:
     *

     *
ServiceURL

     *
UserAgent

     *
SignatureVersion

     *
TimesRetryOnError

     *
ProxyHost

     *
ProxyPort

     *
ProxyUsername

     *
ProxyPassword

     *
MaxErrorRetry

     *

     */
    public function __construct($awsAccessKeyId, $awsSecretAccessKey, $applicationName, $applicationVersion, $config = null)
    {
        iconv_set_encoding('output_encoding', 'UTF-8');
        iconv_set_encoding('input_encoding', 'UTF-8');
        iconv_set_encoding('internal_encoding', 'UTF-8');

        $this->_awsAccessKeyId = $awsAccessKeyId;
        $this->_awsSecretAccessKey = $awsSecretAccessKey;
        if (!is_null($config)) $this->_config = array_merge($this->_config, $config);
        $this->setUserAgentHeader($applicationName, $applicationVersion);
    }

    private function setUserAgentHeader(
        $applicationName,
        $applicationVersion,
        $attributes = null) {

        if (is_null($attributes)) {
            $attributes = array ();
        }

        $this->_config['UserAgent'] =
            $this->constructUserAgentHeader($applicationName, $applicationVersion, $attributes);
    }

    private function constructUserAgentHeader($applicationName, $applicationVersion, $attributes = null) {
        if (is_null($applicationName) || $applicationName === "") {
            throw new InvalidArgumentException('$applicationName cannot be null');
        }

        if (is_null($applicationVersion) || $applicationVersion === "") {
            throw new InvalidArgumentException('$applicationVersion cannot be null');
        }

        $userAgent =
            $this->quoteApplicationName($applicationName)
            . '/'
            . $this->quoteApplicationVersion($applicationVersion);

        $userAgent .= ' (';
        $userAgent .= 'Language=PHP/' . phpversion();
        $userAgent .= '; ';
        $userAgent .= 'Platform=' . php_uname('s') . '/' . php_uname('m') . '/' . php_uname('r');
        $userAgent .= '; ';
        $userAgent .= 'MWSClientVersion=' . self::MWS_CLIENT_VERSION;

        foreach ($attributes as $key => $value) {
            if (empty($value)) {
                throw new InvalidArgumentException("Value for $key cannot be null or empty.");
            }

            $userAgent .= '; '
                . $this->quoteAttributeName($key)
                . '='
                . $this->quoteAttributeValue($value);
        }

        $userAgent .= ')';

        return $userAgent;
    }

   /**
    * Collapse multiple whitespace characters into a single ' ' character.
    * @param $s
    * @return string
    */
   private function collapseWhitespace($s) {
       return preg_replace('/ {2,}|\s/', ' ', $s);
   }

    /**
     * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
     * and '/' characters from a string.
     * @param $s
     * @return string
     */
    private function quoteApplicationName($s) {
        $quotedString = $this->collapseWhitespace($s);
        $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
        $quotedString = preg_replace('/\//', '\\/', $quotedString);

        return $quotedString;
    }

    /**
     * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
     * and '(' characters from a string.
     *
     * @param $s
     * @return string
     */
    private function quoteApplicationVersion($s) {
        $quotedString = $this->collapseWhitespace($s);
        $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
        $quotedString = preg_replace('/\\(/', '\\(', $quotedString);

        return $quotedString;
    }

    /**
     * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
     * and '=' characters from a string.
     *
     * @param $s
     * @return unknown_type
     */
    private function quoteAttributeName($s) {
        $quotedString = $this->collapseWhitespace($s);
        $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
        $quotedString = preg_replace('/\\=/', '\\=', $quotedString);

        return $quotedString;
    }

    /**
     * Collapse multiple whitespace characters into a single ' ' and backslash escape ';', '\',
     * and ')' characters from a string.
     *
     * @param $s
     * @return unknown_type
     */
    private function quoteAttributeValue($s) {
        $quotedString = $this->collapseWhitespace($s);
        $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
        $quotedString = preg_replace('/\\;/', '\\;', $quotedString);
        $quotedString = preg_replace('/\\)/', '\\)', $quotedString);

        return $quotedString;
    }

    // Private API ------------------------------------------------------------//

    /**
     * Invoke request and return response
     */
    private function _invoke(array $parameters)
    {
        try {
            if (empty($this->_config['ServiceURL'])) {
                require_once (dirname(__FILE__) . '/Exception.php');
                throw new MWSFinancesService_Exception(
                    array ('ErrorCode' => 'InvalidServiceURL',
                           'Message' => "Missing serviceUrl configuration value. You may obtain a list of valid MWS URLs by consulting the MWS Developer's Guide, or reviewing the sample code published along side this library."));
            }
            $parameters = $this->_addRequiredParameters($parameters);
            $retries = 0;
            for (;;) {
                $response = $this->_httpPost($parameters);
                $status = $response['Status'];
                if ($status == 200) {
                    return array('ResponseBody' => $response['ResponseBody'],
                      'ResponseHeaderMetadata' => $response['ResponseHeaderMetadata']);
                }
                if ($status == 500 && $this->_pauseOnRetry(++$retries)) {
                    continue;
                }
                throw $this->_reportAnyErrors($response['ResponseBody'],
                    $status, $response['ResponseHeaderMetadata']);
            }
        } catch (MWSFinancesService_Exception $se) {
            throw $se;
        } catch (Exception $t) {
            require_once (dirname(__FILE__) . '/Exception.php');
            throw new MWSFinancesService_Exception(array('Exception' => $t, 'Message' => $t->getMessage()));
        }
    }

    /**
     * Look for additional error strings in the response and return formatted exception
     */
    private function _reportAnyErrors($responseBody, $status, $responseHeaderMetadata, Exception $e =  null)
    {
        $exProps = array();
        $exProps["StatusCode"] = $status;
        $exProps["ResponseHeaderMetadata"] = $responseHeaderMetadata;

        libxml_use_internal_errors(true);  // Silence XML parsing errors
        $xmlBody = simplexml_load_string($responseBody);

        if ($xmlBody !== false) {  // Check XML loaded without errors
            $exProps["XML"] = $responseBody;
            $exProps["ErrorCode"] = $xmlBody->Error->Code;
            $exProps["Message"] = $xmlBody->Error->Message;
            $exProps["ErrorType"] = !empty($xmlBody->Error->Type) ? $xmlBody->Error->Type : "Unknown";
            $exProps["RequestId"] = !empty($xmlBody->RequestID) ? $xmlBody->RequestID : $xmlBody->RequestId; // 'd' in RequestId is sometimes capitalized
        } else { // We got bad XML in response, just throw a generic exception
            $exProps["Message"] = "Internal Error";
        }

        require_once (dirname(__FILE__) . '/Exception.php');
        return new MWSFinancesService_Exception($exProps);
    }

    /**
     * Perform HTTP post with exponential retries on error 500 and 503
     *
     */
    private function _httpPost(array $parameters)
    {
        $config = $this->_config;
        $query = $this->_getParametersAsString($parameters);
        $url = parse_url ($config['ServiceURL']);
        $uri = array_key_exists('path', $url) ? $url['path'] : null;
        if (!isset ($uri)) {
                $uri = "/";
        }

        switch ($url['scheme']) {
            case 'https':
                $scheme = 'https://';
                $port = isset($url['port']) ? $url['port'] : 443;
                break;
            default:
                $scheme = 'http://';
                $port = isset($url['port']) ? $url['port'] : 80;
        }

        $allHeaders = $config['Headers'];
        $allHeaders['Content-Type'] = "application/x-www-form-urlencoded; charset=utf-8"; // We need to make sure to set utf-8 encoding here
        $allHeaders['Expect'] = null; // Don't expect 100 Continue
        $allHeadersStr = array();
        foreach($allHeaders as $name => $val) {
            $str = $name . ": ";
            if(isset($val)) {
                $str = $str . $val;
            }
            $allHeadersStr[] = $str;
        }

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $scheme . $url['host'] . $uri);
        curl_setopt($ch, CURLOPT_PORT, $port);
        $this->setSSLCurlOptions($ch);
        curl_setopt($ch, CURLOPT_USERAGENT, $this->_config['UserAgent']);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $allHeadersStr);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        if ($config['ProxyHost'] != null && $config['ProxyPort'] != -1)
        {
            curl_setopt($ch, CURLOPT_PROXY, $config['ProxyHost'] . ':' . $config['ProxyPort']);
        }
        if ($config['ProxyUsername'] != null && $config['ProxyPassword'] != null)
        {
            curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['ProxyUsername'] . ':' . $config['ProxyPassword']);
        }

        $response = "";
        $response = curl_exec($ch);

        if($response === false) {
            require_once (dirname(__FILE__) . '/Exception.php');
            $exProps["Message"] = curl_error($ch);
            $exProps["ErrorType"] = "HTTP";
            curl_close($ch);
            throw new MWSFinancesService_Exception($exProps);
        }

        curl_close($ch);
        return $this->_extractHeadersAndBody($response);
    }

    /**
     * This method will attempt to extract the headers and body of our response.
     * We need to split the raw response string by 2 'CRLF's.  2 'CRLF's should indicate the separation of the response header
     * from the response body.  However in our case we have some circumstances (certain client proxies) that result in
     * multiple responses concatenated.  We could encounter a response like
     *
     * HTTP/1.1 100 Continue
     *
     * HTTP/1.1 200 OK
     * Date: Tue, 01 Apr 2014 13:02:51 GMT
     * Content-Type: text/html; charset=iso-8859-1
     * Content-Length: 12605
     *
     * ... body ..
     *
     * This method will throw away extra response status lines and attempt to find the first full response headers and body
     *
     * return [status, body, ResponseHeaderMetadata]
     */
    private function _extractHeadersAndBody($response){
        //First split by 2 'CRLF'
        $responseComponents = preg_split("/(?:\r?\n){2}/", $response, 2);
        $body = null;
        for ($count = 0;
                $count < count($responseComponents) && $body == null;
                $count++) {

            $headers = $responseComponents[$count];
            $responseStatus = $this->_extractHttpStatusCode($headers);

            if($responseStatus != null &&
                    $this->_httpHeadersHaveContent($headers)){

                $responseHeaderMetadata = $this->_extractResponseHeaderMetadata($headers);
                //The body will be the next item in the responseComponents array
                $body = $responseComponents[++$count];
            }
        }

        //If the body is null here then we were unable to parse the response and will throw an exception
        if($body == null){
            require_once (dirname(__FILE__) . '/Exception.php');
            $exProps["Message"] = "Failed to parse valid HTTP response (" . $response . ")";
            $exProps["ErrorType"] = "HTTP";
            throw new MWSFinancesService_Exception($exProps);
        }

        return array(
                'Status' => $responseStatus,
                'ResponseBody' => $body,
                'ResponseHeaderMetadata' => $responseHeaderMetadata);
    }

    /**
     * parse the status line of a header string for the proper format and
     * return the status code
     *
     * Example: HTTP/1.1 200 OK
     * ...
     * returns String statusCode or null if the status line can't be parsed
     */
    private function _extractHttpStatusCode($headers){
    	$statusCode = null;
        if (1 === preg_match("/(\\S+) +(\\d+) +([^\n\r]+)(?:\r?\n|\r)/", $headers, $matches)) {
        	//The matches array [entireMatchString, protocol, statusCode, the rest]
            $statusCode = $matches[2];
        }
        return $statusCode;
    }

    /**
     * Tries to determine some valid headers indicating this response
     * has content.  In this case
     * return true if there is a valid "Content-Length" or "Transfer-Encoding" header
     */
    private function _httpHeadersHaveContent($headers){
        return (1 === preg_match("/[cC]ontent-[lL]ength: +(?:\\d+)(?:\\r?\\n|\\r|$)/", $headers) ||
                1 === preg_match("/Transfer-Encoding: +(?!identity[\r\n;= ])(?:[^\r\n]+)(?:\r?\n|\r|$)/i", $headers));
    }

    /**
    *  extract a ResponseHeaderMetadata object from the raw headers
    */
    private function _extractResponseHeaderMetadata($rawHeaders){
        $inputHeaders = preg_split("/\r\n|\n|\r/", $rawHeaders);
        $headers = array();
        $headers['x-mws-request-id'] = null;
        $headers['x-mws-response-context'] = null;
        $headers['x-mws-timestamp'] = null;
        $headers['x-mws-quota-max'] = null;
        $headers['x-mws-quota-remaining'] = null;
        $headers['x-mws-quota-resetsOn'] = null;

        foreach ($inputHeaders as $currentHeader) {
            $keyValue = explode (': ', $currentHeader);
            if (isset($keyValue[1])) {
                list ($key, $value) = $keyValue;
                if (isset($headers[$key]) && $headers[$key]!==null) {
                    $headers[$key] = $headers[$key] . "," . $value;
                } else {
                    $headers[$key] = $value;
                }
            }
        }

        require_once(dirname(__FILE__) . '/Model/ResponseHeaderMetadata.php');
        return new MWSFinancesService_Model_ResponseHeaderMetadata(
          $headers['x-mws-request-id'],
          $headers['x-mws-response-context'],
          $headers['x-mws-timestamp'],
          $headers['x-mws-quota-max'],
          $headers['x-mws-quota-remaining'],
          $headers['x-mws-quota-resetsOn']);
    }

    /**
     * Set curl options relating to SSL. Protected to allow overriding.
     * @param $ch curl handle
     */
    protected function setSSLCurlOptions($ch) {
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    }

    /**
     * Exponential sleep on failed request
     *
     * @param retries current retry
     */
    private function _pauseOnRetry($retries)
    {
        if ($retries <= $this->_config['MaxErrorRetry']) {
            $delay = (int) (pow(4, $retries) * 100000);
            usleep($delay);
            return true;
        }
        return false;
    }

    /**
     * Add authentication related and version parameters
     */
    private function _addRequiredParameters(array $parameters)
    {
        $parameters['AWSAccessKeyId'] = $this->_awsAccessKeyId;
        $parameters['Timestamp'] = $this->_getFormattedTimestamp();
        $parameters['Version'] = self::SERVICE_VERSION;
        $parameters['SignatureVersion'] = $this->_config['SignatureVersion'];
        if ($parameters['SignatureVersion'] > 1) {
            $parameters['SignatureMethod'] = $this->_config['SignatureMethod'];
        }
        $parameters['Signature'] = $this->_signParameters($parameters, $this->_awsSecretAccessKey);

        return $parameters;
    }

    /**
     * Convert paremeters to Url encoded query string
     */
    private function _getParametersAsString(array $parameters)
    {
        $queryParameters = array();
        foreach ($parameters as $key => $value) {
            $queryParameters[] = $key . '=' . $this->_urlencode($value);
        }
        return implode('&', $queryParameters);
    }

    /**
     * Computes RFC 2104-compliant HMAC signature for request parameters
     * Implements AWS Signature, as per following spec:
     *
     * If Signature Version is 0, it signs concatenated Action and Timestamp
     *
     * If Signature Version is 1, it performs the following:
     *
     * Sorts all  parameters (including SignatureVersion and excluding Signature,
     * the value of which is being created), ignoring case.
     *
     * Iterate over the sorted list and append the parameter name (in original case)
     * and then its value. It will not URL-encode the parameter values before
     * constructing this string. There are no separators.
     *
     * If Signature Version is 2, string to sign is based on following:
     *
     *    1. The HTTP Request Method followed by an ASCII newline (%0A)
     *    2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline.
     *    3. The URL encoded HTTP absolute path component of the URI
     *       (up to but not including the query string parameters);
     *       if this is empty use a forward '/'. This parameter is followed by an ASCII newline.
     *    4. The concatenation of all query string components (names and values)
     *       as UTF-8 characters which are URL encoded as per RFC 3986
     *       (hex characters MUST be uppercase), sorted using lexicographic byte ordering.
     *       Parameter names are separated from their values by the '=' character
     *       (ASCII character 61), even if the value is empty.
     *       Pairs of parameter and values are separated by the '&' character (ASCII code 38).
     *
     */
    private function _signParameters(array $parameters, $key) {
        $signatureVersion = $parameters['SignatureVersion'];
        $algorithm = "HmacSHA1";
        $stringToSign = null;
        if (2 == $signatureVersion) {
            $algorithm = $this->_config['SignatureMethod'];
            $parameters['SignatureMethod'] = $algorithm;
            $stringToSign = $this->_calculateStringToSignV2($parameters);
        } else {
            throw new Exception("Invalid Signature Version specified");
        }
        return $this->_sign($stringToSign, $key, $algorithm);
    }

    /**
     * Calculate String to Sign for SignatureVersion 2
     * @param array $parameters request parameters
     * @return String to Sign
     */
    private function _calculateStringToSignV2(array $parameters) {
        $data = 'POST';
        $data .= "\n";
        $endpoint = parse_url ($this->_config['ServiceURL']);
        $data .= $endpoint['host'];
        $data .= "\n";
        $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
        if (!isset ($uri)) {
            $uri = "/";
        }
        $uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
        $data .= $uriencoded;
        $data .= "\n";
        uksort($parameters, 'strcmp');
        $data .= $this->_getParametersAsString($parameters);
        return $data;
    }

    private function _urlencode($value) {
        return str_replace('%7E', '~', rawurlencode($value));
    }

    /**
     * Computes RFC 2104-compliant HMAC signature.
     */
    private function _sign($data, $key, $algorithm)
    {
        if ($algorithm === 'HmacSHA1') {
            $hash = 'sha1';
        } else if ($algorithm === 'HmacSHA256') {
            $hash = 'sha256';
        } else {
            throw new Exception ("Non-supported signing method specified");
        }
        return base64_encode(
            hash_hmac($hash, $data, $key, true)
        );
    }

    /**
     * Formats date as ISO 8601 timestamp
     */
    private function _getFormattedTimestamp()
    {
        return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time());
    }

    /**
     * Formats date as ISO 8601 timestamp
     */
    private function getFormattedTimestamp($dateTime)
    {
        return $dateTime->format(DATE_ISO8601);
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2015 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  MWS Finances Service
 * @version  2015-05-01
 * Library Version: 2015-09-03
 * Generated: Thu Sep 03 17:55:25 GMT 2015
 */

/**
 *  @see MWSFinancesService_Model
 */

require_once (dirname(__FILE__) . '/../Model.php');

/**
 * MWSFinancesService_Model_DebtRecoveryEvent
 *
 * Properties:
 *

 *
 *
DebtRecoveryType: string

 *
RecoveryAmount: MWSFinancesService_Model_Currency

 *
OverPaymentCredit: MWSFinancesService_Model_Currency

 *
DebtRecoveryItemList: array

 *
ChargeInstrumentList: array

 *
 *

 */

 class MWSFinancesService_Model_DebtRecoveryEvent extends MWSFinancesService_Model {

    public function __construct($data = null)
    {
    $this->_fields = array (
    'DebtRecoveryType' => array('FieldValue' => null, 'FieldType' => 'string'),
    'RecoveryAmount' => array('FieldValue' => null, 'FieldType' => 'MWSFinancesService_Model_Currency'),
    'OverPaymentCredit' => array('FieldValue' => null, 'FieldType' => 'MWSFinancesService_Model_Currency'),
    'DebtRecoveryItemList' => array('FieldValue' => array(), 'FieldType' => array('MWSFinancesService_Model_DebtRecoveryItem'), 'ListMemberName' => 'DebtRecoveryItem'),
    'ChargeInstrumentList' => array('FieldValue' => array(), 'FieldType' => array('MWSFinancesService_Model_ChargeInstrument'), 'ListMemberName' => 'ChargeInstrument'),
    );
    parent::__construct($data);
    }

    /**
     * Get the value of the DebtRecoveryType property.
     *
     * @return String DebtRecoveryType.
     */
    public function getDebtRecoveryType()
    {
        return $this->_fields['DebtRecoveryType']['FieldValue'];
    }

    /**
     * Set the value of the DebtRecoveryType property.
     *
     * @param string debtRecoveryType
     * @return this instance
     */
    public function setDebtRecoveryType($value)
    {
        $this->_fields['DebtRecoveryType']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if DebtRecoveryType is set.
     *
     * @return true if DebtRecoveryType is set.
     */
    public function isSetDebtRecoveryType()
    {
                return !is_null($this->_fields['DebtRecoveryType']['FieldValue']);
            }

    /**
     * Set the value of DebtRecoveryType, return this.
     *
     * @param debtRecoveryType
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withDebtRecoveryType($value)
    {
        $this->setDebtRecoveryType($value);
        return $this;
    }

    /**
     * Get the value of the RecoveryAmount property.
     *
     * @return Currency RecoveryAmount.
     */
    public function getRecoveryAmount()
    {
        return $this->_fields['RecoveryAmount']['FieldValue'];
    }

    /**
     * Set the value of the RecoveryAmount property.
     *
     * @param MWSFinancesService_Model_Currency recoveryAmount
     * @return this instance
     */
    public function setRecoveryAmount($value)
    {
        $this->_fields['RecoveryAmount']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if RecoveryAmount is set.
     *
     * @return true if RecoveryAmount is set.
     */
    public function isSetRecoveryAmount()
    {
                return !is_null($this->_fields['RecoveryAmount']['FieldValue']);
            }

    /**
     * Set the value of RecoveryAmount, return this.
     *
     * @param recoveryAmount
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withRecoveryAmount($value)
    {
        $this->setRecoveryAmount($value);
        return $this;
    }

    /**
     * Get the value of the OverPaymentCredit property.
     *
     * @return Currency OverPaymentCredit.
     */
    public function getOverPaymentCredit()
    {
        return $this->_fields['OverPaymentCredit']['FieldValue'];
    }

    /**
     * Set the value of the OverPaymentCredit property.
     *
     * @param MWSFinancesService_Model_Currency overPaymentCredit
     * @return this instance
     */
    public function setOverPaymentCredit($value)
    {
        $this->_fields['OverPaymentCredit']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if OverPaymentCredit is set.
     *
     * @return true if OverPaymentCredit is set.
     */
    public function isSetOverPaymentCredit()
    {
                return !is_null($this->_fields['OverPaymentCredit']['FieldValue']);
            }

    /**
     * Set the value of OverPaymentCredit, return this.
     *
     * @param overPaymentCredit
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withOverPaymentCredit($value)
    {
        $this->setOverPaymentCredit($value);
        return $this;
    }

    /**
     * Get the value of the DebtRecoveryItemList property.
     *
     * @return List<DebtRecoveryItem> DebtRecoveryItemList.
     */
    public function getDebtRecoveryItemList()
    {
        if ($this->_fields['DebtRecoveryItemList']['FieldValue'] == null)
        {
            $this->_fields['DebtRecoveryItemList']['FieldValue'] = array();
        }
        return $this->_fields['DebtRecoveryItemList']['FieldValue'];
    }

    /**
     * Set the value of the DebtRecoveryItemList property.
     *
     * @param array debtRecoveryItemList
     * @return this instance
     */
    public function setDebtRecoveryItemList($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['DebtRecoveryItemList']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear DebtRecoveryItemList.
     */
    public function unsetDebtRecoveryItemList()
    {
        $this->_fields['DebtRecoveryItemList']['FieldValue'] = array();
    }

    /**
     * Check to see if DebtRecoveryItemList is set.
     *
     * @return true if DebtRecoveryItemList is set.
     */
    public function isSetDebtRecoveryItemList()
    {
                return !empty($this->_fields['DebtRecoveryItemList']['FieldValue']);
            }

    /**
     * Add values for DebtRecoveryItemList, return this.
     *
     * @param debtRecoveryItemList
     *             New values to add.
     *
     * @return This instance.
     */
    public function withDebtRecoveryItemList()
    {
        foreach (func_get_args() as $DebtRecoveryItemList)
        {
            $this->_fields['DebtRecoveryItemList']['FieldValue'][] = $DebtRecoveryItemList;
        }
        return $this;
    }

    /**
     * Get the value of the ChargeInstrumentList property.
     *
     * @return List<ChargeInstrument> ChargeInstrumentList.
     */
    public function getChargeInstrumentList()
    {
        if ($this->_fields['ChargeInstrumentList']['FieldValue'] == null)
        {
            $this->_fields['ChargeInstrumentList']['FieldValue'] = array();
        }
        return $this->_fields['ChargeInstrumentList']['FieldValue'];
    }

    /**
     * Set the value of the ChargeInstrumentList property.
     *
     * @param array chargeInstrumentList
     * @return this instance
     */
    public function setChargeInstrumentList($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['ChargeInstrumentList']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear ChargeInstrumentList.
     */
    public function unsetChargeInstrumentList()
    {
        $this->_fields['ChargeInstrumentList']['FieldValue'] = array();
    }

    /**
     * Check to see if ChargeInstrumentList is set.
     *
     * @return true if ChargeInstrumentList is set.
     */
    public function isSetChargeInstrumentList()
    {
                return !empty($this->_fields['ChargeInstrumentList']['FieldValue']);
            }

    /**
     * Add values for ChargeInstrumentList, return this.
     *
     * @param chargeInstrumentList
     *             New values to add.
     *
     * @return This instance.
     */
    public function withChargeInstrumentList()
    {
        foreach (func_get_args() as $ChargeInstrumentList)
        {
            $this->_fields['ChargeInstrumentList']['FieldValue'][] = $ChargeInstrumentList;
        }
        return $this;
    }

}


<?php
/**
 *  PHP Version 5
 *
 * @category    Amazon
 * @package     MarketplaceWebService
 * @copyright   Copyright 2009 Amazon Technologies, Inc.
 * @link        http://aws.amazon.com
 * @license     http://aws.amazon.com/apache2.0  Apache License, Version 2.0
 * @version     2009-01-01
 */
/*******************************************************************************
 *  Marketplace Web Service PHP5 Library
 *  Generated: Thu May 07 13:07:36 PDT 2009
 *
 */

/**
 * MarketplaceWebService_Model_IdList
 *
 * Properties:
 *

 *
 *
Id: string

 *
 *

 */
class MarketplaceWebService_Model_IdList extends MarketplaceWebService_Model
{

    /**
     * Construct new MarketplaceWebService_Model_IdList
     *
     * @param mixed $data DOMElement or Associative Array to construct from.
     *
     * Valid properties:
     *

     *
     *
Id: string

     *
     *

     */
    public function __construct($data = null)
    {
        $this->fields = array(
            'Id' => array('FieldValue' => array(), 'FieldType' => array('string')),
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the Id .
     *
     * @return array of string Id
     */
    public function getId()
    {
        return $this->fields['Id']['FieldValue'];
    }

    /**
     * Sets the value of the Id.
     *
     * @param string $id or an array of string Id
     * @return $this This instance
     */
    public function setId($id)
    {
        if (!$this->isNumericArray($id)) {
            $id = array($id);
        }
        $this->fields['Id']['FieldValue'] = $id;
        return $this;
    }

    /**
     * Sets single or multiple values of Id list via variable number of arguments.
     * For example, to set the list with two elements, simply pass two values as arguments to this function
     * withId($id1, $id2)
     *
     * @param string $stringArgs one or more Id
     * @return MarketplaceWebService_Model_IdList  instance
     */
    public function withId($stringArgs)
    {
        foreach (func_get_args() as $id) {
            $this->fields['Id']['FieldValue'][] = $id;
        }
        return $this;
    }

    /**
     * Checks if Id list is non-empty
     *
     * @return bool true if Id list is non-empty
     */
    public function isSetId()
    {
        return count($this->fields['Id']['FieldValue']) > 0;
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2015 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  MWS Finances Service
 * @version  2015-05-01
 * Library Version: 2015-09-03
 * Generated: Thu Sep 03 17:55:25 GMT 2015
 */

/**
 *  @see MWSFinancesService_Model
 */

require_once (dirname(__FILE__) . '/../Model.php');

/**
 * MWSFinancesService_Model_RentalTransactionEvent
 *
 * Properties:
 *

 *
 *
AmazonOrderId: string

 *
RentalEventType: string

 *
ExtensionLength: int

 *
PostedDate: string

 *
RentalChargeList: array

 *
RentalFeeList: array

 *
MarketplaceName: string

 *
RentalInitialValue: MWSFinancesService_Model_Currency

 *
RentalReimbursement: MWSFinancesService_Model_Currency

 *
 *

 */

 class MWSFinancesService_Model_RentalTransactionEvent extends MWSFinancesService_Model {

    public function __construct($data = null)
    {
    $this->_fields = array (
    'AmazonOrderId' => array('FieldValue' => null, 'FieldType' => 'string'),
    'RentalEventType' => array('FieldValue' => null, 'FieldType' => 'string'),
    'ExtensionLength' => array('FieldValue' => null, 'FieldType' => 'int'),
    'PostedDate' => array('FieldValue' => null, 'FieldType' => 'string'),
    'RentalChargeList' => array('FieldValue' => array(), 'FieldType' => array('MWSFinancesService_Model_ChargeComponent'), 'ListMemberName' => 'ChargeComponent'),
    'RentalFeeList' => array('FieldValue' => array(), 'FieldType' => array('MWSFinancesService_Model_FeeComponent'), 'ListMemberName' => 'FeeComponent'),
    'MarketplaceName' => array('FieldValue' => null, 'FieldType' => 'string'),
    'RentalInitialValue' => array('FieldValue' => null, 'FieldType' => 'MWSFinancesService_Model_Currency'),
    'RentalReimbursement' => array('FieldValue' => null, 'FieldType' => 'MWSFinancesService_Model_Currency'),
    );
    parent::__construct($data);
    }

    /**
     * Get the value of the AmazonOrderId property.
     *
     * @return String AmazonOrderId.
     */
    public function getAmazonOrderId()
    {
        return $this->_fields['AmazonOrderId']['FieldValue'];
    }

    /**
     * Set the value of the AmazonOrderId property.
     *
     * @param string amazonOrderId
     * @return this instance
     */
    public function setAmazonOrderId($value)
    {
        $this->_fields['AmazonOrderId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if AmazonOrderId is set.
     *
     * @return true if AmazonOrderId is set.
     */
    public function isSetAmazonOrderId()
    {
                return !is_null($this->_fields['AmazonOrderId']['FieldValue']);
            }

    /**
     * Set the value of AmazonOrderId, return this.
     *
     * @param amazonOrderId
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withAmazonOrderId($value)
    {
        $this->setAmazonOrderId($value);
        return $this;
    }

    /**
     * Get the value of the RentalEventType property.
     *
     * @return String RentalEventType.
     */
    public function getRentalEventType()
    {
        return $this->_fields['RentalEventType']['FieldValue'];
    }

    /**
     * Set the value of the RentalEventType property.
     *
     * @param string rentalEventType
     * @return this instance
     */
    public function setRentalEventType($value)
    {
        $this->_fields['RentalEventType']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if RentalEventType is set.
     *
     * @return true if RentalEventType is set.
     */
    public function isSetRentalEventType()
    {
                return !is_null($this->_fields['RentalEventType']['FieldValue']);
            }

    /**
     * Set the value of RentalEventType, return this.
     *
     * @param rentalEventType
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withRentalEventType($value)
    {
        $this->setRentalEventType($value);
        return $this;
    }

    /**
     * Get the value of the ExtensionLength property.
     *
     * @return Integer ExtensionLength.
     */
    public function getExtensionLength()
    {
        return $this->_fields['ExtensionLength']['FieldValue'];
    }

    /**
     * Set the value of the ExtensionLength property.
     *
     * @param int extensionLength
     * @return this instance
     */
    public function setExtensionLength($value)
    {
        $this->_fields['ExtensionLength']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if ExtensionLength is set.
     *
     * @return true if ExtensionLength is set.
     */
    public function isSetExtensionLength()
    {
                return !is_null($this->_fields['ExtensionLength']['FieldValue']);
            }

    /**
     * Set the value of ExtensionLength, return this.
     *
     * @param extensionLength
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withExtensionLength($value)
    {
        $this->setExtensionLength($value);
        return $this;
    }

    /**
     * Get the value of the PostedDate property.
     *
     * @return XMLGregorianCalendar PostedDate.
     */
    public function getPostedDate()
    {
        return $this->_fields['PostedDate']['FieldValue'];
    }

    /**
     * Set the value of the PostedDate property.
     *
     * @param string postedDate
     * @return this instance
     */
    public function setPostedDate($value)
    {
        $this->_fields['PostedDate']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if PostedDate is set.
     *
     * @return true if PostedDate is set.
     */
    public function isSetPostedDate()
    {
                return !is_null($this->_fields['PostedDate']['FieldValue']);
            }

    /**
     * Set the value of PostedDate, return this.
     *
     * @param postedDate
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withPostedDate($value)
    {
        $this->setPostedDate($value);
        return $this;
    }

    /**
     * Get the value of the RentalChargeList property.
     *
     * @return List<ChargeComponent> RentalChargeList.
     */
    public function getRentalChargeList()
    {
        if ($this->_fields['RentalChargeList']['FieldValue'] == null)
        {
            $this->_fields['RentalChargeList']['FieldValue'] = array();
        }
        return $this->_fields['RentalChargeList']['FieldValue'];
    }

    /**
     * Set the value of the RentalChargeList property.
     *
     * @param array rentalChargeList
     * @return this instance
     */
    public function setRentalChargeList($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['RentalChargeList']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear RentalChargeList.
     */
    public function unsetRentalChargeList()
    {
        $this->_fields['RentalChargeList']['FieldValue'] = array();
    }

    /**
     * Check to see if RentalChargeList is set.
     *
     * @return true if RentalChargeList is set.
     */
    public function isSetRentalChargeList()
    {
                return !empty($this->_fields['RentalChargeList']['FieldValue']);
            }

    /**
     * Add values for RentalChargeList, return this.
     *
     * @param rentalChargeList
     *             New values to add.
     *
     * @return This instance.
     */
    public function withRentalChargeList()
    {
        foreach (func_get_args() as $RentalChargeList)
        {
            $this->_fields['RentalChargeList']['FieldValue'][] = $RentalChargeList;
        }
        return $this;
    }

    /**
     * Get the value of the RentalFeeList property.
     *
     * @return List<FeeComponent> RentalFeeList.
     */
    public function getRentalFeeList()
    {
        if ($this->_fields['RentalFeeList']['FieldValue'] == null)
        {
            $this->_fields['RentalFeeList']['FieldValue'] = array();
        }
        return $this->_fields['RentalFeeList']['FieldValue'];
    }

    /**
     * Set the value of the RentalFeeList property.
     *
     * @param array rentalFeeList
     * @return this instance
     */
    public function setRentalFeeList($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['RentalFeeList']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear RentalFeeList.
     */
    public function unsetRentalFeeList()
    {
        $this->_fields['RentalFeeList']['FieldValue'] = array();
    }

    /**
     * Check to see if RentalFeeList is set.
     *
     * @return true if RentalFeeList is set.
     */
    public function isSetRentalFeeList()
    {
                return !empty($this->_fields['RentalFeeList']['FieldValue']);
            }

    /**
     * Add values for RentalFeeList, return this.
     *
     * @param rentalFeeList
     *             New values to add.
     *
     * @return This instance.
     */
    public function withRentalFeeList()
    {
        foreach (func_get_args() as $RentalFeeList)
        {
            $this->_fields['RentalFeeList']['FieldValue'][] = $RentalFeeList;
        }
        return $this;
    }

    /**
     * Get the value of the MarketplaceName property.
     *
     * @return String MarketplaceName.
     */
    public function getMarketplaceName()
    {
        return $this->_fields['MarketplaceName']['FieldValue'];
    }

    /**
     * Set the value of the MarketplaceName property.
     *
     * @param string marketplaceName
     * @return this instance
     */
    public function setMarketplaceName($value)
    {
        $this->_fields['MarketplaceName']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if MarketplaceName is set.
     *
     * @return true if MarketplaceName is set.
     */
    public function isSetMarketplaceName()
    {
                return !is_null($this->_fields['MarketplaceName']['FieldValue']);
            }

    /**
     * Set the value of MarketplaceName, return this.
     *
     * @param marketplaceName
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withMarketplaceName($value)
    {
        $this->setMarketplaceName($value);
        return $this;
    }

    /**
     * Get the value of the RentalInitialValue property.
     *
     * @return Currency RentalInitialValue.
     */
    public function getRentalInitialValue()
    {
        return $this->_fields['RentalInitialValue']['FieldValue'];
    }

    /**
     * Set the value of the RentalInitialValue property.
     *
     * @param MWSFinancesService_Model_Currency rentalInitialValue
     * @return this instance
     */
    public function setRentalInitialValue($value)
    {
        $this->_fields['RentalInitialValue']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if RentalInitialValue is set.
     *
     * @return true if RentalInitialValue is set.
     */
    public function isSetRentalInitialValue()
    {
                return !is_null($this->_fields['RentalInitialValue']['FieldValue']);
            }

    /**
     * Set the value of RentalInitialValue, return this.
     *
     * @param rentalInitialValue
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withRentalInitialValue($value)
    {
        $this->setRentalInitialValue($value);
        return $this;
    }

    /**
     * Get the value of the RentalReimbursement property.
     *
     * @return Currency RentalReimbursement.
     */
    public function getRentalReimbursement()
    {
        return $this->_fields['RentalReimbursement']['FieldValue'];
    }

    /**
     * Set the value of the RentalReimbursement property.
     *
     * @param MWSFinancesService_Model_Currency rentalReimbursement
     * @return this instance
     */
    public function setRentalReimbursement($value)
    {
        $this->_fields['RentalReimbursement']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Check to see if RentalReimbursement is set.
     *
     * @return true if RentalReimbursement is set.
     */
    public function isSetRentalReimbursement()
    {
                return !is_null($this->_fields['RentalReimbursement']['FieldValue']);
            }

    /**
     * Set the value of RentalReimbursement, return this.
     *
     * @param rentalReimbursement
     *             The new value to set.
     *
     * @return This instance.
     */
    public function withRentalReimbursement($value)
    {
        $this->setRentalReimbursement($value);
        return $this;
    }

}


<?php
/*******************************************************************************
 * Copyright 2009-2014 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * PHP Version 5
 * @category Amazon
 * @package  Marketplace Web Service Products
 * @version  2011-10-01
 * Library Version: 2014-10-20
 * Generated: Fri Oct 17 17:59:56 GMT 2014
 */

/**
 * MarketplaceWebServiceProducts_Model_OffersList
 *
 * Properties:
 *

 *
 *
Offer: array

 *
 *

 */
class MarketplaceWebServiceProducts_Model_OffersList extends MarketplaceWebServiceProducts_Model
{

    public function __construct($data = null)
    {
        $this->_fields = array(
            'Offer' => array(
                'FieldValue' => array(),
                'FieldType' => array('MarketplaceWebServiceProducts_Model_OfferType')
            ),
        );
        parent::__construct($data);
    }

    /**
     * Get the value of the Offer property.
     *
     * @return MarketplaceWebServiceProducts_Model_OfferType[] Offer.
     */
    public function getOffer()
    {
        if ($this->_fields['Offer']['FieldValue'] == null) {
            $this->_fields['Offer']['FieldValue'] = array();
        }
        return $this->_fields['Offer']['FieldValue'];
    }

    /**
     * Set the value of the Offer property.
     *
     * @param array $value offer
     * @return $this This instance
     */
    public function setOffer($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array($value);
        }
        $this->_fields['Offer']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Clear Offer.
     */
    public function unsetOffer()
    {
        $this->_fields['Offer']['FieldValue'] = array();
    }

    /**
     * Check to see if Offer is set.
     *
     * @return true if Offer is set.
     */
    public function isSetOffer()
    {
        return !empty($this->_fields['Offer']['FieldValue']);
    }

    /**
     * Add values for Offer, return this.
     *
     * @param offer
     *             New values to add.
     *
     * @return $this This instance.
     */
    public function withOffer()
    {
        foreach (func_get_args() as $Offer) {
            $this->_fields['Offer']['FieldValue'][] = $Offer;
        }
        return $this;
    }

}