From 7826720dec92bfbafdc87e2dfe648ae10a9cfd6f Mon Sep 17 00:00:00 2001 From: Justin Sanford Date: Fri, 21 Feb 2025 12:17:14 -0800 Subject: [PATCH] 4.0.0 (#96) - add support for `static-renditions` APIs - add `passthrough` to each `static_rendition` object - add support for additional standard dimensions in Mux Data - allow updating `video_quality` on live streams - [breaking] It is very unlikely that you were using the `AssetStaticRenditionsFiles` type directly, but just in case this has been replaced with `StaticRendition` for the object, and `CreateStaticRenditionRequest` for the request with the new `static-renditions` APIs - [breaking] Deprecate `mp4_support` and associated APIs. [Utilize the new Static Rendition APIs instead.](https://www.mux.com/docs/changelog/static-renditions-api-for-creating-mp4-and-m4a-renditions-now-available) - [breaking] Remove Spaces APIs and routes --- .openapi-generator/FILES | 40 +- MuxPhp/Api/AssetsApi.php | 536 +++++++++ MuxPhp/Api/LiveStreamsApi.php | 517 ++++++++ MuxPhp/Configuration.php | 4 +- MuxPhp/Models/Asset.php | 2 + MuxPhp/Models/AssetStaticRenditions.php | 8 +- MuxPhp/Models/CreateAssetRequest.php | 52 +- .../Models/CreateStaticRenditionRequest.php | 493 ++++++++ .../Models/CreateStaticRenditionResponse.php | 407 +++++++ MuxPhp/Models/InputSettings.php | 2 +- MuxPhp/Models/StaticRendition.php | 1055 +++++++++++++++++ .../UpdateLiveStreamNewAssetSettings.php | 88 +- ...ewAssetSettingsStaticRenditionsRequest.php | 407 +++++++ MuxPhp/Models/VideoView.php | 679 ++++++++++- README.md | 34 +- composer.json | 2 +- docs/Api/AssetsApi.md | 141 ++- docs/Api/LiveStreamsApi.md | 137 +++ docs/Api/SpacesApi.md | 604 ---------- docs/Model/AssetStaticRenditions.md | 4 +- docs/Model/AssetStaticRenditionsFiles.md | 14 - docs/Model/Broadcast.md | 15 - docs/Model/BroadcastLayout.md | 8 - docs/Model/CreateAssetRequest.md | 3 +- docs/Model/CreateBroadcastRequest.md | 13 - docs/Model/CreateSpaceRequest.md | 11 - ...nse.md => CreateStaticRenditionRequest.md} | 5 +- ...on.md => CreateStaticRenditionResponse.md} | 3 +- docs/Model/InputSettings.md | 2 +- docs/Model/ListSpacesResponse.md | 9 - docs/Model/Space.md | 15 - docs/Model/SpaceResponse.md | 9 - docs/Model/SpaceStatus.md | 8 - docs/Model/SpaceType.md | 8 - docs/Model/StartSpaceBroadcastResponse.md | 9 - docs/Model/StaticRendition.md | 20 + docs/Model/StopSpaceBroadcastResponse.md | 9 - .../Model/UpdateLiveStreamNewAssetSettings.md | 3 +- ...ewAssetSettingsStaticRenditionsRequest.md} | 3 +- docs/Model/VideoView.md | 16 + gen/generator-config.json | 2 +- 41 files changed, 4568 insertions(+), 829 deletions(-) create mode 100644 MuxPhp/Models/CreateStaticRenditionRequest.php create mode 100644 MuxPhp/Models/CreateStaticRenditionResponse.php create mode 100644 MuxPhp/Models/StaticRendition.php create mode 100644 MuxPhp/Models/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.php delete mode 100644 docs/Api/SpacesApi.md delete mode 100644 docs/Model/AssetStaticRenditionsFiles.md delete mode 100644 docs/Model/Broadcast.md delete mode 100644 docs/Model/BroadcastLayout.md delete mode 100644 docs/Model/CreateBroadcastRequest.md delete mode 100644 docs/Model/CreateSpaceRequest.md rename docs/Model/{BroadcastResponse.md => CreateStaticRenditionRequest.md} (54%) rename docs/Model/{BroadcastResolution.md => CreateStaticRenditionResponse.md} (67%) delete mode 100644 docs/Model/ListSpacesResponse.md delete mode 100644 docs/Model/Space.md delete mode 100644 docs/Model/SpaceResponse.md delete mode 100644 docs/Model/SpaceStatus.md delete mode 100644 docs/Model/SpaceType.md delete mode 100644 docs/Model/StartSpaceBroadcastResponse.md create mode 100644 docs/Model/StaticRendition.md delete mode 100644 docs/Model/StopSpaceBroadcastResponse.md rename docs/Model/{BroadcastStatus.md => UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md} (56%) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 24ab2a5..7c39b86 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -16,7 +16,6 @@ MuxPhp/Api/PlaybackIDApi.php MuxPhp/Api/PlaybackRestrictionsApi.php MuxPhp/Api/RealTimeApi.php MuxPhp/Api/SigningKeysApi.php -MuxPhp/Api/SpacesApi.php MuxPhp/Api/TranscriptionVocabulariesApi.php MuxPhp/Api/URLSigningKeysApi.php MuxPhp/Api/VideoViewsApi.php @@ -33,21 +32,15 @@ MuxPhp/Models/AssetNonStandardInputReasons.php MuxPhp/Models/AssetRecordingTimes.php MuxPhp/Models/AssetResponse.php MuxPhp/Models/AssetStaticRenditions.php -MuxPhp/Models/AssetStaticRenditionsFiles.php MuxPhp/Models/BreakdownValue.php -MuxPhp/Models/Broadcast.php -MuxPhp/Models/BroadcastLayout.php -MuxPhp/Models/BroadcastResolution.php -MuxPhp/Models/BroadcastResponse.php -MuxPhp/Models/BroadcastStatus.php MuxPhp/Models/CreateAssetRequest.php -MuxPhp/Models/CreateBroadcastRequest.php MuxPhp/Models/CreateLiveStreamRequest.php MuxPhp/Models/CreatePlaybackIDRequest.php MuxPhp/Models/CreatePlaybackIDResponse.php MuxPhp/Models/CreatePlaybackRestrictionRequest.php MuxPhp/Models/CreateSimulcastTargetRequest.php -MuxPhp/Models/CreateSpaceRequest.php +MuxPhp/Models/CreateStaticRenditionRequest.php +MuxPhp/Models/CreateStaticRenditionResponse.php MuxPhp/Models/CreateTrackRequest.php MuxPhp/Models/CreateTrackResponse.php MuxPhp/Models/CreateTranscriptionVocabularyRequest.php @@ -119,7 +112,6 @@ MuxPhp/Models/ListRealTimeDimensionsResponse.php MuxPhp/Models/ListRealTimeMetricsResponse.php MuxPhp/Models/ListRelatedIncidentsResponse.php MuxPhp/Models/ListSigningKeysResponse.php -MuxPhp/Models/ListSpacesResponse.php MuxPhp/Models/ListTranscriptionVocabulariesResponse.php MuxPhp/Models/ListUploadsResponse.php MuxPhp/Models/ListVideoViewExportsResponse.php @@ -159,12 +151,7 @@ MuxPhp/Models/SigningKey.php MuxPhp/Models/SigningKeyResponse.php MuxPhp/Models/SimulcastTarget.php MuxPhp/Models/SimulcastTargetResponse.php -MuxPhp/Models/Space.php -MuxPhp/Models/SpaceResponse.php -MuxPhp/Models/SpaceStatus.php -MuxPhp/Models/SpaceType.php -MuxPhp/Models/StartSpaceBroadcastResponse.php -MuxPhp/Models/StopSpaceBroadcastResponse.php +MuxPhp/Models/StaticRendition.php MuxPhp/Models/Track.php MuxPhp/Models/TranscriptionVocabulary.php MuxPhp/Models/TranscriptionVocabularyResponse.php @@ -174,6 +161,7 @@ MuxPhp/Models/UpdateAssetRequest.php MuxPhp/Models/UpdateLiveStreamEmbeddedSubtitlesRequest.php MuxPhp/Models/UpdateLiveStreamGeneratedSubtitlesRequest.php MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php +MuxPhp/Models/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.php MuxPhp/Models/UpdateLiveStreamRequest.php MuxPhp/Models/UpdateReferrerDomainRestrictionRequest.php MuxPhp/Models/UpdateTranscriptionVocabularyRequest.php @@ -208,7 +196,6 @@ docs/Api/PlaybackIDApi.md docs/Api/PlaybackRestrictionsApi.md docs/Api/RealTimeApi.md docs/Api/SigningKeysApi.md -docs/Api/SpacesApi.md docs/Api/TranscriptionVocabulariesApi.md docs/Api/URLSigningKeysApi.md docs/Api/VideoViewsApi.md @@ -222,21 +209,15 @@ docs/Model/AssetNonStandardInputReasons.md docs/Model/AssetRecordingTimes.md docs/Model/AssetResponse.md docs/Model/AssetStaticRenditions.md -docs/Model/AssetStaticRenditionsFiles.md docs/Model/BreakdownValue.md -docs/Model/Broadcast.md -docs/Model/BroadcastLayout.md -docs/Model/BroadcastResolution.md -docs/Model/BroadcastResponse.md -docs/Model/BroadcastStatus.md docs/Model/CreateAssetRequest.md -docs/Model/CreateBroadcastRequest.md docs/Model/CreateLiveStreamRequest.md docs/Model/CreatePlaybackIDRequest.md docs/Model/CreatePlaybackIDResponse.md docs/Model/CreatePlaybackRestrictionRequest.md docs/Model/CreateSimulcastTargetRequest.md -docs/Model/CreateSpaceRequest.md +docs/Model/CreateStaticRenditionRequest.md +docs/Model/CreateStaticRenditionResponse.md docs/Model/CreateTrackRequest.md docs/Model/CreateTrackResponse.md docs/Model/CreateTranscriptionVocabularyRequest.md @@ -308,7 +289,6 @@ docs/Model/ListRealTimeDimensionsResponse.md docs/Model/ListRealTimeMetricsResponse.md docs/Model/ListRelatedIncidentsResponse.md docs/Model/ListSigningKeysResponse.md -docs/Model/ListSpacesResponse.md docs/Model/ListTranscriptionVocabulariesResponse.md docs/Model/ListUploadsResponse.md docs/Model/ListVideoViewExportsResponse.md @@ -347,12 +327,7 @@ docs/Model/SigningKey.md docs/Model/SigningKeyResponse.md docs/Model/SimulcastTarget.md docs/Model/SimulcastTargetResponse.md -docs/Model/Space.md -docs/Model/SpaceResponse.md -docs/Model/SpaceStatus.md -docs/Model/SpaceType.md -docs/Model/StartSpaceBroadcastResponse.md -docs/Model/StopSpaceBroadcastResponse.md +docs/Model/StaticRendition.md docs/Model/Track.md docs/Model/TranscriptionVocabulary.md docs/Model/TranscriptionVocabularyResponse.md @@ -362,6 +337,7 @@ docs/Model/UpdateAssetRequest.md docs/Model/UpdateLiveStreamEmbeddedSubtitlesRequest.md docs/Model/UpdateLiveStreamGeneratedSubtitlesRequest.md docs/Model/UpdateLiveStreamNewAssetSettings.md +docs/Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md docs/Model/UpdateLiveStreamRequest.md docs/Model/UpdateReferrerDomainRestrictionRequest.md docs/Model/UpdateTranscriptionVocabularyRequest.md diff --git a/MuxPhp/Api/AssetsApi.php b/MuxPhp/Api/AssetsApi.php index 88f14e2..e0133dc 100644 --- a/MuxPhp/Api/AssetsApi.php +++ b/MuxPhp/Api/AssetsApi.php @@ -678,6 +678,297 @@ public function createAssetPlaybackIdRequest($asset_id, $create_playback_id_requ ); } + /** + * Operation createAssetStaticRendition + * + * Create a static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param \MuxPhp\Models\CreateStaticRenditionRequest $create_static_rendition_request create_static_rendition_request (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \MuxPhp\Models\CreateStaticRenditionResponse + */ + public function createAssetStaticRendition($asset_id, $create_static_rendition_request) + { + list($response) = $this->createAssetStaticRenditionWithHttpInfo($asset_id, $create_static_rendition_request); + return $response; + } + + /** + * Operation createAssetStaticRenditionWithHttpInfo + * + * Create a static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param \MuxPhp\Models\CreateStaticRenditionRequest $create_static_rendition_request (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \MuxPhp\Models\CreateStaticRenditionResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createAssetStaticRenditionWithHttpInfo($asset_id, $create_static_rendition_request) + { + $request = $this->createAssetStaticRenditionRequest($asset_id, $create_static_rendition_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\MuxPhp\Models\CreateStaticRenditionResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\MuxPhp\Models\CreateStaticRenditionResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\MuxPhp\Models\CreateStaticRenditionResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\MuxPhp\Models\CreateStaticRenditionResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAssetStaticRenditionAsync + * + * Create a static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param \MuxPhp\Models\CreateStaticRenditionRequest $create_static_rendition_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAssetStaticRenditionAsync($asset_id, $create_static_rendition_request) + { + return $this->createAssetStaticRenditionAsyncWithHttpInfo($asset_id, $create_static_rendition_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAssetStaticRenditionAsyncWithHttpInfo + * + * Create a static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param \MuxPhp\Models\CreateStaticRenditionRequest $create_static_rendition_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAssetStaticRenditionAsyncWithHttpInfo($asset_id, $create_static_rendition_request) + { + $returnType = '\MuxPhp\Models\CreateStaticRenditionResponse'; + $request = $this->createAssetStaticRenditionRequest($asset_id, $create_static_rendition_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAssetStaticRendition' + * + * @param string $asset_id The asset ID. (required) + * @param \MuxPhp\Models\CreateStaticRenditionRequest $create_static_rendition_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAssetStaticRenditionRequest($asset_id, $create_static_rendition_request) + { + // verify the required parameter 'asset_id' is set + if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $asset_id when calling createAssetStaticRendition' + ); + } + // verify the required parameter 'create_static_rendition_request' is set + if ($create_static_rendition_request === null || (is_array($create_static_rendition_request) && count($create_static_rendition_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_static_rendition_request when calling createAssetStaticRendition' + ); + } + + $resourcePath = '/video/v1/assets/{ASSET_ID}/static-renditions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($asset_id !== null) { + $resourcePath = str_replace( + '{' . 'ASSET_ID' . '}', + ObjectSerializer::toPathValue($asset_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($create_static_rendition_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_static_rendition_request)); + } else { + $httpBody = $create_static_rendition_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation createAssetTrack * @@ -1440,6 +1731,251 @@ public function deleteAssetPlaybackIdRequest($asset_id, $playback_id) ); } + /** + * Operation deleteAssetStaticRendition + * + * Delete a single static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param string $static_rendition_id The static rendition ID. (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteAssetStaticRendition($asset_id, $static_rendition_id) + { + $this->deleteAssetStaticRenditionWithHttpInfo($asset_id, $static_rendition_id); + } + + /** + * Operation deleteAssetStaticRenditionWithHttpInfo + * + * Delete a single static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param string $static_rendition_id The static rendition ID. (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAssetStaticRenditionWithHttpInfo($asset_id, $static_rendition_id) + { + $request = $this->deleteAssetStaticRenditionRequest($asset_id, $static_rendition_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAssetStaticRenditionAsync + * + * Delete a single static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param string $static_rendition_id The static rendition ID. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAssetStaticRenditionAsync($asset_id, $static_rendition_id) + { + return $this->deleteAssetStaticRenditionAsyncWithHttpInfo($asset_id, $static_rendition_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAssetStaticRenditionAsyncWithHttpInfo + * + * Delete a single static rendition for an asset + * + * @param string $asset_id The asset ID. (required) + * @param string $static_rendition_id The static rendition ID. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAssetStaticRenditionAsyncWithHttpInfo($asset_id, $static_rendition_id) + { + $returnType = ''; + $request = $this->deleteAssetStaticRenditionRequest($asset_id, $static_rendition_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAssetStaticRendition' + * + * @param string $asset_id The asset ID. (required) + * @param string $static_rendition_id The static rendition ID. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAssetStaticRenditionRequest($asset_id, $static_rendition_id) + { + // verify the required parameter 'asset_id' is set + if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $asset_id when calling deleteAssetStaticRendition' + ); + } + // verify the required parameter 'static_rendition_id' is set + if ($static_rendition_id === null || (is_array($static_rendition_id) && count($static_rendition_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $static_rendition_id when calling deleteAssetStaticRendition' + ); + } + + $resourcePath = '/video/v1/assets/{ASSET_ID}/static-renditions/{STATIC_RENDITION_ID}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($asset_id !== null) { + $resourcePath = str_replace( + '{' . 'ASSET_ID' . '}', + ObjectSerializer::toPathValue($asset_id), + $resourcePath + ); + } + // path params + if ($static_rendition_id !== null) { + $resourcePath = str_replace( + '{' . 'STATIC_RENDITION_ID' . '}', + ObjectSerializer::toPathValue($static_rendition_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteAssetTrack * diff --git a/MuxPhp/Api/LiveStreamsApi.php b/MuxPhp/Api/LiveStreamsApi.php index ad44547..babbcab 100644 --- a/MuxPhp/Api/LiveStreamsApi.php +++ b/MuxPhp/Api/LiveStreamsApi.php @@ -1121,6 +1121,232 @@ public function deleteLiveStreamRequest($live_stream_id) + // path params + if ($live_stream_id !== null) { + $resourcePath = str_replace( + '{' . 'LIVE_STREAM_ID' . '}', + ObjectSerializer::toPathValue($live_stream_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLiveStreamNewAssetSettingsStaticRenditions + * + * Delete a live stream's static renditions setting for new assets + * + * @param string $live_stream_id The live stream ID (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteLiveStreamNewAssetSettingsStaticRenditions($live_stream_id) + { + $this->deleteLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo($live_stream_id); + } + + /** + * Operation deleteLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo + * + * Delete a live stream's static renditions setting for new assets + * + * @param string $live_stream_id The live stream ID (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo($live_stream_id) + { + $request = $this->deleteLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteLiveStreamNewAssetSettingsStaticRenditionsAsync + * + * Delete a live stream's static renditions setting for new assets + * + * @param string $live_stream_id The live stream ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteLiveStreamNewAssetSettingsStaticRenditionsAsync($live_stream_id) + { + return $this->deleteLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo($live_stream_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo + * + * Delete a live stream's static renditions setting for new assets + * + * @param string $live_stream_id The live stream ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo($live_stream_id) + { + $returnType = ''; + $request = $this->deleteLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLiveStreamNewAssetSettingsStaticRenditions' + * + * @param string $live_stream_id The live stream ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id) + { + // verify the required parameter 'live_stream_id' is set + if ($live_stream_id === null || (is_array($live_stream_id) && count($live_stream_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $live_stream_id when calling deleteLiveStreamNewAssetSettingsStaticRenditions' + ); + } + + $resourcePath = '/video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params if ($live_stream_id !== null) { $resourcePath = str_replace( @@ -4833,6 +5059,297 @@ public function updateLiveStreamGeneratedSubtitlesRequest($live_stream_id, $upda ); } + /** + * Operation updateLiveStreamNewAssetSettingsStaticRenditions + * + * Update live stream static renditions for new assets + * + * @param string $live_stream_id The live stream ID (required) + * @param \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest $update_live_stream_new_asset_settings_static_renditions_request update_live_stream_new_asset_settings_static_renditions_request (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \MuxPhp\Models\LiveStreamResponse + */ + public function updateLiveStreamNewAssetSettingsStaticRenditions($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + { + list($response) = $this->updateLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request); + return $response; + } + + /** + * Operation updateLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo + * + * Update live stream static renditions for new assets + * + * @param string $live_stream_id The live stream ID (required) + * @param \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest $update_live_stream_new_asset_settings_static_renditions_request (required) + * + * @throws \MuxPhp\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \MuxPhp\Models\LiveStreamResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLiveStreamNewAssetSettingsStaticRenditionsWithHttpInfo($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + { + $request = $this->updateLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\MuxPhp\Models\LiveStreamResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\MuxPhp\Models\LiveStreamResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\MuxPhp\Models\LiveStreamResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\MuxPhp\Models\LiveStreamResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLiveStreamNewAssetSettingsStaticRenditionsAsync + * + * Update live stream static renditions for new assets + * + * @param string $live_stream_id The live stream ID (required) + * @param \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest $update_live_stream_new_asset_settings_static_renditions_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLiveStreamNewAssetSettingsStaticRenditionsAsync($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + { + return $this->updateLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo + * + * Update live stream static renditions for new assets + * + * @param string $live_stream_id The live stream ID (required) + * @param \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest $update_live_stream_new_asset_settings_static_renditions_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLiveStreamNewAssetSettingsStaticRenditionsAsyncWithHttpInfo($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + { + $returnType = '\MuxPhp\Models\LiveStreamResponse'; + $request = $this->updateLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLiveStreamNewAssetSettingsStaticRenditions' + * + * @param string $live_stream_id The live stream ID (required) + * @param \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest $update_live_stream_new_asset_settings_static_renditions_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLiveStreamNewAssetSettingsStaticRenditionsRequest($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request) + { + // verify the required parameter 'live_stream_id' is set + if ($live_stream_id === null || (is_array($live_stream_id) && count($live_stream_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $live_stream_id when calling updateLiveStreamNewAssetSettingsStaticRenditions' + ); + } + // verify the required parameter 'update_live_stream_new_asset_settings_static_renditions_request' is set + if ($update_live_stream_new_asset_settings_static_renditions_request === null || (is_array($update_live_stream_new_asset_settings_static_renditions_request) && count($update_live_stream_new_asset_settings_static_renditions_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_live_stream_new_asset_settings_static_renditions_request when calling updateLiveStreamNewAssetSettingsStaticRenditions' + ); + } + + $resourcePath = '/video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($live_stream_id !== null) { + $resourcePath = str_replace( + '{' . 'LIVE_STREAM_ID' . '}', + ObjectSerializer::toPathValue($live_stream_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_live_stream_new_asset_settings_static_renditions_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_live_stream_new_asset_settings_static_renditions_request)); + } else { + $httpBody = $update_live_stream_new_asset_settings_static_renditions_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/MuxPhp/Configuration.php b/MuxPhp/Configuration.php index e0fb16e..746c322 100644 --- a/MuxPhp/Configuration.php +++ b/MuxPhp/Configuration.php @@ -91,7 +91,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Mux PHP | 3.21.0'; + protected $userAgent = 'Mux PHP | 4.0.0'; /** * Debug switch (default set to false) @@ -400,7 +400,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: v1' . PHP_EOL; - $report .= ' SDK Package Version: 3.21.0' . PHP_EOL; + $report .= ' SDK Package Version: 4.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/MuxPhp/Models/Asset.php b/MuxPhp/Models/Asset.php index 18e2ba7..89f59fa 100644 --- a/MuxPhp/Models/Asset.php +++ b/MuxPhp/Models/Asset.php @@ -1418,6 +1418,7 @@ public function setMasterAccess($master_access) * Gets mp4_support * * @return string|null + * @deprecated */ public function getMp4Support() { @@ -1430,6 +1431,7 @@ public function getMp4Support() * @param string|null $mp4_support mp4_support * * @return self + * @deprecated */ public function setMp4Support($mp4_support) { diff --git a/MuxPhp/Models/AssetStaticRenditions.php b/MuxPhp/Models/AssetStaticRenditions.php index 5cedb10..ef03ca3 100644 --- a/MuxPhp/Models/AssetStaticRenditions.php +++ b/MuxPhp/Models/AssetStaticRenditions.php @@ -62,7 +62,7 @@ class AssetStaticRenditions implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'status' => 'string', - 'files' => '\MuxPhp\Models\AssetStaticRenditionsFiles[]' + 'files' => '\MuxPhp\Models\StaticRendition[]' ]; /** @@ -334,7 +334,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Indicates the status of downloadable MP4 versions of this asset. + * @param string|null $status Indicates the status of downloadable MP4 versions of this asset. This field is only valid when `mp4_support` is enabled * * @return self */ @@ -363,7 +363,7 @@ public function setStatus($status) /** * Gets files * - * @return \MuxPhp\Models\AssetStaticRenditionsFiles[]|null + * @return \MuxPhp\Models\StaticRendition[]|null */ public function getFiles() { @@ -373,7 +373,7 @@ public function getFiles() /** * Sets files * - * @param \MuxPhp\Models\AssetStaticRenditionsFiles[]|null $files Array of file objects. + * @param \MuxPhp\Models\StaticRendition[]|null $files Array of file objects. * * @return self */ diff --git a/MuxPhp/Models/CreateAssetRequest.php b/MuxPhp/Models/CreateAssetRequest.php index 1b11d02..edc2fcf 100644 --- a/MuxPhp/Models/CreateAssetRequest.php +++ b/MuxPhp/Models/CreateAssetRequest.php @@ -71,7 +71,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'test' => 'bool', 'max_resolution_tier' => 'string', 'encoding_tier' => 'string', - 'video_quality' => 'string' + 'video_quality' => 'string', + 'static_renditions' => '\MuxPhp\Models\CreateStaticRenditionRequest[]' ]; /** @@ -93,7 +94,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'test' => 'boolean', 'max_resolution_tier' => null, 'encoding_tier' => null, - 'video_quality' => null + 'video_quality' => null, + 'static_renditions' => null ]; /** @@ -113,7 +115,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'test' => false, 'max_resolution_tier' => false, 'encoding_tier' => false, - 'video_quality' => false + 'video_quality' => false, + 'static_renditions' => false ]; /** @@ -203,7 +206,8 @@ public function isNullableSetToNull(string $property): bool 'test' => 'test', 'max_resolution_tier' => 'max_resolution_tier', 'encoding_tier' => 'encoding_tier', - 'video_quality' => 'video_quality' + 'video_quality' => 'video_quality', + 'static_renditions' => 'static_renditions' ]; /** @@ -223,7 +227,8 @@ public function isNullableSetToNull(string $property): bool 'test' => 'setTest', 'max_resolution_tier' => 'setMaxResolutionTier', 'encoding_tier' => 'setEncodingTier', - 'video_quality' => 'setVideoQuality' + 'video_quality' => 'setVideoQuality', + 'static_renditions' => 'setStaticRenditions' ]; /** @@ -243,7 +248,8 @@ public function isNullableSetToNull(string $property): bool 'test' => 'getTest', 'max_resolution_tier' => 'getMaxResolutionTier', 'encoding_tier' => 'getEncodingTier', - 'video_quality' => 'getVideoQuality' + 'video_quality' => 'getVideoQuality', + 'static_renditions' => 'getStaticRenditions' ]; /** @@ -405,6 +411,7 @@ public function __construct(array $data = null) $this->setIfExists('max_resolution_tier', $data ?? [], null); $this->setIfExists('encoding_tier', $data ?? [], null); $this->setIfExists('video_quality', $data ?? [], null); + $this->setIfExists('static_renditions', $data ?? [], null); } /** @@ -645,6 +652,7 @@ public function setPassthrough($passthrough) * Gets mp4_support * * @return string|null + * @deprecated */ public function getMp4Support() { @@ -654,9 +662,10 @@ public function getMp4Support() /** * Sets mp4_support * - * @param string|null $mp4_support Specify what level of support for mp4 playback. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. + * @param string|null $mp4_support Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions) for the updated API. Specify what level of support for mp4 playback. You may not enable both `mp4_support` and `static_renditions`. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. * * @return self + * @deprecated */ public function setMp4Support($mp4_support) { @@ -895,6 +904,35 @@ public function setVideoQuality($video_quality) return $this; } + + /** + * Gets static_renditions + * + * @return \MuxPhp\Models\CreateStaticRenditionRequest[]|null + */ + public function getStaticRenditions() + { + return $this->container['static_renditions']; + } + + /** + * Sets static_renditions + * + * @param \MuxPhp\Models\CreateStaticRenditionRequest[]|null $static_renditions An array of static renditions to create for this asset. You may not enable both `static_renditions` and `mp4_support (the latter being deprecated)` + * + * @return self + */ + public function setStaticRenditions($static_renditions) + { + + if (is_null($static_renditions)) { + throw new \InvalidArgumentException('non-nullable static_renditions cannot be null'); + } + + $this->container['static_renditions'] = $static_renditions; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/CreateStaticRenditionRequest.php b/MuxPhp/Models/CreateStaticRenditionRequest.php new file mode 100644 index 0000000..c0909fe --- /dev/null +++ b/MuxPhp/Models/CreateStaticRenditionRequest.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreateStaticRenditionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateStaticRenditionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'resolution' => 'string', + 'passthrough' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'resolution' => null, + 'passthrough' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'resolution' => false, + 'passthrough' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'resolution' => 'resolution', + 'passthrough' => 'passthrough' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'resolution' => 'setResolution', + 'passthrough' => 'setPassthrough' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'resolution' => 'getResolution', + 'passthrough' => 'getPassthrough' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESOLUTION_HIGHEST = 'highest'; + public const RESOLUTION_AUDIO_ONLY = 'audio-only'; + public const RESOLUTION__2160P = '2160p'; + public const RESOLUTION__1440P = '1440p'; + public const RESOLUTION__1080P = '1080p'; + public const RESOLUTION__720P = '720p'; + public const RESOLUTION__540P = '540p'; + public const RESOLUTION__480P = '480p'; + public const RESOLUTION__360P = '360p'; + public const RESOLUTION__270P = '270p'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResolutionAllowableValues() + { + return [ + self::RESOLUTION_HIGHEST, + self::RESOLUTION_AUDIO_ONLY, + self::RESOLUTION__2160P, + self::RESOLUTION__1440P, + self::RESOLUTION__1080P, + self::RESOLUTION__720P, + self::RESOLUTION__540P, + self::RESOLUTION__480P, + self::RESOLUTION__360P, + self::RESOLUTION__270P, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + // MUX: enum hack (self::) due to OAS emitting problems. + // please re-integrate with mainline when possible. + // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 + $this->setIfExists('resolution', $data ?? [], null); + $this->setIfExists('passthrough', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResolutionAllowableValues(); + if (!is_null($this->container['resolution']) && !in_array($this->container['resolution'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'resolution', must be one of '%s'", + $this->container['resolution'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets resolution + * + * @return string|null + */ + public function getResolution() + { + return $this->container['resolution']; + } + + /** + * Sets resolution + * + * @param string|null $resolution resolution + * + * @return self + */ + public function setResolution($resolution) + { + $allowedValues = $this->getResolutionAllowableValues(); + if (!is_null($resolution) && !in_array($resolution, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'resolution', must be one of '%s'", + $resolution, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($resolution)) { + throw new \InvalidArgumentException('non-nullable resolution cannot be null'); + } + + $this->container['resolution'] = $resolution; + + return $this; + } + + /** + * Gets passthrough + * + * @return string|null + */ + public function getPassthrough() + { + return $this->container['passthrough']; + } + + /** + * Sets passthrough + * + * @param string|null $passthrough Arbitrary user-supplied metadata set for the static rendition. Max 255 characters. + * + * @return self + */ + public function setPassthrough($passthrough) + { + + if (is_null($passthrough)) { + throw new \InvalidArgumentException('non-nullable passthrough cannot be null'); + } + + $this->container['passthrough'] = $passthrough; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/MuxPhp/Models/CreateStaticRenditionResponse.php b/MuxPhp/Models/CreateStaticRenditionResponse.php new file mode 100644 index 0000000..5c1ea38 --- /dev/null +++ b/MuxPhp/Models/CreateStaticRenditionResponse.php @@ -0,0 +1,407 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreateStaticRenditionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateStaticRenditionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\MuxPhp\Models\StaticRendition' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + // MUX: enum hack (self::) due to OAS emitting problems. + // please re-integrate with mainline when possible. + // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \MuxPhp\Models\StaticRendition|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \MuxPhp\Models\StaticRendition|null $data data + * + * @return self + */ + public function setData($data) + { + + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/MuxPhp/Models/InputSettings.php b/MuxPhp/Models/InputSettings.php index e0bef87..037208e 100644 --- a/MuxPhp/Models/InputSettings.php +++ b/MuxPhp/Models/InputSettings.php @@ -727,7 +727,7 @@ public function getPassthrough() /** * Sets passthrough * - * @param string|null $passthrough This optional parameter should be used tracks with `type` of `text` and `text_type` set to `subtitles`. + * @param string|null $passthrough This optional parameter should be used for tracks with `type` of `text` and `text_type` set to `subtitles`. * * @return self */ diff --git a/MuxPhp/Models/StaticRendition.php b/MuxPhp/Models/StaticRendition.php new file mode 100644 index 0000000..2c92be5 --- /dev/null +++ b/MuxPhp/Models/StaticRendition.php @@ -0,0 +1,1055 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StaticRendition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StaticRendition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'ext' => 'string', + 'height' => 'int', + 'width' => 'int', + 'bitrate' => 'int', + 'filesize' => 'string', + 'type' => 'string', + 'status' => 'string', + 'resolution_tier' => 'string', + 'resolution' => 'string', + 'id' => 'string', + 'passthrough' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'ext' => null, + 'height' => 'int32', + 'width' => 'int32', + 'bitrate' => 'int64', + 'filesize' => 'int64', + 'type' => null, + 'status' => null, + 'resolution_tier' => null, + 'resolution' => null, + 'id' => null, + 'passthrough' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'ext' => false, + 'height' => false, + 'width' => false, + 'bitrate' => false, + 'filesize' => false, + 'type' => false, + 'status' => false, + 'resolution_tier' => false, + 'resolution' => false, + 'id' => false, + 'passthrough' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'ext' => 'ext', + 'height' => 'height', + 'width' => 'width', + 'bitrate' => 'bitrate', + 'filesize' => 'filesize', + 'type' => 'type', + 'status' => 'status', + 'resolution_tier' => 'resolution_tier', + 'resolution' => 'resolution', + 'id' => 'id', + 'passthrough' => 'passthrough' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'ext' => 'setExt', + 'height' => 'setHeight', + 'width' => 'setWidth', + 'bitrate' => 'setBitrate', + 'filesize' => 'setFilesize', + 'type' => 'setType', + 'status' => 'setStatus', + 'resolution_tier' => 'setResolutionTier', + 'resolution' => 'setResolution', + 'id' => 'setId', + 'passthrough' => 'setPassthrough' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'ext' => 'getExt', + 'height' => 'getHeight', + 'width' => 'getWidth', + 'bitrate' => 'getBitrate', + 'filesize' => 'getFilesize', + 'type' => 'getType', + 'status' => 'getStatus', + 'resolution_tier' => 'getResolutionTier', + 'resolution' => 'getResolution', + 'id' => 'getId', + 'passthrough' => 'getPassthrough' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const NAME_LOW_MP4 = 'low.mp4'; + public const NAME_MEDIUM_MP4 = 'medium.mp4'; + public const NAME_HIGH_MP4 = 'high.mp4'; + public const NAME_HIGHEST_MP4 = 'highest.mp4'; + public const NAME_AUDIO_M4A = 'audio.m4a'; + public const NAME_CAPPED_1080P_MP4 = 'capped-1080p.mp4'; + public const NAME__2160P_MP4 = '2160p.mp4'; + public const NAME__1440P_MP4 = '1440p.mp4'; + public const NAME__1080P_MP4 = '1080p.mp4'; + public const NAME__720P_MP4 = '720p.mp4'; + public const NAME__540P_MP4 = '540p.mp4'; + public const NAME__480P_MP4 = '480p.mp4'; + public const NAME__360P_MP4 = '360p.mp4'; + public const NAME__270P_MP4 = '270p.mp4'; + public const EXT_MP4 = 'mp4'; + public const EXT_M4A = 'm4a'; + public const TYPE_STANDARD = 'standard'; + public const TYPE_ADVANCED = 'advanced'; + public const STATUS_READY = 'ready'; + public const STATUS_PREPARING = 'preparing'; + public const STATUS_SKIPPED = 'skipped'; + public const STATUS_ERRORED = 'errored'; + public const RESOLUTION_TIER__2160P = '2160p'; + public const RESOLUTION_TIER__1440P = '1440p'; + public const RESOLUTION_TIER__1080P = '1080p'; + public const RESOLUTION_TIER__720P = '720p'; + public const RESOLUTION_HIGHEST = 'highest'; + public const RESOLUTION_AUDIO_ONLY = 'audio-only'; + public const RESOLUTION__2160P = '2160p'; + public const RESOLUTION__1440P = '1440p'; + public const RESOLUTION__1080P = '1080p'; + public const RESOLUTION__720P = '720p'; + public const RESOLUTION__540P = '540p'; + public const RESOLUTION__480P = '480p'; + public const RESOLUTION__360P = '360p'; + public const RESOLUTION__270P = '270p'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_LOW_MP4, + self::NAME_MEDIUM_MP4, + self::NAME_HIGH_MP4, + self::NAME_HIGHEST_MP4, + self::NAME_AUDIO_M4A, + self::NAME_CAPPED_1080P_MP4, + self::NAME__2160P_MP4, + self::NAME__1440P_MP4, + self::NAME__1080P_MP4, + self::NAME__720P_MP4, + self::NAME__540P_MP4, + self::NAME__480P_MP4, + self::NAME__360P_MP4, + self::NAME__270P_MP4, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExtAllowableValues() + { + return [ + self::EXT_MP4, + self::EXT_M4A, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STANDARD, + self::TYPE_ADVANCED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_READY, + self::STATUS_PREPARING, + self::STATUS_SKIPPED, + self::STATUS_ERRORED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResolutionTierAllowableValues() + { + return [ + self::RESOLUTION_TIER__2160P, + self::RESOLUTION_TIER__1440P, + self::RESOLUTION_TIER__1080P, + self::RESOLUTION_TIER__720P, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResolutionAllowableValues() + { + return [ + self::RESOLUTION_HIGHEST, + self::RESOLUTION_AUDIO_ONLY, + self::RESOLUTION__2160P, + self::RESOLUTION__1440P, + self::RESOLUTION__1080P, + self::RESOLUTION__720P, + self::RESOLUTION__540P, + self::RESOLUTION__480P, + self::RESOLUTION__360P, + self::RESOLUTION__270P, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + // MUX: enum hack (self::) due to OAS emitting problems. + // please re-integrate with mainline when possible. + // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('ext', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('bitrate', $data ?? [], null); + $this->setIfExists('filesize', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('resolution_tier', $data ?? [], null); + $this->setIfExists('resolution', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('passthrough', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExtAllowableValues(); + if (!is_null($this->container['ext']) && !in_array($this->container['ext'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ext', must be one of '%s'", + $this->container['ext'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getResolutionTierAllowableValues(); + if (!is_null($this->container['resolution_tier']) && !in_array($this->container['resolution_tier'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'resolution_tier', must be one of '%s'", + $this->container['resolution_tier'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getResolutionAllowableValues(); + if (!is_null($this->container['resolution']) && !in_array($this->container['resolution'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'resolution', must be one of '%s'", + $this->container['resolution'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the static rendition file + * + * @return self + */ + public function setName($name) + { + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($name) && !in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'name', must be one of '%s'", + $name, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets ext + * + * @return string|null + */ + public function getExt() + { + return $this->container['ext']; + } + + /** + * Sets ext + * + * @param string|null $ext Extension of the static rendition file + * + * @return self + */ + public function setExt($ext) + { + $allowedValues = $this->getExtAllowableValues(); + if (!is_null($ext) && !in_array($ext, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ext', must be one of '%s'", + $ext, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($ext)) { + throw new \InvalidArgumentException('non-nullable ext cannot be null'); + } + + $this->container['ext'] = $ext; + + return $this; + } + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height The height of the static rendition's file in pixels + * + * @return self + */ + public function setHeight($height) + { + + if (is_null($height)) { + throw new \InvalidArgumentException('non-nullable height cannot be null'); + } + + $this->container['height'] = $height; + + return $this; + } + + /** + * Gets width + * + * @return int|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param int|null $width The width of the static rendition's file in pixels + * + * @return self + */ + public function setWidth($width) + { + + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets bitrate + * + * @return int|null + */ + public function getBitrate() + { + return $this->container['bitrate']; + } + + /** + * Sets bitrate + * + * @param int|null $bitrate The bitrate in bits per second + * + * @return self + */ + public function setBitrate($bitrate) + { + + if (is_null($bitrate)) { + throw new \InvalidArgumentException('non-nullable bitrate cannot be null'); + } + + $this->container['bitrate'] = $bitrate; + + return $this; + } + + /** + * Gets filesize + * + * @return string|null + */ + public function getFilesize() + { + return $this->container['filesize']; + } + + /** + * Sets filesize + * + * @param string|null $filesize The file size in bytes + * + * @return self + */ + public function setFilesize($filesize) + { + + if (is_null($filesize)) { + throw new \InvalidArgumentException('non-nullable filesize cannot be null'); + } + + $this->container['filesize'] = $filesize; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Indicates the static rendition type of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Indicates the status of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. * `ready` indicates the MP4 has been generated and is ready for download * `preparing` indicates the asset has not been ingested or the static rendition is still being generated after an asset is ready * `skipped` indicates the static rendition will not be generated because the requested resolution conflicts with the asset attributes after the asset has been ingested * `errored` indicates the static rendition cannot be generated. For example, an asset could not be ingested + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets resolution_tier + * + * @return string|null + */ + public function getResolutionTier() + { + return $this->container['resolution_tier']; + } + + /** + * Sets resolution_tier + * + * @param string|null $resolution_tier Indicates the resolution tier of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. + * + * @return self + */ + public function setResolutionTier($resolution_tier) + { + $allowedValues = $this->getResolutionTierAllowableValues(); + if (!is_null($resolution_tier) && !in_array($resolution_tier, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'resolution_tier', must be one of '%s'", + $resolution_tier, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($resolution_tier)) { + throw new \InvalidArgumentException('non-nullable resolution_tier cannot be null'); + } + + $this->container['resolution_tier'] = $resolution_tier; + + return $this; + } + + /** + * Gets resolution + * + * @return string|null + */ + public function getResolution() + { + return $this->container['resolution']; + } + + /** + * Sets resolution + * + * @param string|null $resolution Indicates the resolution of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. + * + * @return self + */ + public function setResolution($resolution) + { + $allowedValues = $this->getResolutionAllowableValues(); + if (!is_null($resolution) && !in_array($resolution, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'resolution', must be one of '%s'", + $resolution, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($resolution)) { + throw new \InvalidArgumentException('non-nullable resolution cannot be null'); + } + + $this->container['resolution'] = $resolution; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of this static rendition, used in managing this static rendition. This field is only valid for `static_renditions`, not for `mp4_support`. + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets passthrough + * + * @return string|null + */ + public function getPassthrough() + { + return $this->container['passthrough']; + } + + /** + * Sets passthrough + * + * @param string|null $passthrough Arbitrary user-supplied metadata set for the static rendition. Max 255 characters. + * + * @return self + */ + public function setPassthrough($passthrough) + { + + if (is_null($passthrough)) { + throw new \InvalidArgumentException('non-nullable passthrough cannot be null'); + } + + $this->container['passthrough'] = $passthrough; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php b/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php index 644cdac..78de56d 100644 --- a/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php +++ b/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php @@ -36,7 +36,7 @@ * UpdateLiveStreamNewAssetSettings Class Doc Comment * * @category Class - * @description Updates the new asset settings to use to generate a new asset for this live stream. Only the `mp4_support` and `master_access` settings may be updated. + * @description Updates the new asset settings to use to generate a new asset for this live stream. Only the `mp4_support`, `master_access`, and `video_quality` settings may be updated. * @package MuxPhp * @author Mux API team * @link https://docs.mux.com @@ -62,7 +62,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ */ protected static $openAPITypes = [ 'mp4_support' => 'string', - 'master_access' => 'string' + 'master_access' => 'string', + 'video_quality' => 'string' ]; /** @@ -74,7 +75,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ */ protected static $openAPIFormats = [ 'mp4_support' => null, - 'master_access' => null + 'master_access' => null, + 'video_quality' => null ]; /** @@ -84,7 +86,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ */ protected static array $openAPINullables = [ 'mp4_support' => false, - 'master_access' => false + 'master_access' => false, + 'video_quality' => false ]; /** @@ -164,7 +167,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'mp4_support' => 'mp4_support', - 'master_access' => 'master_access' + 'master_access' => 'master_access', + 'video_quality' => 'video_quality' ]; /** @@ -174,7 +178,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'mp4_support' => 'setMp4Support', - 'master_access' => 'setMasterAccess' + 'master_access' => 'setMasterAccess', + 'video_quality' => 'setVideoQuality' ]; /** @@ -184,7 +189,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'mp4_support' => 'getMp4Support', - 'master_access' => 'getMasterAccess' + 'master_access' => 'getMasterAccess', + 'video_quality' => 'getVideoQuality' ]; /** @@ -235,6 +241,8 @@ public function getModelName() public const MP4_SUPPORT_AUDIO_ONLYCAPPED_1080P = 'audio-only,capped-1080p'; public const MASTER_ACCESS_TEMPORARY = 'temporary'; public const MASTER_ACCESS_NONE = 'none'; + public const VIDEO_QUALITY_PLUS = 'plus'; + public const VIDEO_QUALITY_PREMIUM = 'premium'; /** * Gets allowable values of the enum @@ -265,6 +273,19 @@ public function getMasterAccessAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVideoQualityAllowableValues() + { + return [ + self::VIDEO_QUALITY_PLUS, + self::VIDEO_QUALITY_PREMIUM, + ]; + } + /** * Associative array for storing property values * @@ -285,6 +306,7 @@ public function __construct(array $data = null) // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 $this->setIfExists('mp4_support', $data ?? [], null); $this->setIfExists('master_access', $data ?? [], null); + $this->setIfExists('video_quality', $data ?? [], null); } /** @@ -332,6 +354,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getVideoQualityAllowableValues(); + if (!is_null($this->container['video_quality']) && !in_array($this->container['video_quality'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'video_quality', must be one of '%s'", + $this->container['video_quality'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -351,6 +382,7 @@ public function valid() * Gets mp4_support * * @return string|null + * @deprecated */ public function getMp4Support() { @@ -360,9 +392,10 @@ public function getMp4Support() /** * Sets mp4_support * - * @param string|null $mp4_support Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). + * @param string|null $mp4_support Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions#during-live-stream-creation) for the updated API. Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). * * @return self + * @deprecated */ public function setMp4Support($mp4_support) { @@ -424,6 +457,45 @@ public function setMasterAccess($master_access) return $this; } + + /** + * Gets video_quality + * + * @return string|null + */ + public function getVideoQuality() + { + return $this->container['video_quality']; + } + + /** + * Sets video_quality + * + * @param string|null $video_quality The video quality controls the cost, quality, and available platform features for the asset. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) + * + * @return self + */ + public function setVideoQuality($video_quality) + { + $allowedValues = $this->getVideoQualityAllowableValues(); + if (!is_null($video_quality) && !in_array($video_quality, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'video_quality', must be one of '%s'", + $video_quality, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($video_quality)) { + throw new \InvalidArgumentException('non-nullable video_quality cannot be null'); + } + + $this->container['video_quality'] = $video_quality; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.php b/MuxPhp/Models/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.php new file mode 100644 index 0000000..9bf98c9 --- /dev/null +++ b/MuxPhp/Models/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.php @@ -0,0 +1,407 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'static_renditions' => '\MuxPhp\Models\CreateStaticRenditionRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'static_renditions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'static_renditions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'static_renditions' => 'static_renditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'static_renditions' => 'setStaticRenditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'static_renditions' => 'getStaticRenditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + // MUX: enum hack (self::) due to OAS emitting problems. + // please re-integrate with mainline when possible. + // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 + $this->setIfExists('static_renditions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets static_renditions + * + * @return \MuxPhp\Models\CreateStaticRenditionRequest[]|null + */ + public function getStaticRenditions() + { + return $this->container['static_renditions']; + } + + /** + * Sets static_renditions + * + * @param \MuxPhp\Models\CreateStaticRenditionRequest[]|null $static_renditions static_renditions + * + * @return self + */ + public function setStaticRenditions($static_renditions) + { + + if (is_null($static_renditions)) { + throw new \InvalidArgumentException('non-nullable static_renditions cannot be null'); + } + + $this->container['static_renditions'] = $static_renditions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/MuxPhp/Models/VideoView.php b/MuxPhp/Models/VideoView.php index febf053..9d34c3e 100644 --- a/MuxPhp/Models/VideoView.php +++ b/MuxPhp/Models/VideoView.php @@ -221,7 +221,23 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'ad_playback_failure_error_type_id' => 'int', 'view_content_startup_time' => 'int', 'ad_preroll_startup_time' => 'int', - 'view_dropped' => 'bool' + 'view_dropped' => 'bool', + 'client_application_name' => 'string', + 'client_application_version' => 'string', + 'video_affiliate' => 'string', + 'viewer_plan' => 'string', + 'viewer_plan_status' => 'string', + 'viewer_plan_category' => 'string', + 'view_drm_level' => 'string', + 'video_brand' => 'string', + 'used_pip' => 'bool', + 'time_shift_enabled' => 'bool', + 'used_captions' => 'bool', + 'video_codec' => 'string', + 'audio_codec' => 'string', + 'video_dynamic_range_type' => 'string', + 'view_cdn_edge_pop' => 'string', + 'view_cdn_origin' => 'string' ]; /** @@ -393,7 +409,23 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'ad_playback_failure_error_type_id' => 'int32', 'view_content_startup_time' => 'int32', 'ad_preroll_startup_time' => 'int32', - 'view_dropped' => null + 'view_dropped' => null, + 'client_application_name' => null, + 'client_application_version' => null, + 'video_affiliate' => null, + 'viewer_plan' => null, + 'viewer_plan_status' => null, + 'viewer_plan_category' => null, + 'view_drm_level' => null, + 'video_brand' => null, + 'used_pip' => null, + 'time_shift_enabled' => null, + 'used_captions' => null, + 'video_codec' => null, + 'audio_codec' => null, + 'video_dynamic_range_type' => null, + 'view_cdn_edge_pop' => null, + 'view_cdn_origin' => null ]; /** @@ -563,7 +595,23 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'ad_playback_failure_error_type_id' => true, 'view_content_startup_time' => true, 'ad_preroll_startup_time' => true, - 'view_dropped' => false + 'view_dropped' => false, + 'client_application_name' => true, + 'client_application_version' => true, + 'video_affiliate' => true, + 'viewer_plan' => true, + 'viewer_plan_status' => true, + 'viewer_plan_category' => true, + 'view_drm_level' => true, + 'video_brand' => true, + 'used_pip' => false, + 'time_shift_enabled' => false, + 'used_captions' => false, + 'video_codec' => true, + 'audio_codec' => true, + 'video_dynamic_range_type' => true, + 'view_cdn_edge_pop' => true, + 'view_cdn_origin' => true ]; /** @@ -803,7 +851,23 @@ public function isNullableSetToNull(string $property): bool 'ad_playback_failure_error_type_id' => 'ad_playback_failure_error_type_id', 'view_content_startup_time' => 'view_content_startup_time', 'ad_preroll_startup_time' => 'ad_preroll_startup_time', - 'view_dropped' => 'view_dropped' + 'view_dropped' => 'view_dropped', + 'client_application_name' => 'client_application_name', + 'client_application_version' => 'client_application_version', + 'video_affiliate' => 'video_affiliate', + 'viewer_plan' => 'viewer_plan', + 'viewer_plan_status' => 'viewer_plan_status', + 'viewer_plan_category' => 'viewer_plan_category', + 'view_drm_level' => 'view_drm_level', + 'video_brand' => 'video_brand', + 'used_pip' => 'used_pip', + 'time_shift_enabled' => 'time_shift_enabled', + 'used_captions' => 'used_captions', + 'video_codec' => 'video_codec', + 'audio_codec' => 'audio_codec', + 'video_dynamic_range_type' => 'video_dynamic_range_type', + 'view_cdn_edge_pop' => 'view_cdn_edge_pop', + 'view_cdn_origin' => 'view_cdn_origin' ]; /** @@ -973,7 +1037,23 @@ public function isNullableSetToNull(string $property): bool 'ad_playback_failure_error_type_id' => 'setAdPlaybackFailureErrorTypeId', 'view_content_startup_time' => 'setViewContentStartupTime', 'ad_preroll_startup_time' => 'setAdPrerollStartupTime', - 'view_dropped' => 'setViewDropped' + 'view_dropped' => 'setViewDropped', + 'client_application_name' => 'setClientApplicationName', + 'client_application_version' => 'setClientApplicationVersion', + 'video_affiliate' => 'setVideoAffiliate', + 'viewer_plan' => 'setViewerPlan', + 'viewer_plan_status' => 'setViewerPlanStatus', + 'viewer_plan_category' => 'setViewerPlanCategory', + 'view_drm_level' => 'setViewDrmLevel', + 'video_brand' => 'setVideoBrand', + 'used_pip' => 'setUsedPip', + 'time_shift_enabled' => 'setTimeShiftEnabled', + 'used_captions' => 'setUsedCaptions', + 'video_codec' => 'setVideoCodec', + 'audio_codec' => 'setAudioCodec', + 'video_dynamic_range_type' => 'setVideoDynamicRangeType', + 'view_cdn_edge_pop' => 'setViewCdnEdgePop', + 'view_cdn_origin' => 'setViewCdnOrigin' ]; /** @@ -1143,7 +1223,23 @@ public function isNullableSetToNull(string $property): bool 'ad_playback_failure_error_type_id' => 'getAdPlaybackFailureErrorTypeId', 'view_content_startup_time' => 'getViewContentStartupTime', 'ad_preroll_startup_time' => 'getAdPrerollStartupTime', - 'view_dropped' => 'getViewDropped' + 'view_dropped' => 'getViewDropped', + 'client_application_name' => 'getClientApplicationName', + 'client_application_version' => 'getClientApplicationVersion', + 'video_affiliate' => 'getVideoAffiliate', + 'viewer_plan' => 'getViewerPlan', + 'viewer_plan_status' => 'getViewerPlanStatus', + 'viewer_plan_category' => 'getViewerPlanCategory', + 'view_drm_level' => 'getViewDrmLevel', + 'video_brand' => 'getVideoBrand', + 'used_pip' => 'getUsedPip', + 'time_shift_enabled' => 'getTimeShiftEnabled', + 'used_captions' => 'getUsedCaptions', + 'video_codec' => 'getVideoCodec', + 'audio_codec' => 'getAudioCodec', + 'video_dynamic_range_type' => 'getVideoDynamicRangeType', + 'view_cdn_edge_pop' => 'getViewCdnEdgePop', + 'view_cdn_origin' => 'getViewCdnOrigin' ]; /** @@ -1368,6 +1464,22 @@ public function __construct(array $data = null) $this->setIfExists('view_content_startup_time', $data ?? [], null); $this->setIfExists('ad_preroll_startup_time', $data ?? [], null); $this->setIfExists('view_dropped', $data ?? [], null); + $this->setIfExists('client_application_name', $data ?? [], null); + $this->setIfExists('client_application_version', $data ?? [], null); + $this->setIfExists('video_affiliate', $data ?? [], null); + $this->setIfExists('viewer_plan', $data ?? [], null); + $this->setIfExists('viewer_plan_status', $data ?? [], null); + $this->setIfExists('viewer_plan_category', $data ?? [], null); + $this->setIfExists('view_drm_level', $data ?? [], null); + $this->setIfExists('video_brand', $data ?? [], null); + $this->setIfExists('used_pip', $data ?? [], null); + $this->setIfExists('time_shift_enabled', $data ?? [], null); + $this->setIfExists('used_captions', $data ?? [], null); + $this->setIfExists('video_codec', $data ?? [], null); + $this->setIfExists('audio_codec', $data ?? [], null); + $this->setIfExists('video_dynamic_range_type', $data ?? [], null); + $this->setIfExists('view_cdn_edge_pop', $data ?? [], null); + $this->setIfExists('view_cdn_origin', $data ?? [], null); } /** @@ -7075,6 +7187,561 @@ public function setViewDropped($view_dropped) return $this; } + + /** + * Gets client_application_name + * + * @return string|null + */ + public function getClientApplicationName() + { + return $this->container['client_application_name']; + } + + /** + * Sets client_application_name + * + * @param string|null $client_application_name client_application_name + * + * @return self + */ + public function setClientApplicationName($client_application_name) + { + + if (is_null($client_application_name)) { + array_push($this->openAPINullablesSetToNull, 'client_application_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('client_application_name', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['client_application_name'] = $client_application_name; + + return $this; + } + + /** + * Gets client_application_version + * + * @return string|null + */ + public function getClientApplicationVersion() + { + return $this->container['client_application_version']; + } + + /** + * Sets client_application_version + * + * @param string|null $client_application_version client_application_version + * + * @return self + */ + public function setClientApplicationVersion($client_application_version) + { + + if (is_null($client_application_version)) { + array_push($this->openAPINullablesSetToNull, 'client_application_version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('client_application_version', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['client_application_version'] = $client_application_version; + + return $this; + } + + /** + * Gets video_affiliate + * + * @return string|null + */ + public function getVideoAffiliate() + { + return $this->container['video_affiliate']; + } + + /** + * Sets video_affiliate + * + * @param string|null $video_affiliate video_affiliate + * + * @return self + */ + public function setVideoAffiliate($video_affiliate) + { + + if (is_null($video_affiliate)) { + array_push($this->openAPINullablesSetToNull, 'video_affiliate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('video_affiliate', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['video_affiliate'] = $video_affiliate; + + return $this; + } + + /** + * Gets viewer_plan + * + * @return string|null + */ + public function getViewerPlan() + { + return $this->container['viewer_plan']; + } + + /** + * Sets viewer_plan + * + * @param string|null $viewer_plan viewer_plan + * + * @return self + */ + public function setViewerPlan($viewer_plan) + { + + if (is_null($viewer_plan)) { + array_push($this->openAPINullablesSetToNull, 'viewer_plan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('viewer_plan', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['viewer_plan'] = $viewer_plan; + + return $this; + } + + /** + * Gets viewer_plan_status + * + * @return string|null + */ + public function getViewerPlanStatus() + { + return $this->container['viewer_plan_status']; + } + + /** + * Sets viewer_plan_status + * + * @param string|null $viewer_plan_status viewer_plan_status + * + * @return self + */ + public function setViewerPlanStatus($viewer_plan_status) + { + + if (is_null($viewer_plan_status)) { + array_push($this->openAPINullablesSetToNull, 'viewer_plan_status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('viewer_plan_status', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['viewer_plan_status'] = $viewer_plan_status; + + return $this; + } + + /** + * Gets viewer_plan_category + * + * @return string|null + */ + public function getViewerPlanCategory() + { + return $this->container['viewer_plan_category']; + } + + /** + * Sets viewer_plan_category + * + * @param string|null $viewer_plan_category viewer_plan_category + * + * @return self + */ + public function setViewerPlanCategory($viewer_plan_category) + { + + if (is_null($viewer_plan_category)) { + array_push($this->openAPINullablesSetToNull, 'viewer_plan_category'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('viewer_plan_category', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['viewer_plan_category'] = $viewer_plan_category; + + return $this; + } + + /** + * Gets view_drm_level + * + * @return string|null + */ + public function getViewDrmLevel() + { + return $this->container['view_drm_level']; + } + + /** + * Sets view_drm_level + * + * @param string|null $view_drm_level view_drm_level + * + * @return self + */ + public function setViewDrmLevel($view_drm_level) + { + + if (is_null($view_drm_level)) { + array_push($this->openAPINullablesSetToNull, 'view_drm_level'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('view_drm_level', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['view_drm_level'] = $view_drm_level; + + return $this; + } + + /** + * Gets video_brand + * + * @return string|null + */ + public function getVideoBrand() + { + return $this->container['video_brand']; + } + + /** + * Sets video_brand + * + * @param string|null $video_brand video_brand + * + * @return self + */ + public function setVideoBrand($video_brand) + { + + if (is_null($video_brand)) { + array_push($this->openAPINullablesSetToNull, 'video_brand'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('video_brand', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['video_brand'] = $video_brand; + + return $this; + } + + /** + * Gets used_pip + * + * @return bool|null + */ + public function getUsedPip() + { + return $this->container['used_pip']; + } + + /** + * Sets used_pip + * + * @param bool|null $used_pip used_pip + * + * @return self + */ + public function setUsedPip($used_pip) + { + + if (is_null($used_pip)) { + throw new \InvalidArgumentException('non-nullable used_pip cannot be null'); + } + + $this->container['used_pip'] = $used_pip; + + return $this; + } + + /** + * Gets time_shift_enabled + * + * @return bool|null + */ + public function getTimeShiftEnabled() + { + return $this->container['time_shift_enabled']; + } + + /** + * Sets time_shift_enabled + * + * @param bool|null $time_shift_enabled time_shift_enabled + * + * @return self + */ + public function setTimeShiftEnabled($time_shift_enabled) + { + + if (is_null($time_shift_enabled)) { + throw new \InvalidArgumentException('non-nullable time_shift_enabled cannot be null'); + } + + $this->container['time_shift_enabled'] = $time_shift_enabled; + + return $this; + } + + /** + * Gets used_captions + * + * @return bool|null + */ + public function getUsedCaptions() + { + return $this->container['used_captions']; + } + + /** + * Sets used_captions + * + * @param bool|null $used_captions used_captions + * + * @return self + */ + public function setUsedCaptions($used_captions) + { + + if (is_null($used_captions)) { + throw new \InvalidArgumentException('non-nullable used_captions cannot be null'); + } + + $this->container['used_captions'] = $used_captions; + + return $this; + } + + /** + * Gets video_codec + * + * @return string|null + */ + public function getVideoCodec() + { + return $this->container['video_codec']; + } + + /** + * Sets video_codec + * + * @param string|null $video_codec video_codec + * + * @return self + */ + public function setVideoCodec($video_codec) + { + + if (is_null($video_codec)) { + array_push($this->openAPINullablesSetToNull, 'video_codec'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('video_codec', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['video_codec'] = $video_codec; + + return $this; + } + + /** + * Gets audio_codec + * + * @return string|null + */ + public function getAudioCodec() + { + return $this->container['audio_codec']; + } + + /** + * Sets audio_codec + * + * @param string|null $audio_codec audio_codec + * + * @return self + */ + public function setAudioCodec($audio_codec) + { + + if (is_null($audio_codec)) { + array_push($this->openAPINullablesSetToNull, 'audio_codec'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('audio_codec', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['audio_codec'] = $audio_codec; + + return $this; + } + + /** + * Gets video_dynamic_range_type + * + * @return string|null + */ + public function getVideoDynamicRangeType() + { + return $this->container['video_dynamic_range_type']; + } + + /** + * Sets video_dynamic_range_type + * + * @param string|null $video_dynamic_range_type video_dynamic_range_type + * + * @return self + */ + public function setVideoDynamicRangeType($video_dynamic_range_type) + { + + if (is_null($video_dynamic_range_type)) { + array_push($this->openAPINullablesSetToNull, 'video_dynamic_range_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('video_dynamic_range_type', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['video_dynamic_range_type'] = $video_dynamic_range_type; + + return $this; + } + + /** + * Gets view_cdn_edge_pop + * + * @return string|null + */ + public function getViewCdnEdgePop() + { + return $this->container['view_cdn_edge_pop']; + } + + /** + * Sets view_cdn_edge_pop + * + * @param string|null $view_cdn_edge_pop view_cdn_edge_pop + * + * @return self + */ + public function setViewCdnEdgePop($view_cdn_edge_pop) + { + + if (is_null($view_cdn_edge_pop)) { + array_push($this->openAPINullablesSetToNull, 'view_cdn_edge_pop'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('view_cdn_edge_pop', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['view_cdn_edge_pop'] = $view_cdn_edge_pop; + + return $this; + } + + /** + * Gets view_cdn_origin + * + * @return string|null + */ + public function getViewCdnOrigin() + { + return $this->container['view_cdn_origin']; + } + + /** + * Sets view_cdn_origin + * + * @param string|null $view_cdn_origin view_cdn_origin + * + * @return self + */ + public function setViewCdnOrigin($view_cdn_origin) + { + + if (is_null($view_cdn_origin)) { + array_push($this->openAPINullablesSetToNull, 'view_cdn_origin'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('view_cdn_origin', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['view_cdn_origin'] = $view_cdn_origin; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/README.md b/README.md index 4f00f67..705941a 100644 --- a/README.md +++ b/README.md @@ -150,9 +150,11 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AssetsApi* | [**createAsset**](docs/Api/AssetsApi.md#createasset) | **POST** /video/v1/assets | Create an asset *AssetsApi* | [**createAssetPlaybackId**](docs/Api/AssetsApi.md#createassetplaybackid) | **POST** /video/v1/assets/{ASSET_ID}/playback-ids | Create a playback ID +*AssetsApi* | [**createAssetStaticRendition**](docs/Api/AssetsApi.md#createassetstaticrendition) | **POST** /video/v1/assets/{ASSET_ID}/static-renditions | Create a static rendition for an asset *AssetsApi* | [**createAssetTrack**](docs/Api/AssetsApi.md#createassettrack) | **POST** /video/v1/assets/{ASSET_ID}/tracks | Create an asset track *AssetsApi* | [**deleteAsset**](docs/Api/AssetsApi.md#deleteasset) | **DELETE** /video/v1/assets/{ASSET_ID} | Delete an asset *AssetsApi* | [**deleteAssetPlaybackId**](docs/Api/AssetsApi.md#deleteassetplaybackid) | **DELETE** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID +*AssetsApi* | [**deleteAssetStaticRendition**](docs/Api/AssetsApi.md#deleteassetstaticrendition) | **DELETE** /video/v1/assets/{ASSET_ID}/static-renditions/{STATIC_RENDITION_ID} | Delete a single static rendition for an asset *AssetsApi* | [**deleteAssetTrack**](docs/Api/AssetsApi.md#deleteassettrack) | **DELETE** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track *AssetsApi* | [**generateAssetTrackSubtitles**](docs/Api/AssetsApi.md#generateassettracksubtitles) | **POST** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles | Generate track subtitles *AssetsApi* | [**getAsset**](docs/Api/AssetsApi.md#getasset) | **GET** /video/v1/assets/{ASSET_ID} | Retrieve an asset @@ -183,6 +185,7 @@ Class | Method | HTTP request | Description *LiveStreamsApi* | [**createLiveStreamPlaybackId**](docs/Api/LiveStreamsApi.md#createlivestreamplaybackid) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids | Create a live stream playback ID *LiveStreamsApi* | [**createLiveStreamSimulcastTarget**](docs/Api/LiveStreamsApi.md#createlivestreamsimulcasttarget) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target *LiveStreamsApi* | [**deleteLiveStream**](docs/Api/LiveStreamsApi.md#deletelivestream) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream +*LiveStreamsApi* | [**deleteLiveStreamNewAssetSettingsStaticRenditions**](docs/Api/LiveStreamsApi.md#deletelivestreamnewassetsettingsstaticrenditions) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions | Delete a live stream's static renditions setting for new assets *LiveStreamsApi* | [**deleteLiveStreamPlaybackId**](docs/Api/LiveStreamsApi.md#deletelivestreamplaybackid) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID *LiveStreamsApi* | [**deleteLiveStreamSimulcastTarget**](docs/Api/LiveStreamsApi.md#deletelivestreamsimulcasttarget) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a live stream simulcast target *LiveStreamsApi* | [**disableLiveStream**](docs/Api/LiveStreamsApi.md#disablelivestream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream @@ -196,6 +199,7 @@ Class | Method | HTTP request | Description *LiveStreamsApi* | [**updateLiveStream**](docs/Api/LiveStreamsApi.md#updatelivestream) | **PATCH** /video/v1/live-streams/{LIVE_STREAM_ID} | Update a live stream *LiveStreamsApi* | [**updateLiveStreamEmbeddedSubtitles**](docs/Api/LiveStreamsApi.md#updatelivestreamembeddedsubtitles) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/embedded-subtitles | Update a live stream's embedded subtitles *LiveStreamsApi* | [**updateLiveStreamGeneratedSubtitles**](docs/Api/LiveStreamsApi.md#updatelivestreamgeneratedsubtitles) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/generated-subtitles | Update a live stream's generated subtitles +*LiveStreamsApi* | [**updateLiveStreamNewAssetSettingsStaticRenditions**](docs/Api/LiveStreamsApi.md#updatelivestreamnewassetsettingsstaticrenditions) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions | Update live stream static renditions for new assets *MetricsApi* | [**getMetricTimeseriesData**](docs/Api/MetricsApi.md#getmetrictimeseriesdata) | **GET** /data/v1/metrics/{METRIC_ID}/timeseries | Get metric timeseries data *MetricsApi* | [**getOverallValues**](docs/Api/MetricsApi.md#getoverallvalues) | **GET** /data/v1/metrics/{METRIC_ID}/overall | Get Overall values *MetricsApi* | [**listAllMetricValues**](docs/Api/MetricsApi.md#listallmetricvalues) | **GET** /data/v1/metrics/comparison | List all metric values @@ -223,15 +227,6 @@ Class | Method | HTTP request | Description *SigningKeysApi* | [**deleteSigningKey**](docs/Api/SigningKeysApi.md#deletesigningkey) | **DELETE** /system/v1/signing-keys/{SIGNING_KEY_ID} | Delete a signing key *SigningKeysApi* | [**getSigningKey**](docs/Api/SigningKeysApi.md#getsigningkey) | **GET** /system/v1/signing-keys/{SIGNING_KEY_ID} | Retrieve a signing key *SigningKeysApi* | [**listSigningKeys**](docs/Api/SigningKeysApi.md#listsigningkeys) | **GET** /system/v1/signing-keys | List signing keys -*SpacesApi* | [**createSpace**](docs/Api/SpacesApi.md#createspace) | **POST** /video/v1/spaces | Create a space -*SpacesApi* | [**createSpaceBroadcast**](docs/Api/SpacesApi.md#createspacebroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts | Create a space broadcast -*SpacesApi* | [**deleteSpace**](docs/Api/SpacesApi.md#deletespace) | **DELETE** /video/v1/spaces/{SPACE_ID} | Delete a space -*SpacesApi* | [**deleteSpaceBroadcast**](docs/Api/SpacesApi.md#deletespacebroadcast) | **DELETE** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Delete a space broadcast -*SpacesApi* | [**getSpace**](docs/Api/SpacesApi.md#getspace) | **GET** /video/v1/spaces/{SPACE_ID} | Retrieve a space -*SpacesApi* | [**getSpaceBroadcast**](docs/Api/SpacesApi.md#getspacebroadcast) | **GET** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Retrieve space broadcast -*SpacesApi* | [**listSpaces**](docs/Api/SpacesApi.md#listspaces) | **GET** /video/v1/spaces | List spaces -*SpacesApi* | [**startSpaceBroadcast**](docs/Api/SpacesApi.md#startspacebroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/start | Start a space broadcast -*SpacesApi* | [**stopSpaceBroadcast**](docs/Api/SpacesApi.md#stopspacebroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/stop | Stop a space broadcast *TranscriptionVocabulariesApi* | [**createTranscriptionVocabulary**](docs/Api/TranscriptionVocabulariesApi.md#createtranscriptionvocabulary) | **POST** /video/v1/transcription-vocabularies | Create a Transcription Vocabulary *TranscriptionVocabulariesApi* | [**deleteTranscriptionVocabulary**](docs/Api/TranscriptionVocabulariesApi.md#deletetranscriptionvocabulary) | **DELETE** /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} | Delete a Transcription Vocabulary *TranscriptionVocabulariesApi* | [**getTranscriptionVocabulary**](docs/Api/TranscriptionVocabulariesApi.md#gettranscriptionvocabulary) | **GET** /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} | Retrieve a Transcription Vocabulary @@ -263,21 +258,15 @@ Class | Method | HTTP request | Description - [AssetRecordingTimes](docs/Model/AssetRecordingTimes.md) - [AssetResponse](docs/Model/AssetResponse.md) - [AssetStaticRenditions](docs/Model/AssetStaticRenditions.md) -- [AssetStaticRenditionsFiles](docs/Model/AssetStaticRenditionsFiles.md) - [BreakdownValue](docs/Model/BreakdownValue.md) -- [Broadcast](docs/Model/Broadcast.md) -- [BroadcastLayout](docs/Model/BroadcastLayout.md) -- [BroadcastResolution](docs/Model/BroadcastResolution.md) -- [BroadcastResponse](docs/Model/BroadcastResponse.md) -- [BroadcastStatus](docs/Model/BroadcastStatus.md) - [CreateAssetRequest](docs/Model/CreateAssetRequest.md) -- [CreateBroadcastRequest](docs/Model/CreateBroadcastRequest.md) - [CreateLiveStreamRequest](docs/Model/CreateLiveStreamRequest.md) - [CreatePlaybackIDRequest](docs/Model/CreatePlaybackIDRequest.md) - [CreatePlaybackIDResponse](docs/Model/CreatePlaybackIDResponse.md) - [CreatePlaybackRestrictionRequest](docs/Model/CreatePlaybackRestrictionRequest.md) - [CreateSimulcastTargetRequest](docs/Model/CreateSimulcastTargetRequest.md) -- [CreateSpaceRequest](docs/Model/CreateSpaceRequest.md) +- [CreateStaticRenditionRequest](docs/Model/CreateStaticRenditionRequest.md) +- [CreateStaticRenditionResponse](docs/Model/CreateStaticRenditionResponse.md) - [CreateTrackRequest](docs/Model/CreateTrackRequest.md) - [CreateTrackResponse](docs/Model/CreateTrackResponse.md) - [CreateTranscriptionVocabularyRequest](docs/Model/CreateTranscriptionVocabularyRequest.md) @@ -349,7 +338,6 @@ Class | Method | HTTP request | Description - [ListRealTimeMetricsResponse](docs/Model/ListRealTimeMetricsResponse.md) - [ListRelatedIncidentsResponse](docs/Model/ListRelatedIncidentsResponse.md) - [ListSigningKeysResponse](docs/Model/ListSigningKeysResponse.md) -- [ListSpacesResponse](docs/Model/ListSpacesResponse.md) - [ListTranscriptionVocabulariesResponse](docs/Model/ListTranscriptionVocabulariesResponse.md) - [ListUploadsResponse](docs/Model/ListUploadsResponse.md) - [ListVideoViewExportsResponse](docs/Model/ListVideoViewExportsResponse.md) @@ -388,12 +376,7 @@ Class | Method | HTTP request | Description - [SigningKeyResponse](docs/Model/SigningKeyResponse.md) - [SimulcastTarget](docs/Model/SimulcastTarget.md) - [SimulcastTargetResponse](docs/Model/SimulcastTargetResponse.md) -- [Space](docs/Model/Space.md) -- [SpaceResponse](docs/Model/SpaceResponse.md) -- [SpaceStatus](docs/Model/SpaceStatus.md) -- [SpaceType](docs/Model/SpaceType.md) -- [StartSpaceBroadcastResponse](docs/Model/StartSpaceBroadcastResponse.md) -- [StopSpaceBroadcastResponse](docs/Model/StopSpaceBroadcastResponse.md) +- [StaticRendition](docs/Model/StaticRendition.md) - [Track](docs/Model/Track.md) - [TranscriptionVocabulary](docs/Model/TranscriptionVocabulary.md) - [TranscriptionVocabularyResponse](docs/Model/TranscriptionVocabularyResponse.md) @@ -403,6 +386,7 @@ Class | Method | HTTP request | Description - [UpdateLiveStreamEmbeddedSubtitlesRequest](docs/Model/UpdateLiveStreamEmbeddedSubtitlesRequest.md) - [UpdateLiveStreamGeneratedSubtitlesRequest](docs/Model/UpdateLiveStreamGeneratedSubtitlesRequest.md) - [UpdateLiveStreamNewAssetSettings](docs/Model/UpdateLiveStreamNewAssetSettings.md) +- [UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest](docs/Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md) - [UpdateLiveStreamRequest](docs/Model/UpdateLiveStreamRequest.md) - [UpdateReferrerDomainRestrictionRequest](docs/Model/UpdateReferrerDomainRestrictionRequest.md) - [UpdateTranscriptionVocabularyRequest](docs/Model/UpdateTranscriptionVocabularyRequest.md) @@ -443,5 +427,5 @@ devex@mux.com This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `v1` - - Package version: `3.21.0` + - Package version: `4.0.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json index ba0cdd5..cb2862d 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "muxinc/mux-php", - "version": "3.21.0", + "version": "4.0.0", "description": "Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.", "keywords": [ "php", diff --git a/docs/Api/AssetsApi.md b/docs/Api/AssetsApi.md index cd2d7c1..1fab218 100644 --- a/docs/Api/AssetsApi.md +++ b/docs/Api/AssetsApi.md @@ -6,9 +6,11 @@ All URIs are relative to https://api.mux.com, except if the operation defines an | ------------- | ------------- | ------------- | | [**createAsset()**](AssetsApi.md#createAsset) | **POST** /video/v1/assets | Create an asset | | [**createAssetPlaybackId()**](AssetsApi.md#createAssetPlaybackId) | **POST** /video/v1/assets/{ASSET_ID}/playback-ids | Create a playback ID | +| [**createAssetStaticRendition()**](AssetsApi.md#createAssetStaticRendition) | **POST** /video/v1/assets/{ASSET_ID}/static-renditions | Create a static rendition for an asset | | [**createAssetTrack()**](AssetsApi.md#createAssetTrack) | **POST** /video/v1/assets/{ASSET_ID}/tracks | Create an asset track | | [**deleteAsset()**](AssetsApi.md#deleteAsset) | **DELETE** /video/v1/assets/{ASSET_ID} | Delete an asset | | [**deleteAssetPlaybackId()**](AssetsApi.md#deleteAssetPlaybackId) | **DELETE** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID | +| [**deleteAssetStaticRendition()**](AssetsApi.md#deleteAssetStaticRendition) | **DELETE** /video/v1/assets/{ASSET_ID}/static-renditions/{STATIC_RENDITION_ID} | Delete a single static rendition for an asset | | [**deleteAssetTrack()**](AssetsApi.md#deleteAssetTrack) | **DELETE** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track | | [**generateAssetTrackSubtitles()**](AssetsApi.md#generateAssetTrackSubtitles) | **POST** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles | Generate track subtitles | | [**getAsset()**](AssetsApi.md#getAsset) | **GET** /video/v1/assets/{ASSET_ID} | Retrieve an asset | @@ -166,6 +168,80 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createAssetStaticRendition()` + +```php +createAssetStaticRendition($asset_id, $create_static_rendition_request): \MuxPhp\Models\CreateStaticRenditionResponse +``` + +Create a static rendition for an asset + +Creates a static rendition (i.e. MP4) for an asset + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\AssetsApi( + // 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(), + $config +); +$asset_id = 'asset_id_example'; // string | The asset ID. + +// This API method wants a \MuxPhp\Models\CreateStaticRenditionRequest +// as the second parameter. That being said, these API docs are +// auto-generated from our OpenAPI specification, which +// gives us the example parameter as a JSON string. In this example, +// we'll use json_decode() to turn it into an associative array, which +// is compatible with the model. +// +// In your own code you should use an associative array, or +// use a "new \MuxPhp\Models\CreateStaticRenditionRequest" directly. +$create_static_rendition_request = json_decode('{"resolution":"highest"}',true); // \MuxPhp\Models\CreateStaticRenditionRequest + +try { + $result = $apiInstance->createAssetStaticRendition($asset_id, $create_static_rendition_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->createAssetStaticRendition: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **asset_id** | **string**| The asset ID. | | +| **create_static_rendition_request** | [**\MuxPhp\Models\CreateStaticRenditionRequest**](../Model/CreateStaticRenditionRequest.md)| | | + +### Return type + +[**\MuxPhp\Models\CreateStaticRenditionResponse**](../Model/CreateStaticRenditionResponse.md) + +### Authorization + +[accessToken](../../README.md#accessToken) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `createAssetTrack()` ```php @@ -364,6 +440,69 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteAssetStaticRendition()` + +```php +deleteAssetStaticRendition($asset_id, $static_rendition_id) +``` + +Delete a single static rendition for an asset + +Deletes a single static rendition for an asset + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\AssetsApi( + // 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(), + $config +); +$asset_id = 'asset_id_example'; // string | The asset ID. +$static_rendition_id = 'static_rendition_id_example'; // string | The static rendition ID. + +try { + $apiInstance->deleteAssetStaticRendition($asset_id, $static_rendition_id); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->deleteAssetStaticRendition: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **asset_id** | **string**| The asset ID. | | +| **static_rendition_id** | **string**| The static rendition ID. | | + +### Return type + +void (empty response body) + +### Authorization + +[accessToken](../../README.md#accessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `deleteAssetTrack()` ```php @@ -915,7 +1054,7 @@ updateAssetMp4Support($asset_id, $update_asset_mp4_support_request): \MuxPhp\Mod Update MP4 support -Allows you to add or remove mp4 support for assets that were created without it. The values supported are `capped-1080p`, `audio-only`, `audio-only,capped-1080p`, `standard`(deprecated), and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. +This method has been deprecated. Please see the [Static Rendition API](https://www.mux.com/docs/guides/enable-static-mp4-renditions#after-asset-creation). Allows you to add or remove mp4 support for assets that were created without it. The values supported are `capped-1080p`, `audio-only`, `audio-only,capped-1080p`, `standard`(deprecated), and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. ### Example diff --git a/docs/Api/LiveStreamsApi.md b/docs/Api/LiveStreamsApi.md index 2806275..48121a2 100644 --- a/docs/Api/LiveStreamsApi.md +++ b/docs/Api/LiveStreamsApi.md @@ -8,6 +8,7 @@ All URIs are relative to https://api.mux.com, except if the operation defines an | [**createLiveStreamPlaybackId()**](LiveStreamsApi.md#createLiveStreamPlaybackId) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids | Create a live stream playback ID | | [**createLiveStreamSimulcastTarget()**](LiveStreamsApi.md#createLiveStreamSimulcastTarget) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target | | [**deleteLiveStream()**](LiveStreamsApi.md#deleteLiveStream) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream | +| [**deleteLiveStreamNewAssetSettingsStaticRenditions()**](LiveStreamsApi.md#deleteLiveStreamNewAssetSettingsStaticRenditions) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions | Delete a live stream's static renditions setting for new assets | | [**deleteLiveStreamPlaybackId()**](LiveStreamsApi.md#deleteLiveStreamPlaybackId) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID | | [**deleteLiveStreamSimulcastTarget()**](LiveStreamsApi.md#deleteLiveStreamSimulcastTarget) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a live stream simulcast target | | [**disableLiveStream()**](LiveStreamsApi.md#disableLiveStream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream | @@ -21,6 +22,7 @@ All URIs are relative to https://api.mux.com, except if the operation defines an | [**updateLiveStream()**](LiveStreamsApi.md#updateLiveStream) | **PATCH** /video/v1/live-streams/{LIVE_STREAM_ID} | Update a live stream | | [**updateLiveStreamEmbeddedSubtitles()**](LiveStreamsApi.md#updateLiveStreamEmbeddedSubtitles) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/embedded-subtitles | Update a live stream's embedded subtitles | | [**updateLiveStreamGeneratedSubtitles()**](LiveStreamsApi.md#updateLiveStreamGeneratedSubtitles) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/generated-subtitles | Update a live stream's generated subtitles | +| [**updateLiveStreamNewAssetSettingsStaticRenditions()**](LiveStreamsApi.md#updateLiveStreamNewAssetSettingsStaticRenditions) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions | Update live stream static renditions for new assets | ## `createLiveStream()` @@ -304,6 +306,67 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteLiveStreamNewAssetSettingsStaticRenditions()` + +```php +deleteLiveStreamNewAssetSettingsStaticRenditions($live_stream_id) +``` + +Delete a live stream's static renditions setting for new assets + +Deletes a live stream's static renditions settings for new assets. Further assets made via this live stream will not create static renditions unless re-added. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\LiveStreamsApi( + // 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(), + $config +); +$live_stream_id = 'live_stream_id_example'; // string | The live stream ID + +try { + $apiInstance->deleteLiveStreamNewAssetSettingsStaticRenditions($live_stream_id); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->deleteLiveStreamNewAssetSettingsStaticRenditions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **live_stream_id** | **string**| The live stream ID | | + +### Return type + +void (empty response body) + +### Authorization + +[accessToken](../../README.md#accessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `deleteLiveStreamPlaybackId()` ```php @@ -1157,3 +1220,77 @@ try { [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `updateLiveStreamNewAssetSettingsStaticRenditions()` + +```php +updateLiveStreamNewAssetSettingsStaticRenditions($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request): \MuxPhp\Models\LiveStreamResponse +``` + +Update live stream static renditions for new assets + +Updates a live stream's static renditions settings for new assets. Further assets made via this live stream will create static renditions per the settings provided. You must provide all static renditions desired. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\LiveStreamsApi( + // 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(), + $config +); +$live_stream_id = 'live_stream_id_example'; // string | The live stream ID + +// This API method wants a \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest +// as the second parameter. That being said, these API docs are +// auto-generated from our OpenAPI specification, which +// gives us the example parameter as a JSON string. In this example, +// we'll use json_decode() to turn it into an associative array, which +// is compatible with the model. +// +// In your own code you should use an associative array, or +// use a "new \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest" directly. +$update_live_stream_new_asset_settings_static_renditions_request = json_decode('{"static_renditions":[{"resolution":"audio-only"},{"resolution":"highest"}]}',true); // \MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest + +try { + $result = $apiInstance->updateLiveStreamNewAssetSettingsStaticRenditions($live_stream_id, $update_live_stream_new_asset_settings_static_renditions_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->updateLiveStreamNewAssetSettingsStaticRenditions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **live_stream_id** | **string**| The live stream ID | | +| **update_live_stream_new_asset_settings_static_renditions_request** | [**\MuxPhp\Models\UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest**](../Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md)| | | + +### Return type + +[**\MuxPhp\Models\LiveStreamResponse**](../Model/LiveStreamResponse.md) + +### Authorization + +[accessToken](../../README.md#accessToken) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/SpacesApi.md b/docs/Api/SpacesApi.md deleted file mode 100644 index 0bc4197..0000000 --- a/docs/Api/SpacesApi.md +++ /dev/null @@ -1,604 +0,0 @@ -# MuxPhp\SpacesApi - -All URIs are relative to https://api.mux.com, except if the operation defines another base path. - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**createSpace()**](SpacesApi.md#createSpace) | **POST** /video/v1/spaces | Create a space | -| [**createSpaceBroadcast()**](SpacesApi.md#createSpaceBroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts | Create a space broadcast | -| [**deleteSpace()**](SpacesApi.md#deleteSpace) | **DELETE** /video/v1/spaces/{SPACE_ID} | Delete a space | -| [**deleteSpaceBroadcast()**](SpacesApi.md#deleteSpaceBroadcast) | **DELETE** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Delete a space broadcast | -| [**getSpace()**](SpacesApi.md#getSpace) | **GET** /video/v1/spaces/{SPACE_ID} | Retrieve a space | -| [**getSpaceBroadcast()**](SpacesApi.md#getSpaceBroadcast) | **GET** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Retrieve space broadcast | -| [**listSpaces()**](SpacesApi.md#listSpaces) | **GET** /video/v1/spaces | List spaces | -| [**startSpaceBroadcast()**](SpacesApi.md#startSpaceBroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/start | Start a space broadcast | -| [**stopSpaceBroadcast()**](SpacesApi.md#stopSpaceBroadcast) | **POST** /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/stop | Stop a space broadcast | - - -## `createSpace()` - -```php -createSpace($create_space_request): \MuxPhp\Models\SpaceResponse -``` - -Create a space - -Create a new space. Spaces are used to build [real-time video applications.](https://mux.com/real-time-video) - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); - -// This API method wants a \MuxPhp\Models\CreateSpaceRequest -// as the second parameter. That being said, these API docs are -// auto-generated from our OpenAPI specification, which -// gives us the example parameter as a JSON string. In this example, -// we'll use json_decode() to turn it into an associative array, which -// is compatible with the model. -// -// In your own code you should use an associative array, or -// use a "new \MuxPhp\Models\CreateSpaceRequest" directly. -$create_space_request = json_decode('{"type":"server"}',true); // \MuxPhp\Models\CreateSpaceRequest - -try { - $result = $apiInstance->createSpace($create_space_request); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->createSpace: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **create_space_request** | [**\MuxPhp\Models\CreateSpaceRequest**](../Model/CreateSpaceRequest.md)| | | - -### Return type - -[**\MuxPhp\Models\SpaceResponse**](../Model/SpaceResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `createSpaceBroadcast()` - -```php -createSpaceBroadcast($space_id, $create_broadcast_request): \MuxPhp\Models\BroadcastResponse -``` - -Create a space broadcast - -Creates a new broadcast. Broadcasts are used to create composited versions of your space, which can be broadcast to live streams. **Note:** By default only a single broadcast destination can be specified. Contact Mux support if you need more. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. - -// This API method wants a \MuxPhp\Models\CreateBroadcastRequest -// as the second parameter. That being said, these API docs are -// auto-generated from our OpenAPI specification, which -// gives us the example parameter as a JSON string. In this example, -// we'll use json_decode() to turn it into an associative array, which -// is compatible with the model. -// -// In your own code you should use an associative array, or -// use a "new \MuxPhp\Models\CreateBroadcastRequest" directly. -$create_broadcast_request = json_decode('{"live_stream_id":"GQ9025mPqzyjOy3kKQW006qKTqmULW9vFO"}',true); // \MuxPhp\Models\CreateBroadcastRequest - -try { - $result = $apiInstance->createSpaceBroadcast($space_id, $create_broadcast_request); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->createSpaceBroadcast: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | -| **create_broadcast_request** | [**\MuxPhp\Models\CreateBroadcastRequest**](../Model/CreateBroadcastRequest.md)| | | - -### Return type - -[**\MuxPhp\Models\BroadcastResponse**](../Model/BroadcastResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteSpace()` - -```php -deleteSpace($space_id) -``` - -Delete a space - -Deletes a space. Spaces can only be deleted when `idle`. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. - -try { - $apiInstance->deleteSpace($space_id); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->deleteSpace: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | - -### Return type - -void (empty response body) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteSpaceBroadcast()` - -```php -deleteSpaceBroadcast($space_id, $broadcast_id) -``` - -Delete a space broadcast - -Deletes a single broadcast of a specific space. Broadcasts can only be deleted when `idle`. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. -$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID. - -try { - $apiInstance->deleteSpaceBroadcast($space_id, $broadcast_id); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->deleteSpaceBroadcast: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | -| **broadcast_id** | **string**| The broadcast ID. | | - -### Return type - -void (empty response body) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getSpace()` - -```php -getSpace($space_id): \MuxPhp\Models\SpaceResponse -``` - -Retrieve a space - -Retrieves the details of a space that has previously been created. Supply the unique space ID that was returned from your create space request, and Mux will return the information about the corresponding space. The same information is returned when creating a space. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. - -try { - $result = $apiInstance->getSpace($space_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->getSpace: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | - -### Return type - -[**\MuxPhp\Models\SpaceResponse**](../Model/SpaceResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getSpaceBroadcast()` - -```php -getSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\BroadcastResponse -``` - -Retrieve space broadcast - -Retrieves the details of a broadcast of a specific space. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. -$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID. - -try { - $result = $apiInstance->getSpaceBroadcast($space_id, $broadcast_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->getSpaceBroadcast: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | -| **broadcast_id** | **string**| The broadcast ID. | | - -### Return type - -[**\MuxPhp\Models\BroadcastResponse**](../Model/BroadcastResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `listSpaces()` - -```php -listSpaces($limit, $page): \MuxPhp\Models\ListSpacesResponse -``` - -List spaces - -List all spaces in the current environment. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$limit = 25; // int | Number of items to include in the response -$page = 1; // int | Offset by this many pages, of the size of `limit` - -try { - $result = $apiInstance->listSpaces($limit, $page); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->listSpaces: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **limit** | **int**| Number of items to include in the response | [optional] [default to 25] | -| **page** | **int**| Offset by this many pages, of the size of `limit` | [optional] [default to 1] | - -### Return type - -[**\MuxPhp\Models\ListSpacesResponse**](../Model/ListSpacesResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `startSpaceBroadcast()` - -```php -startSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\StartSpaceBroadcastResponse -``` - -Start a space broadcast - -Starts broadcasting a space to the associated destination. Broadcasts can only be started when the space is `active` (when there are participants connected). - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. -$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID. - -try { - $result = $apiInstance->startSpaceBroadcast($space_id, $broadcast_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->startSpaceBroadcast: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | -| **broadcast_id** | **string**| The broadcast ID. | | - -### Return type - -[**\MuxPhp\Models\StartSpaceBroadcastResponse**](../Model/StartSpaceBroadcastResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `stopSpaceBroadcast()` - -```php -stopSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\StopSpaceBroadcastResponse -``` - -Stop a space broadcast - -Stops broadcasting a space, causing the destination live stream to become idle. This API also automatically calls `complete` on the destination live stream. Broadcasts are also automatically stopped when a space becomes idle. - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new MuxPhp\Api\SpacesApi( - // 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(), - $config -); -$space_id = 'space_id_example'; // string | The space ID. -$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID. - -try { - $result = $apiInstance->stopSpaceBroadcast($space_id, $broadcast_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SpacesApi->stopSpaceBroadcast: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **space_id** | **string**| The space ID. | | -| **broadcast_id** | **string**| The broadcast ID. | | - -### Return type - -[**\MuxPhp\Models\StopSpaceBroadcastResponse**](../Model/StopSpaceBroadcastResponse.md) - -### Authorization - -[accessToken](../../README.md#accessToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) diff --git a/docs/Model/AssetStaticRenditions.md b/docs/Model/AssetStaticRenditions.md index db63127..a46c5ca 100644 --- a/docs/Model/AssetStaticRenditions.md +++ b/docs/Model/AssetStaticRenditions.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | Indicates the status of downloadable MP4 versions of this asset. | [optional] [default to STATUS_DISABLED] -**files** | [**\MuxPhp\Models\AssetStaticRenditionsFiles[]**](AssetStaticRenditionsFiles.md) | Array of file objects. | [optional] +**status** | **string** | Indicates the status of downloadable MP4 versions of this asset. This field is only valid when `mp4_support` is enabled | [optional] [default to STATUS_DISABLED] +**files** | [**\MuxPhp\Models\StaticRendition[]**](StaticRendition.md) | Array of file objects. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AssetStaticRenditionsFiles.md b/docs/Model/AssetStaticRenditionsFiles.md deleted file mode 100644 index b0ab7ee..0000000 --- a/docs/Model/AssetStaticRenditionsFiles.md +++ /dev/null @@ -1,14 +0,0 @@ -# # AssetStaticRenditionsFiles - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | | [optional] -**ext** | **string** | Extension of the static rendition file | [optional] -**height** | **int** | The height of the static rendition's file in pixels | [optional] -**width** | **int** | The width of the static rendition's file in pixels | [optional] -**bitrate** | **int** | The bitrate in bits per second | [optional] -**filesize** | **string** | The file size in bytes | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Broadcast.md b/docs/Model/Broadcast.md deleted file mode 100644 index 8dba33a..0000000 --- a/docs/Model/Broadcast.md +++ /dev/null @@ -1,15 +0,0 @@ -# # Broadcast - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for the broadcast. Max 255 characters. | -**passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. | [optional] -**live_stream_id** | **string** | The ID of the live stream that the broadcast will be sent to. | -**status** | [**\MuxPhp\Models\BroadcastStatus**](BroadcastStatus.md) | | -**layout** | [**\MuxPhp\Models\BroadcastLayout**](BroadcastLayout.md) | | -**background** | **string** | URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. | [optional] -**resolution** | [**\MuxPhp\Models\BroadcastResolution**](BroadcastResolution.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BroadcastLayout.md b/docs/Model/BroadcastLayout.md deleted file mode 100644 index 6c482c5..0000000 --- a/docs/Model/BroadcastLayout.md +++ /dev/null @@ -1,8 +0,0 @@ -# # BroadcastLayout - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateAssetRequest.md b/docs/Model/CreateAssetRequest.md index 27eaf34..c68a032 100644 --- a/docs/Model/CreateAssetRequest.md +++ b/docs/Model/CreateAssetRequest.md @@ -9,12 +9,13 @@ Name | Type | Description | Notes **advanced_playback_policies** | [**\MuxPhp\Models\CreatePlaybackIDRequest[]**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. | [optional] **per_title_encode** | **bool** | | [optional] **passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. | [optional] -**mp4_support** | **string** | Specify what level of support for mp4 playback. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] +**mp4_support** | **string** | Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions) for the updated API. Specify what level of support for mp4 playback. You may not enable both `mp4_support` and `static_renditions`. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] **normalize_audio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to false] **master_access** | **string** | Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] **test** | **bool** | Marks the asset as a test asset when the value is set to true. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test asset are watermarked with the Mux logo, limited to 10 seconds, deleted after 24 hrs. | [optional] **max_resolution_tier** | **string** | Max resolution tier can be used to control the maximum `resolution_tier` your asset is encoded, stored, and streamed at. If not set, this defaults to `1080p`. | [optional] **encoding_tier** | **string** | This field is deprecated. Please use `video_quality` instead. The encoding tier informs the cost, quality, and available platform features for the asset. The default encoding tier for an account can be set in the Mux Dashboard. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] **video_quality** | **string** | The video quality controls the cost, quality, and available platform features for the asset. The default video quality for an account can be set in the Mux Dashboard. This field replaces the deprecated `encoding_tier` value. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] +**static_renditions** | [**\MuxPhp\Models\CreateStaticRenditionRequest[]**](CreateStaticRenditionRequest.md) | An array of static renditions to create for this asset. You may not enable both `static_renditions` and `mp4_support (the latter being deprecated)` | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateBroadcastRequest.md b/docs/Model/CreateBroadcastRequest.md deleted file mode 100644 index 26a9666..0000000 --- a/docs/Model/CreateBroadcastRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# # CreateBroadcastRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. | [optional] -**live_stream_id** | **string** | The ID of the live stream that you want to broadcast to. | -**layout** | [**\MuxPhp\Models\BroadcastLayout**](BroadcastLayout.md) | | [optional] -**background** | **string** | URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. | [optional] -**resolution** | [**\MuxPhp\Models\BroadcastResolution**](BroadcastResolution.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSpaceRequest.md b/docs/Model/CreateSpaceRequest.md deleted file mode 100644 index cf188c5..0000000 --- a/docs/Model/CreateSpaceRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# # CreateSpaceRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**\MuxPhp\Models\SpaceType**](SpaceType.md) | | [optional] -**passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. | [optional] -**broadcasts** | [**\MuxPhp\Models\CreateBroadcastRequest[]**](CreateBroadcastRequest.md) | An array of broadcast destinations you want to stream the space to. **Note:** By default only a single broadcast destination can be specified. Contact Mux support if you need more. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BroadcastResponse.md b/docs/Model/CreateStaticRenditionRequest.md similarity index 54% rename from docs/Model/BroadcastResponse.md rename to docs/Model/CreateStaticRenditionRequest.md index aba443a..93c9eb3 100644 --- a/docs/Model/BroadcastResponse.md +++ b/docs/Model/CreateStaticRenditionRequest.md @@ -1,9 +1,10 @@ -# # BroadcastResponse +# # CreateStaticRenditionRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Broadcast**](Broadcast.md) | | +**resolution** | **string** | | [optional] +**passthrough** | **string** | Arbitrary user-supplied metadata set for the static rendition. Max 255 characters. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BroadcastResolution.md b/docs/Model/CreateStaticRenditionResponse.md similarity index 67% rename from docs/Model/BroadcastResolution.md rename to docs/Model/CreateStaticRenditionResponse.md index 1ffe37f..1756d94 100644 --- a/docs/Model/BroadcastResolution.md +++ b/docs/Model/CreateStaticRenditionResponse.md @@ -1,8 +1,9 @@ -# # BroadcastResolution +# # CreateStaticRenditionResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**data** | [**\MuxPhp\Models\StaticRendition**](StaticRendition.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InputSettings.md b/docs/Model/InputSettings.md index 462acdf..7589d2c 100644 --- a/docs/Model/InputSettings.md +++ b/docs/Model/InputSettings.md @@ -14,6 +14,6 @@ Name | Type | Description | Notes **language_code** | **string** | The language code value must be a valid [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is required for `text` and `audio` track types. | [optional] **name** | **string** | The name of the track containing a human-readable description. This value must be unique within each group of `text` or `audio` track types. The HLS manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for a subtitle text track with `language_code` set to `en`. This optional parameter should be used only for `text` and `audio` type tracks. This parameter can be optionally provided for the first video input to denote the name of the muxed audio track if present. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value. | [optional] **closed_captions** | **bool** | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for tracks with `type` of `text` and `text_type` set to `subtitles`. | [optional] -**passthrough** | **string** | This optional parameter should be used tracks with `type` of `text` and `text_type` set to `subtitles`. | [optional] +**passthrough** | **string** | This optional parameter should be used for tracks with `type` of `text` and `text_type` set to `subtitles`. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSpacesResponse.md b/docs/Model/ListSpacesResponse.md deleted file mode 100644 index 1fe8244..0000000 --- a/docs/Model/ListSpacesResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ListSpacesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Space[]**](Space.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Space.md b/docs/Model/Space.md deleted file mode 100644 index 3baba4e..0000000 --- a/docs/Model/Space.md +++ /dev/null @@ -1,15 +0,0 @@ -# # Space - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for the space. Max 255 characters. | -**created_at** | **string** | Time the space was created, defined as a Unix timestamp (seconds since epoch). | -**type** | [**\MuxPhp\Models\SpaceType**](SpaceType.md) | | -**status** | [**\MuxPhp\Models\SpaceStatus**](SpaceStatus.md) | | -**passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. | [optional] -**broadcasts** | [**\MuxPhp\Models\Broadcast[]**](Broadcast.md) | An array of broadcast destinations. | [optional] -**active_session_id** | **string** | Unique identifier for the current lifecycle of the space. Only set when the space is `active` and is set to a new value each time the space transitions from `idle` to `active`. This value is useful for logging and debugging issues. Max 255 characters. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpaceResponse.md b/docs/Model/SpaceResponse.md deleted file mode 100644 index 6ace7c7..0000000 --- a/docs/Model/SpaceResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SpaceResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Space**](Space.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpaceStatus.md b/docs/Model/SpaceStatus.md deleted file mode 100644 index 8e62c52..0000000 --- a/docs/Model/SpaceStatus.md +++ /dev/null @@ -1,8 +0,0 @@ -# # SpaceStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpaceType.md b/docs/Model/SpaceType.md deleted file mode 100644 index 8c2a9f8..0000000 --- a/docs/Model/SpaceType.md +++ /dev/null @@ -1,8 +0,0 @@ -# # SpaceType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StartSpaceBroadcastResponse.md b/docs/Model/StartSpaceBroadcastResponse.md deleted file mode 100644 index d582914..0000000 --- a/docs/Model/StartSpaceBroadcastResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # StartSpaceBroadcastResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | **object** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StaticRendition.md b/docs/Model/StaticRendition.md new file mode 100644 index 0000000..356a76d --- /dev/null +++ b/docs/Model/StaticRendition.md @@ -0,0 +1,20 @@ +# # StaticRendition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the static rendition file | [optional] +**ext** | **string** | Extension of the static rendition file | [optional] +**height** | **int** | The height of the static rendition's file in pixels | [optional] +**width** | **int** | The width of the static rendition's file in pixels | [optional] +**bitrate** | **int** | The bitrate in bits per second | [optional] +**filesize** | **string** | The file size in bytes | [optional] +**type** | **string** | Indicates the static rendition type of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. | [optional] +**status** | **string** | Indicates the status of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. * `ready` indicates the MP4 has been generated and is ready for download * `preparing` indicates the asset has not been ingested or the static rendition is still being generated after an asset is ready * `skipped` indicates the static rendition will not be generated because the requested resolution conflicts with the asset attributes after the asset has been ingested * `errored` indicates the static rendition cannot be generated. For example, an asset could not be ingested | [optional] +**resolution_tier** | **string** | Indicates the resolution tier of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. | [optional] +**resolution** | **string** | Indicates the resolution of this specific MP4 version of this asset. This field is only valid for `static_renditions`, not for `mp4_support`. | [optional] +**id** | **string** | The ID of this static rendition, used in managing this static rendition. This field is only valid for `static_renditions`, not for `mp4_support`. | [optional] +**passthrough** | **string** | Arbitrary user-supplied metadata set for the static rendition. Max 255 characters. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StopSpaceBroadcastResponse.md b/docs/Model/StopSpaceBroadcastResponse.md deleted file mode 100644 index 0e1a963..0000000 --- a/docs/Model/StopSpaceBroadcastResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # StopSpaceBroadcastResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | **object** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateLiveStreamNewAssetSettings.md b/docs/Model/UpdateLiveStreamNewAssetSettings.md index e048c7b..9db55b7 100644 --- a/docs/Model/UpdateLiveStreamNewAssetSettings.md +++ b/docs/Model/UpdateLiveStreamNewAssetSettings.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mp4_support** | **string** | Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). | [optional] +**mp4_support** | **string** | Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions#during-live-stream-creation) for the updated API. Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). | [optional] **master_access** | **string** | Add or remove access to the master version of the video. | [optional] +**video_quality** | **string** | The video quality controls the cost, quality, and available platform features for the asset. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BroadcastStatus.md b/docs/Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md similarity index 56% rename from docs/Model/BroadcastStatus.md rename to docs/Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md index f1dbb14..1a50798 100644 --- a/docs/Model/BroadcastStatus.md +++ b/docs/Model/UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest.md @@ -1,8 +1,9 @@ -# # BroadcastStatus +# # UpdateLiveStreamNewAssetSettingsStaticRenditionsRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**static_renditions** | [**\MuxPhp\Models\CreateStaticRenditionRequest[]**](CreateStaticRenditionRequest.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoView.md b/docs/Model/VideoView.md index b99310b..c74f683 100644 --- a/docs/Model/VideoView.md +++ b/docs/Model/VideoView.md @@ -166,5 +166,21 @@ Name | Type | Description | Notes **view_content_startup_time** | **int** | | [optional] **ad_preroll_startup_time** | **int** | | [optional] **view_dropped** | **bool** | | [optional] +**client_application_name** | **string** | | [optional] +**client_application_version** | **string** | | [optional] +**video_affiliate** | **string** | | [optional] +**viewer_plan** | **string** | | [optional] +**viewer_plan_status** | **string** | | [optional] +**viewer_plan_category** | **string** | | [optional] +**view_drm_level** | **string** | | [optional] +**video_brand** | **string** | | [optional] +**used_pip** | **bool** | | [optional] +**time_shift_enabled** | **bool** | | [optional] +**used_captions** | **bool** | | [optional] +**video_codec** | **string** | | [optional] +**audio_codec** | **string** | | [optional] +**video_dynamic_range_type** | **string** | | [optional] +**view_cdn_edge_pop** | **string** | | [optional] +**view_cdn_origin** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/gen/generator-config.json b/gen/generator-config.json index a7617e3..ca35dd9 100644 --- a/gen/generator-config.json +++ b/gen/generator-config.json @@ -5,7 +5,7 @@ "apiPackage": "Api", "srcBasePath": "MuxPhp", "invokerPackage": "MuxPhp", - "artifactVersion": "3.21.0", + "artifactVersion": "4.0.0", "gitUserId": "muxinc", "gitRepoId": "mux-php" }