@param string $apiKey
@param array  $topics
@param Pin    $pin

@throws PebbleApiException
518041
public function pushShared($apiKey, array $topics, Pin $pin)
    {
        $url     = self::API_SHARED_URL.$pin->getId();
        $payload = $pin->generate();
        $headers = [
            self::API_SHARED_KEY    => $apiKey,
            self::API_SHARED_TOPICS => implode(',', $topics),
        ];

        $this->log("Pusher::pushShared => {$url}", ['payload' => $payload, 'headers' => $headers]);

        $this->push($url, $payload, $headers);
    }
722930
@Override
  public List<ApiType> byIndex(String indexName, String indexKey) {
    lock.lock();
    try {
      if (!this.indexers.containsKey(indexName)) {
        throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName));
      }
      Map<String, Set<String>> index = this.indices.get(indexName);
      Set<String> set = index.get(indexKey);
      if (set == null) {
        return Arrays.asList();
      }
      List<ApiType> items = new ArrayList<>(set.size());
      for (String key : set) {
        items.add(this.items.get(key));
      }
      return items;
    } finally {
      lock.unlock();
    }
  }
1019229
public static function create($params = null, $apiKey = null)
    {
        return self::_create(get_class(), $params, $apiKey);
    }
515590
public function addComment($issue_key, $params)
	{
		if ( is_string($params) ) {
			// If $params is scalar string value -> wrapping it properly.
			$params = array(
				'body' => $params,
			);
		}

		return $this->api(self::REQUEST_POST, sprintf('/rest/api/2/issue/%s/comment', $issue_key), $params);
	}
95661
public static function all_api_keys($apiKey = null)
    {
        $requestor = new Requestor($apiKey);
        list($response, $apiKey) = $requestor->request('get', '/api_keys');
        return Util::convertToEasyPostObject($response, $apiKey);
    }
271623
public static function update($id, $params, $apiKey = null)
    {
        $class = get_class();
        return self::_scopedUpdate($class, $id, $params, $apiKey);
    }
105147
public CMAWebhook addTopic(CMAWebhookTopic topic) {
    if (this.topics == null) {
      this.topics = new ArrayList<CMAWebhookTopic>();
    }

    this.topics.add(topic);
    return this;
  }
1370726
void setPinResults(String pinResults) {
        for (int i = 0; i < mNumberPinBoxes; i++) {
            if (pinResults != null) {
                int start = i*mNumberCharacters;
                String valuePinBox = pinResults.substring(start, start + mNumberCharacters);
                if (!valuePinBox.trim().isEmpty()) {
                    getPinBox(i).setText(valuePinBox);
                }
                else{
                    break;
                }
            }
        }
    }
288609
private function findIssues(Api $api, $type, array $criteria)
    {
        /* @var Issues|PullRequests $api */

        list($username, $repo) = explode('/', $this->getName());
        $issues                = json_decode($api->all($username, $repo, $criteria)->getContent(), true);
        $newIssues             = [];

        $key = 'issue' === $type ? 'issues' : 'values';

        foreach ((array) $issues[$key] as $issue) {
            if ('open' !== $issue['status'] && 'new' !== $issue['status']) {
                continue;
            }

            $newIssues[] = new BitbucketIssue($issue, $type, $this->getUrl());
        }

        return $newIssues;
    }
887619
public static function setApiKeyToAppId($api_key, $app_id)
    {
        $cacheKey = 'apikey2appid:' . $api_key;
        \Cache::put($cacheKey, $app_id, \Config::get('df.default_cache_ttl'));
    }
915118
public static function authenticateWithPreset($preset, $api_id, $api_key) {
        return !is_null($api_id) && !is_null($api_key) &&
        Maestrano::with($preset)->param('api.id') == $api_id && Maestrano::with($preset)->param('api.key') == $api_key;
    }
672018
public void add(final ITopicNode specTopic, final String key) {
        if (specTopic == null) return;

        final Integer topicId = specTopic.getDBId();
        if (!topics.containsKey(topicId)) {
            topics.put(topicId, new LinkedList<ITopicNode>());
        }

        // Make sure the key exists
        if (!topicsKeys.containsKey(key)) {
            topicsKeys.put(key, new LinkedList<ITopicNode>());
        }

        topics.get(topicId).add(specTopic);
        topicsKeys.get(key).add(specTopic);
    }
310552
public void setTopic(String topic)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setTopic", topic);

    this.topic = topic;

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setTopic");
  }
1341900
public void addTopic(String topic)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addTopic", topic);

    SelectionCriteria criteria = _messageProcessor.
                                   getSelectionCriteriaFactory().
                                   createSelectionCriteria(topic,
                                                           null,
                                                           SelectorDomain.SIMESSAGE);

    if (_subscriptionState == null)
    {
       _subscriptionState =
        new ConsumerDispatcherState(_destinationHandler.getUuid(), criteria, _destName, _busName);
    }
    else
      _subscriptionState.addSelectionCriteria(criteria);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addTopic");
  }
810276
@SuppressWarnings("unchecked")
    public ApiKey getApiKey(final String key) {
        final Query query = pm.newQuery(ApiKey.class, "key == :key");
        final List<ApiKey> result = (List<ApiKey>) query.execute(key);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
977396
public OmdbBuilder setApiKey(final String apiKey) throws OMDBException {
        if (StringUtils.isBlank(apiKey)) {
            throw new OMDBException(ApiExceptionType.AUTH_FAILURE, "Must provide an ApiKey");
        }
        params.add(Param.APIKEY, apiKey);
        return this;
    }
1148206
public function my_pub($topic, $data, $excludeUids = [])
    {
        $this->th_pub($topic, $data, $excludeUids);
        foreach ($this->client as $client) {
            $client->pub($topic, $data, $excludeUids);
        }
    }