Respond with sigle item

@return Response
172123
public function item($model, $transformer, $status = 200)
    {
        $data = $transformer->item( $model );
        return $this->respond( $data, $status );
    }
514020
public function targetGroupHitAction()
    {
        $currentTargetGroup = $this->targetGroupRepository->find($this->targetGroupStore->getTargetGroupId(true));

        $targetGroup = $this->targetGroupEvaluator->evaluate(TargetGroupRuleInterface::FREQUENCY_HIT, $currentTargetGroup);
        $response = new Response();

        if ($targetGroup) {
            $this->targetGroupStore->updateTargetGroupId($targetGroup->getId());
        }

        return $response;
    }
1300426
public function ipnAction()
    {
        $payboxResponse = $this->container->get('lexik_paybox.response_handler');
        $result = $payboxResponse->verifySignature();

        return new Response($result ? 'OK' : 'KO');
    }
990017
public function item()
    {
        if (!empty($this->response['data'])) {
            return new Fluent($this->resource, $this->response['data']);
        }

        // On a valid response that does not have a data field, we can assume that
        // the request is an update/delete type of request that does not return an object.

        return true;
    }
251217
protected function respond()
	{
		// Send the content-type header.
		$this->setHeader('Content-Type', $this->mimeType . '; charset=' . $this->charSet);

		// If the response is set to uncachable, we need to set some appropriate headers so browsers don't cache the response.
		if (!$this->response->cachable)
		{
			// Expires in the past.
			$this->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);

			// Always modified.
			$this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
			$this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);

			// HTTP 1.0
			$this->setHeader('Pragma', 'no-cache');
		}
		else
		{
			// Expires.
			$this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + 900) . ' GMT');

			// Last modified.
			if ($this->modifiedDate instanceof \DateTime)
			{
				$this->modifiedDate->setTimezone(new \DateTimeZone('UTC'));
				$this->setHeader('Last-Modified', $this->modifiedDate->format('D, d M Y H:i:s') . ' GMT');
			}
		}

		$this->sendHeaders();

		echo $this->getBody();
	}
570713
protected function _processResponse(Response $response): ResponseSet
    {
        $responseData = $response->getData();

        $actions = $this->getActions();

        $bulkResponses = [];

        if (isset($responseData['items']) && \is_array($responseData['items'])) {
            foreach ($responseData['items'] as $key => $item) {
                if (!isset($actions[$key])) {
                    throw new InvalidException('No response found for action #'.$key);
                }

                $action = $actions[$key];

                $opType = \key($item);
                $bulkResponseData = \reset($item);

                if ($action instanceof AbstractDocumentAction) {
                    $data = $action->getData();
                    if ($data instanceof Document && $data->isAutoPopulate()
                        || $this->_client->getConfigValue(['document', 'autoPopulate'], false)
                    ) {
                        if (!$data->hasId() && isset($bulkResponseData['_id'])) {
                            $data->setId($bulkResponseData['_id']);
                        }
                        if (isset($bulkResponseData['_version'])) {
                            $data->setVersion($bulkResponseData['_version']);
                        }
                    }
                }

                $bulkResponses[] = new BulkResponse($bulkResponseData, $action, $opType);
            }
        }

        $bulkResponseSet = new ResponseSet($response, $bulkResponses);

        if ($bulkResponseSet->hasError()) {
            throw new BulkResponseException($bulkResponseSet);
        }

        return $bulkResponseSet;
    }
284403
public function respond()
    {
        if (!$this->respond) {
            $this->respond = new Respond();
        }
        $respond = $this->respond->withRequest($this);
        $respond->with($this->getAttributes());
        return $respond;
    }
740771
private function wizardStepPrepare(): ResponseInterface
    {
        $this->filesystem->deleteDir(self::UPGRADE_FOLDER);
        $this->filesystem->createDir(self::UPGRADE_FOLDER);

        return response(view('components/alert-success', [
            'alert' => I18N::translate('The folder %s has been created.', e(self::UPGRADE_FOLDER)),
        ]));
    }
88516
public function send()
    {
        try {
            $response = $this->guzzleClient->request($this->method, $this->uri, $this->options);
        } catch (ClientException $e) {
            $this->handleApiException($e->getResponse()->getBody()->getContents());
        }

        return $this->getBody($response);
    }
1101066
def to_request
      item_pedido = {
        codigo_produto:           self.codigo_produto,
        codigo_categoria:         self.codigo_categoria,
        nome_produto:             self.nome_produto,
        quantidade_produto:       self.quantidade_produto,
        valor_unitario_produto:   self.valor_unitario_produto,
        nome_categoria:           self.nome_categoria,
      }
      return item_pedido
    end
1365394
public function callbackResponse()
    {
        // cleanup
        $this->getCaller()->setParameter("VERSION", null);
        $this->getCaller()->setParameter("PWD", null);
        $this->getCaller()->setParameter("USER", null);
        $this->getCaller()->setParameter("SIGNATURE", null);

        return $this->getCaller()->getCallBackResponse("CallbackResponse");
    }
430085
protected function execute()
    {
        $response = $this->service->IPGApiAction($this);

        if ($response instanceof Error) {
            return $response;
        }

        if ($this->function === self::FUNCTION_INSTALL) {
            return new Sell($response);
        }

        return new ConfirmRecurring($response);
    }
709152
protected function prepareResponse()
    {
        $response = new Response;
        $response->method = $this->method;
        $response->zlib_compression = $this->zlib_compression;
        return $response;
    }
289936
public function handler(): Response
    {
        $response = [];
        foreach (Permission::all() as $permission) {
            $response[] = [
                'id' => $permission->getId(),
                'permission' => $permission->getPermission(),
                'role' => [
                    'id' => $permission->getRole()->getId(),
                    'name' => $permission->getRole()->getName(),
                    'slug' => $permission->getRole()->getSlug()
                ]
            ];
        }
        return response($response);
    }
407127
public function getResponse() {
		if($this->response)
			return $this->response;
		else
			return new \Asgard\Http\Response($this->code);
	}
790600
private function processListResponse()
    {
        /** @var ListDocumentsResponse $obj_list_response */
        $obj_list_response = $this->obj_last_response;
        $obj_response = (object)[
            'status' => $this->describeStatusCode($obj_list_response->getStatus()->getCode()),
            'count' => $obj_list_response->getDocumentSize(),
            'docs' => []
        ];
        $obj_mapper = new Mapper();
        foreach($obj_list_response->getDocumentList() as $obj_document) {
            $obj_doc = $obj_mapper->fromGoogle($obj_document);
            $obj_response->docs[] = $obj_doc;
        }
        return $obj_response;
    }
191264
public function item($item, $transformer, $parameters = [], Closure $after = null)
    {
        $class = get_class($item);

        if ($parameters instanceof \Closure) {
            $after = $parameters;
            $parameters = [];
        }

        $binding = $this->transformer->register($class, $transformer, $parameters, $after);

        return new Response($item, 200, [], $binding);
    }