Skip to content

Commit

Permalink
JobsStatus endpoint added
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Dec 20, 2024
1 parent 3c7e31d commit da966a9
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lib/Model/GetCredential200Response.php
lib/Model/GetCredentialType200Response.php
lib/Model/GetTopic200Response.php
lib/Model/Job.php
lib/Model/JobsStatus.php
lib/Model/RunTemplate.php
lib/Model/Status.php
lib/Model/Tag.php
Expand Down Expand Up @@ -61,6 +62,7 @@ tests/Model/GetCredential200ResponseTest.php
tests/Model/GetCredentialType200ResponseTest.php
tests/Model/GetTopic200ResponseTest.php
tests/Model/JobTest.php
tests/Model/JobsStatusTest.php
tests/Model/RunTemplateTest.php
tests/Model/StatusTest.php
tests/Model/TagTest.php
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Class | Method | HTTP request | Description
*AbstractDefaultApi* | **getApiIndex** | **GET** /index.{suffix} | Endpoints listing
*AbstractDefaultApi* | **getCredential** | **GET** /credential/{credentialId}.{suffix} | Get User Credentials
*AbstractDefaultApi* | **getCredentialType** | **GET** /credential_type/{credentialTypeID}.{suffix} | Get Credential Type by ID
*AbstractDefaultApi* | **getJobsStatus** | **GET** /jobs/status.{suffix} | Get Jobs Status
*AbstractDefaultApi* | **getTopic** | **GET** /topic/{topicId}.{suffix} | Get Topic by ID
*AbstractDefaultApi* | **loginSuffixGet** | **GET** /login.{suffix} | Return User's token
*AbstractDefaultApi* | **loginSuffixPost** | **POST** /login.{suffix} | Return User's token
Expand Down Expand Up @@ -207,6 +208,7 @@ Class | Method | HTTP request | Description
* MultiFlexi\Api\Model\GetCredentialType200Response
* MultiFlexi\Api\Model\GetTopic200Response
* MultiFlexi\Api\Model\Job
* MultiFlexi\Api\Model\JobsStatus
* MultiFlexi\Api\Model\RunTemplate
* MultiFlexi\Api\Model\Status
* MultiFlexi\Api\Model\Tag
Expand Down
46 changes: 46 additions & 0 deletions lib/App/RegisterRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,52 @@ class RegisterRoutes
}
}
}
EOD,
],
],
'authMethods' => [
],
],
[
'httpMethod' => 'GET',
'basePathWithoutHost' => '/VitexSoftware/MultiFlexi/1.0.0',
'path' => '/jobs/status.{suffix}',
'apiPackage' => 'MultiFlexi\Api\Server',
'classname' => 'AbstractDefaultApi',
'userClassname' => 'DefaultApi',
'operationId' => 'getJobsStatus',
'responses' => [
'200' => [
'jsonSchema' => <<<'EOD'
{
"description" : "successful operation",
"content" : {
"application/json" : {
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/JobsStatus"
}
}
}
}
}
EOD,
],
'401' => [
'jsonSchema' => <<<'EOD'
{
"description" : "Authentication information is missing or invalid",
"headers" : {
"WWW_Authenticate" : {
"style" : "simple",
"explode" : false,
"schema" : {
"type" : "string"
}
}
}
}
EOD,
],
],
Expand Down
3 changes: 1 addition & 2 deletions lib/Model/CredentialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class CredentialType extends BaseModel
"format" : "date-time"
},
"DatUpdate" : {
"type" : "string",
"format" : "date-time"
"type" : "string"
}
}
}
Expand Down
86 changes: 86 additions & 0 deletions lib/Model/JobsStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

declare(strict_types=1);

/**
* This file is part of the MultiFlexi package
*
* https://multiflexi.eu/
*
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* This is an example of using OAuth2 Application Flow in a specification to describe security to your API.
* The version of the OpenAPI document: 1.1.0
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git.
*/

/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator.
*/

namespace MultiFlexi\Api\Model;

use MultiFlexi\Api\BaseModel;

/**
* JobsStatus.
*
* @author OpenAPI Generator team
*
* @see https://github.com/openapitools/openapi-generator
*/
class JobsStatus extends BaseModel
{
/**
* @var string Models namespace.
* Can be required for data deserialization when model contains referenced schemas.
*/
protected const MODELS_NAMESPACE = '\MultiFlexi\Api\Model';

/**
* @var string Constant with OAS schema of current class.
* Should be overwritten by inherited class.
*/
protected const MODEL_SCHEMA = <<<'SCHEMA'
{
"properties" : {
"timestamp" : {
"type" : "string",
"format" : "date-time",
"example" : "2023-10-01T12:00:00Z"
},
"successful_jobs" : {
"type" : "integer",
"description" : "Successful jobs"
},
"failed_jobs" : {
"type" : "integer",
"description" : "Failed jobs"
},
"incomplete_jobs" : {
"type" : "integer",
"description" : "Incomplete jobs"
},
"total_applications" : {
"type" : "integer",
"description" : "Total applications"
},
"repeated_jobs" : {
"type" : "integer",
"description" : "Repeated jobs"
},
"total_jobs" : {
"type" : "integer",
"description" : "Total jobs"
}
}
}
SCHEMA;
}
24 changes: 24 additions & 0 deletions lib/Server/AbstractDefaultApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,30 @@ public function getCredentialType(
throw new HttpNotImplementedException($request, $message);
}

/**
* GET getJobsStatus
* Summary: Get Jobs Status
* Notes: Retrieve all jobs status
* Output-Formats: [application/json].
*
* @param ServerRequestInterface $request Request
* @param ResponseInterface $response Response
* @param string $suffix force format suffix
*
* @throws HttpNotImplementedException to force implementation class to override this method
*/
public function getJobsStatus(
ServerRequestInterface $request,
ResponseInterface $response,
string $suffix
): ResponseInterface {
$queryParams = $request->getQueryParams();
$limit = (\array_key_exists('limit', $queryParams)) ? $queryParams['limit'] : null;
$message = 'How about implementing getJobsStatus as a GET method in MultiFlexi\\Api\\Server\\DefaultApi class?';

throw new HttpNotImplementedException($request, $message);
}

/**
* GET getTopic
* Summary: Get Topic by ID
Expand Down
14 changes: 14 additions & 0 deletions tests/Api/DefaultApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ public function testGetCredentialType(): void
);
}

/**
* Test case for getJobsStatus.
*
* Get Jobs Status.
*
* @covers ::getJobsStatus
*/
public function testGetJobsStatus(): void
{
self::markTestIncomplete(
'Test of "getJobsStatus" method has not been implemented yet.',
);
}

/**
* Test case for getTopic.
*
Expand Down
Loading

0 comments on commit da966a9

Please sign in to comment.