filippo-toso/timeseries-insights

一个简单的 Google Timeseries Insights Api 客户端库

v1.0.1 2022-11-03 10:17 UTC

This package is auto-updated.

Last update: 2024-08-30 01:26:37 UTC


README

一个简单的 Google Timeseries Insights Api 客户端库

要求

  • PHP 7.0+

安装

使用 Composer 安装

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");
}