Create request for operation 'getTask'

@param  string $id Task ID (required)

@throws \InvalidArgumentException
@return \GuzzleHttp\Psr7\Request
163897
protected function getTaskRequest($id)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling getTask'
            );
        }

        $resourcePath = '/tasks/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;


        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }

        // body params
        $_tempBody = null;

        if ($multipart) {
            $headers = $this->headerSelector->selectHeadersForMultipart(
                ['application/json']
            );
        } else {
            $headers = $this->headerSelector->selectHeaders(
                ['application/json'],
                ['application/json']
            );
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            // $_tempBody is the method argument, if present
            $httpBody = $_tempBody;
            // \stdClass has no __toString(), so we should encode it manually
            if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($httpBody);
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $multipartContents[] = [
                        'name' => $formParamName,
                        'contents' => $formParamValue
                    ];
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif ($headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($formParams);

            } else {
                // for HTTP post (form)
                $httpBody = \GuzzleHttp\Psr7\build_query($formParams);
            }
        }

        // this endpoint requires API key authentication
        $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY');
        if ($apiKey !== null) {
            $headers['X-API-KEY'] = $apiKey;
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = \GuzzleHttp\Psr7\build_query($queryParams);
        return new Request(
            'GET',
            $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }
1043576
public function get($id) {
        $this->checkPermissions('get');
        
        return $this->client->retrieveData($this->resourceName . '/' . $id);
    }
108846
public function load($id)
    {
        $procedure = $this->procedureFactory->createProcedure();
        $procedure->setTemplate(
            $this->loadTemplate($id)
        );

        return $procedure;
    }
869125
public function getCronBatch($id = 'cron')
    {
        $batch = $this->loader->getTaskRunnerBatch($id);
        $batch->setMessageLogFile($this->project->getCronLogfile());
        $batch->minimalStepDurationMs = 3000; // 3 seconds max before sending feedback

        if (! $batch->isLoaded()) {
            $this->loadCronBatch($batch);
        }

        return $batch;
    }
289640
public function get($id)
    {
        if ($this->has($id)) {

            // prepare constructor arguments and scope
            list($args, $scope, $sid) = $this->prepareArguments(
                $id,
                func_get_args()
            );

            // try get from pool first
            if (empty($args) && isset($this->pool[$sid])) {
                // get service from the pool
                return $this->pool[$sid];

            // not in pool, create the service
            } else {
                // circular detection
                $this->checkCircularMark($id);

                // create service base on definition
                $service = $this->serviceFromDefinition($id, $args);

                // remove circular detection mark
                $this->removeCircularMark($id);

                // store service in the pool
                if (static::SCOPE_SINGLE !== $scope) {
                    $this->pool[$sid] = $service;
                }

                return $service;
            }
        } else {
            throw new NotFoundException(
                Message::get(Message::SERVICE_ID_NOT_FOUND, $id),
                Message::SERVICE_ID_NOT_FOUND
            );
        }
    }
1296140
public function get($id)
    {
        $request = new Request('customizations');
        $request->setIdParam(urlencode($id));

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

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
1331911
public function get($id)
    {
        if (!$this->has($id)) {
            // a class name.
            if (strpos($id, '\\') && class_exists($id)) {
                /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
                $this->set($id, $id);
            } else {
                throw new \InvalidArgumentException("The service '$id' was not found, has not been registered!");
            }
        }

        return $this->getInstance($id);
    }
1102405
public function actionTaskUpdate($id)
    {
        $model = Project::getTaskModel($id);
        if (!isset($model)) {
            throw new NotFoundHttpException('The Task "' . $id . '" not found.');
        }
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['taskview', 'id' => $model->id,]);
        } else {
            return $this->render('taskupdate', [
                'model' => $model,
            ]);
        }
    }
372541
public function show($id)
    {
        $question = $this->client->get(
            sprintf('buckets/%d/questions/%d.json', $this->bucket, $id)
        );

        return new Question($this->response($question));
    }
409305
public function fetch($id)
    {
        $res = $this->request(self::PAYMENTS_PATH . "/$id")->get();

        if ($res->isError()) {
            throw new RequestError($res->errorMessage, null, $res);
        }

        return new Payment($res->json);
    }
3614
protected function performGet(string $key, string $id, array $options = null)
    {
        return $this->flow->send(
            'get',
            $this->endpoint . '/' . ($options['method'] ?? $this->verbsMap['get'] ?? 'get'),
            [$key => $id]
        );
    }
668817
public function createForTask(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE_FOR_TASK,
            $params,
            $id
        );
    }
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;
    }
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();
    }
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()
                    );
                }
            );
    }
858437
public function actionTasknotedelete($taskid, $id)
    {
        Task::getTaskNoteModel($id)->delete();

        return $this->redirect(['tasknotelist', 'taskid' => $taskid]);
    }
728186
public function load($id)
    {
        /** @var \JonnyW\PhantomJs\Procedure\ProcedureLoaderInterface $loader **/
        foreach ($this->procedureLoaders as $loader) {

            try {

                $procedure = $loader->load($id);

                return $procedure;

            } catch (\Exception $e) {}

        }

        throw new \InvalidArgumentException(sprintf('No valid procedure loader could be found to load the \'%s\' procedure.', $id));
    }