@param string $endpoint

@return \Moip\Auth\Connect
771277
public function setEndpoint($endpoint)
    {
        if (!in_array($endpoint, [self::ENDPOINT_SANDBOX, self::ENDPOINT_PRODUCTION])) {
            throw new InvalidArgumentException('Endpoint inválido.');
        }

        $this->endpoint = $endpoint;

        return $this;
    }
1169572
public function endpoint(Endpoint $endpoint = null)
    {
        if ($endpoint === null) {
            return $this->getRepository();
        }

        $this->repository($endpoint);

        return $this;
    }
1007577
public function request($method, $endpoint, array $params = [])
    {
        return new DmmRequest(
            $this->credential,
            $method,
            $endpoint,
            $params
        );
    }
347039
public function performApiRequest($endpoint, $payload)
    {
        $this->setupRequest($payload);
        $this->apiEndpoint = $endpoint;

        return $this->doDropboxApiRequest();
    }
1238982
protected function get($endpoint, $params = [])
    {
        if (array_key_exists('reply_markup', $params)) {
            $params['reply_markup'] = (string)$params['reply_markup'];
        }

        return $this->sendRequest(
            'GET',
            $endpoint,
            $params
        );
    }
1156084
protected function configureEndpoint(EndpointInterface $Endpoint, $action)
    {
        switch ($action) {
            case self::ACTION_AUTH:
                $Endpoint = $this->configureAuthenticationEndpoint($Endpoint);
                break;
            case self::ACTION_LOGOUT:
                $Endpoint = $this->configureLogoutEndpoint($Endpoint);
                break;
        }
        return $Endpoint;
    }
515349
private function createConnection($endpoint)
    {
        // port
        $port = $this->getOption('ssl') == true ? 443 : 80;

        if (!($connection = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
            $errorcode = socket_last_error();
            $errormsg = socket_strerror($errorcode);
            throw new Exception\EndpointServerException('Analytics Socket failure! Error: ' . $errormsg);
        }

        if (!socket_connect($connection, $endpoint['host'], $port)) {
            $errorcode = socket_last_error();
            $errormsg = socket_strerror($errorcode);
            throw new Exception\EndpointServerException('Analytics Host not reachable! Error: ' . $errormsg);
        }

        socket_set_option($connection, SOL_SOCKET, SO_RCVTIMEO, array('sec' => self::READ_TIMEOUT, 'usec' => 0));

        if ($this->getOption('async')) {
            socket_set_nonblock($connection);
        }

        $this->connection = $connection;
    }
1099956
public static function ping(
        $endpoint,
        ClientInterface $client = null
    ) {
        AnnotationRegistry::registerLoader('class_exists');

        $afterpayClient = $client ?: new Client([ 'base_uri' => $endpoint ]);

        return new Service\InStore\Ping($afterpayClient);
    }
981048
private static function parseEndPoint(string $endPoint)
    {
        $endPoint = trim($endPoint, '/');
        $endPointArray = explode('/', $endPoint);
        if ($endPointArray[0] == "api") {
            return $endPoint;
        }
        array_unshift($endPointArray, "api");

        return implode('/', array_filter($endPointArray));
    }
497746
public function getEndpoint($endpoint, $withHost = false, $forceReload = false)
    {
        $this->loadApiDefinition($forceReload);
        $url = "";
        if ($withHost) {
            $url = empty($this->options['host']) ? $this->definition->getHost() : $this->options['host'];
        }

        // If the base path is not already included, we need to add it.
        $url .= (empty($this->options['includeBasePath']) ? $this->definition->getBasePath() : '') . $endpoint;

        return $url;
    }
1041177
public function setSessionEndpoint($endpoint)
    {
        $this->sessionEndpoint = $endpoint;

        $this->sessionClient = Client::makeGuzzle($this->sessionEndpoint);

        return $this;
    }
350762
public function getEndpoint($endpoint, $account = null)
    {
        $isSandbox = (new ConfigurationRepository)->getAccountKey('sandbox', true, $account);

        if ($isSandbox) {
            return $this->resolveUrl(MPESA_SANDBOX, $endpoint);
        }

        return $this->resolveUrl(MPESA_PRODUCTION, $endpoint);
    }
1040009
public function hasEndpoint($endpoint)
    {
        $retVal = false;
        if (isset($this->endpoints)) {
            $retVal = in_array($endpoint, $this->endpoints);
        }

        return $retVal;
    }
590887
public function post($endpoint, array $parameters = array())
    {
        return $this->execute("POST", sprintf("%s%s", $this->host, $endpoint), $parameters);
    }
920199
private function getEndpoint(string $endpoint) : string
    {
        return sprintf(
            '%s/%s/%s',
            $this->config->get('serverUrl'),
            $this->config->get('apmVersion'),
            $endpoint
        );
    }
966280
private function get(string $endpoint): array
    {
        return \GuzzleHttp\json_decode(
            $this->client
                ->get(
                    self::API_BASE_URI.$endpoint,
                    [
                        'query' => [
                            'client_id' => $this->apiKey,
                        ],
                    ]
                )
                ->getBody()
                ->getContents(),
            true
        );
    }
443018
public function setClient($endpoint = null)
    {
        // Create client using API endpoint.
        $this->client = new Client([
                                       'base_uri' => ! is_null($endpoint) ? $endpoint : $this->endpoint,
                                   ]);

        return $this;
    }