# CaptyreSdk

REST API for the Captyre video capture service. Manages users, jobs, events, workers, and authentication.


## Installation & Usage

### Requirements

PHP 8.1 and later.

### 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
<?php
require_once('/path/to/CaptyreSdk/vendor/autoload.php');
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');




$apiInstance = new Barocsi\CaptyrePlugin\SDK\Api\AuthApi(
    // 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()
);
$apikey = 'apikey_example'; // string
$generate_new_secret_for_others_request = new \Barocsi\CaptyrePlugin\SDK\Model\GenerateNewSecretForOthersRequest(); // \Barocsi\CaptyrePlugin\SDK\Model\GenerateNewSecretForOthersRequest

try {
    $result = $apiInstance->generateNewSecretForOthers($apikey, $generate_new_secret_for_others_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->generateNewSecretForOthers: ', $e->getMessage(), PHP_EOL;
}

```

## API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AuthApi* | [**generateNewSecretForOthers**](docs/Api/AuthApi.md#generatenewsecretforothers) | **POST** /auth/secret/generate/others | Generate a new client_secret for a user (requires apikey)
*AuthApi* | [**generateTokenForOthers**](docs/Api/AuthApi.md#generatetokenforothers) | **POST** /auth/token/generate/others | Generate a JWT for another user (requires apikey)
*AuthApi* | [**generateTokenForSelf**](docs/Api/AuthApi.md#generatetokenforself) | **POST** /auth/token/generate/self | Generate a new JWT for the authenticated user
*AuthApi* | [**login**](docs/Api/AuthApi.md#login) | **POST** /auth/login | Login with client_id and client_secret
*AuthApi* | [**revokeTokenByClientId**](docs/Api/AuthApi.md#revoketokenbyclientid) | **POST** /auth/token/revoke/client_id/{client_id} | Revoke JWT tokens for a user by client_id
*AuthApi* | [**revokeTokenForSelf**](docs/Api/AuthApi.md#revoketokenforself) | **POST** /auth/token/revoke/self | Revoke JWT tokens for the authenticated user
*AuthApi* | [**validateToken**](docs/Api/AuthApi.md#validatetoken) | **GET** /auth/token/validate | Validate a Bearer token
*EventsApi* | [**deleteEvent**](docs/Api/EventsApi.md#deleteevent) | **DELETE** /event/single/delete/{id} | Delete an event by MongoDB ObjectId
*EventsApi* | [**getOneEventById**](docs/Api/EventsApi.md#getoneeventbyid) | **GET** /event/single/get/{id} | Get a single event by MongoDB ObjectId
*EventsApi* | [**listEvents**](docs/Api/EventsApi.md#listevents) | **POST** /event/list | List events with pagination and filters
*JobsApi* | [**countIsErrorJobs**](docs/Api/JobsApi.md#countiserrorjobs) | **GET** /job/stats/count_is_error_jobs | Count errored jobs within a time window
*JobsApi* | [**countIsPendingJobs**](docs/Api/JobsApi.md#countispendingjobs) | **GET** /job/stats/count_is_pending_jobs | Count pending jobs within a time window
*JobsApi* | [**jobSingleAdd**](docs/Api/JobsApi.md#jobsingleadd) | **POST** /job/single/add | Create a new capture job
*JobsApi* | [**jobSingleCancel**](docs/Api/JobsApi.md#jobsinglecancel) | **PATCH** /job/single/cancel/{uuid} | Cancel a job
*JobsApi* | [**jobSingleDeleteByUuid**](docs/Api/JobsApi.md#jobsingledeletebyuuid) | **DELETE** /job/single/delete/{uuid} | Delete a job by UUID
*JobsApi* | [**jobSingleGetOneByUuid**](docs/Api/JobsApi.md#jobsinglegetonebyuuid) | **POST** /job/single/get/{uuid} | Get a single job by UUID
*JobsApi* | [**jobSingleGetnext**](docs/Api/JobsApi.md#jobsinglegetnext) | **POST** /job/single/getnext | Get the next pending job from the queue
*JobsApi* | [**jobSingleRequeue**](docs/Api/JobsApi.md#jobsinglerequeue) | **GET** /job/single/requeue/{uuid} | Re-queue a job (creates a copy with pending status)
*JobsApi* | [**jobSingleUpdate**](docs/Api/JobsApi.md#jobsingleupdate) | **PUT** /job/single/update/{uuid} | Update a job by UUID
*JobsApi* | [**jobSingleUpdateDetails**](docs/Api/JobsApi.md#jobsingleupdatedetails) | **PATCH** /job/single/updatedetails/{uuid} | Update job details sub-document
*JobsApi* | [**jobSingleUpdateStatus**](docs/Api/JobsApi.md#jobsingleupdatestatus) | **PATCH** /job/single/update_job_status/{uuid} | Update job status or error status
*JobsApi* | [**listJobs**](docs/Api/JobsApi.md#listjobs) | **POST** /job/list | List jobs with pagination and filters
*JobsApi* | [**perClientIdStats**](docs/Api/JobsApi.md#perclientidstats) | **GET** /job/stats/per_client_id/{client_id} | Per-client_id processing statistics
*JobsApi* | [**perExternalContentIdStats**](docs/Api/JobsApi.md#perexternalcontentidstats) | **GET** /job/stats/per_external_content_id | Per-external_content_id processing statistics
*JobsApi* | [**queueStats**](docs/Api/JobsApi.md#queuestats) | **GET** /job/stats/queue | Queue statistics (average wait time, duration)
*JobsApi* | [**queueStatus**](docs/Api/JobsApi.md#queuestatus) | **GET** /job/stats/queue_status | Count pending/working jobs and elapsed time
*JobsApi* | [**updateTimedOutJobs**](docs/Api/JobsApi.md#updatetimedoutjobs) | **GET** /job/updatetimedout | Mark timed-out jobs as errored
*MiscApi* | [**iframePlayer**](docs/Api/MiscApi.md#iframeplayer) | **GET** /player/iframe | Render an iframe player page (returns HTML)
*MiscApi* | [**siteRoot**](docs/Api/MiscApi.md#siteroot) | **GET** / | API root – returns name, version, build
*UsersApi* | [**gETUserSingleQuotaUsage**](docs/Api/UsersApi.md#getusersinglequotausage) | **GET** /user/single/quota/usage | Get quota usage for a user
*UsersApi* | [**userList**](docs/Api/UsersApi.md#userlist) | **POST** /user/list | List users with pagination and filters
*UsersApi* | [**userSingleAdd**](docs/Api/UsersApi.md#usersingleadd) | **POST** /user/single/add | Create a new user
*UsersApi* | [**userSingleDeleteByClientId**](docs/Api/UsersApi.md#usersingledeletebyclientid) | **DELETE** /user/single/delete/client_id/{client_id} | Delete a user by client_id (also revokes tokens)
*UsersApi* | [**userSingleDeleteByUuid**](docs/Api/UsersApi.md#usersingledeletebyuuid) | **DELETE** /user/single/delete/uuid/{uuid} | Delete a user by UUID
*UsersApi* | [**userSingleGetOneUserByClientId**](docs/Api/UsersApi.md#usersinglegetoneuserbyclientid) | **GET** /user/single/client_id/{client_id} | Get a user by client_id
*UsersApi* | [**userSingleGetOneUserByEmail**](docs/Api/UsersApi.md#usersinglegetoneuserbyemail) | **GET** /user/single/email/{email} | Get a user by email
*UsersApi* | [**userSingleGetOneUserByExternalUserId**](docs/Api/UsersApi.md#usersinglegetoneuserbyexternaluserid) | **GET** /user/single/external_user_id/{external_user_id} | Get a user by external_user_id
*UsersApi* | [**userSingleGetOneUserByUuid**](docs/Api/UsersApi.md#usersinglegetoneuserbyuuid) | **GET** /user/single/uuid/{uuid} | Get a user by UUID
*UsersApi* | [**userSingleUpdate**](docs/Api/UsersApi.md#usersingleupdate) | **PUT** /user/single/update/{uuid} | Update a user by UUID
*UsersApi* | [**userSingleUpdateExternalUserIdByEmail**](docs/Api/UsersApi.md#usersingleupdateexternaluseridbyemail) | **PUT** /user/single/updateexternaluserid/{email} | Set external_user_id for a user by email
*UsersApi* | [**userSingleUpdateLevelByClientId**](docs/Api/UsersApi.md#usersingleupdatelevelbyclientid) | **PUT** /user/single/updatelevel/client_id/{client_id} | Update subscription level and quota by client_id
*UsersApi* | [**userSingleUpdateLevelByUuid**](docs/Api/UsersApi.md#usersingleupdatelevelbyuuid) | **PUT** /user/single/updatelevel/uuid/{uuid} | Update subscription level and quota by UUID
*WorkersApi* | [**listWorkers**](docs/Api/WorkersApi.md#listworkers) | **GET** /worker/list | List registered workers
*WorkersApi* | [**pingWorkers**](docs/Api/WorkersApi.md#pingworkers) | **POST** /worker/ping | Worker heartbeat (upsert)

## Models

- [ApiResponse](docs/Model/ApiResponse.md)
- [ApiResponseMeta](docs/Model/ApiResponseMeta.md)
- [CountIsPendingJobs200Response](docs/Model/CountIsPendingJobs200Response.md)
- [CountIsPendingJobs200ResponsePayload](docs/Model/CountIsPendingJobs200ResponsePayload.md)
- [DeleteResult](docs/Model/DeleteResult.md)
- [ErrorResponse](docs/Model/ErrorResponse.md)
- [Event](docs/Model/Event.md)
- [GETUserSingleQuotaUsage200Response](docs/Model/GETUserSingleQuotaUsage200Response.md)
- [GETUserSingleQuotaUsage200ResponsePayload](docs/Model/GETUserSingleQuotaUsage200ResponsePayload.md)
- [GenerateNewSecretForOthers200Response](docs/Model/GenerateNewSecretForOthers200Response.md)
- [GenerateNewSecretForOthers200ResponsePayload](docs/Model/GenerateNewSecretForOthers200ResponsePayload.md)
- [GenerateNewSecretForOthersRequest](docs/Model/GenerateNewSecretForOthersRequest.md)
- [GenerateTokenForOthersRequest](docs/Model/GenerateTokenForOthersRequest.md)
- [GenerateTokenForSelf200Response](docs/Model/GenerateTokenForSelf200Response.md)
- [GenerateTokenForSelf200ResponseMeta](docs/Model/GenerateTokenForSelf200ResponseMeta.md)
- [GenerateTokenForSelfRequest](docs/Model/GenerateTokenForSelfRequest.md)
- [GetOneEventById200Response](docs/Model/GetOneEventById200Response.md)
- [Job](docs/Model/Job.md)
- [JobDetails](docs/Model/JobDetails.md)
- [JobSingleAdd200Response](docs/Model/JobSingleAdd200Response.md)
- [JobSingleAddRequest](docs/Model/JobSingleAddRequest.md)
- [JobSingleCancelRequest](docs/Model/JobSingleCancelRequest.md)
- [JobSingleDeleteByUuid200Response](docs/Model/JobSingleDeleteByUuid200Response.md)
- [JobSingleGetOneByUuidRequest](docs/Model/JobSingleGetOneByUuidRequest.md)
- [JobSingleGetnextRequest](docs/Model/JobSingleGetnextRequest.md)
- [JobSingleUpdate200Response](docs/Model/JobSingleUpdate200Response.md)
- [JobSingleUpdate200ResponsePayload](docs/Model/JobSingleUpdate200ResponsePayload.md)
- [JobSingleUpdateDetailsRequest](docs/Model/JobSingleUpdateDetailsRequest.md)
- [JobSingleUpdateStatusRequest](docs/Model/JobSingleUpdateStatusRequest.md)
- [ListEvents200Response](docs/Model/ListEvents200Response.md)
- [ListEventsRequest](docs/Model/ListEventsRequest.md)
- [ListJobs200Response](docs/Model/ListJobs200Response.md)
- [ListJobs200ResponseMeta](docs/Model/ListJobs200ResponseMeta.md)
- [ListJobsRequest](docs/Model/ListJobsRequest.md)
- [ListWorkers200Response](docs/Model/ListWorkers200Response.md)
- [Login200Response](docs/Model/Login200Response.md)
- [Login200ResponsePayload](docs/Model/Login200ResponsePayload.md)
- [LoginRequest](docs/Model/LoginRequest.md)
- [PaginationParams](docs/Model/PaginationParams.md)
- [PerClientIdStats200Response](docs/Model/PerClientIdStats200Response.md)
- [PerClientIdStats200ResponsePayload](docs/Model/PerClientIdStats200ResponsePayload.md)
- [PingWorkers200Response](docs/Model/PingWorkers200Response.md)
- [PingWorkersRequest](docs/Model/PingWorkersRequest.md)
- [QueueStats200Response](docs/Model/QueueStats200Response.md)
- [QueueStats200ResponsePayload](docs/Model/QueueStats200ResponsePayload.md)
- [QueueStats200ResponsePayloadStats](docs/Model/QueueStats200ResponsePayloadStats.md)
- [QueueStatus200Response](docs/Model/QueueStatus200Response.md)
- [QueueStatus200ResponsePayload](docs/Model/QueueStatus200ResponsePayload.md)
- [Quota](docs/Model/Quota.md)
- [RevokeTokenForSelf200Response](docs/Model/RevokeTokenForSelf200Response.md)
- [RevokeTokenForSelf200ResponsePayload](docs/Model/RevokeTokenForSelf200ResponsePayload.md)
- [RevokeTokenForSelfRequest](docs/Model/RevokeTokenForSelfRequest.md)
- [Session](docs/Model/Session.md)
- [SiteRoot200Response](docs/Model/SiteRoot200Response.md)
- [Storage](docs/Model/Storage.md)
- [Token](docs/Model/Token.md)
- [UpdateTimedOutJobs200Response](docs/Model/UpdateTimedOutJobs200Response.md)
- [UpdateTimedOutJobs200ResponseMeta](docs/Model/UpdateTimedOutJobs200ResponseMeta.md)
- [UpdateTimedOutJobs200ResponsePayload](docs/Model/UpdateTimedOutJobs200ResponsePayload.md)
- [User](docs/Model/User.md)
- [UserList200Response](docs/Model/UserList200Response.md)
- [UserListRequest](docs/Model/UserListRequest.md)
- [UserSingleAdd200Response](docs/Model/UserSingleAdd200Response.md)
- [UserSingleAdd200ResponsePayload](docs/Model/UserSingleAdd200ResponsePayload.md)
- [UserSingleAddRequest](docs/Model/UserSingleAddRequest.md)
- [UserSingleDeleteByClientId200Response](docs/Model/UserSingleDeleteByClientId200Response.md)
- [UserSingleDeleteByClientId200ResponsePayload](docs/Model/UserSingleDeleteByClientId200ResponsePayload.md)
- [UserSingleDeleteByUuid200Response](docs/Model/UserSingleDeleteByUuid200Response.md)
- [UserSingleGetOneUserByUuid200Response](docs/Model/UserSingleGetOneUserByUuid200Response.md)
- [UserSingleUpdate200Response](docs/Model/UserSingleUpdate200Response.md)
- [UserSingleUpdate200ResponsePayload](docs/Model/UserSingleUpdate200ResponsePayload.md)
- [UserSingleUpdateExternalUserIdByEmailRequest](docs/Model/UserSingleUpdateExternalUserIdByEmailRequest.md)
- [UserSingleUpdateLevelByUuidRequest](docs/Model/UserSingleUpdateLevelByUuidRequest.md)
- [ValidateToken200Response](docs/Model/ValidateToken200Response.md)
- [ValidateToken200ResponsePayload](docs/Model/ValidateToken200ResponsePayload.md)
- [Worker](docs/Model/Worker.md)

## Authorization

Authentication schemes defined for the API:
### bearerAuth

- **Type**: Bearer authentication (JWT)

## 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: `1.0.0`
    - Generator version: `7.23.0-SNAPSHOT`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
