@param string $accountUid

@return array
@throws \Smartling\Exceptions\SmartlingApiException
177344
public function getToken($accountUid)
    {
        $requestData = $this->getDefaultRequestData('query', []);
        $endpoint = vsprintf('accounts/%s/token', [$accountUid]);

        return $this->sendRequest($endpoint, $requestData, static::HTTP_METHOD_GET);
    }
1057495
public function mintFedoraUrl(
        $uuid,
        $token = null
    ) {
        $headers = ['Content-Type' => 'text/plain'];

        if (!empty($token)) {
            $headers['Authorization'] = $token;
        }

        $response = $this->client->post('', [
            'body' => $uuid,
            'headers' => $headers,
        ]);

        $this->log->debug("Gemini POST response", [
            'uuid' => $uuid,
            'response' => $response,
        ]);

        return (string)$response->getBody();
    }
445565
public function my_getUidTopics($uid)
    {
        $array = $this->th_getUidTopics($uid);
        foreach ($this->client as $client) {
            $token = $client->getUidTopics($uid);
            $one_array = $client->getTokenResult($token);
            $array = array_merge($array, $one_array);
        }
        return $array;
    }
931408
public static function getPayload(string $token, string $secret): array
    {
        $parser = self::parser($token, $secret);

        return $parser->validate()->parse()->getPayload();
    }
1130259
public function getCharacterAlliances(): Collection
    {

        $user = auth()->user();

        $alliances = CharacterInfo::join(
            'alliance_members',
            'alliance_members.corporation_id',
            'character_infos.corporation_id')
            ->join(
                'alliances',
                'alliances.alliance_id',
                'alliance_members.alliance_id')
            ->distinct();

        // If the user us a super user, return all
        if (! $user->hasSuperUser()) {

            $alliances = $alliances->orWhere(function ($query) use ($user) {

                // If the user has any affiliations and can
                // list those characters, add them
                if ($user->has('character.list', false))
                    $query = $query->whereIn('character_id',
                        array_keys($user->getAffiliationMap()['char']));

                // Add any characters from owner API keys
                $query->orWhere('character_id', $user->id);
            });
        }

        return $alliances->orderBy('alliances.name')
            ->pluck('alliances.name')
            ->filter(function ($item) {

                // Filter out the null alliance name
                return ! is_null($item);
            });

    }
163607
private function verify(string $token): array
    {
        $jsonConverter = new StandardConverter();
        $serializer = new JWSCompactSerializer($jsonConverter);
        $jws = $serializer->unserialize($token);
        $this->signatureHeaderCheckerManager->check($jws, 0);
        if (false === $this->jwsLoader->verifyWithKeySet($jws, $this->signatureKeyset, 0)) {
            throw new JWTDecodeFailureException('decoding_error', 'An error occurred while trying to verify the JWT token.');
        }
        $payload = $jsonConverter->decode($jws->getPayload());
        $this->claimCheckerManager->check($payload);

        return $payload;
    }
557690
protected
    function parseAccount(
        AccountInterface $account
    ) {
        if ($account) {
            $data = [];
            $data['id'] = $account->getId();
            $data['name'] = $account->getName();
            $data['phone'] = $account->getMainPhone();
            $data['email'] = $account->getMainEmail();
            $data['url'] = $account->getMainUrl();

            // get main contact
            if ($account->getMainContact()) {
                $data['contact'] = $account->getMainContact()->getFullName();
            }

            /* @var Address $accountAddress */
            $accountAddress = $account->getMainAddress();
            if ($accountAddress) {
                $data['address']['street'] = $accountAddress->getStreet();
                $data['address']['number'] = $accountAddress->getNumber();
                $data['address']['zip'] = $accountAddress->getZip();
                $data['address']['city'] = $accountAddress->getCity();
                $data['address']['country'] = $accountAddress->getCountry()->getName();
            }

            return $data;
        } else {
            return null;
        }
    }
1216704
public function visit(AccountInfoList $accountList)
    {
        $list = new Simplified\AccountList();
        foreach ($accountList->accountInfo as $accountInfo) {
            $list->accounts[] = $this->visitAccount($accountInfo);
        }

        return $list;
    }
