A simple client library for Google Timeseries Insights Api
- PHP 7.0+
Use Composer to install it:
composer require filippo-toso/timeseries-insights
use Google\Cloud\Timeseriesinsights\V1\TimeseriesInsightsControllerClient;
use Google\Cloud\Timeseriesinsights\V1\DataSet;
use Google\Cloud\Timeseriesinsights\V1\DataSource;
// The project ID from the credentials file downloaded from Google Console
define('PROJECT_ID', 'project-id');
$client = new TimeseriesInsightsControllerClient([
'credentials' => __DIR__ . '/credentials.json', // Your JSON credentials file downloaded from Google Console
]);
$datasets = $client->listDataSets('projects/' . PROJECT_ID);
print("List datasets: \r\n");
foreach ($datasets as $dataset) {
print($dataset->serializeToJsonString() . "\r\n");
}