Builds the complete API endpoint url

@param string $method The API method to call
@param string $method_template The API method to call

@return string The URL to send the request to
511384
protected function _getEndpoint($method, $method_template)
  {
    $url = self::$_endpoints['rest'] . $method . '.json';
    if (substr($method_template, 0, 22) === 'oauth/invalidate_token') {
      $url = self::$_endpoints['rest'] . $method . '.json';
    } elseif (substr($method_template, 0, 5) === 'oauth') {
      $url = self::$_endpoints['oauth'] . $method;
    } elseif ($this->_detectMedia($method_template)) {
      $url = self::$_endpoints['media'] . $method . '.json';
    } elseif ($method_template === 'statuses/oembed') {
      $url = self::$_endpoints['publish'] . 'oembed';
    } elseif ($variant = $this->_detectStreaming($method_template)) {
      $url = self::$_endpoints['streaming'][$variant] . $method . '.json';
    } elseif ($this->_detectBinaryBody($method_template)) {
      $url = self::$_endpoints['ton'] . $method;
    } elseif (substr($method_template, 0, 12) === 'ads/sandbox/') {
      $url = self::$_endpoints['ads']['sandbox'] . substr($method, 12);
    } elseif (substr($method_template, 0, 4) === 'ads/') {
      $url = self::$_endpoints['ads']['production'] . substr($method, 4);
    }
    return $url;
  }
258258
public function getMethodMutations(
        $method_name,
        Context $context
    ) {
        $project_analyzer = $this->getFileAnalyzer()->project_analyzer;
        $codebase = $project_analyzer->getCodebase();

        foreach ($this->class->stmts as $stmt) {
            if ($stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                strtolower($stmt->name->name) === strtolower($method_name)
            ) {
                $method_analyzer = new MethodAnalyzer($stmt, $this);

                $method_analyzer->analyze($context, null, true);
            } elseif ($stmt instanceof PhpParser\Node\Stmt\TraitUse) {
                foreach ($stmt->traits as $trait) {
                    $fq_trait_name = self::getFQCLNFromNameObject(
                        $trait,
                        $this->source->getAliases()
                    );

                    $trait_file_analyzer = $project_analyzer->getFileAnalyzerForClassLike($fq_trait_name);
                    $trait_node = $codebase->classlikes->getTraitNode($fq_trait_name);
                    $trait_aliases = $codebase->classlikes->getTraitAliases($fq_trait_name);
                    $trait_analyzer = new TraitAnalyzer(
                        $trait_node,
                        $trait_file_analyzer,
                        $fq_trait_name,
                        $trait_aliases
                    );

                    foreach ($trait_node->stmts as $trait_stmt) {
                        if ($trait_stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                            strtolower($trait_stmt->name->name) === strtolower($method_name)
                        ) {
                            $method_analyzer = new MethodAnalyzer($trait_stmt, $trait_analyzer);

                            $actual_method_id = (string)$method_analyzer->getMethodId();

                            if ($context->self && $context->self !== $this->fq_class_name) {
                                $analyzed_method_id = (string)$method_analyzer->getMethodId($context->self);
                                $declaring_method_id = $codebase->methods->getDeclaringMethodId($analyzed_method_id);

                                if ($actual_method_id !== $declaring_method_id) {
                                    break;
                                }
                            }

                            $method_analyzer->analyze($context, null, true);
                        }
                    }
                }
            }
        }
    }
642300
private function getHttpMethodAndResourcesFromMethod(\ReflectionMethod $method, $resource)
    {
        // if method doesn't match regex - skip
        if (!preg_match('/([a-z][_a-z0-9]+)(.*)Action/', $method->getName(), $matches)) {
            return false;
        }

        $httpMethod = strtolower($matches[1]);
        $resources = preg_split(
            '/([A-Z][^A-Z]*)/', $matches[2], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
        );
        $isCollection = false;
        $isInflectable = true;

        if (0 === strpos($httpMethod, self::COLLECTION_ROUTE_PREFIX)
            && in_array(substr($httpMethod, 1), $this->availableHTTPMethods)
        ) {
            $isCollection = true;
            $httpMethod = substr($httpMethod, 1);
        } elseif ('options' === $httpMethod) {
            $isCollection = true;
        }

        if ($isCollection && !empty($resource)) {
            $resourcePluralized = $this->generateResourceName(end($resource));
            $isInflectable = ($resourcePluralized != $resource[count($resource) - 1]);
            $resource[count($resource) - 1] = $resourcePluralized;
        }

        $resources = array_merge($resource, $resources);

        return [$httpMethod, $resources, $isCollection, $isInflectable];
    }
1041703
public function getMethodLimits( string $api_key, string $region, string $endpoint)
	{
		return @$this->limits[$region][$api_key]['method'][$endpoint];
	}
