@param string $usernsMode

@return Client
198208
public function setUsernsMode(string $usernsMode)
    {
        $this->usernsMode = $usernsMode;

        $this->hostConfig = array_merge($this->hostConfig, ['UsernsMode' => $usernsMode]);

        return $this;
    }
669538
public function getUserLogin(UserServiceInterface $userService)
    {
        $user = $this->getAndLogUserByCookie($userService);
        return $user ? $user->getLogin() : null;
    }
468841
public function getGoogleBatchServiceGmailForUserId(string $userId)
    {
        $email = $this->directory->resolvePrimaryEmailFromUserId($userId);
        if (array_key_exists($email, $this->googleBatchServiceGmails)) {
            return $this->googleBatchServiceGmails[$email];
        }

        $googleServiceGmail = new \Google_Service_Gmail($this->serviceAccount->getGoogleBatchClientForEmail($email));
        $this->googleBatchServiceGmails[$email] = $googleServiceGmail;

        return $googleServiceGmail;
    }
1318043
public function setUTSMode(string $UTSMode)
    {
        $this->UTSMode = $UTSMode;

        $this->hostConfig = array_merge($this->hostConfig, ['UTSMode' => $UTSMode]);

        return $this;
    }
589223
private function createGoogleClient(string $userEmail)
    {
        if (array_key_exists($userEmail, $this->googleClients)) {
            return $this->googleClients[$userEmail];
        }

        $googleClient = new \Google_Client();
        $googleClient->setScopes(static::SCOPES);
        $googleClient->setAuthConfig($this->configFileLocation);
        $googleClient->setSubject($userEmail);

        $this->googleClients[$userEmail] = $googleClient;

        return $googleClient;
    }
21066
public function removeCommunityModerator($communityId, $userId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!is_numeric($userId)) {
            throw new InvalidIdentifierException('user');
        }

        return $this->delete(sprintf('communities/%s/moderators/%s', $communityId, $userId), [], $accessToken);
    }
553978
public static function getUserClient($organization = null, $apiKey = null, $options = [])
    {
        $baseUrl = BaseClient::DEFAULT_API_BASE_URL;

        //bc compability, when first param was $options
        if (\is_array($organization)) {
            $options = $organization;
            $organization = null;
            $apiKey = null;
        }
        if (isset($options[self::API_BASE_URL])) {
            $baseUrl = $options[self::API_BASE_URL];
        }

        $client = self::getGuzzleClient($baseUrl, $options);

        return new UserClient($client, $organization, $apiKey);
    }
953173
public function get($userId)
    {
        $endpoint = '/admin/users/'.$userId.'.json';
        $response = $this->request($endpoint);
        return $this->createObject(User::class, $response['user']);
    }
290849
public function impersonateUser($username, $validate = false)
    {
        return new UserContext($this->getConnection()->loginAs($username), $validate);
    }
401585
private function hydrateCustomerWithSubEntities(
        HalResource $customerResource,
        CustomerRequest $customerRequest
    ): Customer {
        $customerLoader = new CustomerLoader(
            $this->restClient,
            $customerResource,
            $customerRequest->getLinks()
        );
        $customerLoader->load();

        return $customerResource->getEntity();
    }
917538
public function setUnserializeMode($unserializeMode)
    {
        switch ($unserializeMode) {
            case self::STRICT_MODE:
            case self::MEDIUM_STRICT_MODE:
            case self::NON_STRICT_MODE:
                $this->unserializeMode = $unserializeMode;
                break;
            default:
                throw new InvalidArgumentException(sprintf('Non acceptable unserialize mode: "%s"', $unserializeMode));
        }

        return $this;
    }
471955
public function setUserRole(\Dacorp\ExtraBundle\Entity\UserRole $userRole = null)
    {
        $this->userRole = $userRole;
    
        return $this;
    }
484600
public function createPasswordGrantClient($userId, $name, $redirect)
    {
        return $this->create($userId, $name, $redirect, false, true);
    }
319037
public function grantToUser( $rightId, $userId, $grant = true )
    {
        return $this->getMapper()
                    ->grantToUser( $rightId, $userId, $grant );
    }
1093608
public function get(Provider $provider, $userId, $requestScope, $requestUri, array $requestHeaders = [])
    {
        return $this->send($provider, $userId, $requestScope, Request::get($requestUri, $requestHeaders));
    }
437323
private function createContext($userPublicKey)
    {
        $label = 'P-256';
        // The two length fields are encoded as a two octet unsigned integer in network byte order.
        $recipientPublicLength = chr(0).chr(strlen($userPublicKey));
        $senderPublicLength = chr(0).chr(strlen($this->publicKeyContent));

        return $label.chr(0).$recipientPublicLength.$userPublicKey.$senderPublicLength.$this->publicKeyContent;
    }
449738
public function setUser( UserStructure $user = null )
    {
        if ( null === $user )
        {
            $this->_user    = null;
            $this->userId   = null;

        }
        else
        {
            $this->_user    = $user;
            $this->userId   = $user->id;
        }

        return $this;
    }