Set the class to use when calling the API

@param string $api_client The class to use.

@return void
@throws DataSift_Exception_InvalidData
4345
public function setApiClient($api_client)
    {
        if (! class_exists($api_client) || ! method_exists($api_client, 'call')) {
            throw new DataSift_Exception_InvalidData('Class "' . $api_client . '" does not exist');
        }

        $this->_api_client = $api_client;
    }
479246
public function setIteratorClass($class)
    {
        if (class_exists($class)) {
            $this->iteratorClass = $class;

            return ;
        }

        if (strpos($class, '\\') === 0) {
            $class = '\\' . $class;
            if (class_exists($class)) {
                $this->iteratorClass = $class;

                return ;
            }
        }

        throw new Exception\InvalidArgumentException('The iterator class does not exist');
    }
1113126
public function delete($api, $class)
    {
        $cacheKey = md5($api . $class);

        if (isset($this->cache[$cacheKey])) {
            unset($this->cache[$cacheKey]);
        }
    }
423537
public function setClient(\OAuth2\ServerBundle\Entity\Client $client = null)
    {
        $this->client = $client;

        return $this;
    }
259602
public static function register($name, $class, $client = null)
    {
        if (!in_array('Ivory\HttpAdapter\HttpAdapterInterface', class_implements($class), true)) {
            throw HttpAdapterException::httpAdapterMustImplementInterface($class);
        }

        $adapter = ['adapter' => $class];

        if ($client !== null) {
            $adapter['client'] = $client;
        }

        self::unregister($name);
        self::$adapters = array_merge([$name => $adapter], self::$adapters);
    }
1260786
function setClientInfo(req) {

	let client = req.client = {};

	initUserAgendAndOS(req.headers, client);
	initClientIp(req, client);
}
67667
public static function init(Client $client, &$request)
    {
        // Verification for required parameters
        $config = $client->getConfig();
        if (empty($config['public_key']) || empty($config['private_key'])) {
            throw new InvalidKeysHmacException('Both, public and private key are required for hmac authentication');
        }

        // Data to process
        switch ($request->getMethod()) {
            case 'POST':
                $data = count($request->getBody()->getFields()) ? json_encode($request->getBody()->getFields()) : null;
                break;
            case 'GET' :
                $data = count($request->getQuery()) ? json_encode((string)$request->getQuery()) : null;
                break;
            case 'PUT' :
                $data = $request->getBody()->getContents();
                break;
            case 'DELETE':
                $data = $request->getQuery();
                break;
        }

        // Setting the credentials
        $request->setHeaders([
            'X-PUBLIC-KEY' => $config['public_key'],
            'X-SIGNATURE' => base64_encode(hash_hmac('sha256', $data, $config['private_key'])),
            'X-NONCE' => time(),
        ]);
    }
273117
public static function setClientId($client_id){
      if (!isset(self::$_config)){
        self::initialize();
      }
      self::$_config->configure(['CLIENT_ID' => $client_id]); 
    }
315169
public void setDatasource(Object datasource) throws PageException, ClassException, BundleException {
	if (datasource == null) return;
	data.rawDatasource = datasource;
	data.datasource = toDatasource(pageContext, datasource);
    }
651113
public static function setKey($key, ClientInterface $client = null)
	{
		self::$api = new Api($key, $client);

		return self::$api;
	}
1032724
protected function assertApiClassImplementsInterface(string $interface): void
    {
        $apiClass = $this->getFactorySpecificConfig()['default'];

        if (false === ($interfaces = @class_implements($apiClass, true))) {
            throw new InvalidApiClassException(
                sprintf("Class %s is invalid", $apiClass)
            );
        }

        if (!in_array($interface, $interfaces)) {
            throw new InvalidApiClassException(
                sprintf("Class %s must implement %s interface", $apiClass, $interface)
            );
        }
    }
1115150
protected function setClient(HttpClient $client = null)
    {
        if ($client instanceof HttpClient) {
            $this->client = $client;
        } else {
            $this->client = new HttpClient([
                'headers' => [
                    'Authorization' => "Bearer {$this->accessToken}",
                ],
            ]);
        }
    }
255363
public function setData($data)
    {
      if(!is_string($data) && strlen(trim($data)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid data, must be a non empty string');

      $this->data = $data;
    }
1371357
protected function HTTPOptionsTrait():void{

		if(!\is_array($this->curl_options)){
			$this->curl_options = [];
		}

		if(!\is_string($this->user_agent) || empty(\trim($this->user_agent))){
			throw new ClientException('invalid user agent');
		}

		$this->setCA();
	}
1232735
public function reload()
    {
        if (strlen($this->_id) == 0) {
            throw new DataSift_Exception_InvalidData('Unable to reload pylon without an ID');
        }

        $this->load(self::get($this->_user, $this->_id));
    }
806921
protected function init($data)
    {
        if (! isset($data['id'])) {
            throw new DataSift_Exception_InvalidData('No id found');
        }
        $this->_id = $data['id'];

        if (! isset($data['name'])) {
            throw new DataSift_Exception_InvalidData('No name found');
        }
        $this->_name = $data['name'];

        if (! isset($data['created_at'])) {
            throw new DataSift_Exception_InvalidData('No created_at found');
        }
        $this->_created_at = $data['created_at'];

        if (! isset($data['status'])) {
            throw new DataSift_Exception_InvalidData('No status found');
        }
        $this->_status = $data['status'];

        if (! isset($data['hash_type'], $data)) {
            throw new DataSift_Exception_InvalidData('No hash_type found');
        }
        $this->_hash_type = $data['hash_type'];

        if (! isset($data['hash'])) {
            throw new DataSift_Exception_InvalidData('No hash found');
        }
        $this->_hash = $data['hash'];

        if (! isset($data['last_request'])) {
            $this->_last_request = 0;
        } else {
            $this->_last_request = $data['last_request'];
        }

        if (! isset($data['last_success'])) {
            $this->_last_success = 0;
        } else {
            $this->_last_success = $data['last_success'];
        }

        if (! isset($data['output_type'])) {
            throw new DataSift_Exception_InvalidData('No output_type found');
        }
        $this->_output_type = $data['output_type'];

        if (! isset($data['output_params'])) {
            throw new DataSift_Exception_InvalidData('No output_params found');
        }
        $this->_output_params = $this->parseOutputParams($data['output_params']);
    }
163072
public function setData($data = array())
    {
        /**
         * Since we base our signature off of the secure[data] parameter it cannot
         * be changed once the signature has been generated.
         */
        if (isset($this->requestSignature)) {
            throw new BadMethodCallException('The signature for this request has already been generated.');
        }

        $this->data = $data;
        $this->mergeRedirect();
    }