400159
protected function buildMethod(ReflectionMethod $method)
    {
        $argString = "";
        $paramString = "";
        foreach ($method->getParameters() as $value) {
            $argString .= "\${$value->getName()}, ";
            $paramString .= $this->getParamString($value);
        }

        $argString = trim($argString, ", ");
        $paramString = trim($paramString, ", ");
        $replaces = array(
            $method->getDocComment(),
            $method->getName(),
            $paramString,
            $argString
        );
        return str_replace(self::$methodTplSearches, $replaces, $this->template->getMethodTemplate());
    }
1161652
protected function getEndpoint($method)
    {
        $endpoint = 'me/password';
        $reset = $this->getArgument('reset');
        $nonce = $this->getArgument('nonce');
        if (!is_null($reset)) {
            $endpoint .= '/reset';
            $this->delArgument('reset');
        }
        if (!is_null($nonce)) {
            $endpoint .= "/$nonce";
            $this->delArgument('nonce');
        }
        return $endpoint;
    }
992461
protected function request($method, $url, $parameters = [])
    {
        $endpoint = 'https://api.b2bfamily.com' . $url;

        if (in_array($method, [self::METHOD_GET, self::METHOD_DELETE])) {
            $endpoint .= '?' . http_build_query($parameters, null, '&');
        }

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $endpoint);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

        if (in_array($method, [self::METHOD_POST, self::METHOD_PUT])) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($parameters));
        }

        $result = curl_exec($ch);
        $error = curl_error($ch);
        $errno = curl_errno($ch);

        curl_close($ch);

        if ($error) {
            throw new B2BFamilyException($error, $errno);
        }

        $result = json_decode($result, true);

        if (isset($result['error'])) {
            throw new B2BFamilyException($result['error']['message'], $result['error']['code']);
        }

        return $result;
    }
1198202
protected function getEndpoint($method)
    {
        $endpoint = "calls";
        $searchParams = $this->getArgument("search_params");
        if (!is_null($searchParams)) {
            $queryString = http_build_query($searchParams);
            $this->delArgument("search_params");
            return "$endpoint?$queryString";
        }
        return $endpoint;
    }
538907
public function request($method, $endpoint, array $parameters = null)
    {
        $url = $this->config->getEndpoint() . $endpoint;

        // Client should always send OAuth2 tokens in its headers
        $headers = array('Authorization' => 'Bearer ' . $this->config->getAccessToken());

        return $this->client->request($method, $url, $parameters, $headers);
    }
288119
protected function getMethodName($method, $docBlock = null): string
    {
        if ($docBlock !== null && $docBlock->hasTag(self::API_METHOD_NAME)) {
            $tags = $docBlock->getTagsByName(self::API_METHOD_NAME);

            return (string)$tags[0];
        }

        $controllerName = $method->getDeclaringClass();

        if (!empty($this->server->endpoint)) {
            return $method->getName();
        }

        return $this->getShortNameForController($controllerName->getName()) . '_' . $method->getName();
    }
551304
def get_url endpoint, method
      api = @wp_api ? 'wp-json' : 'wc-api'
      url = @url
      url = "#{url}/" unless url.end_with? "/"
      url = "#{url}#{api}/#{@version}/#{endpoint}"

      @is_ssl ? url : oauth_url(url, method)
    end
1250902
protected function getEndpoint($method)
    {
        $endpoint = "summary";
        $queryString = array();
        $dateFrom = $this->getArgument("date_from");
        if (!is_null($dateFrom)) {
            $queryString['date_from'] = $dateFrom;
            $this->delArgument("date_from");
        }
        $dateTo = $this->getArgument("date_to");
        if (!is_null($dateTo)) {
            $queryString['date_to'] = $dateTo;
            $this->delArgument("date_to");
        }
        $granularity = $this->getArgument("granularity");
        if (!is_null($granularity)) {
            $queryString['granularity'] = $granularity;
            $this->delArgument("granularity");
        }
        if (!empty($queryString)) {
            $queryString = http_build_query($queryString);
            $endpoint .= "?$queryString";
        }
        return $endpoint;
    }
261801
public function request($method, $data = [])
    {
        $path = '_template/'.$this->getName();

        return $this->getClient()->request($path, $method, $data);
    }
