Registers that new API call has been made.

@param string $api_key
@param string $region
@param string $app_header
1693
public function registerAppLimits( string $api_key, string $region, string $app_header )
	{
		$limits = self::parseLimitHeaders($app_header);
		$this->initApp($api_key, $region, $limits);
	}
772288
public static PagerDuty create(String apiKey) {
    Retrofit retrofit = new Retrofit.Builder() //
        .baseUrl(HOST) //
        .addConverterFactory(GsonConverterFactory.create())
        .build();
    return create(apiKey, retrofit);
  }
1152283
public void setApiKey(String apiKey) {
        if (this.jsonHttpClient != null) {
            this.jsonHttpClient.setApiKey(apiKey);
        }
        if (this.restApiClient != null) {
            this.restApiClient.setApiKey(apiKey);
        }
        if (this.swaggerApiClient != null) {
            ApiKeyAuth genieKey = (ApiKeyAuth) this.swaggerApiClient.getAuthentication("GenieKey");
            genieKey.setApiKeyPrefix("GenieKey");
            genieKey.setApiKey(apiKey);
        }
    }
283877
def _initialize_connection(api_key, app_key):
    '''
    
    '''
    if api_key is None:
        raise SaltInvocationError('api_key must be specified')
    if app_key is None:
        raise SaltInvocationError('app_key must be specified')
    options = {
        'api_key': api_key,
        'app_key': app_key
    }
    datadog.initialize(**options)
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;
    }
25101
public function canCall( string $api_key, string $region, string $resource, string $endpoint ): bool
	{
		return $this->storage->canCall($api_key, $region, $resource, $endpoint);
	}
1114777
static function create($apikey, array $conf = []) {
        $clnt = new YunpianClient();
        $clnt->conf->init()->with($apikey, $conf);
        $clnt->initHttp($clnt->conf); // YunpianGuzzle->initHttp
        return $clnt;
    }
946886
public static function validateKey($app_id, $key) {
        $app_key = AppKey::with('app')
            ->where('app_id', $app_id)
            ->where('key', $key)
            ->first();

        if ($app_key) {
            return static::setKey($app_key);
        }
    }
1146274
public static function getAppIdByApiKey($api_key)
    {
        if (empty($api_key)) {
            return null;
        }
        $cacheKey = 'apikey2appid:' . $api_key;
        try {
            return \Cache::remember($cacheKey, \Config::get('df.default_cache_ttl'), function () use ($api_key){
                return App::whereApiKey($api_key)->firstOrFail()->id;
            });
        } catch (ModelNotFoundException $ex) {
            return null;
        }
    }
510059
public static function create($statuscode,$remote_app_id, $last_response){

        $aLogs = ApiLogQuery::create()->findByRemoteAppId($remote_app_id);
        foreach($aLogs as $oLog){
            $oLog->delete();
        }

        $oApiLog = new ApiLog();
        $oApiLog->setRemoteAppId($remote_app_id);
        $oApiLog->setStatuscode($statuscode);
        $oApiLog->setLastResponse($last_response);
        $dt = new \DateTime();
        $oApiLog->setDtCall($dt);
        $oApiLog->save();
    }
1041703
public function getMethodLimits( string $api_key, string $region, string $endpoint)
	{
		return @$this->limits[$region][$api_key]['method'][$endpoint];
	}
156904
public function onRequest(Application $application, Request $request)
    {
        $params = $request->getParameters();
        $this->setCode($params['locale'] ?? $this->defaultLocale);
    }
1104500
public function addResponseHeader(ResponseHeader $header, $key = '')
    {
        if (empty($key)) {
            $this->responseHeaders[] = $header->toArray();
        } else {
            $this->responseHeaders[$key] = $header->toArray();
        }

        return $this;
    }
1374320
public static PagerDuty create(String apiKey, Retrofit retrofit) {
    checkStringArgument(apiKey, "apiKey");
    checkNotNull(retrofit, "retrofit");

    return realPagerDuty(apiKey, retrofit.create(EventService.class));
  }
45499
public static function create($params = null, $apiKey = null)
    {
        $class = get_class();
        return self::_scopedCreate($class, $params, $apiKey);
    }
887619
public static function setApiKeyToAppId($api_key, $app_id)
    {
        $cacheKey = 'apikey2appid:' . $api_key;
        \Cache::put($cacheKey, $app_id, \Config::get('df.default_cache_ttl'));
    }
1108543
public function register(Application $app)
    {
        /**
         * Add the
         */
        $app[self::HTTP_CORS] = $app->protect(
            function (Request $request, Response $response) use ($app) {
                $response->headers->set("Access-Control-Max-Age", "86400");
                $response->headers->set("Access-Control-Allow-Origin", "*");

                return $response;
            }
        );
    }