Operation getTaskAsyncWithHttpInfo



@param  string $id Task ID (required)

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
353158
public function getTaskAsyncWithHttpInfo($id)
    {
        $returnType = '\Wodby\Api\Model\Task';
        $request = $this->getTaskRequest($id);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    $responseBody = $response->getBody();
                    if ($returnType === '\SplFileObject') {
                        $content = $responseBody; //stream goes to serializer
                    } else {
                        $content = $responseBody->getContents();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
706765
public function getTaskById( $TaskId){
        $rest = $this->getService( self::API_FS_TASK . $TaskId);
        $rest->GET();

        return $rest->getResult( models\FileSystem\FsTask::class);
    }
1108392
public function runTask($id)
    {
        set_time_limit(0);

        /** @var \Illuminate\Console\Scheduling\Event $event */
        $event = $this->getKernelEvents()[$id - 1];

        $event->sendOutputTo($this->getOutputTo());

        $event->run(app());

        return $this->readOutput();
    }
1248556
public function get($id = null)
    {

        // Prep the endpoint
        $endpoint = ($id) ? $this->getEndpoint() . "/" . $id : $this->getEndpoint();

        // Get the resource
        $response = $this->client->get($endpoint, $this->prepareParams());

        // Handle response
        return $this->handleResponse(json_decode($response));

    }
1137937
public function retryTask($task_id, $delay = 1)
    {
        if (empty($task_id)) {
            throw new \InvalidArgumentException("Please set task_id");
        }
        $url = "projects/{$this->project_id}/tasks/$task_id/retry";
        $request = array('delay' => $delay);

        $this->setCommonHeaders();
        $res = json_decode($this->apiCall(self::POST, $url, $request));
        return $res->tasks[0]->id;
    }
123240
public function startTask($id, $options=array()){

        $data = array();
        
        $data['id'] = $id;

        $data = array_merge($data, $options);

        return $this->request($this->taskStartUrl, $data);
    }
1098218
public function getSourceUrlById($id) {
        $image = instance(new Model_Image)->fetchById($id);
        if (!$image) {
            throw new InvalidArgumentException(self::ERROR_IMAGE_NOT_FOUND);
        }
        return $this->getSourceUrl($image['filename']);
    }
1112973
public function fetch($id)
    {
        if (!is_string($id)) {
            throw new InvalidArgumentException(1, 'string');
        }

        if (($frozenObject = $this->doFetch($id)) !== false) {
            $this->fetchArray($frozenObject['objects'][$id]['state']);
            $object = $this->freezer->thaw($frozenObject);
        } else {
            throw new ObjectNotFoundException(
                sprintf('Object with id "%s" could not be fetched.', $id)
            );
        }

        return $object;
    }
1053538
public function getImportState($id)
    {
        $url = $this->service_url . '/import' . '/' . $id . '/state';
        $data = $this->service->prepAndSend($url, array(200), 'GET', null, true, 'application/json', 'application/json');
        return TaskState::createFromJSON(json_decode($data));
    }
1296140
public function get($id)
    {
        $request = new Request('customizations');
        $request->setIdParam(urlencode($id));

        $response = $this->client->get($request);

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
196033
public function get(string $id)
    {
        if ($this->can('get')) {
            $this->flow->getLogger()->debug("Retrieving Resource: $this->id => $id");
            return $this->make(
                $this->performGet($this->id, $id)
            );
        }
        throw new \BadMethodCallException('Method '.__FUNCTION__.' does not exist');
    }
830094
public function getTask(string $taskId): Google_Service_Tasks
    {
        return $this->service->tasks->get($this->tasklist, $taskId);
    }
1157813
public function fetch( $id ) {

		if ( $this->contains( $id ) ) {
			$this->cacheHits++;
			return $this->cache->getItem( $id );
		}

		$this->cacheMisses++;
		return false;
	}
109671
public function offsetGet($id)
    {
        if (!array_key_exists($id, $this->strings)) {
            throw new InvalidArgumentException($id . ' is not defined');
        }

        return $this->strings[$id];
    }
1284180
public function getByTask($task_id, array $params = [])
    {
        $task_id = (int) $task_id;
        if ($task_id <= 0) {
            throw new Exception('Invalid param task_id');
        }
        return $this->rest->get("todo_items/$task_id/$this->action", $params);
    }
51800
protected function getTaskData($taskId)
    {
        $task             = $this->getTask($taskId);
        $result['id']     = $this->getTaskId($task);
        $result['status'] = $this->getTaskStatus($task);
        $result['report'] = $this->getTaskReport($task);

        return $result;
    }
193486
protected function doFetch($id)
    {
        $md5Key = md5($id);

        $kvm = KVMLogger::instance('anycontent-cache');

        $data = $this->getCacheProvider()->doFetch($md5Key);

        if ($data)
        {
            $this->hit++;
            $message = $kvm->createLogMessage('Cache hit', [ 'key' => $id, 'md5' => md5($id), 'doctrine-namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }
        else
        {
            $this->miss++;
            $message = $kvm->createLogMessage('Cache miss', [ 'key' => $id, 'md5' => md5($id), 'doctrine-namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }

        return $data;

    }