diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f187e7f..a1c81e1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -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 @@ -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 diff --git a/README.md b/README.md index 4e2f8d5..42eecb7 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/lib/App/RegisterRoutes.php b/lib/App/RegisterRoutes.php index 9800986..16a1319 100644 --- a/lib/App/RegisterRoutes.php +++ b/lib/App/RegisterRoutes.php @@ -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, ], ], diff --git a/lib/Model/CredentialType.php b/lib/Model/CredentialType.php index d3ba71f..ace068e 100644 --- a/lib/Model/CredentialType.php +++ b/lib/Model/CredentialType.php @@ -77,8 +77,7 @@ class CredentialType extends BaseModel "format" : "date-time" }, "DatUpdate" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } } diff --git a/lib/Model/JobsStatus.php b/lib/Model/JobsStatus.php new file mode 100644 index 0000000..d912167 --- /dev/null +++ b/lib/Model/JobsStatus.php @@ -0,0 +1,86 @@ + + * + * 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: vitezslav.dvorak@spojenet.cz + * 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; +} diff --git a/lib/Server/AbstractDefaultApi.php b/lib/Server/AbstractDefaultApi.php index c4528f0..5762594 100644 --- a/lib/Server/AbstractDefaultApi.php +++ b/lib/Server/AbstractDefaultApi.php @@ -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 diff --git a/tests/Api/DefaultApiTest.php b/tests/Api/DefaultApiTest.php index 5cfa49c..5506b19 100644 --- a/tests/Api/DefaultApiTest.php +++ b/tests/Api/DefaultApiTest.php @@ -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. * diff --git a/tests/Model/JobsStatusTest.php b/tests/Model/JobsStatusTest.php new file mode 100644 index 0000000..9b4c975 --- /dev/null +++ b/tests/Model/JobsStatusTest.php @@ -0,0 +1,169 @@ + + * + * 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: vitezslav.dvorak@spojenet.cz + * 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 + * Please update the test case below to test the model. + */ + +namespace MultiFlexi\Api\Model; + +use PHPUnit\Framework\TestCase; + +/** + * JobsStatusTest Class Doc Comment. + * + * @author OpenAPI Generator team + * + * @see https://github.com/openapitools/openapi-generator + * + * @coversDefaultClass \MultiFlexi\Api\Model\JobsStatus + */ +class JobsStatusTest extends TestCase +{ + /** + * Setup before running any test cases. + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Clean up after running all test cases. + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Setup before running each test case. + */ + protected function setUp(): void + { + } + + /** + * Clean up after running each test case. + */ + protected function tearDown(): void + { + } + + /** + * Test "JobsStatus". + */ + public function testJobsStatus(): void + { + $testJobsStatus = new JobsStatus(); + $namespacedClassname = JobsStatus::getModelsNamespace().'\\JobsStatus'; + $this->assertSame('\\'.JobsStatus::class, $namespacedClassname); + $this->assertTrue( + class_exists($namespacedClassname), + sprintf('Assertion failed that "%s" class exists', $namespacedClassname), + ); + self::markTestIncomplete( + 'Test of "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "timestamp". + */ + public function testPropertyTimestamp(): void + { + self::markTestIncomplete( + 'Test of "timestamp" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "successfulJobs". + */ + public function testPropertySuccessfulJobs(): void + { + self::markTestIncomplete( + 'Test of "successfulJobs" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "failedJobs". + */ + public function testPropertyFailedJobs(): void + { + self::markTestIncomplete( + 'Test of "failedJobs" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "incompleteJobs". + */ + public function testPropertyIncompleteJobs(): void + { + self::markTestIncomplete( + 'Test of "incompleteJobs" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "totalApplications". + */ + public function testPropertyTotalApplications(): void + { + self::markTestIncomplete( + 'Test of "totalApplications" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "repeatedJobs". + */ + public function testPropertyRepeatedJobs(): void + { + self::markTestIncomplete( + 'Test of "repeatedJobs" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test attribute "totalJobs". + */ + public function testPropertyTotalJobs(): void + { + self::markTestIncomplete( + 'Test of "totalJobs" property in "JobsStatus" model has not been implemented yet.', + ); + } + + /** + * Test getOpenApiSchema static method. + * + * @covers ::getOpenApiSchema + */ + public function testGetOpenApiSchema(): void + { + $schemaArr = JobsStatus::getOpenApiSchema(); + $this->assertIsArray($schemaArr); + } +}