Create a new saved search for the authenticated user. A user may only have 25 saved searches.

@param array $parameters
@param bool $multipart
@param bool $appOnlyAuth
@return mixed
341069
public function getSavedSearchesCreate(array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->post('saved_searches/create', $parameters, $multipart, $appOnlyAuth);
    }
601218
public static function listAllCustomerGroupsAsync(array $parameters = [])
    {
        return self::listAllCustomerGroupsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
755541
public function getApplicationRateLimitStatus(array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->get("application/race_limit_status", $parameters, $multipart, $appOnlyAuth);
    }
158600
public static function listAllDiscountCouponsAsync(array $parameters = [])
    {
        return self::listAllDiscountCouponsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
283447
public function getStatusesRetweetsOfMe(array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->get('statuses/retweets_of_me', $parameters, $multipart, $appOnlyAuth);
    }
271932
private function createRequest(array $params, array $files, $method, $url)
    {
        if (!count($params) && !count($files)) {
            return $this->factory->createRequest($method, $url);
        }

        $builder = clone $this->multipartStreamBuilder;

        foreach ($params as $k => $v) {
            $builder->addResource($k, $v);
        }

        foreach ($files as $k => $file) {
            $builder->addResource($k, fopen($file, 'r'), ['filename' => $file]);
        }

        return $this->factory->createRequest(
            $method,
            $url,
            ['Content-Type' => 'multipart/form-data; boundary=' . $builder->getBoundary()],
            $builder->build()
        );
    }
1160107
public function search($params)
    {
        $query = OAuth2Client::find()->orderBy(['client_id' => SORT_DESC]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'client_id' => $this->client_id,
            'user_id' => $this->user_id
        ]);

        $query->andFilterWhere(['like', 'client_secret', $this->client_secret])
            ->andFilterWhere(['like', 'redirect_uri', $this->redirect_uri])
            ->andFilterWhere(['like', 'grant_type', $this->grant_type])
            ->andFilterWhere(['like', 'scope', $this->scope])
            ->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'domain', $this->domain])
            ->andFilterWhere(['like', 'provider', $this->provider])
            ->andFilterWhere(['like', 'icp', $this->icp])
            ->andFilterWhere(['like', 'registration_ip', $this->registration_ip]);

        return $dataProvider;
    }
926791
public function search($parameters = [])
    {
        $parameters = array_merge([
            'term' => $this->defaultTerm,
            'location' => $this->defaultLocation,
            'limit' => $this->searchLimit
        ], $parameters);

        $path = $this->appendParametersToUrl('/v2/search', $parameters);
        $request = $this->getRequest('GET', $path);

        return $this->processRequest($request);
    }
820506
public function api($method, $path, array $parameters = array(), $multipart = false, $appOnlyAuth = false, $internal = false)
    {
        $result = $this->twitter->api($method, $path, $parameters, $multipart, $appOnlyAuth, $internal);
        
        return $this->reformatResult($result);
    }
1332804
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = [])
    {
        return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters);
    }
1234822
public function query($name, $parameters = [])
    {
        if (!isset($parameters['APPID'])) {
            $parameters['APPID'] = $this->apiKey;
        }

        if (!isset($parameters['units'])) {
            $parameters['units'] = $this->units;
        }

        if (!isset($parameters['lang'])) {
            $parameters['lang'] = $this->lang;
        }

        $baseUrl = $this->apiUrl.$name;

        $requestQueryParts = [];
        foreach ($parameters as $key => $value) {
            $requestQueryParts[] = $key.'='.rawurlencode($value);
        }
        $baseUrl .= '?'.implode('&', $requestQueryParts);

        $response = $this->guzzleClient->get($baseUrl);
        $response = json_decode($response->getBody()->getContents());

        return $response;
    }
1223872
public function patch($path, array $parameters = array(), $multipart = false, $appOnlyAuth = false, $internal = false)
    {
        return $this->api('PATCH', $path, $parameters, $multipart, $appOnlyAuth, $internal);
    }
52518
public function postStatusesRetweet($id, array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->post("statuses/retweet/{$id}", $parameters, $multipart, $appOnlyAuth);
    }
1170378
protected function getOAuthHeader($method, $url, $params = [], $multipart = false)
    {
        $oauth['oauth_consumer_key']     = $this->consumerKey;
        $oauth['oauth_nonce']            = time();
        $oauth['oauth_signature_method'] = self::OAUTH_SIGNATURE_METHOD;
        $oauth['oauth_timestamp']        = time();
        $oauth['oauth_token']            = $this->token;
        $oauth['oauth_version']          = self::OAUTH_VERSION;

        if (!$multipart) {
            $signParams = array_merge($params, $oauth);
        } else {
            $signParams = $oauth;
        }

        uksort($signParams, 'strcmp');

        $query = $this->encodeParams($signParams);

        $queryString = implode('&', $query);

        $signature = strtoupper($method)
            . '&' . $this->urlencodeRfc3986($url)
            . '&' . $this->urlencodeRfc3986($queryString);

        $signingKey = $this->urlencodeRfc3986($this->consumerSecret)
            . '&' . $this->urlencodeRfc3986($this->tokenSecret);

        $hash_hmac = hash_hmac('sha1', $signature, $signingKey, true);
        $oauth['oauth_signature'] = base64_encode($hash_hmac);

        uksort($oauth, 'strcmp');
        $authParams = $this->encodeParams($oauth, true);

        return 'OAuth ' . implode(', ', $authParams);
    }
600326
public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
    {
        $parameters = $this->formatParameters($parameters);

        if ($expiration) {
            $parameters = $parameters + ['expires' => $this->availableAt($expiration)];
        }

        ksort($parameters);

        $key = call_user_func($this->keyResolver);

        return $this->route($name, $parameters + [
            'signature' => hash_hmac('sha256', $this->route($name, $parameters, $absolute), $key),
        ], $absolute);
    }
940336
private function createHeader($parameters)
	{
		$header = 'OAuth ';

		foreach ($parameters as $key => $value)
		{
			if (!strcmp($header, 'OAuth '))
			{
				$header .= $key . '="' . $this->safeEncode($value) . '"';
			}
			else
			{
				$header .= ', ' . $key . '="' . $value . '"';
			}
		}

		return $header;
	}
762729
function post($url, $parameters = array(), $multi = false) {
    $response = $this->oAuthRequest($url, 'POST', $parameters, $multi );
    if ($this->format === 'json' && $this->decode_json) {
      return json_decode($response, true);
    }
    return $response;
  }