type !== null) { self::requireIn($this->type, ['full', '1025'], 'automatic_anticipation_settings.type'); } if ($this->volumePercentage !== null && ($this->volumePercentage < 0 || $this->volumePercentage > 100)) { throw new \InvalidArgumentException('automatic_anticipation_settings.volume_percentage deve estar entre 0 e 100.'); } if ($this->delay !== null && $this->delay < 0) { throw new \InvalidArgumentException('automatic_anticipation_settings.delay deve ser maior ou igual a zero.'); } } public function toArray(): array { return $this->filterFilledRecursive([ 'enabled' => $this->enabled, 'type' => $this->type, 'volume_percentage' => $this->volumePercentage, 'delay' => $this->delay, 'days' => $this->days, ]); } }