<commit_before><?php

namespace Janrain\Api\Capture;

use Janrain\Api\AbstractApi;
use Janrain\Exception\MissingArgumentException;

class Settings extends AbstractApi
{
	/**
	 * Get the value associated with a key for a particular `client_id`. If the key
	 * has not value for that client, then return the key's default value for the
	 * application, or if they key has not default value, then return null.
	 *
	 * @param string $key The key whose value you want to retrieve. To find out the
	 *                    values available, use the 'settings/keys' API call first
	 *
	 * @param string $forClientId The client identifier. If you do not enter a value
	 *                            for this parameter, it defaults to the value of
	 *                            the `client_id`, that is, you are getting the
	 *                            value for a key in your own record.
	 */
	public function getSingle($key, $forClientId = null)
	{
		$params = array('key' => $key);

		if ($forClientId) {
			$params['for_client_id'] = $forClientId;
		}

		return $this->post('settings/get', $params);
	}

	/**
	 * Look up multiple keys. Each value is retrieved, as in the 'settings/get'
	 * command, by first looking at the client-specific setting, and then falling
	 * back to the application default setting.
	 *
	 * @param array $keys Array of the keys to retrieve
	 *
	 * @param string $forClientId The client identifier whose keys will be retrieved.
	 *                            If you do not enter a value for this parameter,
	 *                            it defaults to the value of the `client_id`,
	 *                            that is, you are getting the values for multiple
	 *                            keys in your own record
	 */
	public function getMulti(array $keys, $forClientId = null)
	{
		$params = json_encode(array_values($keys));

		if ($forClientId) {
			$params['for_client_id'] = $forClientId;
		}

		return $this->post('settings/get_multi', $params);
	}

	/**
	 * Get all settings for a particular client, including those from the application-
	 * wide default settings. If a key is defined in both the client and application<commit_msg>Fixed params in Settings api.<commit_after><?php

namespace Janrain\Api\Capture;

use Janrain\Api\AbstractApi;
use Janrain\Exception\MissingArgumentException;

class Settings extends AbstractApi
{
	/**
	 * Get the value associated with a key for a particular `client_id`. If the key
	 * has not value for that client, then return the key's default value for the
	 * application, or if they key has not default value, then return null.
	 *
	 * @param string $key The key whose value you want to retrieve. To find out the
	 *                    values available, use the 'settings/keys' API call first
	 *
	 * @param string $forClientId The client identifier. If you do not enter a value
	 *                            for this parameter, it defaults to the value of
	 *                            the `client_id`, that is, you are getting the
	 *                            value for a key in your own record.
	 */
	public function getSingle($key, $forClientId = null)
	{
		$params = array('key' => $key);

		if ($forClientId) {
			$params['for_client_id'] = $forClientId;
		}

		return $this->post('settings/get', $params);
	}

	/**
	 * Look up multiple keys. Each value is retrieved, as in the 'settings/get'
	 * command, by first looking at the client-specific setting, and then falling
	 * back to the application default setting.
	 *
	 * @param array $keys Array of the keys to retrieve
	 *
	 * @param string $forClientId The client identifier whose keys will be retrieved.
	 *                            If you do not enter a value for this parameter,
	 *                            it defaults to the value of the `client_id`,
	 *                            that is, you are getting the values for multiple
	 *                            keys in your own record
	 */
	public function getMulti(array $keys, $forClientId = null)
	{
		$params = array(
			'keys' => json_encode(array_values($keys)),
		);

		if ($forClientId) {
			$params['for_client_id'] = $forClientId;
		}

		return $this->post('settings/get_multi', $params);
	}

	/**
	 * Get all settings for a particular client, including those from the application-
	 * wide default settings. If a key is defined in both the client and application
{'fraction_non_alphanumeric': 0.08419126058110273, 'fraction_numerical': 0.0, 'mean_word_length': 2.4781225139220364, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7231836', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1123, 'n_words': 503}