Skip to content

Commit

Permalink
import for Kimai 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Jun 24, 2023
1 parent bfc1718 commit b2e1a0d
Show file tree
Hide file tree
Showing 82 changed files with 11,120 additions and 8,266 deletions.
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ JSON API for the Kimai time-tracking software: [API documentation](https://www.k

This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 0.6
- Build package: io.swagger.codegen.languages.PhpClientCodegen
- API version: 0.7 (for Kimai 2.0.x)

## Requirements

PHP 5.5 and later
- Kimai 2.0.x
- PHP 7.4 and later
- Curl extension
- JSON extension
- mbstring extension

## Installation & Usage

Expand All @@ -30,36 +33,28 @@ Please follow the [installation procedure](#installation--usage) and then run th
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apiToken
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-AUTH-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AUTH-TOKEN', 'Bearer');
// Configure API key authorization: apiUser
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-AUTH-USER', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AUTH-USER', 'Bearer');
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-AUTH-USER', 'YOUR_USERNAME');

$apiInstance = new Swagger\Client\Api\ActivityApi(
// 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
);
$project = ""; // string | Project ID to filter activities
$projects = ""; // string | Comma separated list of project IDs to filter activities
$visible = "1"; // string | Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1)
$project = "123"; // string | Project ID to filter activities
$projects = []; // string[] | List of project IDs to filter activities, e.g.: projects[]=1&projects[]=2
$visible = "1"; // string | Visibility status to filter activities: 1=visible, 2=hidden, 3=all
$globals = "1"; // string | Use if you want to fetch only global activities. Allowed values: true (default: false)
$globals_first = "globals_first_example"; // string | Deprecated parameter, value is not used any more
$order_by = ""; // string | The field by which results will be ordered. Allowed values: id, name, project (default: name)
$order_by = "name"; // string | The field by which results will be ordered. Allowed values: id, name, project (default: name)
$order = "order_example"; // string | The result order. Allowed values: ASC, DESC (default: ASC)
$term = "term_example"; // string | Free search term

try {
$result = $apiInstance->apiActivitiesGet($project, $projects, $visible, $globals, $globals_first, $order_by, $order, $term);
$result = $apiInstance->getGetActivities($project, $projects, $visible, $globals, $order_by, $order, $term);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ActivityApi->apiActivitiesGet: ', $e->getMessage(), PHP_EOL;
}

?>
```

8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@
}
],
"require": {
"php": ">=5.5",
"php": "^7.4 || ^8.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
"guzzlehttp/guzzle": "^7.3",
"guzzlehttp/psr7": "^1.7 || ^2.0"
},
"autoload": {
"psr-4": { "Swagger\\Client\\" : "lib/" }
},
"autoload-dev": {
"psr-4": { "Swagger\\Client\\" : "test/" }
}
}
Loading

0 comments on commit b2e1a0d

Please sign in to comment.