Retrieve the json response

@return string
553871
public function getJson()
    {
        $response = [
            'status' => $this->status,
        ];

        switch ($this->status) {
            case self::STATUS_SUCCESS:
            case self::STATUS_FAIL:
                $response = array_merge(
                    $response,
                    [
                        'data' => $this->data,
                    ]
                );
                break;
            case self::STATUS_ERROR;
                $code     = $this->code ? ['code' => $this->code] : [];
                $data     = $this->data ? ['data' => $this->data] : [];
                $response = array_merge(
                    $response,
                    [
                        'message' => $this->message,
                    ],
                    $code,
                    $data
                );
                break;
            default:
                // because of the check in setStatus, this should never occur
                $response = [
                    'status'  => self::STATUS_ERROR,
                    'code'    => 500,
                    'message' => 'JSend response was built illegally',
                    'data'    => [
                        'original-data' => [
                            'status'  => $this->status,
                            'code'    => $this->code,
                            'message' => $this->message,
                            'data'    => $this->data,
                        ],
                    ],
                ];
                break;
        }

        return json_encode($response);
    }
1248057
public function toJson()
    {
        $json = array();
        $json['id'] = $this->id;
        $json['url'] = $this->url;
        $json['pattern'] = $this->pattern;
        $json['event'] = $this->event;
        $json['name'] = $this->name;
        $json['links'] = $this->links;

        return $json;
    }
381524
public function getStatus(){

        // set response to json
        $this->setEndpoint('json');

        // get response
        $obj = json_decode( $this->get(), true);

        return array_get($obj, 'status', null);

    }
758616
public function jsonSerialize()
    {
        $serializer = $this->localSerializer ?? static::$serializer;
        if ($serializer) {
            return is_string($serializer)
                ? $this->rawFormat($serializer)
                : call_user_func($serializer, $this);
        }

        return $this->toJSON();
    }
618626
public function info(): JsonResponse
    {
        $data = $this->definitionService->generate(OpenApi3Generator::FORMAT);

        return $this->json($data);
    }
1110607
public function jsonSerialize()
    {
        $data = [
            'title' => $this->title,
            'address' => $this->address
        ];


        $data = array_merge($data, $this->buildJsonAttributes([
            'reply_markup' => $this->replyMarkup
        ]));

        return $data;
    }
1357669
public function jsonSerialize()
    {
        $json = [];

        foreach (['code', 'message', 'description', 'uri'] as $field) {
            if ($this->$field !== null) {
                $json[$field] = $this->$field;
            }
        }

        return $json;
    }
740830
protected function respond()
    {
        $response = [];

        if (!empty($this->meta)) {
            $response['meta'] = $this->meta;
        }

        $response['data'] = $this->data;

        if ($this->data instanceof Arrayable) {
            $response['data'] = $this->data->toArray();
        }

        return Response::json($response, $this->statusCode, $this->headers);
    }
1209814
protected function getJson()
    {
        if ($this->json) {
            return $this->json;
        }
        $composer = Util::joinPaths($this->getPath(), 'composer.json');
        $file = new JsonFile($composer);
        $this->json = $file->read();
        return $this->json;
    }
958762
public function json()
    {
        $this->response->data = json_decode($this->response->body);

        return $this->response;
    }
992048
public function getNotifyResponseStringJson() {
    $response['Result'] = $this->notifyResponse['Result'];
    $response['ErrorMessage'] = $this->notifyResponse['ErrorMessage'];
    $response['OrderId'] = $this->notifyResponse['OrderId'];
    $response['CustomerId'] = $this->notifyResponse['CustomerId'];
    $response['MailSent'] = $this->notifyResponse['MailSent'];
    $response['Timestamp'] = time();

    return json_encode($this->notifyResponse);
  }
703104
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'text' => $this->getText(),
                'html' => $this->getHtml()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
1333286
public function getJson()
    {
        if (stripos($this->getHeader('content-type'), '/json') !== false) {
            return json_decode($this->body, true);
        } else {
            return false;
        }
    }
215701
public function toResponseJSON()
    {
        // successful response
        $arr = array('jsonrpc' => self::JSON_RPC_VERSION);
        if ($this->result !== null) {
            $arr['result'] = $this->result;
            $arr['id'] = $this->id;
            return json_encode($arr);
        // error response
        } else {
            $arr['error'] = array('code' => $this->error_code, 'message' => $this->error_message);
            $arr['id'] = $this->id;
            return json_encode($arr);
        }
    }
545407
public function getJsonResponse($data)
    {
        $view = new JsonModel();
        $view->setTerminal(true);

        $response = $this->getResponse();
        $response->setContent(json_encode($data));

        return $response;
    }
809661
public function get(): array
    {
        $response = [];
        if ($this->request('get')) {
            $response = \GuzzleHttp\json_decode(
                $this->lastResponse->getBody(),
                true
            );
        };

        return $response;
	}
1296653
public function asJSON() : string
    {
        $fields = [];

        foreach($this->_data as $key => $value) {
            if(!is_object($value)) {
                $fields[$key] = $value;
            }
        }

        return json_encode($fields);
    }