<?php

namespace ebay\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GetSellingManagerSoldListingsRequestType StructType
 * Meta informations extracted from the WSDL
 * - documentation: Returns a Selling Manager user's sold listings. <br><br> This call is subject to change without notice; the deprecation process is inapplicable to this call.
 * @subpackage Structs
 * @date 2017-04-07 16
 */
class GetSellingManagerSoldListingsRequestType extends AbstractRequestType
{
    /**
     * The Search
     * Meta informations extracted from the WSDL
     * - documentation: Search filters for sold listings.
     * - minOccurs: 0
     * @var \ebay\StructType\SellingManagerSearchType
     */
    public $Search;
    /**
     * The StoreCategoryID
     * Meta informations extracted from the WSDL
     * - documentation: Listings with this store category ID will be listed.
     * - minOccurs: 0
     * @var int
     */
    public $StoreCategoryID;
    /**
     * The Filter
     * Meta informations extracted from the WSDL
     * - documentation: This holds the list of filters that can be applicable for sold listings.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var string[]
     */
    public $Filter;
    /**
     * The Archived
     * Meta informations extracted from the WSDL
     * - documentation: Requests listing records that are more than 90 days old. Records are archived between 90 and 120 days after being created, and thereafter can only be retrieved using this tag.
     * - minOccurs: 0
     * @var bool
     */
    public $Archived;
    /**
     * The Sort
     * Meta informations extracted from the WSDL
     * - documentation: Field to be used to sort the response.
     * - minOccurs: 0
     * @var string
     */
    public $Sort;
    /**
     * The SortOrder
     * Meta informations extracted from the WSDL
     * - documentation: Order to be used for sorting the requested listings.
     * - minOccurs: 0
     * @var string
     */
    public $SortOrder;
    /**
     * The Pagination
     * Meta informations extracted from the WSDL
     * - documentation: Details about how many listings to return per page and which page to view.
     * - minOccurs: 0
     * @var \ebay\StructType\PaginationType
     */
    public $Pagination;
    /**
     * The SaleDateRange
     * Meta informations extracted from the WSDL
     * - documentation: Specifies the earliest (oldest) and latest (most recent) dates to use in a date range filter based on item start time. A time range can be up to 120 days.
     * - minOccurs: 0
     * @var \ebay\StructType\TimeRangeType
     */
    public $SaleDateRange;
    /**
     * Constructor method for GetSellingManagerSoldListingsRequestType
     * @uses GetSellingManagerSoldListingsRequestType::setSearch()
     * @uses GetSellingManagerSoldListingsRequestType::setStoreCategoryID()
     * @uses GetSellingManagerSoldListingsRequestType::setFilter()
     * @uses GetSellingManagerSoldListingsRequestType::setArchived()
     * @uses GetSellingManagerSoldListingsRequestType::setSort()
     * @uses GetSellingManagerSoldListingsRequestType::setSortOrder()
     * @uses GetSellingManagerSoldListingsRequestType::setPagination()
     * @uses GetSellingManagerSoldListingsRequestType::setSaleDateRange()
     * @param \ebay\StructType\SellingManagerSearchType $search
     * @param int $storeCategoryID
     * @param string[] $filter
     * @param bool $archived
     * @param string $sort
     * @param string $sortOrder
     * @param \ebay\StructType\PaginationType $pagination
     * @param \ebay\StructType\TimeRangeType $saleDateRange
     */
    public function __construct(\ebay\StructType\SellingManagerSearchType $search = null, $storeCategoryID = null, array $filter = array(), $archived = null, $sort = null, $sortOrder = null, \ebay\StructType\PaginationType $pagination = null, \ebay\StructType\TimeRangeType $saleDateRange = null)
    {
        $this
            ->setSearch($search)
            ->setStoreCategoryID($storeCategoryID)
            ->setFilter($filter)
            ->setArchived($archived)
            ->setSort($sort)
            ->setSortOrder($sortOrder)
            ->setPagination($pagination)
            ->setSaleDateRange($saleDateRange);
    }
    /**
     * Get Search value
     * @return \ebay\StructType\SellingManagerSearchType|null
     */
    public function getSearch()
    {
        return $this->Search;
    }
    /**
     * Set Search value
     * @param \ebay\StructType\SellingManagerSearchType $search
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setSearch(\ebay\StructType\SellingManagerSearchType $search = null)
    {
        $this->Search = $search;
        return $this;
    }
    /**
     * Get StoreCategoryID value
     * @return int|null
     */
    public function getStoreCategoryID()
    {
        return $this->StoreCategoryID;
    }
    /**
     * Set StoreCategoryID value
     * @param int $storeCategoryID
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setStoreCategoryID($storeCategoryID = null)
    {
        // validation for constraint: int
        if (!is_null($storeCategoryID) && !is_numeric($storeCategoryID)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($storeCategoryID)), __LINE__);
        }
        $this->StoreCategoryID = $storeCategoryID;
        return $this;
    }
    /**
     * Get Filter value
     * @return string[]|null
     */
    public function getFilter()
    {
        return $this->Filter;
    }
    /**
     * Set Filter value
     * @uses \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::valueIsValid()
     * @uses \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string[] $filter
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setFilter(array $filter = array())
    {
        $invalidValues = array();
        foreach ($filter as $getSellingManagerSoldListingsRequestTypeFilterItem) {
            if (!\ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::valueIsValid($getSellingManagerSoldListingsRequestTypeFilterItem)) {
                $invalidValues[] = var_export($getSellingManagerSoldListingsRequestTypeFilterItem);
            }
        }
        if (!empty($invalidValues)) {
            throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::getValidValues())), __LINE__);
        }
        $this->Filter = $filter;
        return $this;
    }
    /**
     * Add item to Filter value
     * @uses \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::valueIsValid()
     * @uses \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $item
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function addToFilter($item)
    {
        // validation for constraint: enumeration
        if (!\ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::valueIsValid($item)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \ebay\EnumType\SellingManagerSoldListingsPropertyTypeCodeType::getValidValues())), __LINE__);
        }
        $this->Filter[] = $item;
        return $this;
    }
    /**
     * Get Archived value
     * @return bool|null
     */
    public function getArchived()
    {
        return $this->Archived;
    }
    /**
     * Set Archived value
     * @param bool $archived
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setArchived($archived = null)
    {
        $this->Archived = $archived;
        return $this;
    }
    /**
     * Get Sort value
     * @return string|null
     */
    public function getSort()
    {
        return $this->Sort;
    }
    /**
     * Set Sort value
     * @uses \ebay\EnumType\SellingManagerSoldListingsSortTypeCodeType::valueIsValid()
     * @uses \ebay\EnumType\SellingManagerSoldListingsSortTypeCodeType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $sort
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setSort($sort = null)
    {
        // validation for constraint: enumeration
        if (!\ebay\EnumType\SellingManagerSoldListingsSortTypeCodeType::valueIsValid($sort)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $sort, implode(', ', \ebay\EnumType\SellingManagerSoldListingsSortTypeCodeType::getValidValues())), __LINE__);
        }
        $this->Sort = $sort;
        return $this;
    }
    /**
     * Get SortOrder value
     * @return string|null
     */
    public function getSortOrder()
    {
        return $this->SortOrder;
    }
    /**
     * Set SortOrder value
     * @uses \ebay\EnumType\SortOrderCodeType::valueIsValid()
     * @uses \ebay\EnumType\SortOrderCodeType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $sortOrder
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setSortOrder($sortOrder = null)
    {
        // validation for constraint: enumeration
        if (!\ebay\EnumType\SortOrderCodeType::valueIsValid($sortOrder)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $sortOrder, implode(', ', \ebay\EnumType\SortOrderCodeType::getValidValues())), __LINE__);
        }
        $this->SortOrder = $sortOrder;
        return $this;
    }
    /**
     * Get Pagination value
     * @return \ebay\StructType\PaginationType|null
     */
    public function getPagination()
    {
        return $this->Pagination;
    }
    /**
     * Set Pagination value
     * @param \ebay\StructType\PaginationType $pagination
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setPagination(\ebay\StructType\PaginationType $pagination = null)
    {
        $this->Pagination = $pagination;
        return $this;
    }
    /**
     * Get SaleDateRange value
     * @return \ebay\StructType\TimeRangeType|null
     */
    public function getSaleDateRange()
    {
        return $this->SaleDateRange;
    }
    /**
     * Set SaleDateRange value
     * @param \ebay\StructType\TimeRangeType $saleDateRange
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public function setSaleDateRange(\ebay\StructType\TimeRangeType $saleDateRange = null)
    {
        $this->SaleDateRange = $saleDateRange;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \ebay\StructType\GetSellingManagerSoldListingsRequestType
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