876382
public function getReferences($uuid)
    {
        $session = $this->sessionManager->getSession();
        $node = $session->getNodeByIdentifier($uuid);

        return iterator_to_array($node->getReferences());
    }
8952
public function decode($encodedUuid)
    {
        $components = $this->extractComponents($encodedUuid);
        $fields = $this->getFields($components);

        return $this->builder->build($this, $fields);
    }
791050
public function findAll($locale, $filter = null)
    {
        if ($filter) {
            $accountEntities = $this->accountRepository->findByFilter($filter);
        } else {
            $accountEntities = $this->accountRepository->findAll();
        }

        if (!empty($accountEntities)) {
            $accounts = [];
            foreach ($accountEntities as $account) {
                $accounts[] = $this->getApiObject($account, $locale);
            }

            return $accounts;
        }

        return;
    }
86736
public function getAccounts(array $account_ids = [])
    {
        //Get account
        $response = $this->postToAPI('/users/get_account_batch', ['account_ids' => $account_ids]);
        $body = $response->getDecodedBody();

        //Make and return the model
        return new AccountList($body);
    }
994003
public function getAccount($accountID, $subaccounts = true)
	{
		if ($this->isAuthenticated())
		{
			$url   = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . ($subaccounts ? '?tree=true' : '');
			$jdata = $this->query($url);

			if ($data = json_decode($jdata->body, true))
			{
				return $data;
			}

			throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
		}

		return false;
	}
501171
public function getLists($accountId, array $parameters = [], array $headers = [])
    {
        $data  = $this->getApi()->getLists($accountId, $parameters, $headers);

        return $this->getFactory()->createResultCollection($data, 'createListItem');
    }
516544
public function getAllDrafts(TokenInterface $token)
    {
        $owner = UserSecurityIdentity::fromToken($token);
        $states = [Revision::STATE_ADDED, Revision::STATE_MODIFIED];

        $result = [];

        try {
            $result = $this->findBy([
                '_owner' => $owner,
                '_state' => $states,
            ]);
        } catch (ConversionException $e) {
            $result = [];
            foreach ($this->getAllDraftsUids($owner, $states) as $data) {
                try {
                    $result[] = $this->find($data['_uid']);
                } catch (ConversionException $e) {
                    $this->_em->getConnection()->executeUpdate(
                        'DELETE FROM revision WHERE uid = :uid',
                        ['uid' => $data['_uid']]
                    );
                }
            }
        } catch (MappingException $e) {
            $result = [];
            foreach ($this->getAllDraftsUids($owner, $states) as $data) {
                $draft = $this->find($data['_uid']);
                if (null !== $draft->getContent()) {
                    $result[] = $draft;
                } else {
                    $this->_em->getConnection()->executeUpdate(
                        'DELETE FROM revision WHERE uid = :uid',
                        ['uid' => $data['_uid']]
                    );
                }
            }
        }

        return $result;
    }
1153064
public static function getTokenCustomProperties(ContainerInterface $container, TokenInterface $token): array
    {
        $userId = $token->getUserIdentifier();

        /** @var FactoryInterface $factory */
        $factory = $container->get(FactoryInterface::class);
        /** @var UsersApi $usersApi */
        $usersApi = $factory->createApi(UsersApi::class);

        $builder = $usersApi->shouldBeUntyped()->withIndexFilter($userId)->createIndexBuilder([
            User::FIELD_EMAIL,
            User::FIELD_FIRST_NAME,
            User::FIELD_LAST_NAME,
        ]);

        $user = $usersApi->fetchRow($builder, User::class);

        return [
            User::FIELD_ID         => $userId,
            User::FIELD_EMAIL      => $user[User::FIELD_EMAIL],
            User::FIELD_FIRST_NAME => $user[User::FIELD_FIRST_NAME],
            User::FIELD_LAST_NAME  => $user[User::FIELD_LAST_NAME],
        ];
    }
975920
private function decodeToken(string $token): array
    {
        try {
            $decoded = JWT::decode(
                $token,
                $this->options["secret"],
                (array) $this->options["algorithm"]
            );
            return (array) $decoded;
        } catch (Exception $exception) {
            $this->log(LogLevel::WARNING, $exception->getMessage(), [$token]);
            throw $exception;
        }
    }