Skip to content

Commit

Permalink
Release of version 1.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrant committed Aug 29, 2018
1 parent 23ba9c3 commit 2dace32
Show file tree
Hide file tree
Showing 9 changed files with 1,147 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
*ItemApi* | [**currentItemPostStructure**](docs/Api/ItemApi.md#currentitempoststructure) | **POST** /items/current/structure | Post a current playing item, keep structure
*ItemApi* | [**currentItemPostTiming**](docs/Api/ItemApi.md#currentitemposttiming) | **POST** /items/current/timing | Post a current playing item
*ItemApi* | [**deleteItemById**](docs/Api/ItemApi.md#deleteitembyid) | **DELETE** /items/{id} | Delete item by ID.
*ItemApi* | [**getCurrentItem**](docs/Api/ItemApi.md#getcurrentitem) | **GET** /items/current | Get current Item
*ItemApi* | [**getItemById**](docs/Api/ItemApi.md#getitembyid) | **GET** /items/{id} | Get extended item details by ID.
*ItemApi* | [**listItems**](docs/Api/ItemApi.md#listitems) | **GET** /items | Get a list of all the items currently in your station.
*ItemApi* | [**playlistPostStructure**](docs/Api/ItemApi.md#playlistpoststructure) | **POST** /items/playlist/structure | Post a playlist, keep current structure
Expand Down
57 changes: 55 additions & 2 deletions docs/Api/ItemApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Method | HTTP request | Description
[**currentItemPostStructure**](ItemApi.md#currentItemPostStructure) | **POST** /items/current/structure | Post a current playing item, keep structure
[**currentItemPostTiming**](ItemApi.md#currentItemPostTiming) | **POST** /items/current/timing | Post a current playing item
[**deleteItemById**](ItemApi.md#deleteItemById) | **DELETE** /items/{id} | Delete item by ID.
[**getCurrentItem**](ItemApi.md#getCurrentItem) | **GET** /items/current | Get current Item
[**getItemById**](ItemApi.md#getItemById) | **GET** /items/{id} | Get extended item details by ID.
[**listItems**](ItemApi.md#listItems) | **GET** /items | Get a list of all the items currently in your station.
[**playlistPostStructure**](ItemApi.md#playlistPostStructure) | **POST** /items/playlist/structure | Post a playlist, keep current structure
Expand Down Expand Up @@ -215,6 +216,56 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getCurrentItem**
> \RadioManager\Model\ItemResult getCurrentItem($lastplayed)
Get current Item

Get current Item

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

// Configure API key authorization: API Key
RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');

$api_instance = new RadioManager\Api\ItemApi();
$lastplayed = true; // bool | Show last played item if there is no current item*(Optional)*

try {
$result = $api_instance->getCurrentItem($lastplayed);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->getCurrentItem: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**lastplayed** | **bool**| Show last played item if there is no current item*(Optional)* | [optional]

### Return type

[**\RadioManager\Model\ItemResult**](../Model/ItemResult.md)

### Authorization

[API Key](../../README.md#API Key)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getItemById**
> \RadioManager\Model\ItemResult getItemById($id, $_external_station_id)
Expand Down Expand Up @@ -268,7 +319,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **listItems**
> \RadioManager\Model\ItemResults listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id)
> \RadioManager\Model\ItemResults listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id)
Get a list of all the items currently in your station.

Expand Down Expand Up @@ -296,6 +347,7 @@ $program_draft_id = 789; // int | Search on Program Draft ID *(Optional)*
$user_draft_id = 789; // int | Search on User Draft ID *(Optional)*
$station_draft_id = 789; // int | Search on Station Draft ID *(Optional)*
$program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)`
$external_id = "external_id_example"; // string | Search on External ID *(Optional)*
$start_min = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Minimum start date *(Optional)*
$start_max = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Maximum start date *(Optional)*
$duration_min = 56; // int | Minimum duration (seconds) *(Optional)*
Expand All @@ -307,7 +359,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering
$_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)*

try {
$result = $api_instance->listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id);
$result = $api_instance->listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->listItems: ', $e->getMessage(), PHP_EOL;
Expand All @@ -330,6 +382,7 @@ Name | Type | Description | Notes
**user_draft_id** | **int**| Search on User Draft ID *(Optional)* | [optional]
**station_draft_id** | **int**| Search on Station Draft ID *(Optional)* | [optional]
**program_id** | **int**| Search on Program ID *(Optional)* &#x60;(Relation)&#x60; | [optional]
**external_id** | **string**| Search on External ID *(Optional)* | [optional]
**start_min** | **\DateTime**| Minimum start date *(Optional)* | [optional]
**start_max** | **\DateTime**| Maximum start date *(Optional)* | [optional]
**duration_min** | **int**| Minimum duration (seconds) *(Optional)* | [optional]
Expand Down
13 changes: 13 additions & 0 deletions docs/Model/BroadcastRelationsGenre.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# BroadcastRelationsGenre

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**href** | **string** | | [optional]
**model** | **string** | | [optional]
**operation** | **string** | | [optional]
**params** | [**\RadioManager\Model\BlockRelationsBroadcastParams**](BlockRelationsBroadcastParams.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/Model/StationResultStationStartDays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# StationResultStationStartDays

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**monday** | **string** | | [optional]
**tuesday** | **string** | | [optional]
**wednesday** | **string** | | [optional]
**thursday** | **string** | | [optional]
**friday** | **string** | | [optional]
**saturday** | **string** | | [optional]
**sunday** | **string** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


103 changes: 100 additions & 3 deletions lib/Api/ItemApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,97 @@ public function deleteItemByIdWithHttpInfo($id)
}
}

/**
* Operation getCurrentItem
*
* Get current Item
*
* @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional)
* @throws \RadioManager\ApiException on non-2xx response
* @return \RadioManager\Model\ItemResult
*/
public function getCurrentItem($lastplayed = null)
{
list($response) = $this->getCurrentItemWithHttpInfo($lastplayed);
return $response;
}

/**
* Operation getCurrentItemWithHttpInfo
*
* Get current Item
*
* @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional)
* @throws \RadioManager\ApiException on non-2xx response
* @return array of \RadioManager\Model\ItemResult, HTTP status code, HTTP response headers (array of strings)
*/
public function getCurrentItemWithHttpInfo($lastplayed = null)
{
// parse inputs
$resourcePath = "/items/current";
$httpBody = '';
$queryParams = [];
$headerParams = [];
$formParams = [];
$_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

// query params
if ($lastplayed !== null) {
$queryParams['lastplayed'] = $this->apiClient->getSerializer()->toQueryValue($lastplayed);
}

// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
if (strlen($apiKey) !== 0) {
$headerParams['api-key'] = $apiKey;
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'GET',
$queryParams,
$httpBody,
$headerParams,
'\RadioManager\Model\ItemResult',
'/items/current'
);

return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ItemResult', $httpHeader), $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ItemResult', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 202:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 403:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 404:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}

throw $e;
}
}

/**
* Operation getItemById
*
Expand Down Expand Up @@ -583,6 +674,7 @@ public function getItemByIdWithHttpInfo($id, $_external_station_id = null)
* @param int $user_draft_id Search on User Draft ID *(Optional)* (optional)
* @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional)
* @param int $program_id Search on Program ID *(Optional)* &#x60;(Relation)&#x60; (optional)
* @param string $external_id Search on External ID *(Optional)* (optional)
* @param \DateTime $start_min Minimum start date *(Optional)* (optional)
* @param \DateTime $start_max Maximum start date *(Optional)* (optional)
* @param int $duration_min Minimum duration (seconds) *(Optional)* (optional)
Expand All @@ -595,9 +687,9 @@ public function getItemByIdWithHttpInfo($id, $_external_station_id = null)
* @throws \RadioManager\ApiException on non-2xx response
* @return \RadioManager\Model\ItemResults
*/
public function listItems($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null)
public function listItems($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null)
{
list($response) = $this->listItemsWithHttpInfo($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id);
list($response) = $this->listItemsWithHttpInfo($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id);
return $response;
}

Expand All @@ -617,6 +709,7 @@ public function listItems($page = null, $block_id = null, $broadcast_id = null,
* @param int $user_draft_id Search on User Draft ID *(Optional)* (optional)
* @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional)
* @param int $program_id Search on Program ID *(Optional)* &#x60;(Relation)&#x60; (optional)
* @param string $external_id Search on External ID *(Optional)* (optional)
* @param \DateTime $start_min Minimum start date *(Optional)* (optional)
* @param \DateTime $start_max Maximum start date *(Optional)* (optional)
* @param int $duration_min Minimum duration (seconds) *(Optional)* (optional)
Expand All @@ -629,7 +722,7 @@ public function listItems($page = null, $block_id = null, $broadcast_id = null,
* @throws \RadioManager\ApiException on non-2xx response
* @return array of \RadioManager\Model\ItemResults, HTTP status code, HTTP response headers (array of strings)
*/
public function listItemsWithHttpInfo($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null)
public function listItemsWithHttpInfo($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null)
{
if (!is_null($page) && ($page < 1)) {
throw new \InvalidArgumentException('invalid value for "$page" when calling ItemApi.listItems, must be bigger than or equal to 1.');
Expand Down Expand Up @@ -699,6 +792,10 @@ public function listItemsWithHttpInfo($page = null, $block_id = null, $broadcast
$queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id);
}
// query params
if ($external_id !== null) {
$queryParams['external_id'] = $this->apiClient->getSerializer()->toQueryValue($external_id);
}
// query params
if ($start_min !== null) {
$queryParams['start-min'] = $this->apiClient->getSerializer()->toQueryValue($start_min);
}
Expand Down
Loading

0 comments on commit 2dace32

Please sign in to comment.