public static function factory($config = [])
    {
        $default = [
            'url' => 'https://syrup.keboola.com/gooddata-writer'
        ];
        $required = ['token'];
        $config = Collection::fromConfig($config, $default, $required);
        $config['request.options'] = [
            'headers' => [
                'X-StorageApi-Token' => $config->get('token')
            ],
            'config' => [
                'curl' => [
                    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_0
                ]

            ]
        ];

        $client = new self($config->get('url'), $config);

        // Attach a service description to the client
        $description = ServiceDescription::factory(__DIR__ . '/service.json');
        $client->setDescription($description);

        $client->setBaseUrl($config->get('url'));

        // Setup exponential backoff
        // 503 retry always, other errors five times
        $backoffPlugin = new BackoffPlugin(new TruncatedBackoffStrategy(
            5,
            new HttpBackoffStrategy(
                null,
                new CurlBackoffStrategy(
                    null,
                    new ExponentialBackoffStrategy()
                )
            )
        ));
        $client->addSubscriber($backoffPlugin);

        return $client;
    }