timelight-ai / php-api-client
1.0.5
2019-12-23 16:16 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2025-04-24 05:23:54 UTC
README
A PHP library for easy use of the Timelight AI API.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen
Documentation
Generic documentation and tutorials of the API can be found at api.timelight.tech.
Full client reference can be found in the docs folder
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
Run composer require timelight-ai/php-api-client
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/php-api-client/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: bearer $config = TimelightAi\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = TimelightAi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new TimelightAi\Api\AIApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $source_id = 8.14; // float | try { $result = $apiInstance->v1AiAnomaliesSourceIdGet($source_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling AIApi->v1AiAnomaliesSourceIdGet: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
AIApi | v1AiAnomaliesSourceIdGet | GET /v1/ai/anomalies/{sourceId} | Auto detect-anomalies |
AIApi | v1AiRecomputeDayModelsSourceIdYearPost | POST /v1/ai/recompute-day-models/{sourceId}/{year} | Recomputes all day modesl |
AIApi | v1AiRecomputeDaysProjectionSourceIdYearPost | POST /v1/ai/recompute-days-projection/{sourceId}/{year} | Computes all days projection for a source and save them |
AIApi | v1AiRecomputeModelsSourceIdYearPost | POST /v1/ai/recompute-models/{sourceId}/{year} | Triggers a model recompute |
AIApi | v1AiRecomputeSourceModelsModelCountPost | POST /v1/ai/recompute-source-models/{modelCount} | Triggers a model recompute for source groups |
AlertApi | v1AlertAlertIdCommentPatch | PATCH /v1/alert/{alertId}/comment | Add a comment to an alert |
AlertApi | v1AlertAlertIdFavoritePatch | PATCH /v1/alert/{alertId}/favorite | Set alert favorite for the current user |
AlertApi | v1AlertListGet | GET /v1/alert/list | List alerts data of the selected year, all alerts if no year is provided |
AlertApi | v1AlertRefListGet | GET /v1/alert/ref/list | List alerts data of the selected year, all alerts if no year is provided |
DayApi | v1DayBulkPatch | PATCH /v1/day/bulk | Update day entities |
DayApi | v1DayListSourceIdYearGet | GET /v1/day/list/{sourceId}/{year} | List day data of the reference year |
DayContextApi | v1DayContextBulkPost | POST /v1/day-context/bulk | Create many DayContext |
DayContextApi | v1DayContextGet | GET /v1/day-context | Retrieve many DayContext |
DayContextApi | v1DayContextIdDelete | DELETE /v1/day-context/{id} | Delete one DayContext |
DayContextApi | v1DayContextIdGet | GET /v1/day-context/{id} | Retrieve one DayContext |
DayContextApi | v1DayContextIdPatch | PATCH /v1/day-context/{id} | Update one DayContext |
DayContextApi | v1DayContextIdPut | PUT /v1/day-context/{id} | Replace one DayContext |
DayContextApi | v1DayContextImportMeteoCsvSourceIdPost | POST /v1/day-context/import-meteo-csv/{sourceId} | Imports a meteo csv file for the source id |
DayContextApi | v1DayContextPost | POST /v1/day-context | Create one DayContext |
DayTrendApi | v1DayTrendBulkPost | POST /v1/day-trend/bulk | Create many DayTrend |
DayTrendApi | v1DayTrendGet | GET /v1/day-trend | Retrieve many DayTrend |
DayTrendApi | v1DayTrendIdDelete | DELETE /v1/day-trend/{id} | Delete one DayTrend |
DayTrendApi | v1DayTrendIdGet | GET /v1/day-trend/{id} | Retrieve one DayTrend |
DayTrendApi | v1DayTrendIdPatch | PATCH /v1/day-trend/{id} | Update one DayTrend |
DayTrendApi | v1DayTrendIdPut | PUT /v1/day-trend/{id} | Replace one DayTrend |
DayTrendApi | v1DayTrendPost | POST /v1/day-trend | Create one DayTrend |
DayTrendApi | v1DayTrendReplaceAllInSourceSourceIdPost | POST /v1/day-trend/replace-all-in-source/{sourceId} | Imports many trends and replace existing. Recomputes alerts |
ImportApi | v1ImportCreateSourcePost | POST /v1/import/create-source | First source creation |
ImportApi | v1ImportDaysPost | POST /v1/import/days | Add new data to a source |
ImportApi | v1ImportReprocessDaysSourceIdYearPost | POST /v1/import/reprocess-days/{sourceId}/{year} | Reprocess days from database |
ImportApi | v1ImportSourceIdDaysPost | POST /v1/import/{sourceId}/days | Add new data to a source |
ModelApi | v1ModelBulkPatch | PATCH /v1/model/bulk | Model bulk update |
ModelApi | v1ModelListSourceIdGet | GET /v1/model/list/{sourceId} | List models data of this source |
PrevisionApi | v1PrevisionGroupApplyPrevisionPost | POST /v1/prevision/group-apply-prevision | Apply a source prevision to the whole group |
PrevisionApi | v1PrevisionListSourceIdYearGet | GET /v1/prevision/list/{sourceId}/{year} | Fetch data previsions for a given year |
PrevisionApi | v1PrevisionSaveDefaultPrevisionsSourceIdYearPost | POST /v1/prevision/save-default-previsions/{sourceId}/{year} | Generate default previsions for the source and save them |
PrevisionApi | v1PrevisionSavePost | POST /v1/prevision/save | Save many previsions at once |
PrevisionApi | v1PrevisionUpdatePatch | PATCH /v1/prevision/update | Update a specific prevision |
SourceApi | v1SourceListGet | GET /v1/source/list | All user sources |
SourceApi | v1SourceSourceIdDelete | DELETE /v1/source/{sourceId} | Delete a source and all linked data |
SourceApi | v1SourceSourceIdGroupPatch | PATCH /v1/source/{sourceId}/group | Update a source group |
SourceApi | v1SourceSourceIdPatch | PATCH /v1/source/{sourceId} | Update a source |
SourceGroupApi | v1SourceGroupCreatePost | POST /v1/source-group/create | Create a new source groups |
SourceGroupApi | v1SourceGroupGroupIdPatch | PATCH /v1/source-group/{groupId} | Updates a group configuration |
SourceGroupApi | v1SourceGroupListGet | GET /v1/source-group/list | All source groups |
UserApi | v1UserLoginPost | POST /v1/user/login | Log the user in |
UserApi | v1UserMeGet | GET /v1/user/me | Retrieve current user information |
UserApi | v1UserRegisterDemoPost | POST /v1/user/register-demo | |
ViewHelperApi | v1ViewHelperAlertsGet | GET /v1/view-helper/alerts | Get the alert view data |
ViewHelperApi | v1ViewHelperAlertsRefGet | GET /v1/view-helper/alerts-ref | Get the alert referential view data |
ViewHelperApi | v1ViewHelperDaysNearDateSourceIdDayDateGet | GET /v1/view-helper/days-near-date/{sourceId}/{dayDate} | Get the alert modal view data |
Documentation For Models
- AlertCommentDto
- AlertDto
- AlertFavoriteDto
- AlertListDto
- AlertRefDto
- AlertRefListDto
- AlertRefResultDto
- AnomaliesResponseDto
- CreateSourceDayDto
- CreateSourceDto
- DayContext
- DayListDto
- DayModelDto
- DayPatchDto
- DayTrend
- DayTrendInput
- DayTrendInputListDto
- DayTrendListDto
- DaysNearDateResultDto
- DaysPatchDto
- GeneratedDayContextBulkDto
- GeneratedDayTrendBulkDto
- ImportDayDto
- ImportDaysDto
- LoginDto
- LoginResponseDto
- ModelDto
- ModelListDto
- ModelPatchDto
- ModelsPatchDto
- PrevisionApplyGroupDto
- PrevisionApplyGroupResponseDto
- PrevisionBulkSaveDto
- PrevisionBulkSaveResultDto
- PrevisionDto
- PrevisionListDto
- PrevisionPatchDto
- PrevisionSaveDto
- PrevisionUpdateResultDto
- RecomputeDayModelsResponseDto
- RecomputeDaysProjectionResponseDto
- RecomputeModelsResponseDto
- RecomputeSourceModelsResponseDto
- RequestDemoDto
- SourceDto
- SourceGroupCreateDto
- SourceGroupDto
- SourceGroupListDto
- SourceGroupPatchDto
- SourceListDto
- SourcePatchDto
- SourcePatchGroupDto
- UserDto
Documentation For Authorization
bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header