Skip to content

Commit 4feaee4

Browse files
regenerate
1 parent b774216 commit 4feaee4

File tree

128 files changed

+17488
-5616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+17488
-5616
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
2+
3+
composer.phar
4+
/vendor/
5+
6+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
7+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8+
# composer.lock
9+
10+
# php-cs-fixer cache
11+
.php_cs.cache
12+
.php-cs-fixer.cache
13+
14+
# PHPUnit cache
15+
.phpunit.result.cache

README.md

Lines changed: 92 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
# LORIS PHP API Client
2-
API for interacting with the LORIS Platform
1+
# OpenAPIClient-php
32

4-
This PHP package is automatically generated by the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) project:
3+
LORIS REST API for clinical data ingestion pipelines.
4+
Authentication via JWT - POST /login to get token, use as \"Bearer <token>\".
55

6-
- API version: 0.0.4
7-
- Build package: openapi-generator (php)
8-
- OpenAPI specification: [schema.yml](schema.yml)
96

10-
For more information, please visit [https://github.com/aces/Loris](https://github.com/aces/Loris)
7+
For more information, please visit [https://github.com/aces/loris](https://github.com/aces/loris).
118

12-
## Requirements
9+
## Installation & Usage
1310

14-
PHP 8.1 and later
11+
### Requirements
12+
13+
PHP 8.1 and later.
1514

16-
## Installation & Usage
1715
### Composer
1816

19-
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
17+
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
2018

2119
```json
2220
{
2321
"repositories": [
2422
{
25-
"type": "git",
26-
"url": "https://github.com/aces/loris-php-client.git"
23+
"type": "vcs",
24+
"url": "https://github.com/aces/loris-php-api-client.git"
2725
}
2826
],
2927
"require": {
30-
"loris/php-client": "dev-main"
28+
"aces/loris-php-api-client": "*@dev"
3129
}
3230
}
3331
```
@@ -39,16 +37,8 @@ Then run `composer install`
3937
Download the files and include `autoload.php`:
4038

4139
```php
42-
require_once('/path/to/loris-php-client/vendor/autoload.php');
43-
```
44-
45-
## Tests
46-
47-
To run the unit tests:
48-
49-
```bash
50-
composer install
51-
./vendor/bin/phpunit
40+
<?php
41+
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
5242
```
5343

5444
## Getting Started
@@ -59,137 +49,106 @@ Please follow the [installation procedure](#installation--usage) and then run th
5949
<?php
6050
require_once(__DIR__ . '/vendor/autoload.php');
6151

62-
use LORISClient\Configuration;
63-
use LORISClient\Api\AuthenticationApi;
64-
use LORISClient\Api\ClinicalApi;
65-
use GuzzleHttp\Client;
6652

67-
// Configure API client
68-
$config = Configuration::getDefaultConfiguration()
69-
->setHost('https://loris.example.com/api/v0.0.3');
7053

71-
$httpClient = new Client(['verify' => true]);
7254

73-
// Authenticate and get token
74-
$authApi = new AuthenticationApi($httpClient, $config);
55+
$apiInstance = new LORISClient\Api\AuthenticationApi(
56+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
57+
// This is optional, `GuzzleHttp\Client` will be used as default.
58+
new GuzzleHttp\Client()
59+
);
60+
$loginRequest = new \LORISClient\LORISClient\Model\LoginRequest(); // \LORISClient\LORISClient\Model\LoginRequest
7561

7662
try {
77-
$result = $authApi->authenticate([
78-
'username' => 'your_username',
79-
'password' => 'your_password'
80-
]);
81-
82-
$token = $result['token'];
83-
84-
// Configure API with token
85-
$config->setAccessToken($token);
86-
87-
// Use the Clinical API
88-
$clinicalApi = new ClinicalApi($httpClient, $config);
89-
90-
63+
$result = $apiInstance->login($loginRequest);
64+
print_r($result);
9165
} catch (Exception $e) {
92-
echo 'Exception: ', $e->getMessage(), PHP_EOL;
66+
echo 'Exception when calling AuthenticationApi->login: ', $e->getMessage(), PHP_EOL;
9367
}
9468

95-
?>
9669
```
9770

98-
## Documentation for API Endpoints
71+
## API Endpoints
9972

100-
All URIs are relative to your LORIS instance API endpoint (e.g., *https://loris.example.com/api/v0.0.3*)
73+
All URIs are relative to *https://demo.loris.ca/api/v0.0.4-dev*
10174

10275
Class | Method | HTTP request | Description
10376
------------ | ------------- | ------------- | -------------
104-
*AuthenticationApi* | [**authenticate**](docs/Api/AuthenticationApi.md#authenticate) | **POST** /login | Authenticate and obtain JWT token
105-
*ClinicalApi* | [**getInstruments**](docs/Api/ClinicalApi.md#getinstruments) | **GET** /instruments | Get list of instruments
106-
*ClinicalApi* | [**getCandidates**](docs/Api/ClinicalApi.md#getcandidates) | **GET** /candidates | Get list of candidates
107-
*ClinicalApi* | [**createCandidate**](docs/Api/ClinicalApi.md#createcandidate) | **POST** /candidates | Create a new candidate
108-
*ClinicalApi* | [**getCandidate**](docs/Api/ClinicalApi.md#getcandidate) | **GET** /candidates/{candID} | Get candidate details
109-
*ClinicalApi* | [**getVisit**](docs/Api/ClinicalApi.md#getvisit) | **GET** /candidates/{candID}/{visitLabel} | Get visit information
110-
*ClinicalApi* | [**createTimepoint**](docs/Api/ClinicalApi.md#createtimepoint) | **PUT** /candidates/{candID}/{visitLabel} | Create timepoint/visit
111-
*ClinicalApi* | [**getInstrumentData**](docs/Api/ClinicalApi.md#getinstrumentdata) | **GET** /candidates/{candID}/{visitLabel}/instruments/{instrument} | Get instrument data
112-
*ClinicalApi* | [**uploadInstrumentData**](docs/Api/ClinicalApi.md#uploadinstrumentdata) | **PUT** /candidates/{candID}/{visitLabel}/instruments/{instrument} | Upload instrument data
113-
*ClinicalApi* | [**uploadInstrumentCSV**](docs/Api/ClinicalApi.md#uploadinstrumentcsv) | **POST** /instrument_manager/instrument_data | Bulk upload instrument data via CSV
114-
115-
116-
## Documentation For Models
117-
118-
- [Authenticate200Response](docs/Model/Authenticate200Response.md)
119-
- [AuthenticateRequest](docs/Model/AuthenticateRequest.md)
120-
- [Candidate](docs/Model/Candidate.md)
121-
- [CandidateCreate](docs/Model/CandidateCreate.md)
122-
- [CandidateCreateCandidate](docs/Model/CandidateCreateCandidate.md)
123-
- [CandidateDetail](docs/Model/CandidateDetail.md)
124-
- [CreateCandidate201Response](docs/Model/CreateCandidate201Response.md)
125-
- [CreateCandidate201ResponseMeta](docs/Model/CreateCandidate201ResponseMeta.md)
126-
- [GetCandidates200Response](docs/Model/GetCandidates200Response.md)
127-
- [GetInstruments200Response](docs/Model/GetInstruments200Response.md)
128-
- [GetInstruments401Response](docs/Model/GetInstruments401Response.md)
129-
- [UploadInstrumentCSV200Response](docs/Model/UploadInstrumentCSV200Response.md)
130-
- [Visit](docs/Model/Visit.md)
131-
- [VisitCreate](docs/Model/VisitCreate.md)
132-
133-
134-
## Documentation For Authorization
135-
136-
137-
## BearerAuth
138-
139-
- **Type**: HTTP Bearer Token authentication
140-
- **Bearer format**: JWT
141-
- **Description**: JWT token obtained from /login endpoint
142-
143-
Example:
144-
```php
145-
$config = Configuration::getDefaultConfiguration()
146-
->setAccessToken('YOUR_JWT_TOKEN');
147-
```
148-
149-
150-
## Development
77+
*AuthenticationApi* | [**login**](docs/Api/AuthenticationApi.md#login) | **POST** /login | Authenticate and obtain JWT token
78+
*CandidatesApi* | [**createCandidate**](docs/Api/CandidatesApi.md#createcandidate) | **POST** /candidates | Create a new candidate
79+
*CandidatesApi* | [**getCandidate**](docs/Api/CandidatesApi.md#getcandidate) | **GET** /candidates/{candid} | Get candidate details
80+
*CandidatesApi* | [**getCandidates**](docs/Api/CandidatesApi.md#getcandidates) | **GET** /candidates | Get list of candidates
81+
*InstrumentManagerApi* | [**createInstrument**](docs/Api/InstrumentManagerApi.md#createinstrument) | **POST** /instrument_manager | Create instrument from LINST or REDCap data dictionary
82+
*InstrumentManagerApi* | [**getInstrumentDataHeaders**](docs/Api/InstrumentManagerApi.md#getinstrumentdataheaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data
83+
*InstrumentManagerApi* | [**uploadInstrumentData**](docs/Api/InstrumentManagerApi.md#uploadinstrumentdata) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV
84+
*InstrumentsApi* | [**getInstrumentData**](docs/Api/InstrumentsApi.md#getinstrumentdata) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data for a candidate/visit
85+
*InstrumentsApi* | [**getVisitInstruments**](docs/Api/InstrumentsApi.md#getvisitinstruments) | **GET** /candidates/{candid}/{visit}/instruments | Get instruments for a visit
86+
*InstrumentsApi* | [**patchInstrumentData**](docs/Api/InstrumentsApi.md#patchinstrumentdata) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data
87+
*InstrumentsApi* | [**putInstrumentData**](docs/Api/InstrumentsApi.md#putinstrumentdata) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data
88+
*ProjectsApi* | [**getProject**](docs/Api/ProjectsApi.md#getproject) | **GET** /projects/{project} | Get project details including instruments
89+
*ProjectsApi* | [**getProjectInstruments**](docs/Api/ProjectsApi.md#getprojectinstruments) | **GET** /projects/{project}/instruments | Get instruments for a project
90+
*ProjectsApi* | [**getProjects**](docs/Api/ProjectsApi.md#getprojects) | **GET** /projects | Get list of projects
91+
*SitesApi* | [**getSites**](docs/Api/SitesApi.md#getsites) | **GET** /sites | Get list of sites
92+
*VisitsApi* | [**createVisit**](docs/Api/VisitsApi.md#createvisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit
93+
*VisitsApi* | [**getVisit**](docs/Api/VisitsApi.md#getvisit) | **GET** /candidates/{candid}/{visit} | Get visit details
94+
95+
## Models
96+
97+
- [CandidateCreateRequest](docs/Model/CandidateCreateRequest.md)
98+
- [CandidateCreateRequestCandidate](docs/Model/CandidateCreateRequestCandidate.md)
99+
- [CandidateObject](docs/Model/CandidateObject.md)
100+
- [CandidatesResponse](docs/Model/CandidatesResponse.md)
101+
- [ErrorResponse](docs/Model/ErrorResponse.md)
102+
- [IdMapping](docs/Model/IdMapping.md)
103+
- [InstrumentData](docs/Model/InstrumentData.md)
104+
- [InstrumentDataMeta](docs/Model/InstrumentDataMeta.md)
105+
- [InstrumentDataRequest](docs/Model/InstrumentDataRequest.md)
106+
- [InstrumentDataRequestMeta](docs/Model/InstrumentDataRequestMeta.md)
107+
- [InstrumentDataResponse](docs/Model/InstrumentDataResponse.md)
108+
- [InstrumentDataResponseMessage](docs/Model/InstrumentDataResponseMessage.md)
109+
- [InstrumentMeta](docs/Model/InstrumentMeta.md)
110+
- [InstrumentsResponse](docs/Model/InstrumentsResponse.md)
111+
- [LoginRequest](docs/Model/LoginRequest.md)
112+
- [LoginResponse](docs/Model/LoginResponse.md)
113+
- [ProjectResponse](docs/Model/ProjectResponse.md)
114+
- [ProjectResponseMeta](docs/Model/ProjectResponseMeta.md)
115+
- [ProjectsResponse](docs/Model/ProjectsResponse.md)
116+
- [Site](docs/Model/Site.md)
117+
- [SitesResponse](docs/Model/SitesResponse.md)
118+
- [StageObject](docs/Model/StageObject.md)
119+
- [SuccessResponse](docs/Model/SuccessResponse.md)
120+
- [VisitCreateRequest](docs/Model/VisitCreateRequest.md)
121+
- [VisitInstrumentsResponse](docs/Model/VisitInstrumentsResponse.md)
122+
- [VisitInstrumentsResponseMeta](docs/Model/VisitInstrumentsResponseMeta.md)
123+
- [VisitObject](docs/Model/VisitObject.md)
124+
- [VisitObjectMeta](docs/Model/VisitObjectMeta.md)
125+
- [VisitObjectStages](docs/Model/VisitObjectStages.md)
126+
127+
## Authorization
128+
129+
Authentication schemes defined for the API:
130+
### BearerAuth
131+
132+
- **Type**: Bearer authentication (JWT)
151133

152-
This client is generated from the OpenAPI specification using OpenAPI Generator.
153-
154-
To regenerate the client:
155-
156-
```bash
157-
./generate.sh
158-
```
134+
## Tests
159135

160-
Or manually:
136+
To run the tests, use:
161137

162138
```bash
163-
openapi-generator-cli generate \
164-
-i schema.yml \
165-
-g php \
166-
-o . \
167-
-c openapi-config.json \
168-
--additional-properties=composerPackageName=loris/php-client
169-
```
170-
171-
## API Version Compatibility
172-
173-
This client supports LORIS API versions:
174-
- v0.0.3
175-
- v0.0.4
176-
177-
Configure the version in the base URL:
178-
```php
179-
$config->setHost('https://loris.example.com/api/v0.0.3');
139+
composer install
140+
vendor/bin/phpunit
180141
```
181142

182-
## Contributing
183-
184-
Issues and pull requests are welcome on [GitHub](https://github.com/aces/loris-php-client).
143+
## Author
185144

186-
## License
187145

188-
[GPL-3.0](LICENSE)
189146

190-
## Related Projects
147+
## About this package
191148

192-
- [LORIS](https://github.com/aces/Loris) - Longitudinal Online Research and Imaging System
193-
## Author
149+
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
194150

195-
The LORIS Team
151+
- API version: `0.0.4-dev`
152+
- Package version: `0.0.4-dev`
153+
- Generator version: `7.17.0`
154+
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"name": "loris/php-client",
3-
"description": "LORIS (Longitudinal Online Research and Imaging System) REST API for managing clinical neuroimaging and behavioral research data.",
2+
"name": "aces/loris-php-api-client",
3+
"version": "0.0.4-dev",
4+
"description": "LORIS REST API for clinical data ingestion pipelines. Authentication via JWT - POST /login to get token, use as \"Bearer <token>\".",
45
"keywords": [
56
"openapitools",
67
"openapi-generator",

docs/Api/AuthenticationApi.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
# LORISClient\AuthenticationApi
22

3-
Authentication and token management
3+
Login and JWT token
44

5-
All URIs are relative to https://localhost/api/v0.0.4, except if the operation defines another base path.
5+
All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the operation defines another base path.
66

77
| Method | HTTP request | Description |
88
| ------------- | ------------- | ------------- |
9-
| [**authenticate()**](AuthenticationApi.md#authenticate) | **POST** /login | Authenticate and obtain JWT token |
9+
| [**login()**](AuthenticationApi.md#login) | **POST** /login | Authenticate and obtain JWT token |
1010

1111

12-
## `authenticate()`
12+
## `login()`
1313

1414
```php
15-
authenticate($authenticateRequest): \LORISClient\LORISClient\Model\Authenticate200Response
15+
login($loginRequest): \LORISClient\LORISClient\Model\LoginResponse
1616
```
1717

1818
Authenticate and obtain JWT token
1919

20-
Login to LORIS API with username and password credentials
21-
2220
### Example
2321

2422
```php
@@ -32,25 +30,25 @@ $apiInstance = new LORISClient\Api\AuthenticationApi(
3230
// This is optional, `GuzzleHttp\Client` will be used as default.
3331
new GuzzleHttp\Client()
3432
);
35-
$authenticateRequest = new \LORISClient\LORISClient\Model\AuthenticateRequest(); // \LORISClient\LORISClient\Model\AuthenticateRequest
33+
$loginRequest = new \LORISClient\LORISClient\Model\LoginRequest(); // \LORISClient\LORISClient\Model\LoginRequest
3634

3735
try {
38-
$result = $apiInstance->authenticate($authenticateRequest);
36+
$result = $apiInstance->login($loginRequest);
3937
print_r($result);
4038
} catch (Exception $e) {
41-
echo 'Exception when calling AuthenticationApi->authenticate: ', $e->getMessage(), PHP_EOL;
39+
echo 'Exception when calling AuthenticationApi->login: ', $e->getMessage(), PHP_EOL;
4240
}
4341
```
4442

4543
### Parameters
4644

4745
| Name | Type | Description | Notes |
4846
| ------------- | ------------- | ------------- | ------------- |
49-
| **authenticateRequest** | [**\LORISClient\LORISClient\Model\AuthenticateRequest**](../Model/AuthenticateRequest.md)| | |
47+
| **loginRequest** | [**\LORISClient\LORISClient\Model\LoginRequest**](../Model/LoginRequest.md)| | |
5048

5149
### Return type
5250

53-
[**\LORISClient\LORISClient\Model\Authenticate200Response**](../Model/Authenticate200Response.md)
51+
[**\LORISClient\LORISClient\Model\LoginResponse**](../Model/LoginResponse.md)
5452

5553
### Authorization
5654

0 commit comments

Comments
 (0)