Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lenra-io/internal-api-client-lib-php

The PHP Lenra's app internal API client
https://github.com/lenra-io/internal-api-client-lib-php

Last synced: about 1 month ago
JSON representation

The PHP Lenra's app internal API client

Awesome Lists containing this project

README

        

# OpenAPIClient-php

The API usable by the Lenra applications

For more information, please visit [https://www.lenra.io/contact.html](https://www.lenra.io/contact.html).

## Installation & Usage

### Requirements

PHP 7.4 and later.
Should also work with PHP 8.0.

### Composer

To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:

```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
```

Then run `composer install`

### Manual Installation

Download the files and include `autoload.php`:

```php
setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new OpenAPI\Client\Api\DataApi(
// 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
);

try {
$apiInstance->abortTransaction();
} catch (Exception $e) {
echo 'Exception when calling DataApi->abortTransaction: ', $e->getMessage(), PHP_EOL;
}

```

## API Endpoints

All URIs are relative to *http://localhost:4001*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DataApi* | [**abortTransaction**](docs/Api/DataApi.md#aborttransaction) | **POST** /app-api/v1/data/transaction/abort | Aborts a transaction
*DataApi* | [**commitTransaction**](docs/Api/DataApi.md#committransaction) | **POST** /app-api/v1/data/transaction/commit | Commits a transaction
*DataApi* | [**createDocument**](docs/Api/DataApi.md#createdocument) | **POST** /app-api/v1/data/colls/{coll}/docs | Creates a document in database
*DataApi* | [**createTransaction**](docs/Api/DataApi.md#createtransaction) | **POST** /app-api/v1/data/transaction | Creates a transaction
*DataApi* | [**deleteCollection**](docs/Api/DataApi.md#deletecollection) | **DELETE** /app-api/v1-api/v1/data/colls/{coll} | Deletes a collection from database
*DataApi* | [**deleteDocumentById**](docs/Api/DataApi.md#deletedocumentbyid) | **DELETE** /app-api/v1/data/colls/{coll}/docs/{id} | Deletes a document from database
*DataApi* | [**findDocuments**](docs/Api/DataApi.md#finddocuments) | **POST** /app-api/v1/data/colls/{coll}/find | Finds documents in database
*DataApi* | [**getDocumentById**](docs/Api/DataApi.md#getdocumentbyid) | **GET** /app-api/v1/data/colls/{coll}/docs/{id} | Gets a document from database
*DataApi* | [**getDocuments**](docs/Api/DataApi.md#getdocuments) | **GET** /app-api/v1/data/colls/{coll}/docs | Gets documents from database
*DataApi* | [**updateDocumentById**](docs/Api/DataApi.md#updatedocumentbyid) | **PUT** /app-api/v1/data/colls/{coll}/docs/{id} | Updates a document in database
*DataApi* | [**updateManyDocuments**](docs/Api/DataApi.md#updatemanydocuments) | **POST** /app-api/v1/data/colls/{coll}/updateMany | Updates many documents in database

## Models

- [FindDocumentsRequest](docs/Model/FindDocumentsRequest.md)
- [UpdateManyDocumentsRequest](docs/Model/UpdateManyDocumentsRequest.md)

## Authorization

Authentication schemes defined for the API:
### bearerAuth

- **Type**: Bearer authentication

## Tests

To run the tests, use:

```bash
composer install
vendor/bin/phpunit
```

## Author

## About this package

This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `0.0.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`