/**
  * @param string|NULL $filter
  * @param string|NULL $booster
  * @param float|NULL $userWeight
  * @param float|NULL $itemWeight
  * @param float|NULL $diversity
  * @param bool $details
  * @param float|NULL $diversityDecay
  * @param bool|NULL $recommendationFeedback
  * @param bool|NULL $categoryBlacklist
  * @param DateTime|NULL $userInteractionTime
  * @throws InvalidArgumentException when given diversity decay isn't number or in range <0,1>
  */
 public function __construct($filter = NULL, $booster = NULL, $userWeight = NULL, $itemWeight = NULL, $diversity = NULL, $details = false, $diversityDecay = NULL, $recommendationFeedback = NULL, $categoryBlacklist = NULL, DateTime $userInteractionTime = NULL)
 {
     parent::__construct($filter, $booster, $userWeight, $itemWeight, $diversity);
     $this->details = (bool) $details;
     if ($diversityDecay !== NULL) {
         $this->setDiversityDecay($diversityDecay);
     }
     $this->recommendationFeedback = $recommendationFeedback === NULL ? NULL : (bool) $recommendationFeedback;
     $this->categoryBlacklist = $categoryBlacklist === NULL ? NULL : (bool) $categoryBlacklist;
     $this->userInteractionTime = $userInteractionTime;
 }
 /**
  * @param string $templateId
  * @param TemplateConfiguration $configuration
  * @return NULL
  * @throws InvalidArgumentException when given template id is empty string value
  * @throws RequestFailedException when request failed for some reason
  */
 public function insertOrUpdateTemplate($templateId, TemplateConfiguration $configuration)
 {
     if ($templateId == '') {
         throw new InvalidArgumentException("Template id can't be empty string.");
     }
     $content = [self::TEMPLATE_ID_PARAMETER => $templateId];
     $content = $this->setContentIfNotNull($content, self::FILTER_PARAMETER, $configuration->getFilter());
     $content = $this->setContentIfNotNull($content, self::BOOSTER_PARAMETER, $configuration->getBooster());
     $content = $this->setContentIfNotNull($content, self::USER_WEIGHT_PARAMETER, $configuration->getUserWeight());
     $content = $this->setContentIfNotNull($content, self::ITEM_WEIGHT_PARAMETER, $configuration->getItemWeight());
     $content = $this->setContentIfNotNull($content, self::DIVERSITY_PARAMETER, $configuration->getDiversity());
     $restriction = new Restriction([], $content);
     return $this->performPost(self::INSERT_OR_UPDATE_TEMPLATE_URL, $restriction);
 }