public function setIdType($idType)
{
$idTypes = [self::TYPE_ASIN, self::TYPE_SKU, self::TYPE_UPC, self::TYPE_EAN, self::TYPE_ISBN];
if (!in_array($idType, $idTypes)) {
throw new \InvalidArgumentException(sprintf("Invalid type '%s' passed. Valid types are: '%s'", $idType, implode(', ', $idTypes)));
}
$this->parameters['IdType'] = $idType;
if (empty($this->parameters['SearchIndex']) && $idType != self::TYPE_ASIN) {
$this->parameters['SearchIndex'] = 'All';
}
return $this;
}