Uploadcare\Api::__getPath PHP Method

__getPath() private method

Throws Exception if wrong type is provided or parameters missing.
private __getPath ( string $type, array $params = [] ) : string
$type string Construct type.
$params array Additional parameters for requests as array.
return string
    private function __getPath($type, $params = array())
    {
        switch ($type) {
            case 'root':
                return '/';
            case 'account':
                return '/account/';
            case 'file_list':
                return '/files/' . $this->__getQueryString($params, '?');
            case 'file_storage':
                if (array_key_exists('uuid', $params) == false) {
                    throw new \Exception('Please provide "uuid" param for request');
                }
                return sprintf('/files/%s/storage/', $params['uuid']);
            case 'file_copy':
                return '/files/';
            case 'file':
                if (array_key_exists('uuid', $params) == false) {
                    throw new \Exception('Please provide "uuid" param for request');
                }
                return sprintf('/files/%s/', $params['uuid']);
            case 'group_list':
                $allowedParams = array('from');
                $queryAr = array();
                foreach ($allowedParams as $paramName) {
                    if (isset($params[$paramName])) {
                        $queryAr[] = sprintf('%s=%s', $paramName, $params[$paramName]);
                    }
                }
                return '/groups/' . ($queryAr ? '?' . join('&', $queryAr) : '');
            case 'group':
                if (array_key_exists('uuid', $params) == false) {
                    throw new \Exception('Please provide "uuid" param for request');
                }
                return sprintf('/groups/%s/', $params['uuid']);
            case 'group_storage':
                if (array_key_exists('uuid', $params) == false) {
                    throw new \Exception('Please provide "uuid" param for request');
                }
                return sprintf('/groups/%s/storage/', $params['uuid']);
            default:
                throw new \Exception('No api url type is provided for request "' . $type . '". Use store, or appropriate constants.');
        }
    }