api keys

@param string $apiKey
@return array|null
171461
public function api_keys($apiKey = null)
    {
        $api_keys = self::all_api_keys();
        $my_api_keys = null;

        if ($api_keys->id == $this->id) {
            $my_api_keys = $api_keys->keys;
        }
        if (is_null($my_api_keys)) {
            foreach($api_keys->children as $children_keys) {
                if ($children_keys->id == $this->id) {
                    $my_api_keys = $children_keys->keys;
                }
            }
        }

        if (is_null($my_api_keys)) {
            return null;
        } else {
            $response = array();
            foreach($my_api_keys as $key) {
                $response[$key->mode] = $key->key;
            }
            return $response;
        }
    }
391144
public function create($data, $apiKeyId = null)
    {
        if (isset($apiKeyId)) {
            return $this->client()->put($data, 'api-keys/{apiKeyId}', ['apiKeyId' => $apiKeyId]);
        }

        return $this->client()->post($data, 'api-keys');
    }
920689
protected function _stringifyNullBoolParams($apiparams)
  {
    foreach ($apiparams as $key => $value) {
      if (! is_scalar($value)) {
        // no need to try replacing arrays
        continue;
      }
      if (is_null($value)) {
        $apiparams[$key] = 'null';
      } elseif (is_bool($value)) {
        $apiparams[$key] = $value ? 'true' : 'false';
      }
    }

    return $apiparams;
  }
994388
public function setApiKey($apiKey)
    {
        $key = base64_decode($apiKey, true);
        if ($key === false) {
            throw new \InvalidArgumentException('Invalid API key');
        }

        $this->apiKey = $key;
        return $this;
    }
673775
public function getKey($key)
	{
		return isset($this->data[$key]) ? $this->data[$key] : null;
	}
669448
protected function parseKey($key) {
        $key = trim($key);
        $data = explode('.', $key);
        $group = trim($data[0]);
        if (1 == count($data)) {
            return [$group, null];
        }

        return [$group, $data[1]];
    }
878429
protected function _padKey(string $key): array
    {
        $len = strlen($key);
        // append padding
        if (0 != $len % 8) {
            $key .= str_repeat("\0", 8 - $len % 8);
        }
        // compute AIV
        $mli = pack("N", $len);
        $aiv = self::AIV_HI . $mli;
        return [$key, $aiv];
    }
1034045
public static function fetch_google_fonts( $api_key = null ) {
		$raw_fonts = static::request_google_fonts( $api_key );

		// Invalid API key or something else.
		if ( ! is_array( $raw_fonts ) || ! isset( $raw_fonts['items'] ) ) {
			return [];
		}

		$fonts = [];

		foreach ( $raw_fonts['items'] as $item ) {
			if ( ! isset( $item['kind'] ) || 'webfonts#webfont' !== $item['kind'] ) {
				continue;
			}

			$fonts[] = Arr::only( $item, [ 'family', 'category', 'variants', 'subset' ] );
		}

		static::flush_transients();
		static::set_transients( $fonts );

		return $fonts;
	}
422193
protected function getParams()
    {
        $params = ["key=".$this->apiKey];
        if (@count($this->options[0]) > 0 && is_array($this->options[0])) {
            foreach ($this->options[0] as $k => $v) {
                if ($k != "response_type" && $k != "apiKey") {
                    array_push($params, "$k=$v");
                }
            }
        }
        return $params;
    }
862497
protected function fetchKey($key)
    {
        if (str_contains($key, '.'))
        {
            $keys = explode('.', $key);
            $search = array_except($keys, 0);

            return array(array_get($keys, 0), implode('.', $search));
        }

        return array($key, null);
    }
1191040
public function deleteApiKey($apikey)
    {
        $endPointUrl = $this->apiurl."/account/apikey/".$apikey;

        $response = $this->curlDelete($endPointUrl);

        return $response;
    }
67840
public function getAuthKeyByVar($property)
    {
        if (!($key = array_search($property, $this->authKeyMap))) {
            $msg = 'Invalid Auth property requested: ' . $property;
            throw new ApiException($msg);
        }

        return $key;
    }
930656
def get_api_key(self, api_key_id):
        
        api = self._get_api(iam.DeveloperApi)
        return ApiKey(api.get_api_key(api_key_id))
1286237
public function getForNode(array $nodeKey)
    {
        $normalized = $this->stringifyNodeKey($nodeKey);

        return array_get($this->index(), $normalized, false);
    }
226722
public function getApiKeyWithPrefix($apiKeyIdentifier)
    {
        $prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
        $apiKey = $this->getApiKey($apiKeyIdentifier);

        if ($apiKey === null) {
            return null;
        }

        if ($prefix === null) {
            $keyWithPrefix = $apiKey;
        } else {
            $keyWithPrefix = $prefix . ' ' . $apiKey;
        }

        return $keyWithPrefix;
    }
748592
public static Single<String> getUserInfo(String apikey) {
        Map<String, String> params = new HashMap<>();
        params.put("apikey", apikey);
        return post(URI_GET_USER_INFO, params);
    }
837610
public function getNameByKey($key)
    {
        return (array_key_exists($key, $this->_languages)) ? $this->_languages[$key] : null;
    }