| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace Elasticsearch\Endpoints\Tasks;
- use Elasticsearch\Common\Exceptions;
- use Elasticsearch\Endpoints\AbstractEndpoint;
- /**
- * Class Get
- *
- * @category Elasticsearch
- * @package Elasticsearch\Endpoints\Tasks
- * @author Zachary Tong <zach@elastic.co>
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
- * @link http://elastic.co
- */
- class Get extends AbstractEndpoint
- {
- private $taskId;
- /**
- * @param string $taskId
- *
- * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException
- * @return $this
- */
- public function setTaskId($taskId)
- {
- if (isset($taskId) !== true) {
- return $this;
- }
- $this->taskId = $taskId;
- return $this;
- }
- /**
- * @throws \Elasticsearch\Common\Exceptions\RuntimeException
- * @return string
- */
- public function getURI()
- {
- if (isset($this->taskId) === true) {
- return "/_tasks/{$this->taskId}";
- }
- return "/_tasks";
- }
- /**
- * @return string[]
- */
- public function getParamWhitelist()
- {
- return array(
- 'wait_for_completion'
- );
- }
- /**
- * @return string
- */
- public function getMethod()
- {
- return 'GET';
- }
- }
|