-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from apivideo/add-video-tags-endpoint
Add video tags endpoint
- Loading branch information
Showing
12 changed files
with
623 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# ApiVideo\Client\Api\TagsApi | ||
|
||
All URIs are relative to https://ws.api.video. | ||
|
||
Method | Description | HTTP request | ||
------------- | ------------- | ------------- | ||
[**list()**](TagsApi.md#list) | List all video tags | **GET** /tags | ||
|
||
|
||
## **`list()` - List all video tags** | ||
|
||
|
||
|
||
This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project. | ||
|
||
### Arguments | ||
|
||
|
||
|
||
|
||
|
||
Note: `queryParams` argument is an associative array with the keys listed below. | ||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
`value` | **string**| Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. | [optional] | ||
`sortBy` | **string**| Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. | [optional] | ||
`sortOrder` | **string**| Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. | [optional] | ||
`currentPage` | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] | ||
`pageSize` | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Return type | ||
|
||
[**\ApiVideo\Client\Model\ListTagsResponse**](../Model/ListTagsResponse.md) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# # ListTagsResponse | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**data** | [**\ApiVideo\Client\Model\ListTagsResponseData[]**](ListTagsResponseData.md) | | [optional] | ||
**pagination** | [**\ApiVideo\Client\Model\Pagination**](Pagination.md) | | [optional] | ||
|
||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# # ListTagsResponseData | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**value** | **string** | Returns the value of a video tag used in your project. | [optional] | ||
**videoCount** | **int** | Returns the number of times a video tag is used. | [optional] | ||
|
||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?php declare(strict_types = 1); | ||
/** | ||
* api.video PHP API client | ||
* api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. | ||
* | ||
* The version of the OpenAPI document: 1 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated. | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
namespace ApiVideo\Client\Api; | ||
|
||
use ApiVideo\Client\BaseClient; | ||
use ApiVideo\Client\ModelPreprocessor; | ||
use Exception; | ||
use Http\Message\MultipartStream\MultipartStreamBuilder; | ||
use Psr\Http\Client\ClientExceptionInterface; | ||
use ApiVideo\Client\Request; | ||
use ApiVideo\Client\ObjectSerializer; | ||
use ApiVideo\Client\VideoUploader; | ||
use ApiVideo\Client\ProgressiveUploadSession; | ||
|
||
/** | ||
* @category Class | ||
* @package ApiVideo\Client | ||
*/ | ||
class TagsApi implements ApiInterface | ||
{ | ||
/** | ||
* @var BaseClient | ||
*/ | ||
private $client; | ||
|
||
/** | ||
* @param BaseClient $client | ||
*/ | ||
public function __construct(BaseClient $client) | ||
{ | ||
$this->client = $client; | ||
} | ||
|
||
/** | ||
* List all video tags | ||
* | ||
* @param array $queryParams | ||
* | ||
* @throws \ApiVideo\Client\ApiException on non-2xx response | ||
* @throws \InvalidArgumentException | ||
* @return \ApiVideo\Client\Model\ListTagsResponse|\ApiVideo\Client\Model\TooManyRequests | ||
*/ | ||
public function list(array $queryParams = []): \ApiVideo\Client\Model\ListTagsResponse | ||
{ | ||
$request = $this->buildListRequest($queryParams); | ||
|
||
$model = new \ApiVideo\Client\Model\ListTagsResponse($this->client->request($request)); | ||
|
||
return $model; | ||
} | ||
|
||
/** | ||
* Create request for operation 'list' | ||
* | ||
* @param array $queryParams | ||
* | ||
* @throws \InvalidArgumentException | ||
* @return Request | ||
*/ | ||
private function buildListRequest(array $queryParams = []): Request | ||
{ | ||
// unbox the parameters from the associative array | ||
$value = array_key_exists('value', $queryParams) ? $queryParams['value'] : null; | ||
$sortBy = array_key_exists('sortBy', $queryParams) ? $queryParams['sortBy'] : null; | ||
$sortOrder = array_key_exists('sortOrder', $queryParams) ? $queryParams['sortOrder'] : null; | ||
$currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; | ||
$pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; | ||
|
||
|
||
$resourcePath = '/tags'; | ||
$formParams = []; | ||
$queryParams = []; | ||
$headers = []; | ||
$httpBody = ''; | ||
$multipart = false; | ||
|
||
// value query params | ||
if ($value !== null) { | ||
$queryParams['value'] = $value; | ||
} | ||
|
||
// sortBy query params | ||
if ($sortBy !== null) { | ||
$queryParams['sortBy'] = $sortBy; | ||
} | ||
|
||
// sortOrder query params | ||
if ($sortOrder !== null) { | ||
$queryParams['sortOrder'] = $sortOrder; | ||
} | ||
|
||
// currentPage query params | ||
if ($currentPage !== null) { | ||
$queryParams['currentPage'] = $currentPage; | ||
} | ||
|
||
// pageSize query params | ||
if ($pageSize !== null) { | ||
$queryParams['pageSize'] = $pageSize; | ||
} | ||
|
||
|
||
|
||
|
||
$query = \http_build_query($queryParams); | ||
|
||
return new Request( | ||
'GET', | ||
$resourcePath . ($query ? "?{$query}" : ''), | ||
$headers, | ||
$httpBody | ||
); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.