486793
function handleResource( $tpl, &$resourceData, $method, &$extraParameters )
    {
        $path = $resourceData['template-name'];

        $matchKeys = $this->Keys;
        if ( isset( $GLOBALS['eZDesignKeys'] ) )
        {
            $matchKeys = array_merge( $matchKeys, $GLOBALS['eZDesignKeys'] );
            unset( $GLOBALS['eZDesignKeys'] );
            $this->Keys = $matchKeys;
        }
        if ( is_array( $extraParameters ) and
             isset( $extraParameters['ezdesign:keys'] ) )
        {
            $this->mergeKeys( $matchKeys, $extraParameters['ezdesign:keys'] );
        }
        $this->KeyStack[] = $this->Keys;
        $this->Keys = $matchKeys;

        eZDebug::accumulatorStart( 'override_cache', 'Override', 'Cache load' );

        if( !isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            $overrideCacheFile = $this->createOverrideCache();

            if ( $overrideCacheFile )
            {
                include_once( $overrideCacheFile );
            }
        }

        if ( isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            if( isset( $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )] ) )
            {
                $cacheMap = $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )];
                if ( !is_string( $cacheMap ) and trim( $cacheMap['code'] ) )
                {
                    eval( "\$matchFile = " . $cacheMap['code'] . ";" );
                }
                else
                {
                    $matchFile = $cacheMap;
                }
                $match['file'] = $matchFile;
            }
        }
        else
        {
            $template = "/" . $path;
            $matchFileArray = eZTemplateDesignResource::overrideArray( $this->OverrideSiteAccess );

            $matchFile = $matchFileArray[$template];

            if ( isset( $matchFile['custom_match'] ) )
            {
                $matchFound = false;
                foreach ( $matchFile['custom_match'] as $customMatch )
                {
                    $matchOverride = true;
                    if ( count( $customMatch['conditions'] ) > 0 )
                    {
                        foreach ( array_keys( $customMatch['conditions'] ) as $conditionKey )
                        {
                            // Create special substring match for subtree override
                            if ( $conditionKey == 'url_alias' )
                            {
                                if ( strpos( $matchKeys['url_alias'], $customMatch['conditions'][$conditionKey] ) === 0 )
                                {
                                }
                                else
                                {
                                    $matchOverride = false;
                                }
                            }
                            else if ( isset( $matchKeys[$conditionKey] ) and
                                      isset( $customMatch['conditions'][$conditionKey] ) )
                            {
                                if ( is_array( $matchKeys[$conditionKey] ) )
                                {
                                    if ( !in_array( $customMatch['conditions'][$conditionKey], $matchKeys[$conditionKey] ) )
                                    {
                                        $matchOverride = false;
                                    }
                                }
                                else if ( $matchKeys[$conditionKey] != $customMatch['conditions'][$conditionKey] )
                                {
                                    $matchOverride = false;
                                }
                            }
                            else
                            {
                                $matchOverride = false;
                            }
                        }
                        if ( $matchOverride == true )
                        {
                            $match['file'] = $customMatch['match_file'];
                            $matchFound = true;
                            break;
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        // Default match without conditions
                        $match['file'] = $customMatch['match_file'];
                        $matchFound = true;
                    }
                }
                if ( !$matchFound )
                    $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
            else
            {
                $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
        }
        eZDebug::accumulatorStop( 'override_cache' );
        if ( isset( $match ) )
        {
            $file = $match["file"];

            $matchedKeys = array();
            $usedKeys = array();
            foreach ( $matchKeys as $matchKeyName => $matchKeyValue )
            {
                $usedKeys[$matchKeyName] = $matchKeyValue;
            }
            $extraParameters['ezdesign:used_keys'] = $usedKeys;
            $extraParameters['ezdesign:matched_keys'] = $matchedKeys;
            $tpl->setVariable( 'used', $usedKeys, 'DesignKeys' );
            $tpl->setVariable( 'matched', $matchedKeys, 'DesignKeys' );
            $resourceData['template-filename'] = $file;
            $result = eZTemplateFileResource::handleResourceData( $tpl, $this, $resourceData, $method, $extraParameters );
        }
        else
        {
            $result = false;
        }
        $this->Keys = array_pop( $this->KeyStack );
        return $result;
    }
336083
public function registerMethodLimits( string $api_key, string $region, string $endpoint, string $method_header )
	{
		$limits = self::parseLimitHeaders($method_header);
		$this->initMethod($api_key, $region, $endpoint, $limits);
	}
975053
function makeRequest(string $method, string $endpoint, array $options) {
        $request = new \CharlotteDunois\Yasmin\HTTP\APIRequest($this, $method, $endpoint, $options);
        return $this->add($request);
    }
374890
protected function buildOEmbedRequestUrl($resource, $endPoint, $format = self::FORMAT_DEFAULT)
    {
        $parameters = [
            'url' => $resource,
            'format' => $format,
            'version' => self::VERSION
        ];

        if ($this->getRequestParameters() !== null) {
            $parameters = Arrays::arrayMergeRecursiveOverrule($this->getRequestParameters()->toArray(), $parameters);
        }

        $urlParams = http_build_query($parameters, '', '&');
        $url = $endPoint . ((strpos($endPoint, '?') !== false) ? '&' : '?') . $urlParams;

        return $url;
    }