Get the API URI for the given service/request.

@param string $service
@param string $operation
@param array $params
@param string $format
@return string
336626
public function getApiUri($service, $operation, $params = [], $format = 'xml')
    {
        $config = Mage::helper('radial_core')->getConfigModel();

        return sprintf(
            self::URI_FORMAT,
            $config->apiHostname,
            $config->apiMajorVersion,
            $config->apiMinorVersion,
            $config->storeId,
            $service,
            $operation,
            (!empty($params)) ? '/' . implode('/', $params) : '',
            $format
        );
    }
1189576
private function getOperationRoute(string $resourceClass, string $operationName, string $operationType): Route
    {
        $routeName = $this->getRouteName($this->resourceMetadataFactory->create($resourceClass), $operationName, $operationType);
        if (null !== $routeName) {
            return $this->getRoute($routeName);
        }

        $operationNameKey = sprintf('_api_%s_operation_name', $operationType);

        foreach ($this->router->getRouteCollection()->all() as $routeName => $route) {
            $currentResourceClass = $route->getDefault('_api_resource_class');
            $currentOperationName = $route->getDefault($operationNameKey);

            if ($resourceClass === $currentResourceClass && $operationName === $currentOperationName) {
                return $route;
            }
        }

        throw new RuntimeException(sprintf('No route found for operation "%s" for type "%s".', $operationName, $resourceClass));
    }
556382
public function getApiRequestUrl(Event $event)
    {
        $params = $event->getCustomParams();
        $query = trim(implode(" ", $params));

        $querystringParams = [
            'v' => '1.0',
            'q' => $query
        ];

        return sprintf("%s?%s", $this->apiUrl, http_build_query($querystringParams));
    }
276775
public function getRequestParameters(ServerRequestInterface $httpRequest, Operation $operation): \stdClass
    {
        $indexed = array_combine(
            explode('/', trim($operation->getPath(), '/')),
            explode('/', trim($httpRequest->getUri()->getPath(), '/'))
        );

        $pathParams = [];

        foreach ($indexed as $key => $value) {
            if (0 == strpos('{', $key)) {
                $pathParams[trim($key, '{}')] = $value;
            }
        }

        $queryParams = $httpRequest->getQueryParams();
        $headers     = $httpRequest->getHeaders();

        return $this->assemble(
            $operation,
            $queryParams,
            $pathParams,
            $headers,
            $httpRequest->getParsedBody()
        );
    }
1187406
public final URL getUrl(final Operation op) throws TransportException {
        try {
            return new URL(url.toExternalForm() + "?operation=" + op.getName());
        } catch (MalformedURLException e) {
            throw new TransportException(e);
        }
    }
1098576
private function getReason(OperationInterface $operation)
    {
        if (!$this->pool) {
            return null;
        }

        $reason = $operation->getReason();
        if ($reason instanceof Rule) {
            switch ($reason->getReason()) {
                case Rule::RULE_JOB_INSTALL:
                    return 'Required by the root package: ' . $reason->getPrettyString($this->pool);
                case Rule::RULE_PACKAGE_REQUIRES:
                    return $reason->getPrettyString($this->pool);
                default:
            }
        }

        return null;
    }
894137
private function fetch($method, $url, $call, array $params = array())
    {
        // Make the API call via the consumer
        $response = $this->OAuth->fetch($method, $url, $call, $params);
        
        // Format the response and return
        switch ($this->responseFormat) {
            case 'json':
                return json_encode($response);
            case 'jsonp':
                $response = json_encode($response);
                return $this->callback . '(' . $response . ')';
            default:
                return $response;
        }
    }
919163
def _get_operation_http(self):
        
        path = "operations/%s" % (self.name,)
        api_response = self.client._connection.api_request(method="GET", path=path)
        return json_format.ParseDict(api_response, operations_pb2.Operation())
874120
public function getFormatsFromOperation(string $resourceClass, string $operationName, string $operationType): array
    {
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

        if (!$formats = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'formats', [], true)) {
            return $this->configuredFormats;
        }

        if (!\is_array($formats)) {
            throw new InvalidArgumentException(sprintf("The 'formats' attributes must be an array, %s given for resource class '%s'.", \gettype($formats), $resourceClass));
        }

        return $this->getOperationFormats($formats);
    }
1162909
public function getUrl($service, $url, $params = [])
    {
        if (!empty($this->stubs[$service])) {
            $tokens = [];
            $params['url'] = $url;
            foreach ($this->tokens as $token) {
                $tokens['/{' . $token . '}/'] = urlencode(
                    !empty($params[$token]) ? $params[$token] : ''
                );
            }
            return preg_replace(array_keys($tokens), $tokens, $this->stubs[$service]);
        }
    }
1202715
protected function urlService($service)
	{
		if($service instanceof Uri)
		{
			$uri = $service->get();
		}
		else
		{
			$uri = $service;
		}
		return $this->baseUrl .'/'. ltrim($uri, '/');
	}
1094954
public function toString(string $format = null) : string
    {
        $operations = $this->operations;
        $operations[] = [ 'getImage', [ $format ] ];
        
        $driver = $this->getDriver();
        return array_reduce($operations, function ($carry, $item) use ($driver) {
            return $driver->{$item[0]}(...$item[1]);
        });
    }
1059858
private function api($method, $params) 
	{
    
		$basic = array(
		  'method'      => $method,
		  'appid'       => $this->appid,
		  'key'         => $this->key,
		  'path'        => $this->path,
		  'user_ip'     => $_SERVER['REMOTE_ADDR'],
		  'language'    => $this->language,
		  'platform'    => 'php'
		);

		return $this->call(array_merge(isset($params[0]) ? $params[0] : $params, $basic));
	}
432377
public function getOperationDocs($operation)
    {
        return isset($this->docs['operations'][$operation])
            ? $this->docs['operations'][$operation]
            : null;
    }
67000
private static function filterInList($operation, &$params)
    {
        $params    = \array_merge($params, \array_values($operation['values']));
        $wildcards = \rtrim(\str_repeat('?,', \count($operation['values'])), ',');

        return \sprintf('(%s IN (%s))', $operation['property'], $wildcards);
    }
1213757
public function url($service)
    {
        $url = 'index.php?option=com_connect&view=login&server='.$service;

        if (AnRequest::get('get.return', 'cmd')) {
            $url .= '&return='.AnRequest::get('get.return', 'raw');
        }

        return route($url);
    }
609907
public function getPath($uri, array $params, $withQuery = true)
    {
        $cleanUrl = trim($this->getBaseUrl(), "/ ");
        $cleanUri = trim($uri, "/ ");

        if ($withQuery === false || empty($params))
            return sprintf("%s/%s", $this->getBaseUrl(), $cleanUri);

        // build HTTP query for GET request
        $query = http_build_query($params);
        return sprintf("/%s/%s?%s", $cleanUrl, $cleanUri, $query);
    }