Converts the response's data to JSON.

@return string JSON representation of the results.
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
521107
public function getData()
    {
        if (null == $this->_response) {
            $response = $this->_responseString;

            try {
                if ($this->getJsonBigintConversion()) {
                    $response = JSON::parse($response, true, 512, JSON_BIGINT_AS_STRING);
                } else {
                    $response = JSON::parse($response);
                }
            } catch (JSONParseException $e) {
                // leave response as is if parse fails
            }

            if (empty($response)) {
                $response = [];
            }

            if (\is_string($response)) {
                $response = ['message' => $response];
            }

            $this->_response = $response;
            $this->_responseString = '';
        }

        return $this->_response;
    }
993296
public function json()
    {
        $json = json_decode($this->getBody(), true);
        if ($json === null) {
            throw new RuntimeException(sprintf(
                "Can't decode response as JSON: %s",
                function_exists('json_last_error_msg')?
                    json_last_error_msg():
                    'Error code '.json_last_error()
            ));
        }
        return $json;
    }
137951
public function to_json() {
		parent::to_json();

		$this->json['palette']          = $this->palette;
		$this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false';
		$this->json['mode']             = $this->mode;
		$this->json['defaultPalette']   = 			[
			[
				'name'  => esc_attr__( 'Pale Pink', 'kirki' ),
				'slug'  => 'pale-pink',
				'color' => '#f78da7',
			],
			[
				'name'  => esc_attr__( 'Vivid Red', 'kirki' ),
				'slug'  => 'vivid-red',
				'color' => '#cf2e2e',
			],
			[
				'name'  => esc_attr__( 'Luminous Vivid Orange', 'kirki' ),
				'slug'  => 'luminous-vivid-orange',
				'color' => '#ff6900',
			],
			[
				'name'  => esc_attr__( 'Luminous Vivid Amber', 'kirki' ),
				'slug'  => 'luminous-vivid-amber',
				'color' => '#fcb900',
			],
			[
				'name'  => esc_attr__( 'Light Green Cyan', 'kirki' ),
				'slug'  => 'light-green-cyan',
				'color' => '#7bdcb5',
			],
			[
				'name'  => esc_attr__( 'Vivid Green Cyan', 'kirki' ),
				'slug'  => 'vivid-green-cyan',
				'color' => '#00d084',
			],
			[
				'name'  => esc_attr__( 'Pale Cyan Blue', 'kirki' ),
				'slug'  => 'pale-cyan-blue',
				'color' => '#8ed1fc',
			],
			[
				'name'  => esc_html__( 'Vivid Cyan Blue', 'kirki' ),
				'slug'  => 'vivid-cyan-blue',
				'color' => '#0693e3',
			],
			[
				'name'  => esc_attr__( 'White', 'kirki' ),
				'slug'  => 'theme-white',
				'color' => '#fff',
			],
			[
				'name'  => esc_attr__( 'Very Light Gray', 'kirki' ),
				'slug'  => 'very-light-gray',
				'color' => '#eee',
			],
			[
				'name'  => esc_html__( 'Cyan Bluish Gray', 'kirki' ),
				'slug'  => 'cyan-bluish-gray',
				'color' => '#abb8c3',
			],
			[
				'name'  => esc_attr__( 'Blue Gray', 'kirki' ),
				'slug'  => 'blue-gray',
				'color' => '#546E7A',
			],
			[
				'name'  => esc_attr__( 'Very Dark Gray', 'kirki' ),
				'slug'  => 'very-dark-gray',
				'color' => '#313131',
			],
			[
				'name'  => esc_attr__( 'Black', 'kirki' ),
				'slug'  => 'theme-black',
				'color' => '#000',
			],
		];
	}
996485
public function getJson()
    {
        $json = array(
            'urlKeyParam' => $this->getUrlKeyParam(),
            'inputFieldName' => $this->getTokenInputName(),
            'observedCssRules' => $this->getObservedCssRules(),
            'requestUrl' => $this->getTokenUrl(),
            'cookieName' => $this->getCookieName()
        );

        return json_encode($json);
    }
503683
public function jsonSerialize() {
        return array('count' => $this->totalAmount, 
            'countOfPages' => $this->numberOfPages(), 
            'limit' => $this->amountPerPage,
            'page' => $this->currentPage, 
            'previousPage' => $this->previousPage(), 
            'nextPage' => $this->nextPage());
    }
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);
  }
333999
public function json() : string
    {
        return json_encode([
            'title' => $this->title,
            'body' => $this->body,
            'url' => $this->url,
            'icon' => $this->icon,
        ]);
    }
1201473
public function to_json() {
		parent::to_json();

		if ( is_array( $this->choices ) ) {
			foreach ( $this->choices as $choice => $value ) {
				if ( 'labels' !== $choice && true === $value ) {
					$this->json['choices'][ $choice ] = true;
				}
			}
		}
		if ( is_array( $this->json['default'] ) ) {
			foreach ( $this->json['default'] as $key => $value ) {
				if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) {
					$this->json['value'][ $key ] = $value;
				}
			}
		}
	}
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);
        }
    }
1160410
protected function _getJson()
    {
        if ($this->_json) {
            return $this->_json;
        }

        return $this->_json = json_decode($this->_getBody(), true);
    }
834393
public function getJson()
    {
        if (!isset($this->json)) {
            $this->json = json_decode($this->getProp('dump-single-json'));
        }

        return $this->json;
    }
325929
public function toJson ()
    {
        $rows    = array_map("str_getcsv", explode("\n", trim($this->data)));
        $columns = array_shift($rows);
        $csv     = array();

        foreach ($rows as $row)
        {
            $csv[] = array_combine($columns, $row);
        }

        return json_encode($csv);
    }
1194247
public function serializeToJsonString()
    {
        $output = new CodedOutputStream($this->jsonByteSize());
        $this->serializeToJsonStream($output);
        return $output->getData();
    }
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
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);
    }
1200668
public function jsonSerialize()
    {
        $data = [
            'url' => $this->url
        ];

        $data = array_merge($data, $this->buildJsonAttributes([
            'certificate' => $this->certificate,
            'max_connections' => $this->maxConnections,
            'allowed_updates' => $this->allowedUpdates
        ]));

        return $data;
    }